Hide full OOM message at and of the table

Since all elements are extracted and shown already. The original OOM
text is faded out. Click to notice next by the head line to expand
the full message again.
This commit is contained in:
Carsten Grohmann 2018-08-12 13:34:24 +02:00
parent 9f7a419e2a
commit d7456383a2
2 changed files with 25 additions and 1 deletions

View File

@ -38,6 +38,12 @@
display: none;
}
.click_msg_in_th {
font-size: small;
font-weight: unset;
padding: unset;
}
table {
border-collapse: collapse;
padding: 10px;
@ -541,7 +547,11 @@ function goBack() {
<!-- Initial OOM -->
<tr>
<th scope="row" colspan="3">Entire OOM Message</th>
<th scope="row" colspan="3">Entire OOM Message
<span class="click_msg_in_th">
<a href="javascript:void(0);" id="oom_toogle_msg" onclick="OOMAnalyser.oomAnalyser.toggle_oom()" title="Click to show/hide full OOM message">(click to hide)</a>
</span>
</th>
</tr>
<tr>
<td></td>

View File

@ -891,6 +891,7 @@ Killed process 6576 (java) total-vm:33914892kB, anon-rss:20629004kB, file-rss:0k
element = document.getElementById('oom')
element.textContent = self.oom.text
self.toggle_oom(show=False)
def analyse(self):
# reset the output elements to default
@ -921,5 +922,18 @@ Killed process 6576 (java) total-vm:33914892kB, anon-rss:20629004kB, file-rss:0k
def copy_example(self):
document.getElementById('textarea_oom').value = self.example
def toggle_oom(self, show=False):
"""Toggle the visibility of the full OOM message"""
oom_element = document.getElementById('oom')
row_with_oom = oom_element.parentNode.parentNode
toggle_msg = document.getElementById('oom_toogle_msg')
if show or row_with_oom.classList.contains('hide_tablerow'):
row_with_oom.classList.remove('hide_tablerow')
toggle_msg.text = "(click to hide)"
else:
row_with_oom.classList.add('hide_tablerow')
toggle_msg.text = "(click to show)"
oomAnalyser = OOMAnalyser()