aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeterminant <ted.sybil@gmail.com>2014-12-29 00:34:16 +0800
committerDeterminant <ted.sybil@gmail.com>2014-12-29 00:34:16 +0800
commit4c7c9dcdfd05a2d9648756c0da5c68588929ba5d (patch)
tree2c1681ad60e1469b4dda7a2ab6a0d03637dbde1e
parent5dc3a3b043a990fc58a4ead74c2c5c92e910727d (diff)
restructured the project
-rwxr-xr-xexamples/count.sh (renamed from count.sh)0
-rwxr-xr-xexamples/cpu.sh (renamed from cpu.sh)0
-rwxr-xr-xexamples/mem.sh (renamed from mem.sh)0
-rwxr-xr-xexamples/sge.sh (renamed from sge.sh)0
-rwxr-xr-xexamples/top.sh (renamed from top.sh)0
-rw-r--r--lab_monitor_client.py (renamed from client.py)0
-rw-r--r--lab_monitor_server.py4
-rwxr-xr-xmonitor_daemon.sh6
-rw-r--r--static/assets/css/monitor.css (renamed from assets/css/monitor.css)0
-rw-r--r--static/assets/dist/css/bootstrap-theme.css (renamed from assets/dist/css/bootstrap-theme.css)0
-rw-r--r--static/assets/dist/css/bootstrap-theme.css.map (renamed from assets/dist/css/bootstrap-theme.css.map)0
-rw-r--r--static/assets/dist/css/bootstrap-theme.min.css (renamed from assets/dist/css/bootstrap-theme.min.css)0
-rw-r--r--static/assets/dist/css/bootstrap.css (renamed from assets/dist/css/bootstrap.css)0
-rw-r--r--static/assets/dist/css/bootstrap.css.map (renamed from assets/dist/css/bootstrap.css.map)0
-rw-r--r--static/assets/dist/css/bootstrap.min.css (renamed from assets/dist/css/bootstrap.min.css)0
-rw-r--r--static/assets/dist/fonts/glyphicons-halflings-regular.eot (renamed from assets/dist/fonts/glyphicons-halflings-regular.eot)bin20335 -> 20335 bytes
-rw-r--r--static/assets/dist/fonts/glyphicons-halflings-regular.svg (renamed from assets/dist/fonts/glyphicons-halflings-regular.svg)0
-rw-r--r--static/assets/dist/fonts/glyphicons-halflings-regular.ttf (renamed from assets/dist/fonts/glyphicons-halflings-regular.ttf)bin41280 -> 41280 bytes
-rw-r--r--static/assets/dist/fonts/glyphicons-halflings-regular.woff (renamed from assets/dist/fonts/glyphicons-halflings-regular.woff)bin23320 -> 23320 bytes
-rw-r--r--static/assets/dist/js/bootstrap.js (renamed from assets/dist/js/bootstrap.js)0
-rw-r--r--static/assets/dist/js/bootstrap.min.js (renamed from assets/dist/js/bootstrap.min.js)0
-rw-r--r--static/assets/dist/js/npm.js (renamed from assets/dist/js/npm.js)0
-rw-r--r--static/assets/js/d3.js (renamed from assets/js/d3.js)0
-rw-r--r--static/assets/js/d3.min.js (renamed from assets/js/d3.min.js)0
-rw-r--r--static/assets/js/jquery-1.11.1.min.js (renamed from assets/js/jquery-1.11.1.min.js)0
-rw-r--r--static/assets/js/monitor.js (renamed from assets/js/monitor.js)8
-rw-r--r--static/index.html (renamed from index.html)0
27 files changed, 8 insertions, 10 deletions
diff --git a/count.sh b/examples/count.sh
index 3db505f..3db505f 100755
--- a/count.sh
+++ b/examples/count.sh
diff --git a/cpu.sh b/examples/cpu.sh
index 0487b6f..0487b6f 100755
--- a/cpu.sh
+++ b/examples/cpu.sh
diff --git a/mem.sh b/examples/mem.sh
index e8a3df6..e8a3df6 100755
--- a/mem.sh
+++ b/examples/mem.sh
diff --git a/sge.sh b/examples/sge.sh
index ebfb65b..ebfb65b 100755
--- a/sge.sh
+++ b/examples/sge.sh
diff --git a/top.sh b/examples/top.sh
index 55288b8..55288b8 100755
--- a/top.sh
+++ b/examples/top.sh
diff --git a/client.py b/lab_monitor_client.py
index 194b927..194b927 100644
--- a/client.py
+++ b/lab_monitor_client.py
diff --git a/lab_monitor_server.py b/lab_monitor_server.py
index da707b8..4207eb9 100644
--- a/lab_monitor_server.py
+++ b/lab_monitor_server.py
@@ -155,8 +155,8 @@ class AJAXHandler(RequestHandler):
yield gen.Task(grab_lock, self)
try:
app = Application([url(r"/ajax", AJAXHandler),
- url(r'/()', StaticFileHandler, {'path': "./index.html"}),
- url(r'/(.*)', StaticFileHandler, {'path': "./"})])
+ url(r'/()', StaticFileHandler, {'path': "./static/index.html"}),
+ url(r'/(.*)', StaticFileHandler, {'path': "./static/"})])
app.listen(PORT)
IOLoop.current().start()
except KeyboardInterrupt:
diff --git a/monitor_daemon.sh b/monitor_daemon.sh
index fed2967..7d976ee 100755
--- a/monitor_daemon.sh
+++ b/monitor_daemon.sh
@@ -4,18 +4,18 @@
# echo "you must specify the triggered command"
# exit 1
#fi
+CLIENT="python lab_monitor_client.py"
function on_exit {
- python client.py --drop "$JID"
+ $CLIENT --drop "$JID"
exit 0
}
-JID=$(python client.py --create "$JMNAME" --type "$JTYPE")
+JID=$($CLIENT --create "$JMNAME" --type "$JTYPE")
if [[ "$JID" == "" ]]; then
echo "failed to create monitor"
exit 1
fi
trap on_exit SIGINT SIGTERM
-CLIENT="python client.py"
while [ 1 ]; do
trigger
sleep 1
diff --git a/assets/css/monitor.css b/static/assets/css/monitor.css
index 25a9430..25a9430 100644
--- a/assets/css/monitor.css
+++ b/static/assets/css/monitor.css
diff --git a/assets/dist/css/bootstrap-theme.css b/static/assets/dist/css/bootstrap-theme.css
index c4cadf1..c4cadf1 100644
--- a/assets/dist/css/bootstrap-theme.css
+++ b/static/assets/dist/css/bootstrap-theme.css
diff --git a/assets/dist/css/bootstrap-theme.css.map b/static/assets/dist/css/bootstrap-theme.css.map
index 016a8da..016a8da 100644
--- a/assets/dist/css/bootstrap-theme.css.map
+++ b/static/assets/dist/css/bootstrap-theme.css.map
diff --git a/assets/dist/css/bootstrap-theme.min.css b/static/assets/dist/css/bootstrap-theme.min.css
index 4c3e7ba..4c3e7ba 100644
--- a/assets/dist/css/bootstrap-theme.min.css
+++ b/static/assets/dist/css/bootstrap-theme.min.css
diff --git a/assets/dist/css/bootstrap.css b/static/assets/dist/css/bootstrap.css
index c6f3d21..c6f3d21 100644
--- a/assets/dist/css/bootstrap.css
+++ b/static/assets/dist/css/bootstrap.css
diff --git a/assets/dist/css/bootstrap.css.map b/static/assets/dist/css/bootstrap.css.map
index a02f6ba..a02f6ba 100644
--- a/assets/dist/css/bootstrap.css.map
+++ b/static/assets/dist/css/bootstrap.css.map
diff --git a/assets/dist/css/bootstrap.min.css b/static/assets/dist/css/bootstrap.min.css
index b6fe4e0..b6fe4e0 100644
--- a/assets/dist/css/bootstrap.min.css
+++ b/static/assets/dist/css/bootstrap.min.css
diff --git a/assets/dist/fonts/glyphicons-halflings-regular.eot b/static/assets/dist/fonts/glyphicons-halflings-regular.eot
index 4a4ca86..4a4ca86 100644
--- a/assets/dist/fonts/glyphicons-halflings-regular.eot
+++ b/static/assets/dist/fonts/glyphicons-halflings-regular.eot
Binary files differ
diff --git a/assets/dist/fonts/glyphicons-halflings-regular.svg b/static/assets/dist/fonts/glyphicons-halflings-regular.svg
index 25691af..25691af 100644
--- a/assets/dist/fonts/glyphicons-halflings-regular.svg
+++ b/static/assets/dist/fonts/glyphicons-halflings-regular.svg
diff --git a/assets/dist/fonts/glyphicons-halflings-regular.ttf b/static/assets/dist/fonts/glyphicons-halflings-regular.ttf
index 67fa00b..67fa00b 100644
--- a/assets/dist/fonts/glyphicons-halflings-regular.ttf
+++ b/static/assets/dist/fonts/glyphicons-halflings-regular.ttf
Binary files differ
diff --git a/assets/dist/fonts/glyphicons-halflings-regular.woff b/static/assets/dist/fonts/glyphicons-halflings-regular.woff
index 8c54182..8c54182 100644
--- a/assets/dist/fonts/glyphicons-halflings-regular.woff
+++ b/static/assets/dist/fonts/glyphicons-halflings-regular.woff
Binary files differ
diff --git a/assets/dist/js/bootstrap.js b/static/assets/dist/js/bootstrap.js
index b6ac8d9..b6ac8d9 100644
--- a/assets/dist/js/bootstrap.js
+++ b/static/assets/dist/js/bootstrap.js
diff --git a/assets/dist/js/bootstrap.min.js b/static/assets/dist/js/bootstrap.min.js
index d839865..d839865 100644
--- a/assets/dist/js/bootstrap.min.js
+++ b/static/assets/dist/js/bootstrap.min.js
diff --git a/assets/dist/js/npm.js b/static/assets/dist/js/npm.js
index bf6aa80..bf6aa80 100644
--- a/assets/dist/js/npm.js
+++ b/static/assets/dist/js/npm.js
diff --git a/assets/js/d3.js b/static/assets/js/d3.js
index a582440..a582440 100644
--- a/assets/js/d3.js
+++ b/static/assets/js/d3.js
diff --git a/assets/js/d3.min.js b/static/assets/js/d3.min.js
index ddaf546..ddaf546 100644
--- a/assets/js/d3.min.js
+++ b/static/assets/js/d3.min.js
diff --git a/assets/js/jquery-1.11.1.min.js b/static/assets/js/jquery-1.11.1.min.js
index ab28a24..ab28a24 100644
--- a/assets/js/jquery-1.11.1.min.js
+++ b/static/assets/js/jquery-1.11.1.min.js
diff --git a/assets/js/monitor.js b/static/assets/js/monitor.js
index 890c3f1..0aa0e5a 100644
--- a/assets/js/monitor.js
+++ b/static/assets/js/monitor.js
@@ -63,8 +63,6 @@ function random_color() {
return "#" + hex(r) + hex(g) + hex(b);
}
-var freeze_var = function(cont, i, val) { return cont[i] = function(){ return val }; };
-
function LineGraph() {}
LineGraph.prototype.recalc_y_domain = function(mdata) {
@@ -101,7 +99,7 @@ LineGraph.prototype.parse_data = function(d) {
LineGraph.prototype.update = function(d, i, b) {
var graph = this;
var mdata = this.parse_data(d);
- var freezed_i = [];
+ if (mdata.length == 0) return;
var recalced = false;
var svg = d3.select(this.elem).select("svg");
this.recalc_y_domain(mdata);
@@ -213,7 +211,7 @@ LineGraph.prototype.setup = function(elem, d, i, b) {
var mdata = this.parse_data(d);
this.y = d3.scale.linear().range([this.height, 0]);
- this.recalc_y_domain(mdata);
+ if (mdata.length) this.recalc_y_domain(mdata);
this.yAxis = d3.svg.axis().scale(this.y)
.orient("left").ticks(5);
@@ -230,7 +228,7 @@ LineGraph.prototype.setup = function(elem, d, i, b) {
svg.attr("transform", "translate(" + (maxw + margin.left) + "," + margin.top + ")");
this.inner_width = this.width - maxw;
this.x = d3.scale.linear().range([0, this.inner_width]);
- this.recalc_x_domain(mdata);
+ if (mdata.length) this.recalc_x_domain(mdata);
this.xAxis = d3.svg.axis().scale(this.x)
.orient("bottom").ticks(5).tickFormat(d3.format("d"));
// Define the line
diff --git a/index.html b/static/index.html
index f7bbd07..f7bbd07 100644
--- a/index.html
+++ b/static/index.html