Use better names for CSS selectors

This commit is contained in:
Carsten Grohmann 2018-10-13 19:00:09 +02:00
parent eb579c01a7
commit 32126bf735
2 changed files with 112 additions and 114 deletions

View File

@ -6,42 +6,33 @@
<title>OOM Analyser</title> <title>OOM Analyser</title>
<style type='text/css'> <style type='text/css'>
.text--append-suffix-kbytes {
text-align: right;
}
.text--append-suffix-kbytes::after {
content: " kBytes";
}
.text--append-suffix-pages {
text-align: right;
}
.text--append-suffix-pages::after {
content: " pages";
}
.text--align-right {
text-align: right;
}
h1 { h1 {
font-size: 2em; font-size: 2em;
margin: 0.67em 0; margin: 0.67em 0;
} }
#notify_box { svg {
display: none; display: block;
width: 100%; max-height: 200px;
}
.kbytes {
text-align: right;
}
.kbytes::after {
content: " kBytes";
}
.pages {
text-align: right;
}
.pages::after {
content: " pages";
}
.align_right {
text-align: right;
}
.hide_tablerow {
display: none;
}
.click_msg_in_th {
font-size: small;
font-weight: unset;
padding: unset;
} }
table { table {
@ -52,11 +43,6 @@
width: 100%; width: 100%;
} }
svg {
display: block;
max-height: 200px;
}
th { th {
font-weight: bold; font-weight: bold;
font-size: large; font-size: large;
@ -68,30 +54,44 @@
word-wrap: break-word; word-wrap: break-word;
} }
.terminal { .js-table__tr--hide {
font-family: monospace; display: none;
overflow: auto;
} }
.notify-warning { .a--small {
color: #9F6000; font-size: small;
background-color: #FEEFB3; font-weight: unset;
} padding: unset;
.notify-error { }
color: #D8000C;
background-color: #FFD2D2;
}
/* Zebra-Layout */ /* Zebra-Layout */
tr:nth-child(odd) td:nth-child(2), tr:nth-child(odd) td:nth-child(3) { tr:nth-child(odd) td:nth-child(2), tr:nth-child(odd) td:nth-child(3) {
background-color: #f2f2f2; background-color: #f2f2f2;
} }
.license { .js-notify_box__msg--warning {
color: #9F6000;
background-color: #FEEFB3;
}
.js-notify_box__msg--error {
color: #D8000C;
background-color: #FFD2D2;
}
.license__text {
font-size: small; font-size: small;
display: none; display: none;
} }
.notify_box {
display: none;
width: 100%;
}
.terminal {
font-family: monospace;
overflow: auto;
}
</style> </style>
<script> <script>
function goBack() { function goBack() {
@ -123,7 +123,7 @@ function goBack() {
</div> </div>
<p> <p>
<div class="terminal" id="notify_box"></div> <div class="terminal notify_box" id="notify_box"></div>
</p> </p>
<div id="analysis"> <div id="analysis">
@ -158,31 +158,31 @@ function goBack() {
</tr> </tr>
<tr> <tr>
<td></td> <td></td>
<td class="align_right"><span id="trigger_proc_name"></span> (PID <span id="trigger_proc_pid"></span>)</td> <td class="text--align-right"><span id="trigger_proc_name"></span> (PID <span id="trigger_proc_pid"></span>)</td>
<td>This process requests memory and is triggering thereby the OOM situation</td> <td>This process requests memory and is triggering thereby the OOM situation</td>
</tr> </tr>
<tr> <tr>
<td>Memory allocation flags<br>(gfp_mask)</td> <td>Memory allocation flags<br>(gfp_mask)</td>
<td id="trigger_proc_gfp_mask" class="align_right"></td> <td id="trigger_proc_gfp_mask" class="text--align-right"></td>
<td>These flags are used to control the kernel internal memory allocation<br> <td>These flags are used to control the kernel internal memory allocation<br>
GFP stands for <code>__get_free_pages()</code> </td> GFP stands for <code>__get_free_pages()</code> </td>
</tr> </tr>
<tr> <tr>
<td>Node mask to show on which CPU Cores this process can run<br>(nodemask)</td> <td>Node mask to show on which CPU Cores this process can run<br>(nodemask)</td>
<td id="trigger_proc_nodemask" class="align_right"></td> <td id="trigger_proc_nodemask" class="text--align-right"></td>
<td>Bit mask indicating the cores on which the process can run</td> <td>Bit mask indicating the cores on which the process can run</td>
</tr> </tr>
<tr> <tr>
<td>Requested memory<br>(order)</td> <td>Requested memory<br>(order)</td>
<td class="align_right"> <td class="text--align-right">
<span id="trigger_proc_requested_memory"></span> (2^<sup><span id="trigger_proc_order"></span></sup>) pages / <span id="trigger_proc_requested_memory"></span> (2^<sup><span id="trigger_proc_order"></span></sup>) pages /
<span class="kbytes" id="trigger_proc_requested_memory_kbytes"></span> <span class="text--append-suffix-kbytes" id="trigger_proc_requested_memory_kbytes"></span>
</td> </td>
<td>The kernel specifies the requested number of pages as exponent of power of two. <td>The kernel specifies the requested number of pages as exponent of power of two.
</tr> </tr>
<tr> <tr>
<td>Adjust oom-killer score<br>(oom_score_adj)</td> <td>Adjust oom-killer score<br>(oom_score_adj)</td>
<td id="trigger_proc_oomscore" class="align_right"></td> <td id="trigger_proc_oomscore" class="text--align-right"></td>
<td> <td>
This value is added to the badness score before it's used to determine the process to be killed. This value is added to the badness score before it's used to determine the process to be killed.
</td> </td>
@ -195,34 +195,34 @@ function goBack() {
</tr> </tr>
<tr> <tr>
<td></td> <td></td>
<td class="align_right"><span id="killed_proc_name"></span> (PID <span id="killed_proc_pid"></span>)</td> <td class="text--align-right"><span id="killed_proc_name"></span> (PID <span id="killed_proc_pid"></span>)</td>
<td>Process killed by Linux kernel to satisfy the memory request</td> <td>Process killed by Linux kernel to satisfy the memory request</td>
</tr> </tr>
<tr> <tr>
<td>OOM Score<br>(score)</td> <td>OOM Score<br>(score)</td>
<td id="killed_proc_score" class="align_right"></td> <td id="killed_proc_score" class="text--align-right"></td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>Virtual Memory <br> (total-vm) </td> <td>Virtual Memory <br> (total-vm) </td>
<td id="killed_proc_vm_kb" class="kbytes"></td> <td id="killed_proc_vm_kb" class="text--append-suffix-kbytes"></td>
<td>Virtual memory used by this process</td> <td>Virtual memory used by this process</td>
</tr> </tr>
<tr> <tr>
<td>Resident anonymous memory <br> (anon-rss) </td> <td>Resident anonymous memory <br> (anon-rss) </td>
<td id="killed_proc_anon_rss_kb" class="kbytes"></td> <td id="killed_proc_anon_rss_kb" class="text--append-suffix-kbytes"></td>
<td>Part of the virtual process memory mapped into RAM</td> <td>Part of the virtual process memory mapped into RAM</td>
</tr> </tr>
<tr> <tr>
<td>Resident file mapping memory <br> (file-rss) </td> <td>Resident file mapping memory <br> (file-rss) </td>
<td id="killed_proc_file_rss_kb" class="kbytes"></td> <td id="killed_proc_file_rss_kb" class="text--append-suffix-kbytes"></td>
<td>Files which have been mapped into RAM (with <td>Files which have been mapped into RAM (with
<a href="http://man7.org/linux/man-pages/man2/mmap.2.html">mmap(2)</a>) <a href="http://man7.org/linux/man-pages/man2/mmap.2.html">mmap(2)</a>)
</td> </td>
</tr> </tr>
<tr> <tr>
<td>Resident shared memory <br> (shmem-rss) </td> <td>Resident shared memory <br> (shmem-rss) </td>
<td id="killed_proc_shmem_rss_kb" class="kbytes"></td> <td id="killed_proc_shmem_rss_kb" class="text--append-suffix-kbytes"></td>
<td>This may include System V shared memory and shared anonymous memory</td> <td>This may include System V shared memory and shared anonymous memory</td>
</tr> </tr>
@ -250,13 +250,13 @@ function goBack() {
</tr> </tr>
<tr> <tr>
<td>RAM pages</td> <td>RAM pages</td>
<td id="ram_pages" class="pages"></td> <td id="ram_pages" class="text--append-suffix-pages"></td>
<td>Total number of RAM pages <td>Total number of RAM pages
</td> </td>
</tr> </tr>
<tr> <tr>
<td>HighMem/MovableOnly</td> <td>HighMem/MovableOnly</td>
<td id="highmem_pages" class="pages"></td> <td id="highmem_pages" class="text--append-suffix-pages"></td>
<td>Number of pages in the High Memory Area or marked movable for Contiguous Memory Allocator (CMA). <td>Number of pages in the High Memory Area or marked movable for Contiguous Memory Allocator (CMA).
<br> <br>
HighMem pages are also counted in the total page number. HighMem pages are also counted in the total page number.
@ -264,25 +264,25 @@ function goBack() {
</tr> </tr>
<tr> <tr>
<td>Reserved pages</td> <td>Reserved pages</td>
<td id="reserved_pages" class="pages"></td> <td id="reserved_pages" class="text--append-suffix-pages"></td>
<td>Number of reserved pages <td>Number of reserved pages
</td> </td>
</tr> </tr>
<tr> <tr>
<td>CMA reserved pages</td> <td>CMA reserved pages</td>
<td id="cma_pages" class="pages">0</td> <td id="cma_pages" class="text--append-suffix-pages">0</td>
<td>Pages reserved for Contiguous Memory Allocator (CMA) <td>Pages reserved for Contiguous Memory Allocator (CMA)
</td> </td>
</tr> </tr>
<tr> <tr>
<td>Pagetable Cache</td> <td>Pagetable Cache</td>
<td id="pagetablecache_pages" class="pages">0</td> <td id="pagetablecache_pages" class="text--append-suffix-pages">0</td>
<td>Number of pages in pagetable cache <td>Number of pages in pagetable cache
</td> </td>
</tr> </tr>
<tr> <tr>
<td>Number of pages with hardware errors</td> <td>Number of pages with hardware errors</td>
<td id="hwpoisoned_pages" class="pages">0</td> <td id="hwpoisoned_pages" class="text--append-suffix-pages">0</td>
<td>Pages with uncorrectable memory errors <td>Pages with uncorrectable memory errors
</td> </td>
</tr> </tr>
@ -296,41 +296,41 @@ function goBack() {
</tr> </tr>
<tr> <tr>
<td>Active anonymous memory <br> (active_anon) </td> <td>Active anonymous memory <br> (active_anon) </td>
<td id="active_anon_pages" class="pages"></td> <td id="active_anon_pages" class="text--append-suffix-pages"></td>
<td>Recently used anonymous memory.<br> <td>Recently used anonymous memory.<br>
These memory pages will usually not swapped out. These memory pages will usually not swapped out.
</td> </td>
</tr> </tr>
<tr> <tr>
<td>Inactive anonymous memory <br> (inactive_anon)</td> <td>Inactive anonymous memory <br> (inactive_anon)</td>
<td id="inactive_anon_pages" class="pages"></td> <td id="inactive_anon_pages" class="text--append-suffix-pages"></td>
<td>Least recently used anonymous memory.<br> <td>Least recently used anonymous memory.<br>
These memory pages can be swapped out. These memory pages can be swapped out.
</td> </td>
</tr> </tr>
<tr> <tr>
<td>Isolated anonymous memory <br> (isolated_anon)</td> <td>Isolated anonymous memory <br> (isolated_anon)</td>
<td id="isolated_anon_pages" class="pages"></td> <td id="isolated_anon_pages" class="text--append-suffix-pages"></td>
<td>Memory isolation is used to separate memory between different virtual machines.</td> <td>Memory isolation is used to separate memory between different virtual machines.</td>
</tr> </tr>
<tr> <tr>
<td>Active Pagecache <br> (active_file)</td> <td>Active Pagecache <br> (active_file)</td>
<td id="active_file_pages" class="pages"></td> <td id="active_file_pages" class="text--append-suffix-pages"></td>
<td>Pagecache that has been used more recently and usually not reclaimed unless absolutely necessary.</td> <td>Pagecache that has been used more recently and usually not reclaimed unless absolutely necessary.</td>
</tr> </tr>
<tr> <tr>
<td>Inactive Pagecache <br> (inactive_file)</td> <td>Inactive Pagecache <br> (inactive_file)</td>
<td id="inactive_file_pages" class="pages"></td> <td id="inactive_file_pages" class="text--append-suffix-pages"></td>
<td>Pagecache which has been less recently used. It can be reclaimed without huge performance impact.</td> <td>Pagecache which has been less recently used. It can be reclaimed without huge performance impact.</td>
</tr> </tr>
<tr> <tr>
<td>Isolated Pagecache <br> (isolated_file)</td> <td>Isolated Pagecache <br> (isolated_file)</td>
<td id="isolated_file_pages" class="pages"></td> <td id="isolated_file_pages" class="text--append-suffix-pages"></td>
<td>Memory isolation is used to separate memory between different virtual machines.</td> <td>Memory isolation is used to separate memory between different virtual machines.</td>
</tr> </tr>
<tr> <tr>
<td>Unevictable Pages <br> (unevictable)</td> <td>Unevictable Pages <br> (unevictable)</td>
<td id="unevictable_pages" class="pages"></td> <td id="unevictable_pages" class="text--append-suffix-pages"></td>
<td>Unevictable memory. It can't be swapped out because the pages are owned by ramfs or protected by <td>Unevictable memory. It can't be swapped out because the pages are owned by ramfs or protected by
<a href="http://man7.org/linux/man-pages/man3/mlock.5.html" target="_blank">mlock(3)</a> / <a href="http://man7.org/linux/man-pages/man3/mlock.5.html" target="_blank">mlock(3)</a> /
<a href="http://man7.org/linux/man-pages/man2/shmctl.2.html" target="_blank">shmctl(SHM_LOCK)</a>. <a href="http://man7.org/linux/man-pages/man2/shmctl.2.html" target="_blank">shmctl(SHM_LOCK)</a>.
@ -339,14 +339,14 @@ function goBack() {
</tr> </tr>
<tr> <tr>
<td>Dirty Pages <br> (dirty)</td> <td>Dirty Pages <br> (dirty)</td>
<td id="dirty_pages" class="pages"></td> <td id="dirty_pages" class="text--append-suffix-pages"></td>
<td>Memory which is waiting to get written back to the disk. <td>Memory which is waiting to get written back to the disk.
<sup><a href="#footnote-proc5">[1]</a></sup> <sup><a href="#footnote-proc5">[1]</a></sup>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>Writeback <br> (writeback)</td> <td>Writeback <br> (writeback)</td>
<td id="writeback_pages" class="pages"></td> <td id="writeback_pages" class="text--append-suffix-pages"></td>
<td> <td>
Memory which is actively being written back to the disk. Memory which is actively being written back to the disk.
<sup><a href="#footnote-proc5">[1]</a></sup> <sup><a href="#footnote-proc5">[1]</a></sup>
@ -354,12 +354,12 @@ function goBack() {
</tr> </tr>
<tr> <tr>
<td>Unstable <br> (unstable)</td> <td>Unstable <br> (unstable)</td>
<td id="unstable_pages" class="pages"></td> <td id="unstable_pages" class="text--append-suffix-pages"></td>
<td>Not yet committed to stable storage.</td> <td>Not yet committed to stable storage.</td>
</tr> </tr>
<tr> <tr>
<td>Slab Reclaimable <br> (slab_reclaimable)</td> <td>Slab Reclaimable <br> (slab_reclaimable)</td>
<td id="slab_reclaimable_pages" class="pages"></td> <td id="slab_reclaimable_pages" class="text--append-suffix-pages"></td>
<td> <td>
Slab is a in-kernel data structures cache. Part of Slab, that might be reclaimed, such as caches. Slab is a in-kernel data structures cache. Part of Slab, that might be reclaimed, such as caches.
<sup><a href="#footnote-proc5">[1]</a></sup> <sup><a href="#footnote-proc5">[1]</a></sup>
@ -370,7 +370,7 @@ function goBack() {
</tr> </tr>
<tr> <tr>
<td>Slab Unreclaimable <br> (slab_unreclaimable)</td> <td>Slab Unreclaimable <br> (slab_unreclaimable)</td>
<td id="slab_unreclaimable_pages" class="pages"></td> <td id="slab_unreclaimable_pages" class="text--append-suffix-pages"></td>
<td> <td>
Part of Slab, that cannot be reclaimed on memory pressure. Part of Slab, that cannot be reclaimed on memory pressure.
<sup><a href="#footnote-proc5">[1]</a></sup> <sup><a href="#footnote-proc5">[1]</a></sup>
@ -378,7 +378,7 @@ function goBack() {
</tr> </tr>
<tr> <tr>
<td>Mapped <br> (mapped)</td> <td>Mapped <br> (mapped)</td>
<td id="mapped_pages" class="pages"></td> <td id="mapped_pages" class="text--append-suffix-pages"></td>
<td> <td>
Files which have been mapped into memory (with Files which have been mapped into memory (with
<a href="http://man7.org/linux/man-pages/man2/mmap.2.html">mmap(2)</a>), such as libraries. <a href="http://man7.org/linux/man-pages/man2/mmap.2.html">mmap(2)</a>), such as libraries.
@ -387,7 +387,7 @@ function goBack() {
</tr> </tr>
<tr> <tr>
<td>Shared Memory <br> (shmem)</td> <td>Shared Memory <br> (shmem)</td>
<td id="shmem_pages" class="pages"></td> <td id="shmem_pages" class="text--append-suffix-pages"></td>
<td> <td>
Amount of memory consumed in Amount of memory consumed in
<a href="http://man7.org/linux/man-pages/man5/tmpfs.5.html">tmpfs(5)</a> <a href="http://man7.org/linux/man-pages/man5/tmpfs.5.html">tmpfs(5)</a>
@ -397,7 +397,7 @@ function goBack() {
</tr> </tr>
<tr> <tr>
<td>Pagetables <br> (pagetables)</td> <td>Pagetables <br> (pagetables)</td>
<td id="pagetables_pages" class="pages"></td> <td id="pagetables_pages" class="text--append-suffix-pages"></td>
<td> <td>
Amount of memory dedicated to the lowest level of pagetables. Amount of memory dedicated to the lowest level of pagetables.
<sup><a href="#footnote-proc5">[1]</a></sup> <sup><a href="#footnote-proc5">[1]</a></sup>
@ -405,7 +405,7 @@ function goBack() {
</tr> </tr>
<tr> <tr>
<td>Bounce <br> (bounce)</td> <td>Bounce <br> (bounce)</td>
<td id="bounce_pages" class="pages"></td> <td id="bounce_pages" class="text--append-suffix-pages"></td>
<td> <td>
Memory used for block device "bounce buffers". Memory used for block device "bounce buffers".
<sup><a href="#footnote-proc5">[1]</a></sup> <sup><a href="#footnote-proc5">[1]</a></sup>
@ -413,22 +413,22 @@ function goBack() {
</tr> </tr>
<tr> <tr>
<td>free <br> (free)</td> <td>free <br> (free)</td>
<td id="free_pages" class="pages"></td> <td id="free_pages" class="text--append-suffix-pages"></td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>free_pcp <br> (free_pcp)</td> <td>free_pcp <br> (free_pcp)</td>
<td id="free_pcp_pages" class="pages"></td> <td id="free_pcp_pages" class="text--append-suffix-pages"></td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>free_cma <br> (free_cma)</td> <td>free_cma <br> (free_cma)</td>
<td id="free_cma_pages" class="pages"></td> <td id="free_cma_pages" class="text--append-suffix-pages"></td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>Total Pagecache</td> <td>Total Pagecache</td>
<td id="pagecache_total_pages" class="pages"></td> <td id="pagecache_total_pages" class="text--append-suffix-pages"></td>
<td></td> <td></td>
</tr> </tr>
@ -441,21 +441,21 @@ function goBack() {
</tr> </tr>
<tr> <tr>
<td>Swap Total</td> <td>Swap Total</td>
<td id="swap_total_kb" class="kbytes"></td> <td id="swap_total_kb" class="text--append-suffix-kbytes"></td>
<td>Total amount of swap space available. <td>Total amount of swap space available.
<sup><a href="#footnote-proc5">[1]</a></sup> <sup><a href="#footnote-proc5">[1]</a></sup>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>Swap Free</td> <td>Swap Free</td>
<td id="swap_free_kb" class="kbytes"></td> <td id="swap_free_kb" class="text--append-suffix-kbytes"></td>
<td>Amount of swap space that is currently unused. <td>Amount of swap space that is currently unused.
<sup><a href="#footnote-proc5">[1]</a></sup> <sup><a href="#footnote-proc5">[1]</a></sup>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>Swap Cached</td> <td>Swap Cached</td>
<td id="swap_cache_kb" class="kbytes"></td> <td id="swap_cache_kb" class="text--append-suffix-kbytes"></td>
<td>Memory that once was swapped out, is swapped back in <td>Memory that once was swapped out, is swapped back in
but still also is in the swap file. (If memory pres but still also is in the swap file. (If memory pres
sure is high, these pages don't need to be swapped out sure is high, these pages don't need to be swapped out
@ -466,7 +466,7 @@ function goBack() {
</tr> </tr>
<tr> <tr>
<td>Swap Used</td> <td>Swap Used</td>
<td id="swap_used_kb" class="kbytes"></td> <td id="swap_used_kb" class="text--append-suffix-kbytes"></td>
<td>Amount of used swap space w/o cached swap <br> <td>Amount of used swap space w/o cached swap <br>
(<code>SwapUsed = SwapTotal - SwapFree -SwapCache</code>) (<code>SwapUsed = SwapTotal - SwapFree -SwapCache</code>)
</td> </td>
@ -479,22 +479,22 @@ function goBack() {
</tr> </tr>
<tr> <tr>
<td>Kernel</td> <td>Kernel</td>
<td id="kernel_version" class="align_right"></td> <td id="kernel_version" class="text--align-right"></td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>Distribution</td> <td>Distribution</td>
<td id="dist" class="align_right"></td> <td id="dist" class="text--align-right"></td>
<td>Guessed from the kernel version</td> <td>Guessed from the kernel version</td>
</tr> </tr>
<tr> <tr>
<td>Platform</td> <td>Platform</td>
<td id="platform" class="align_right"></td> <td id="platform" class="text--align-right"></td>
<td>Guessed from the kernel version</td> <td>Guessed from the kernel version</td>
</tr> </tr>
<tr> <tr>
<td>Page size</td> <td>Page size</td>
<td id="page_size" class="kbytes"></td> <td id="page_size" class="text--append-suffix-kbytes"></td>
<td>Guessed</td> <td>Guessed</td>
</tr> </tr>
@ -549,9 +549,7 @@ function goBack() {
<tr> <tr>
<th scope="row" colspan="3">Entire OOM Message <th scope="row" colspan="3">Entire OOM Message
<span class="click_msg_in_th"> <a class="a--small" href="javascript:void(0);" id="oom_toogle_msg" onclick="OOMAnalyser.OOMDisplayInstance.toggle_oom()" title="Click to show/hide full OOM message">(click to hide)</a>
<a href="javascript:void(0);" id="oom_toogle_msg" onclick="OOMAnalyser.OOMDisplayInstance.toggle_oom()" title="Click to show/hide full OOM message">(click to hide)</a>
</span>
</th> </th>
</tr> </tr>
<tr> <tr>
@ -601,7 +599,7 @@ function goBack() {
<a href="https://github.com/CarstenGrohmann/OOMAnalyser" title="Source code on GitHub">Source Code on GitHub</a> <a href="https://github.com/CarstenGrohmann/OOMAnalyser" title="Source code on GitHub">Source Code on GitHub</a>
</div> </div>
<div class="license" id="license"> <div class="license__text" id="license">
<p> <p>
Copyright (c) 2017-2018 Carsten Grohmann mail &lt;add at here&gt; carsten-grohmann.de Copyright (c) 2017-2018 Carsten Grohmann mail &lt;add at here&gt; carsten-grohmann.de
</p> </p>

View File

@ -39,7 +39,7 @@ def error(msg):
notify_box = document.getElementById('notify_box') notify_box = document.getElementById('notify_box')
notify_box.style.display = 'block' notify_box.style.display = 'block'
notification = document.createElement('div') notification = document.createElement('div')
notification.classList.add('notify-error') notification.classList.add('js-notify_box__msg--error')
notification.innerHTML = 'ERROR: {}<br>'.format(msg) notification.innerHTML = 'ERROR: {}<br>'.format(msg)
notify_box.appendChild(notification) notify_box.appendChild(notification)
@ -49,7 +49,7 @@ def warning(msg):
notify_box = document.getElementById('notify_box') notify_box = document.getElementById('notify_box')
notify_box.style.display = 'block' notify_box.style.display = 'block'
notification = document.createElement('div') notification = document.createElement('div')
notification.classList.add('notify-warning') notification.classList.add('js-notify_box__msg--warning')
notification.innerHTML = 'WARNING: {}<br>'.format(msg) notification.innerHTML = 'WARNING: {}<br>'.format(msg)
notify_box.appendChild(notification) notify_box.appendChild(notification)
@ -746,11 +746,11 @@ Killed process 6576 (java) total-vm:33914892kB, anon-rss:20629004kB, file-rss:0k
if content == '<not found>': if content == '<not found>':
row = element.parentNode row = element.parentNode
row.classList.add('hide_tablerow') row.classList.add('js-table__tr--hide')
elif item.endswith('_kb'): elif item.endswith('_kb'):
element.classList.add('kbytes') element.classList.add('text--append-suffix-kbytes')
elif item.endswith('_pages'): elif item.endswith('_pages'):
element.classList.add('pages') element.classList.add('text--append-suffix-pages')
if DEBUG: if DEBUG:
show_element('notify_box') show_element('notify_box')
@ -760,13 +760,13 @@ Killed process 6576 (java) total-vm:33914892kB, anon-rss:20629004kB, file-rss:0k
if clean_oom: if clean_oom:
document.getElementById('textarea_oom').value = "<paste your OOM here>" document.getElementById('textarea_oom').value = "<paste your OOM here>"
hide_element("analysis") hide_element('analysis')
hide_element("notify_box") hide_element('notify_box')
show_element("input") show_element('input')
# show hidden rows # show hidden rows
for element in document.getElementsByClassName('hide_tablerow'): for element in document.getElementsByClassName('js-table__tr--hide'):
element.classList.remove('hide_tablerow') element.classList.remove('js-table__tr--hide')
for item in self.mem_modinfo_entries: for item in self.mem_modinfo_entries:
element = document.getElementById(item) element = document.getElementById(item)
@ -877,11 +877,11 @@ Killed process 6576 (java) total-vm:33914892kB, anon-rss:20629004kB, file-rss:0k
row_with_oom = oom_element.parentNode.parentNode row_with_oom = oom_element.parentNode.parentNode
toggle_msg = document.getElementById('oom_toogle_msg') toggle_msg = document.getElementById('oom_toogle_msg')
if show or row_with_oom.classList.contains('hide_tablerow'): if show or row_with_oom.classList.contains('js-table__tr--hide'):
row_with_oom.classList.remove('hide_tablerow') row_with_oom.classList.remove('js-table__tr--hide')
toggle_msg.text = "(click to hide)" toggle_msg.text = "(click to hide)"
else: else:
row_with_oom.classList.add('hide_tablerow') row_with_oom.classList.add('js-table__tr--hide')
toggle_msg.text = "(click to show)" toggle_msg.text = "(click to show)"
def analyse_and_show(self): def analyse_and_show(self):
@ -931,8 +931,8 @@ Killed process 6576 (java) total-vm:33914892kB, anon-rss:20629004kB, file-rss:0k
if DEBUG: if DEBUG:
print(self.oom_details) print(self.oom_details)
hide_element("input") hide_element('input')
show_element("analysis") show_element('analysis')
for item in self.oom_details.keys(): for item in self.oom_details.keys():
self._set_single_item(item) self._set_single_item(item)