diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2022-02-18 14:28:40 +0000 |
|---|---|---|
| committer | Aleksandr Nogikh <wp32pw@gmail.com> | 2022-02-25 18:57:32 +0100 |
| commit | 76b1ee05242f92043cdb68c61bbaa2b7e20ab201 (patch) | |
| tree | 88224e261e0f802924bba3ba5ddef07c902d9f1a /pkg/html | |
| parent | 2b05e7f413f5cc13a142292c4557f691fc1fba45 (diff) | |
dasboard: add crash stats page
Show top crashers for X last days.
Show graph with daily shares of crashes that satisfy user-entered regexps.
Diffstat (limited to 'pkg/html')
| -rw-r--r-- | pkg/html/generated.go | 60 |
1 files changed, 59 insertions, 1 deletions
diff --git a/pkg/html/generated.go b/pkg/html/generated.go index 53d035c6e..02c1a94b5 100644 --- a/pkg/html/generated.go +++ b/pkg/html/generated.go @@ -230,6 +230,7 @@ aside { border: 1px solid #aaa; border-radius: 5px; margin-bottom: 5px; + margin-top: 5px; } .panel h1 { @@ -244,6 +245,10 @@ aside { width: 100%; } +.panel label { + margin-left: 7px; +} + .main-content { position: absolute; top: 0; @@ -265,9 +270,24 @@ aside { } #graph_div { - width: 100%; height: 85vh; } + + +.input-values { + margin-left: 7px; + margin-bottom: 7px; +} + +.input-group { + margin-top: 7px; + margin-bottom: 7px; + display: block; +} + +.input-group button { + width: 20pt; +} ` const js = ` // Copyright 2018 syzkaller project authors. All rights reserved. @@ -333,4 +353,42 @@ function timeSort(v) { return parseInt(v) * 60 * 24; return 1000000000; } + + + +function findAncestorByClass (el, cls) { + while ((el = el.parentElement) && !el.classList.contains(cls)); + return el; +} + +function deleteInputGroup(node) { + group = findAncestorByClass(node, "input-group") + values = findAncestorByClass(group, "input-values") + if (!values) { + return false + } + count = values.querySelectorAll('.input-group').length + if (count == 1) { + // If it's the only input, just clear it. + input = group.querySelector('input') + input.value = "" + } else { + group.remove() + } + return false +} + +function addInputGroup(node) { + values = findAncestorByClass(node, "input-values") + groups = values.querySelectorAll(".input-group") + if (groups.length == 0) { + // Something strange has happened. + return false + } + lastGroup = groups[groups.length - 1] + newGroup = lastGroup.cloneNode(true) + newGroup.querySelector('input').value = "" + values.insertBefore(newGroup, lastGroup.nextSibling) + return false +} ` |
