summaryrefslogtreecommitdiff
path: root/widgets
diff options
context:
space:
mode:
authordrebs <drebs@riseup.net>2017-10-17 02:21:23 -0200
committerdrebs <drebs@riseup.net>2017-10-17 02:49:16 -0200
commitbb8c98053434e5aa0de09b0a2a0fbe35e69542f3 (patch)
treeba80802ca61fa8b2bd03c79c057d191e4abfbe95 /widgets
parentc3e807eb42ea7389676b714584bde204eab18577 (diff)
Add benchmark status to dashboard.
A "benchmarks" widget is added, together with a update job. The job queries the benchmarks.leap.se website and shows current benchmarking status and outliers. It's a simple start for something that can get more complex depending on identified needs.
Diffstat (limited to 'widgets')
-rw-r--r--widgets/benchmarks/benchmarks.coffee15
-rw-r--r--widgets/benchmarks/benchmarks.html23
-rw-r--r--widgets/benchmarks/benchmarks.scss13
3 files changed, 51 insertions, 0 deletions
diff --git a/widgets/benchmarks/benchmarks.coffee b/widgets/benchmarks/benchmarks.coffee
new file mode 100644
index 0000000..1d47b7c
--- /dev/null
+++ b/widgets/benchmarks/benchmarks.coffee
@@ -0,0 +1,15 @@
+class Dashing.Benchmarks extends Dashing.Widget
+
+ ready: ->
+ # This is fired when the widget is done being rendered
+
+ onData: (data) ->
+ # Handle incoming data
+ # You can access the html node of this widget with `@node`
+ # Example: $(@node).fadeOut().fadeIn() will make the node flash each time data comes in.
+
+ @accessor 'hasBadOutliers', ->
+ @get('bad') > 0
+
+ @accessor 'hasGoodOutliers', ->
+ @get('good') > 0
diff --git a/widgets/benchmarks/benchmarks.html b/widgets/benchmarks/benchmarks.html
new file mode 100644
index 0000000..d7dda1c
--- /dev/null
+++ b/widgets/benchmarks/benchmarks.html
@@ -0,0 +1,23 @@
+<h1 class="title"><a href="https://benchmarks.leap.se/"><span data-bind="title"></span></a></h1>
+
+<p>&nbsp;</p>
+
+<h4><a href="https://benchmarks.leap.se"><span>Current Status</span></a></h4>
+
+<p>
+ <a href="https://benchmarks.leap.se">
+ <span data-bind="is-benchmarked-status"></span>
+ </a>
+</p>
+
+<p>&nbsp;</p>
+
+<h4><a href="https://benchmarks.leap.se">Recent Outliers</a></h4>
+
+<p>
+ <a href="https://benchmarks.leap.se">
+ <span data-bind="good" data-addclass-good="hasGoodOutliers"></span> / <span data-bind="bad" data-addclass-bad="hasBadOutliers"></span></a>
+ </a>
+</p>
+
+<p class="updated-at" data-bind="updatedAtMessage"></p>
diff --git a/widgets/benchmarks/benchmarks.scss b/widgets/benchmarks/benchmarks.scss
new file mode 100644
index 0000000..7acfe24
--- /dev/null
+++ b/widgets/benchmarks/benchmarks.scss
@@ -0,0 +1,13 @@
+.widget-benchmarks {
+ background-color: black;
+}
+
+.good {
+ color: green;
+ font-weight: bold;
+}
+
+.bad {
+ color: #d93c38;
+ font-weight: bold;
+}