summaryrefslogtreecommitdiff
path: root/web-static/socket.html
diff options
context:
space:
mode:
Diffstat (limited to 'web-static/socket.html')
-rw-r--r--web-static/socket.html51
1 files changed, 42 insertions, 9 deletions
diff --git a/web-static/socket.html b/web-static/socket.html
index 9b118ac..9781e81 100644
--- a/web-static/socket.html
+++ b/web-static/socket.html
@@ -17,6 +17,19 @@
margin-bottom: 1em;
}
+ #progress {
+ background-color: white;
+ border: 1px solid;
+ padding: 1em;
+ font-family: monospace;
+ margin-top: 2em;
+ margin-bottom: 0em;
+ }
+
+ #progress span.caption {
+ font-weight: bold;
+ }
+
td {
text-align: right;
}
@@ -60,6 +73,9 @@
$('#sessionid').val(msg.ID);
buttonsRunning();
break;
+ case "progress":
+ repaintProgress(msg.PROGRESS_STEP_NAME, msg.PROGRESS, msg.TITLE, msg.CART_NUMBER, msg.CUT_NUMBER);
+ break;
case "done":
case "error":
this.sock.close();
@@ -110,23 +126,32 @@
}
function buttonsIdle() {
- $('#buttonrun').removeAttr('disabled')
- $('#buttonreconnect').removeAttr('disabled')
- $('#buttondetach').attr('disabled','disabled')
- $('#buttoncancel').attr('disabled','disabled')
+ $('#buttonrun').removeAttr('disabled');
+ $('#buttonreconnect').removeAttr('disabled');
+ $('#buttondetach').attr('disabled','disabled');
+ $('#buttoncancel').attr('disabled','disabled');
}
function buttonsRunning() {
- $('#buttonrun').attr('disabled','disabled')
- $('#buttonreconnect').attr('disabled','disabled')
- $('#buttondetach').removeAttr('disabled')
- $('#buttoncancel').removeAttr('disabled')
+ $('#buttonrun').attr('disabled','disabled');
+ $('#buttonreconnect').attr('disabled','disabled');
+ $('#buttondetach').removeAttr('disabled');
+ $('#buttoncancel').removeAttr('disabled');
+ }
+
+ function repaintProgress(step, value, title, cart, cut) {
+ $('#progress_step').text("'" + step + "'");
+ $('#progress_value').text(Math.round(value*100)/100 + "%");
+ $('#progress_title').text("'" + title + "'");
+ $('#progress_cart').text(cart);
+ $('#progress_cut').text(cut);
}
function init() {
$('#sessionid').val("");
buttonsIdle();
- $('#buttonlist').removeAttr('disabled','disabled')
+ repaintProgress("", 0, "", 0, 0);
+ $('#buttonlist').removeAttr('disabled','disabled');
}
</script>
</head>
@@ -154,6 +179,14 @@
<input id="sessionid" type="text" size="45">
<button id="buttonreconnect" onclick="reconnect()">reconnect</button>
<button id="buttoncancel" onclick="cancel()">cancel</button>
+ <div id="progress">
+ <span class="caption">Step/Value:</span>
+ <span id="progress_step"></span> / <span id="progress_value"></span>
+ <span class="caption">Title</span>
+ <span id="progress_title"></span>
+ <span class="caption">Cart/Cut</span>
+ <span id="progress_cart"></span> / <span id="progress_cut"></span>
+ </div>
<div id="rawmsg" class="data"></div>
</div>
</body>