From 20a0b986c84ccddd5e71e278e2d0b9be81f60f50 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Wed, 9 Nov 2016 23:38:28 +0800 Subject: webui: Add the foreground simulation task to ConsoleHandler * The original sleep test task "_task()" renamed to "_task_test()" * Also add the new "startServerTaskTest()" to trigger the "_task_test()" NOTE/XXX: The foregrounds simulation requires the configurations, which is currently obtained from "self.websocket.configs", which I think is a HACK. How to better solve this?? --- fg21sim/webui/static/js/console.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'fg21sim/webui/static/js/console.js') diff --git a/fg21sim/webui/static/js/console.js b/fg21sim/webui/static/js/console.js index 86ea90c..14e0ad7 100644 --- a/fg21sim/webui/static/js/console.js +++ b/fg21sim/webui/static/js/console.js @@ -144,7 +144,18 @@ var getServerTaskStatus = function (ws) { */ var startServerTask = function (ws, time) { time = typeof time !== "undefined" ? time : 5; - var msg = {type: "console", action: "start", time: time}; + var msg = {type: "console", action: "start"}; + ws.send(JSON.stringify(msg)); +}; + +/** + * Request to start the test task on the server. + * + * @param {Number} time - Time in seconds for the sleep test task on server + */ +var startServerTaskTest = function (ws, time) { + time = typeof time !== "undefined" ? time : 5; + var msg = {type: "console", action: "start_test", time: time}; ws.send(JSON.stringify(msg)); }; -- cgit v1.2.2