From 8ea646590f94e06b8c0a81c1f49cfe9dae63b89b Mon Sep 17 00:00:00 2001 From: Christian Eichelmann Date: Fri, 8 Sep 2017 13:53:34 -0400 Subject: [PATCH 1/4] refactoring for luminous --- app/static/js/ceph.dash.js | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/app/static/js/ceph.dash.js b/app/static/js/ceph.dash.js index be245fd..b5adcce 100644 --- a/app/static/js/ceph.dash.js +++ b/app/static/js/ceph.dash.js @@ -309,15 +309,14 @@ $(function () { // *overall status* clusterStatusOverall = data['health']['overall_status']; - clusterHealthSummary = data['health']['summary']; + clusterHealthSummary = []; + $.each(data['health']['checks'], function(index, check) { + clusterHealthSummary.push(check['summary']['message']); + }); // *monitor state* monmapMons = data['monmap']['mons']; - if (monmapMons.length > 1) { - timechekMons = data['health']['timechecks']['mons']; - } else { - timechekMons = data['health']['health']['health_services'][0]['mons']; - } + timechekMons = data['quorum_names']; // }}} // Update Content {{{ @@ -414,7 +413,7 @@ $(function () { // update overall cluster status details $("#overall_status").append(''); @@ -422,11 +421,9 @@ $(function () { $("#monitor_status").empty(); $.each(monmapMons, function(index, mon) { health = 'HEALTH_ERR' - $.each(timechekMons, function(index, mon_health) { - if (mon['name'] == mon_health['name']) { - health = mon_health['health']; - } - }); + if (timechekMons.includes(mon['name'])) { + health = 'HEALTH_OK'; + } msg = 'Monitor ' + mon['name'].toUpperCase() + ': ' + health; $("#monitor_status").append('
' + message(ceph2bootstrap[health], msg) + '
'); }); From 70e849cf518b9f316b47c6ed025cd3f38cfc8582 Mon Sep 17 00:00:00 2001 From: Christian Eichelmann Date: Fri, 8 Sep 2017 14:16:13 -0400 Subject: [PATCH 2/4] this should work for all versions now --- app/static/js/ceph.dash.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/app/static/js/ceph.dash.js b/app/static/js/ceph.dash.js index b5adcce..7c463ea 100644 --- a/app/static/js/ceph.dash.js +++ b/app/static/js/ceph.dash.js @@ -310,13 +310,20 @@ $(function () { // *overall status* clusterStatusOverall = data['health']['overall_status']; clusterHealthSummary = []; - $.each(data['health']['checks'], function(index, check) { - clusterHealthSummary.push(check['summary']['message']); - }); + if (data['health']['summary'] || false) { + $.each(data['health']['summary'], function(index, check) { + clusterHealthSummary.push(check['summary']); + }); + } + if (data['health']['checks'] || false) { + $.each(data['health']['checks'], function(index, check) { + clusterHealthSummary.push(check['summary']['message']); + }); + } // *monitor state* monmapMons = data['monmap']['mons']; - timechekMons = data['quorum_names']; + quorumMons = data['quorum_names']; // }}} // Update Content {{{ @@ -421,7 +428,7 @@ $(function () { $("#monitor_status").empty(); $.each(monmapMons, function(index, mon) { health = 'HEALTH_ERR' - if (timechekMons.includes(mon['name'])) { + if (quorumMons.includes(mon['name'])) { health = 'HEALTH_OK'; } msg = 'Monitor ' + mon['name'].toUpperCase() + ': ' + health; From 1eff936a7ccec29011c5b2be977daf6a7166c4f7 Mon Sep 17 00:00:00 2001 From: Christian Eichelmann Date: Tue, 19 Sep 2017 11:02:38 +0200 Subject: [PATCH 3/4] Update ceph.dash.js use status field if it exists since luminous seems to favour this field --- app/static/js/ceph.dash.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/static/js/ceph.dash.js b/app/static/js/ceph.dash.js index 7c463ea..3ddf240 100644 --- a/app/static/js/ceph.dash.js +++ b/app/static/js/ceph.dash.js @@ -309,6 +309,9 @@ $(function () { // *overall status* clusterStatusOverall = data['health']['overall_status']; + if (data['health']['status'] || false) { + clusterStatusOverall = data['health']['status']; + } clusterHealthSummary = []; if (data['health']['summary'] || false) { $.each(data['health']['summary'], function(index, check) { From 2e05a89fc0eb7237fed33dd8ce8b49a48fc9c95f Mon Sep 17 00:00:00 2001 From: Christian Eichelmann Date: Mon, 23 Oct 2017 19:30:08 +0200 Subject: [PATCH 4/4] not supported anymore --- .travis.yml | 1 - tox.ini | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7bbc434..43393e7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,5 +5,4 @@ script: - tox env: - TOXENV=flake8 - - TOXENV=py26 - TOXENV=py27 diff --git a/tox.ini b/tox.ini index b6ea575..2e7d3e6 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] minversion = 1.6 skipsdist = True -envlist = flake8, py26, py27 +envlist = flake8, py27 [testenv] setenv = VIRTUAL_ENV={envdir}