Skip to content

Commit

Permalink
fix node subnav
Browse files Browse the repository at this point in the history
  • Loading branch information
mose committed Jan 27, 2016
1 parent 293fc39 commit 9fd6c2a
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 11 deletions.
18 changes: 18 additions & 0 deletions app/public/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,24 @@ input {
.meat.farms div:hover {
background-color: #f3f3de;
}
/* ----- info ---- */
.meat .info {
margin-top: 4.8em;
display: table;
}
.meat .info .row {
display: table-row;
}
.meat .info .row .infokey {
display: table-cell;
padding: .1em 1em;
text-align: right;
}
.meat .info .row .infovalue {
display: table-cell;
font-family: monospace;
padding: .1em 1em;
}
/* ----- Foot ---- */
.foot {
padding: 1em;
Expand Down
28 changes: 17 additions & 11 deletions app/public/js/nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,14 @@ ready( () => {
function build_info(top, title, hash) {
if (Object.keys(hash).length > 0) {
var wrapper = document.createElement('div');
wrapper.className = 'rows';
wrapper.className = 'rows info';
top.appendChild(wrapper);
Array.prototype.forEach.call(Object.keys(hash), (item, k) => {
addTo(top, "<div class=\"row\">" +
"<span class=\"key\">" + k + "</span>" +
"<span class=\"value\">" + item + "</span>" +
"</div");
console.log(item);
addTo(wrapper, "<div class=\"row\">" +
"<span class=\"infokey\">" + item + "</span>" +
"<span class=\"infovalue\">" + JSON.stringify(hash[item], null, 2) + "</span>" +
"</div");
});
var rows = document.querySelectorAll('div.row');
filterBox(".paramfilter input", rows);
Expand Down Expand Up @@ -135,14 +136,15 @@ ready( () => {
then(res => res.json()).
then(j => {
console.log(auth_header().headers.getAll('x-auth'));
build_top(node);
if (j.error != undefined) {
build_top(node);
show_error(meat, j['error']);
} else {
build_top(node);
build_params(meat, node, j);
rebuild_nav(node);
update_footer('/v1/node/' + node);
update_footer('/v1/node/' + node);
but = document.querySelector('.showparams');
addClass(but, 'focus');
}
end_wait(meat);
});
Expand All @@ -153,13 +155,15 @@ ready( () => {
fetch('/v1/node/' + node + '/info', auth_header()).
then(res => res.json()).
then(j => {
build_top(node);
if (j.error != undefined) {
show_error(meat, j['error']);
} else {
build_top(node);
build_info(meat, node, j);
rebuild_nav(node);
update_footer('/v1/node/' + node + '/info');
but = document.querySelector('.showinfo');
addClass(but, 'focus');
}
end_wait(meat);
});
Expand All @@ -170,13 +174,15 @@ ready( () => {
fetch('/v1/node/' + node + '/allparams', auth_header()).
then(res => res.json()).
then(j => {
build_top(node);
if (j.error != undefined) {
show_error(meat, j['error']);
} else {
build_top(node);
build_info(meat, node, j);
build_params(meat, node, j);
rebuild_nav(node);
update_footer('/v1/node/' + node + '/allparams');
but = document.querySelector('.showallparams');
addClass(but, 'focus');
}
end_wait(meat);
});
Expand Down

0 comments on commit 9fd6c2a

Please sign in to comment.