Commit f70ce67a authored by Romain Courteaud's avatar Romain Courteaud Committed by Jérome Perrin

Commit built version.

parent a1bc007a
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
var key = this.props.jio_key, gadget = this; var key = this.props.jio_key, gadget = this;
return new RSVP.Queue().push(function() { return new RSVP.Queue().push(function() {
// XXX Conditional simulation menu // XXX Conditional simulation menu
return RSVP.all([ gadget.whoWantToDisplayThisDocumentPage("edit_table", key), gadget.whoWantToDisplayThisDocumentPage("run_simulation", key), gadget.whoWantToDisplayThisDocumentPage("manage_document", key), gadget.whoWantToDisplayThisDocumentPage("station_utilisation_graph", key), gadget.whoWantToDisplayThisDocumentPage("debug_json", key) ]); return RSVP.all([ gadget.whoWantToDisplayThisDocumentPage("edit_table", key), gadget.whoWantToDisplayThisDocumentPage("run_simulation", key), gadget.whoWantToDisplayThisDocumentPage("manage_document", key), gadget.whoWantToDisplayThisDocumentPage("station_utilisation_graph", key), gadget.whoWantToDisplayThisDocumentPage("queue_stat_graph", key), gadget.whoWantToDisplayThisDocumentPage("debug_json", key) ]);
}).push(function(result_list) { }).push(function(result_list) {
return [ { return [ {
link: result_list[0], link: result_list[0],
...@@ -22,6 +22,9 @@ ...@@ -22,6 +22,9 @@
title: "Stations Utilization" title: "Stations Utilization"
}, { }, {
link: result_list[4], link: result_list[4],
title: "Queues Statistics"
}, {
link: result_list[5],
title: "Debug JSON" title: "Debug JSON"
} ]; } ];
}); });
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Queues Statistics</title>
<script src="../lib/rsvp.min.js" type="text/javascript"></script>
<script src="../lib/renderjs.min.js" type="text/javascript"></script>
<script src="../lib/jquery.flot.js"></script>
<script src="../lib/jquery.flot.stack.js"></script>
<script src="document_page_mixin.js" type="text/javascript"></script>
<script src="queue_stat_graph.js" type="text/javascript"></script>
</head>
<body>
<div class="graph_container" style="width: 100%;height:300px"></div>
</body>
</html>
/*global console, rJS, RSVP, initDocumentPageMixin, jQuery */
/*jslint nomen: true */
(function(window, rJS, RSVP, initDocumentPageMixin, $) {
"use strict";
function queue_stat_widget(output_data) {
/* FIXME: does not support more than one replic.
* + see george email to integrate without the need of an EG
*/
var series = [];
$.each(output_data.elementList, function(idx, el) {
if (el._class === "Dream.Queue") {
series.push({
label: el.name || el.id,
data: el.wip_stat_list
});
}
});
return series;
}
var gadget_klass = rJS(window);
initDocumentPageMixin(gadget_klass);
gadget_klass.ready(function(g) {
g.props = {};
}).ready(function(g) {
return g.getElement().push(function(element) {
g.props.element = element;
});
}).declareAcquiredMethod("aq_getAttachment", "jio_getAttachment").declareMethod("render", function(options) {
var jio_key = options.id, gadget = this;
gadget.props.jio_key = jio_key;
return gadget.aq_getAttachment({
_id: gadget.props.jio_key,
_attachment: "simulation.json"
}).push(function(simulation_json) {
gadget.props.series = queue_stat_widget(// XXX Hardcoded result
JSON.parse(simulation_json)[0].result);
});
}).declareMethod("startService", function() {
// XXX Manually calculate width and height when resizing
$.plot(this.props.element.querySelector(".graph_container"), this.props.series);
});
})(window, rJS, RSVP, initDocumentPageMixin, jQuery);
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment