Skip to content

Commit

Permalink
Another round of API URL and UI tweaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkraljevic committed Oct 9, 2014
1 parent 04b2395 commit 1a6a92d
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 52 deletions.
16 changes: 0 additions & 16 deletions lib/resources/watermeter/index.html

This file was deleted.

24 changes: 0 additions & 24 deletions lib/resources/watermeter/perfbar.html

This file was deleted.

16 changes: 8 additions & 8 deletions lib/resources/watermeter/perfbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ function saturate0(value) {
}

function appendBody(str) {
var h = document.body.innerHTML;
var el = document.getElementById("perfbarContainer");

var h = el.innerHTML;
h = h + str;
document.body.innerHTML = h;
el.innerHTML = h;
// console.log("document.body.innerHTML: " + h);
}

Expand Down Expand Up @@ -317,13 +319,11 @@ function initializeNode(nodeIdx, nodeName, nodePort) {
}

var legend = "" +
"<div>" +
"<br/>" +
"[Legend]" +
"<br/>" +
"Each bar represents one CPU." +
"<div style='max-width: 300px;'>" +
"<br/>" +
"<table>" +
"<h3>Legend</h3>" +
"<p>Each bar represents one CPU.</p>" +
"<table class='table'>" +
" <tr><td>Blue:</td><td>idle time</td></tr>" +
" <tr><td>Green:</td><td>user time</td></tr>" +
" <tr><td>Red:</td><td>system time</td></tr>" +
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/water/api/RequestServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public enum API_VERSION {
Request.addToNavbar(registerRequest(new JStack()), "Stack Dump", "Admin");
Request.addToNavbar(registerRequest(new LogView()), "Inspect Log", "Admin");
Request.addToNavbar(registerRequest(new NetworkTest()), "Network Test", "Admin");
Request.addToNavbar(registerRequest(new WaterMeter()), "Water Meter", "Admin");
Request.addToNavbar(registerRequest(new WaterMeterPerfbar()), "Water Meter (Perfbar)", "Admin");
Request.addToNavbar(registerRequest(new Shutdown()), "Shutdown", "Admin");

// Help and Tutorials
Expand Down Expand Up @@ -258,7 +258,7 @@ public enum API_VERSION {
registerRequest(new ModelMetrics());

// WaterMeter support APIs
registerRequest(new WaterMeter.WaterMeterCpuTicks());
registerRequest(new WaterMeterPerfbar.WaterMeterCpuTicks());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@
/**
* Redirect to water meter page.
*/
public class WaterMeter extends HTMLOnlyRequest {
public class WaterMeterPerfbar extends HTMLOnlyRequest {
protected String build(Response response) {
return "<meta http-equiv=\"refresh\" content=\"0; url=watermeter/index.html\">";
return "" +
"<div class='container' id='perfbarContainer'>" +
"<script>" +
"var PB_LINEOFTEXT_BACKGROUND_COLOR = \"#fff\";" +
"</script>" +
"<script src=\"watermeter/perfbar.js\"></script>" +
"</div>";
}

public static class WaterMeterCpuTicks extends JSONOnlyRequest {
Expand Down

0 comments on commit 1a6a92d

Please sign in to comment.