samples/consul-ui/js/utils.js in consul-templaterb-1.9.2 vs samples/consul-ui/js/utils.js in consul-templaterb-1.9.3

- old
+ new

@@ -50,10 +50,14 @@ break; } } var htmlTitle = document.createElement('h5'); + htmlTitle.setAttribute('title', 'Node Name: ' + instance.name + + '\nAddress : ' + instance.addr + + '\nService ID: ' + instance.id + + '\nService Port : ' + instance.port); var instanceLink = document.createElement('a'); instanceLink.setAttribute('class', 'instance-name'); var appendPort = ""; if (instance.port > 0) { @@ -221,26 +225,29 @@ services.appendChild(service); } return services; } -function checksStatusGenerator(instanceChecks) { +function checksStatusGenerator(instance) { + var instanceChecks = instance.checks; var checks = document.createElement('div'); checks.className = 'checks'; checks.appendChild(document.createTextNode("Checks: ")); checks.appendChild(document.createElement('br')); for (var checkKey in instanceChecks) { - checkId = Math.floor(Math.random()*10000); + var checkInstance = instanceChecks[checkKey]; + var checkId = instance.name + '::' + checkInstance.checkid; var btn = 'btn-' + toCSSClass(instanceChecks[checkKey]['status']) var check = document.createElement('div'); var btnCheck = document.createElement('button'); btnCheck.setAttribute('class','btn ' + btn + ' btn-sm m-1'); btnCheck.setAttribute('type', 'button'); btnCheck.setAttribute('data-toggle', 'collapse'); btnCheck.setAttribute('data-target', '#' + checkId); btnCheck.setAttribute('aria-expanded', 'false'); + btnCheck.setAttribute('title', checkInstance.checkid); btnCheck.appendChild(document.createTextNode(instanceChecks[checkKey]['name'])); check.appendChild(btnCheck);