Permalink
Browse files

Minor UI improvements (additional tooltips)

  • Loading branch information...
pierresouchay committed Jan 9, 2019
1 parent 4bd6968 commit bde6ea68788653a8a338a20bebe3c017e5713d4e
@@ -31,6 +31,7 @@
<meta name="description" content="Display Consul information"/>
<meta name="author" content="Criteo"/>
<title><%= param('title', 'Consul Real Time information') %></title>
<link rel="icon" type="image/png" href="images/favicon.png" sizes="32x32" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.11/css/all.css" integrity="sha384-p2jx59pefphTFIpeqCcISO9MdVfIm4pNnsL08A6v5vaQc4owkQqxMV8kg4Yvhaw/" crossorigin="anonymous">
<link rel="stylesheet" href="css/style.css">
Binary file not shown.
@@ -251,7 +251,7 @@ class ConsulService {
serviceHtml.appendChild(tagsGenerator(instance.tags));
serviceHtml.appendChild(serviceMetaGenerator(instance.sMeta));
serviceHtml.appendChild(connectGenerator(instance))
serviceHtml.appendChild(checksStatusGenerator(instance.checks));
serviceHtml.appendChild(checksStatusGenerator(instance));
serviceHtml.setAttribute('status', state);
$("#instances-list").append(serviceHtml);
}
@@ -457,7 +457,7 @@ class ServiceTimeline {
var checkName = document.createElement('div');
checkName.setAttribute('class', 'lookup checkName');
checkName.setAttribute('data-toggle', 'tooltip');
checkName.setAttribute('title', c['id']+'\n\n' + c.output);
checkName.setAttribute('title', 'ID: ' + c['id'] + '\nName: ' + c['name'] + '\n\n' + c.output);
checkName.appendChild(document.createTextNode(c['name']));
checksCell.appendChild(checkName);
}
@@ -52,6 +52,10 @@ function serviceTitleGenerator(instance) {
}

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');
@@ -223,14 +227,16 @@ function servicesGenerator(instanceServices) {
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');

@@ -240,6 +246,7 @@ function checksStatusGenerator(instanceChecks) {
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']));

0 comments on commit bde6ea6

Please sign in to comment.