Skip to content

Commit 6b666d2

Browse files
committed
clusters page (aka dashboard) indicates replication analysis problems
1 parent 0e5d058 commit 6b666d2

File tree

4 files changed

+34
-14
lines changed

4 files changed

+34
-14
lines changed

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#
77
set -e
88

9-
RELEASE_VERSION="1.4.473"
9+
RELEASE_VERSION="1.4.474"
1010
TOPDIR=/tmp/orchestrator-release
1111
export RELEASE_VERSION TOPDIR
1212

resources/public/css/orchestrator.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,10 @@ body {
243243
color: #31708f;
244244
}
245245

246+
#clusters .instance h3 .pull-left > .glyphicon {
247+
margin-right: 2px;
248+
}
249+
246250
#instance_problems {
247251
z-index: 10;
248252
position: absolute;

resources/public/js/clusters.js

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ $(document).ready(function () {
1111
};
1212

1313
$.get("/api/clusters-info", function (clusters) {
14-
$.get("/api/problems", function (problemInstances) {
15-
if (problemInstances == null) {
16-
problemInstances = [];
17-
}
18-
normalizeInstances(problemInstances, []);
19-
displayClusters(clusters, problemInstances);
14+
$.get("/api/replication-analysis", function (replicationAnalysis) {
15+
$.get("/api/problems", function (problemInstances) {
16+
if (problemInstances == null) {
17+
problemInstances = [];
18+
}
19+
normalizeInstances(problemInstances, []);
20+
displayClusters(clusters, replicationAnalysis, problemInstances);
21+
}, "json");
2022
}, "json");
2123
}, "json");
2224
function sortByCountInstances(cluster1, cluster2) {
@@ -27,15 +29,26 @@ $(document).ready(function () {
2729
return cluster1.ClusterName.localeCompare(cluster2.ClusterName);
2830
}
2931

30-
function displayClusters(clusters, problemInstances) {
32+
function displayClusters(clusters, replicationAnalysis, problemInstances) {
3133
hideLoader();
3234

3335
clusters.sort(sortByCountInstances);
3436
var clustersProblems = {};
3537
clusters.forEach(function (cluster) {
3638
clustersProblems[cluster.ClusterName] = {};
3739
});
38-
40+
41+
var clustersAnalysisProblems = {};
42+
replicationAnalysis.Details.forEach(function (analysisEntry) {
43+
if (!(analysisEntry.Analysis in interestingAnalysis)) {
44+
return;
45+
}
46+
if (!clustersAnalysisProblems[analysisEntry.ClusterDetails.ClusterName]) {
47+
clustersAnalysisProblems[analysisEntry.ClusterDetails.ClusterName] = [];
48+
}
49+
clustersAnalysisProblems[analysisEntry.ClusterDetails.ClusterName].push(analysisEntry);
50+
});
51+
3952
function addInstancesBadge(clusterName, count, badgeClass, title) {
4053
$("#clusters [data-cluster-name='" + clusterName + "'].popover").find(".popover-content .pull-right").append('<span class="badge '+badgeClass+'" title="' + title + '">' + count + '</span> ');
4154
}
@@ -77,18 +90,20 @@ $(document).ready(function () {
7790
popoverElement.find("h3 .pull-left").prepend('<a href="/web/cluster/alias/'+encodeURIComponent(cluster.ClusterAlias)+'"><strong>'+cluster.ClusterAlias+'</strong></a><br/>');
7891
compactClusterUri = '/web/cluster/alias/'+encodeURIComponent(cluster.ClusterAlias)+'?compact=true';
7992
}
93+
if (clustersAnalysisProblems[cluster.ClusterName]) {
94+
clustersAnalysisProblems[cluster.ClusterName].forEach(function (analysisEntry) {
95+
console.log(analysisEntry)
96+
popoverElement.find("h3 .pull-left").prepend('<span class="glyphicon glyphicon-exclamation-sign text-danger" title="'+analysisEntry.Analysis+': '+getInstanceTitle(analysisEntry.AnalyzedInstanceKey.Hostname, analysisEntry.AnalyzedInstanceKey.Port)+'"></span>');
97+
});
98+
99+
}
80100
popoverElement.find("h3 .pull-right").append('<a href="'+compactClusterUri+'"><span class="glyphicon glyphicon-compressed" title="Compact display"></span></a>');
81101
if (cluster.HasAutomatedIntermediateMasterRecovery === true) {
82102
popoverElement.find("h3 .pull-right").prepend('<span class="glyphicon glyphicon-heart-empty text-info" title="Automated intermediate master recovery for this cluster ENABLED"></span>');
83103
}
84104
if (cluster.HasAutomatedMasterRecovery === true) {
85105
popoverElement.find("h3 .pull-right").prepend('<span class="glyphicon glyphicon-heart text-info" title="Automated master recovery for this cluster ENABLED"></span>');
86106
}
87-
88-
89-
90-
91-
92107

93108
var contentHtml = ''
94109
+ '<div>Instances: <div class="pull-right"></div></div>'

resources/templates/clusters.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@
99
return "{{.removeTextFromHostnameDisplay}}";
1010
}
1111
</script>
12+
<script src="/js/cluster-analysis-shared.js"></script>
1213
<script src="/js/clusters.js"></script>

0 commit comments

Comments
 (0)