Skip to content

Commit

Permalink
Merge pull request #88 from synyx/clickable-row
Browse files Browse the repository at this point in the history
Clickable status with highlighting on hover
  • Loading branch information
BuJo committed Jun 26, 2023
2 parents 756e6af + 1856b52 commit db3e433
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 41 deletions.
53 changes: 19 additions & 34 deletions pkg/web/static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ h3 {

table, td {
border: none;
padding: 2px;
border-spacing: 2px;
border-collapse: collapse;
padding: 3px;
font-size: 1.1em;
}

Expand Down Expand Up @@ -91,40 +91,41 @@ th {

.status {
font-weight: bold;
padding: 0;
}

.status.green {
.status.green, .status.green summary, .status.green details {
background-color: #269926;
color: white;
padding: 3px;
opacity: 0.75;
}

.status.red {
.status.red, .status.red summary, .status.red details {
background-color: #FF4040;
color: white;
padding: 3px;
opacity: 0.75;
}

.status.yellow {
background-color: #FFDE40;
.status.yellow, .status.yellow summary, .status.yellow details {
background-color: #C8AF38;
color: black;
padding: 3px;
opacity: 0.75;
}

.status.grey {
.status.grey, .status.grey summary, .status.grey details {
background-color: #444444;
color: white;
padding: 3px;
opacity: 0.90;
}

summary {
list-style: none;
float: right;
padding: 3px;
cursor: pointer;
}

summary:hover {
filter: brightness(110%) !important;
}

summary::-webkit-details-marker {
display: none;
}
Expand All @@ -134,28 +135,12 @@ details summary::after {
details[open] summary::after {
content: "⮾";
}
.status details summary {
cursor: pointer;
float: right;
}
.status details[open] summary {
float: right;
text-align: right;
}

.status > details {
display: inline;
position: relative;
float: right;
max-width: inherit;
}
.status > details[open] {
display: inline;
position: relative;
float: left;
width: 100%;
details .content {
padding: 3px;
}
.status details div, .status details pre {

.status details .content {
font-size: 0.75em;
opacity: 0.8;
width: 95%;
Expand Down
18 changes: 11 additions & 7 deletions pkg/web/templates/alerts.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,17 @@
{{.Where}} <span class="tag {{.Tag}}">{{.Tag}}</span>
</td>
<td class="status {{.Status}}">
{{.What}}
<details>
<summary>
{{.What}}
{{range .Links}}
{{.}}
{{end}}
</summary>
<div>{{.Details}}</div>
<pre>{{json .Labels}}</pre>
<div class="content">
<div>{{.Details}}</div>
<pre>{{json .Labels}}</pre>
</div>
</details>
</td>
<td align="right"><time datetime="{{.When.Seconds}}S">{{niceDuration .When}}</time></td>
Expand All @@ -54,16 +56,18 @@
{{.Where}} <span class="tag {{.Tag}}">{{.Tag}}</span>
</td>
<td class="status {{.Status}}">
{{.What}}
<span><i>({{.Reason}})</i></span>
<details>
<summary>
{{.What}}
<span><i>({{.Reason}})</i></span>
{{range .Links}}
{{.}}
{{end}}
</summary>
<div>{{.Details}}</div>
<pre>{{json .Labels}}</pre>
<div class="content">
<div>{{.Details}}</div>
<pre>{{json .Labels}}</pre>
</div>
</details>
</td>
<td align="right"><time datetime="{{.When.Seconds}}S">{{niceDuration .When}}</time></td>
Expand Down

0 comments on commit db3e433

Please sign in to comment.