Skip to content

Commit e955a3e

Browse files
authored
Merge branch 'percona:master' into DISTMYSQL-185
2 parents cb8db1f + f13d2ba commit e955a3e

File tree

3 files changed

+47
-22
lines changed

3 files changed

+47
-22
lines changed

resources/public/css/orchestrator.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ body {
143143
cursor: default;
144144
}
145145

146+
.instance h3 .glyphicon-tags {
147+
margin-right: 0.4em;
148+
}
149+
146150
.instance h3 .instance-glyphs {
147151
cursor: pointer;
148152
}

resources/public/js/cluster.js

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1546,25 +1546,27 @@ function Cluster() {
15461546
recoveryListing.append('<li role="separator" class="divider"></li>');
15471547

15481548
// Suggest successor
1549-
instance.children.forEach(function(replica) {
1550-
if (!replica.LogBinEnabled) {
1551-
return
1552-
}
1553-
if (replica.SQLDelay > 0) {
1554-
return
1555-
}
1556-
if (!replica.LogReplicationUpdatesEnabled) {
1557-
return
1558-
}
1559-
if (replica.lastCheckInvalidProblem()) {
1560-
return
1561-
}
1562-
if (replica.notRecentlyCheckedProblem()) {
1563-
return
1564-
}
1565-
recoveryListing.append(
1566-
'<li><a href="#" data-btn="recover-suggested-successor" data-command="recover-suggested-successor" data-successor-host="' + replica.Key.Hostname + '" data-successor-port="' + replica.Key.Port + '">Recover, try to promote <code>' + replica.title + '</code></a></li>');
1567-
});
1549+
if (instance.children) {
1550+
instance.children.forEach(function(replica) {
1551+
if (!replica.LogBinEnabled) {
1552+
return
1553+
}
1554+
if (replica.SQLDelay > 0) {
1555+
return
1556+
}
1557+
if (!replica.LogReplicationUpdatesEnabled) {
1558+
return
1559+
}
1560+
if (replica.lastCheckInvalidProblem()) {
1561+
return
1562+
}
1563+
if (replica.notRecentlyCheckedProblem()) {
1564+
return
1565+
}
1566+
recoveryListing.append(
1567+
'<li><a href="#" data-btn="recover-suggested-successor" data-command="recover-suggested-successor" data-successor-host="' + replica.Key.Hostname + '" data-successor-port="' + replica.Key.Port + '">Recover, try to promote <code>' + replica.title + '</code></a></li>');
1568+
});
1569+
}
15681570
}
15691571
if (!instance.isMaster) {
15701572
recoveryListing.append('<li><a href="#" data-btn="auto" data-command="recover-auto">Auto (implies running external hooks/processes)</a></li>');
@@ -1633,7 +1635,6 @@ function Cluster() {
16331635
}
16341636
}
16351637

1636-
16371638
function indicateClusterPoolInstances(clusterPoolInstances) {
16381639
var instancesMap = _instancesMap;
16391640
for (var pool in clusterPoolInstances.Details) {
@@ -1676,7 +1677,7 @@ function Cluster() {
16761677
instances.forEach(function(instance) {
16771678
if (instance.isMaster) {
16781679
getData("/api/recently-active-instance-recovery/" + instance.Key.Hostname + "/" + instance.Key.Port, function(recoveries) {
1679-
if (!recoveries) {
1680+
if (!recoveries || !recoveries.length) {
16801681
return
16811682
}
16821683
// Result is an array: either empty (no active recovery) or with multiple entries
@@ -1767,7 +1768,7 @@ function Cluster() {
17671768
});
17681769
});
17691770
getData("/api/recently-active-cluster-recovery/" + currentClusterName(), function(recoveries) {
1770-
if (!recoveries) {
1771+
if (!recoveries || !recoveries.length) {
17711772
return
17721773
}
17731774
// Result is an array: either empty (no active recovery) or with multiple entries

resources/public/js/orchestrator.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,14 @@ function openNodeModal(node) {
385385
addNodeModalDataAttribute("Agent",
386386
'<a href="' + appUrl('/web/agent/' + node.Key.Hostname) + '">' + node.Key.Hostname + '</a>');
387387

388+
var tagsText = "";
389+
if (node.hasOwnProperty('tagStrings') && node.tagStrings.length) {
390+
node.tagStrings.forEach(function(tag){
391+
tagsText = tagsText.concat(tag, '<br>');
392+
});
393+
}
394+
addNodeModalDataAttribute("Tags", tagsText);
395+
388396
$('#node_modal [data-btn]').unbind("click");
389397

390398
$("#beginDowntimeOwner").val(getUserId());
@@ -965,6 +973,18 @@ function renderInstanceElement(popoverElement, instance, renderType) {
965973
popoverElement.find("h3 div.pull-right").prepend('<span class="glyphicon glyphicon-volume-off" title="' + downtimeMessage + '"></span> ');
966974
}
967975

976+
$.get(appUrl("/api/tags/" + instance.Key.Hostname + "/" + instance.Key.Port), function(tagStrings) {
977+
if (tagStrings.length) {
978+
// Need to remember this. It is used in instance's modal window.
979+
instance.tagStrings = tagStrings;
980+
var tagsText = "";
981+
instance.tagStrings.forEach(function(tag) {
982+
tagsText = tagsText.concat(tag, '&#10;');
983+
});
984+
popoverElement.find("h3 div.pull-right").prepend('<span class="glyphicon glyphicon-tags" title="' + tagsText +'"></span> ');
985+
}
986+
}, "json");
987+
968988
if (instance.lastCheckInvalidProblem()) {
969989
instance.renderHint = "fatal";
970990
indicateLastSeenInStatus = true;

0 commit comments

Comments
 (0)