From 2bc57ca15953fc96be43051a64d69f4eabd1e332 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Mon, 10 Jul 2017 17:55:46 -0400 Subject: [PATCH] mgr/dashboard: initial block mirroring status page Signed-off-by: Jason Dillaman --- src/pybind/mgr/dashboard/base.html | 25 ++- src/pybind/mgr/dashboard/module.py | 37 +++- src/pybind/mgr/dashboard/rbd_mirroring.html | 214 ++++++++++++++++++++ src/pybind/mgr/dashboard/rbd_mirroring.py | 140 +++++++++++++ 4 files changed, 414 insertions(+), 2 deletions(-) create mode 100644 src/pybind/mgr/dashboard/rbd_mirroring.html create mode 100644 src/pybind/mgr/dashboard/rbd_mirroring.py diff --git a/src/pybind/mgr/dashboard/base.html b/src/pybind/mgr/dashboard/base.html index da01000cc6fb..420cf8405de8 100644 --- a/src/pybind/mgr/dashboard/base.html +++ b/src/pybind/mgr/dashboard/base.html @@ -115,6 +115,15 @@ return format_number(n, 1024, ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB']); }; + rivets.formatters.block_health_color = function(rbd_mirroring) { + if (rbd_mirroring.errors > 0) { + return "color: #ff0000"; + } else if (rbd_mirroring.warnings > 0) { + return "color: #ffc200"; + } + return ""; + }; + rivets.formatters.short_version = function(version) { // Expect "ceph version 1.2.3-g9asdasd (as98d7a0s8d7)" var result = /ceph version\s+([^ ]+)\s+\(.+\)/.exec(version); @@ -134,6 +143,11 @@ return val.length; } + rivets.formatters.hide_count_box = function(value) { + value = +value + return (isNaN(value) || value == 0) + }; + rivets.bind($("#health"), toplevel_data); rivets.bind($("section.sidebar"), toplevel_data); setTimeout(refresh, refresh_interval); @@ -295,12 +309,21 @@
  • - Block + Block