Skip to content

Commit adf424a

Browse files
committed
Dashboard: Set click behaviors on some dash units (cards), for e.g. conductors, servers, alerts, jobs today, jobs failed today. Fixes #113.
1 parent 4f1c446 commit adf424a

2 files changed

Lines changed: 24 additions & 5 deletions

File tree

htdocs/css/style.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,25 @@ body.dark div.dash_unit_box {
396396
color: var(--red);
397397
}
398398

399+
.dash_unit_box.clicky {
400+
cursor: pointer;
401+
}
402+
.dash_unit_box.clicky > * {
403+
pointer-events: none;
404+
}
405+
.dash_unit_box.clicky:hover {
406+
border: 1px solid var(--theme-color-half);
407+
}
408+
.dash_unit_box.clicky:active {
409+
border: 1px solid var(--theme-color);
410+
}
411+
.dash_unit_box.warning.clicky:hover {
412+
border: 1px solid var(--red-half);
413+
}
414+
.dash_unit_box.warning.clicky:active {
415+
border: 1px solid var(--red);
416+
}
417+
399418
/* Dash Donuts */
400419

401420
.dash_donut_grid {

htdocs/js/pages/Dashboard.class.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,20 +166,20 @@ Page.Dashboard = class Dashboard extends Page.PageUtils {
166166
var html = '';
167167

168168
// masters
169-
html += '<div class="dash_unit_box">';
169+
html += '<div class="dash_unit_box clicky" onClick="Nav.go(\'Conductors\')">';
170170
html += '<div class="dash_unit_value">' + num_keys(app.masters) + '</div>';
171171
html += '<div class="dash_unit_label">Conductors</div>';
172172
html += '</div>';
173173

174174
// servers
175-
html += '<div class="dash_unit_box">';
175+
html += '<div class="dash_unit_box clicky" onClick="Nav.go(\'Servers\')">';
176176
html += '<div class="dash_unit_value">' + num_keys(app.servers) + '</div>';
177177
html += '<div class="dash_unit_label">Servers</div>';
178178
html += '</div>';
179179

180180
// alerts
181181
var num_alerts = num_keys(app.activeAlerts);
182-
html += '<div class="dash_unit_box ' + (num_alerts ? 'warning' : '') + '">';
182+
html += '<div class="dash_unit_box clicky ' + (num_alerts ? 'warning' : '') + '" onClick="Nav.go(\'Alerts\')">';
183183
html += '<div class="dash_unit_value">' + num_alerts + '</div>';
184184
html += '<div class="dash_unit_label">Current Alerts</div>';
185185
html += '</div>';
@@ -191,13 +191,13 @@ Page.Dashboard = class Dashboard extends Page.PageUtils {
191191
html += '</div>';
192192

193193
// completed
194-
html += '<div class="dash_unit_box">';
194+
html += '<div class="dash_unit_box clicky" onClick="Nav.go(\'Search?date=today\')">';
195195
html += '<div class="dash_unit_value">' + this.getNiceDashNumber(trans.job_complete) + '</div>';
196196
html += '<div class="dash_unit_label">Jobs Today</div>';
197197
html += '</div>';
198198

199199
// failed
200-
html += '<div class="dash_unit_box ' + (trans.job_error ? 'warning' : '') + '">';
200+
html += '<div class="dash_unit_box clicky ' + (trans.job_error ? 'warning' : '') + '" onClick="Nav.go(\'Search?result=error&date=today\')">';
201201
html += '<div class="dash_unit_value">' + this.getNiceDashNumber(trans.job_error) + '</div>';
202202
html += '<div class="dash_unit_label">Jobs Failed Today</div>';
203203
html += '</div>';

0 commit comments

Comments
 (0)