From e365513e9435cfc7968ad5acb5ec3dd54b9948bc Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Sat, 12 Jun 2021 11:20:27 +0200 Subject: [PATCH] Added unavailable count display in uptime view. --- .../statoolinfos/htmlize/UptimeView.java | 1 + .../htmlize/stuff/dialog-warning.svg | 261 ++++++++++++++++++ .../htmlize/stuff/dialog-warning.svg.txt | 17 ++ .../htmlize/stuff/statoolinfos.css | 13 +- .../statoolinfos/htmlize/uptimeView.xhtml | 1 + .../statoolinfos/uptime/UptimeStat.java | 15 + 6 files changed, 305 insertions(+), 3 deletions(-) create mode 100644 src/fr/devinsy/statoolinfos/htmlize/stuff/dialog-warning.svg create mode 100644 src/fr/devinsy/statoolinfos/htmlize/stuff/dialog-warning.svg.txt diff --git a/src/fr/devinsy/statoolinfos/htmlize/UptimeView.java b/src/fr/devinsy/statoolinfos/htmlize/UptimeView.java index 5be51b5..73358de 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/UptimeView.java +++ b/src/fr/devinsy/statoolinfos/htmlize/UptimeView.java @@ -134,6 +134,7 @@ public class UptimeView data.setContent("alertCount", last.getAlertCount()); data.setContent("errorCount", last.getErrorCount()); data.setContent("voidCount", last.getVoidCount()); + data.setContent("unavailableCount", last.getUnavailableCount()); for (int dayCount = 0; dayCount < 22; dayCount++) { diff --git a/src/fr/devinsy/statoolinfos/htmlize/stuff/dialog-warning.svg b/src/fr/devinsy/statoolinfos/htmlize/stuff/dialog-warning.svg new file mode 100644 index 0000000..8aab574 --- /dev/null +++ b/src/fr/devinsy/statoolinfos/htmlize/stuff/dialog-warning.svg @@ -0,0 +1,261 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Warning + + + + Jakub Steiner + + + + + + + + + + dialog + warning + caution + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/fr/devinsy/statoolinfos/htmlize/stuff/dialog-warning.svg.txt b/src/fr/devinsy/statoolinfos/htmlize/stuff/dialog-warning.svg.txt new file mode 100644 index 0000000..a7ac12b --- /dev/null +++ b/src/fr/devinsy/statoolinfos/htmlize/stuff/dialog-warning.svg.txt @@ -0,0 +1,17 @@ +https://commons.wikimedia.org/wiki/File:Gnome-dialog-warning.svg + +Gnome-dialog-warning.svg + +An icon from the GNOME-icon-theme. + +GNOME Project + +Creative Commons Attribution-Share Alike 3.0 + +Gnome-dialog-warning.svg [[File:Gnome-dialog-warning.svg|Gnome-dialog-warning]] + +January 12, 2008 + +48 × 48 + +image/svg+xml diff --git a/src/fr/devinsy/statoolinfos/htmlize/stuff/statoolinfos.css b/src/fr/devinsy/statoolinfos/htmlize/stuff/statoolinfos.css index b8b388a..07378e2 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/stuff/statoolinfos.css +++ b/src/fr/devinsy/statoolinfos/htmlize/stuff/statoolinfos.css @@ -852,21 +852,28 @@ table > tfoot > tr > th.danger text-align: center; } -.uptimeCounts ul li +.uptimeCounts > ul > li { display: inline-block; list-style-type:none; padding: 0 5px 5px 5px; } -.uptimeCounts img +.uptimeCounts > ul > li > img { height: 18px; width: 11px; vertical-align: bottom; } -.uptimeCounts ul li span +.uptimeCounts > ul > li:last-child img +{ + height: 18px; + width: 18px; + vertical-align: bottom; +} + +.uptimeCounts > ul > li > span { padding-left : 5px; padding-right : 5px; diff --git a/src/fr/devinsy/statoolinfos/htmlize/uptimeView.xhtml b/src/fr/devinsy/statoolinfos/htmlize/uptimeView.xhtml index d28d432..06a3d18 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/uptimeView.xhtml +++ b/src/fr/devinsy/statoolinfos/htmlize/uptimeView.xhtml @@ -37,6 +37,7 @@
  • n/a
  • n/a
  • n/a
  • +
  • n/a
  • diff --git a/src/fr/devinsy/statoolinfos/uptime/UptimeStat.java b/src/fr/devinsy/statoolinfos/uptime/UptimeStat.java index 7ff3fd1..073f537 100644 --- a/src/fr/devinsy/statoolinfos/uptime/UptimeStat.java +++ b/src/fr/devinsy/statoolinfos/uptime/UptimeStat.java @@ -107,6 +107,21 @@ public class UptimeStat return result; } + /** + * Gets the unavailable count. + * + * @return the unavailable count + */ + public int getUnavailableCount() + { + int result; + + result = this.errorCount + this.alertCount + this.voidCount; + + // + return result; + } + public int getVoidCount() { return this.voidCount;