Skip to content

Commit a55e5f1

Browse files
authored
Merge branch 'percona:master' into DISTMYSQL-226
2 parents 26c74c1 + f13d2ba commit a55e5f1

File tree

2 files changed

+33
-38
lines changed

2 files changed

+33
-38
lines changed

resources/public/js/cluster.js

Lines changed: 21 additions & 38 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,16 +1635,6 @@ function Cluster() {
16331635
}
16341636
}
16351637

1636-
function showInstanceTags(instance) {
1637-
if (instance.hasOwnProperty('tagStrings') && instance.tagStrings.length) {
1638-
var tagsText = "";
1639-
instance.tagStrings.forEach(function(tag){
1640-
tagsText = tagsText.concat(tag, '&#10;');
1641-
});
1642-
getInstanceDiv(instance.id).find("h3 div.pull-right").prepend('<span class="glyphicon glyphicon-tags" title="' + tagsText +'"></span> ');
1643-
}
1644-
}
1645-
16461638
function indicateClusterPoolInstances(clusterPoolInstances) {
16471639
var instancesMap = _instancesMap;
16481640
for (var pool in clusterPoolInstances.Details) {
@@ -1682,15 +1674,6 @@ function Cluster() {
16821674

16831675
reviewReplicationAnalysis(replicationAnalysis);
16841676

1685-
// Tags are displayed only for not aggregated instances
1686-
for (var instanceId in _instancesMap) {
1687-
let instance = _instancesMap[instanceId];
1688-
getData("/api/tags/" + instance.Key.Hostname + "/" + instance.Key.Port, function(tagStrings) {
1689-
instance.tagStrings = tagStrings;
1690-
showInstanceTags(instance)
1691-
});
1692-
}
1693-
16941677
instances.forEach(function(instance) {
16951678
if (instance.isMaster) {
16961679
getData("/api/recently-active-instance-recovery/" + instance.Key.Hostname + "/" + instance.Key.Port, function(recoveries) {

resources/public/js/orchestrator.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -973,6 +973,18 @@ function renderInstanceElement(popoverElement, instance, renderType) {
973973
popoverElement.find("h3 div.pull-right").prepend('<span class="glyphicon glyphicon-volume-off" title="' + downtimeMessage + '"></span> ');
974974
}
975975

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+
976988
if (instance.lastCheckInvalidProblem()) {
977989
instance.renderHint = "fatal";
978990
indicateLastSeenInStatus = true;

0 commit comments

Comments
 (0)