Free cookie consent management tool by TermsFeed Policy Generator

source: branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/wwwroot/js/Scripts/Graphs/GraphHubber.min.js @ 13740

Last change on this file since 13740 was 13740, checked in by jlodewyc, 8 years ago

#2582 Job Manager done. Start user management

File size: 4.2 KB
Line 
1var hubber = $.connection.jobUpdaterHub;
2$(function () {
3    var a = document.getElementById("userId").innerHTML; $.connection.hub.qs = { userid: a }; $.connection.hub.start().done(function () { hubber.server.initConnection(); redrawMain() }); hubber.client.processData = function (a, c, d) { c = JSON.parse(c); editTaskData(a, c); saveData(a, c.StateLog, d); console.log("#UPDATED " + a) }; hubber.client.processJobData = function (a, c) { editJobData(a, c) }; hubber.client.requestDone = function () {
4        document.getElementById("refreshtogg").checked && setTimeout(function () { hubber.server.updateAll(); console.log("#REFRESH ALL") },
5        5E3)
6    }
7}); function autoRefresh() { document.getElementById("refreshtogg").checked && hubber.server.updateAll() } function restart(a) { document.getElementById("restarterbtn" + a).disabled = !0; document.getElementById("restarterbtn" + a).value = "Sending restart request..."; hubber.server.restartTask(a) } function editJobData(a, b) { $("#jobcalculating").html("Calculating: " + a); $("#jobfinished").html("Finished: " + b) }
8function editTaskData(a, b) {
9    if (null != b.LastHeartbeat) { var c = new Date(b.LastHeartbeat); $("#lastupdpar" + a).html("Last update: " + c.toUTCString()) } else $("#lastupdpar" + a).html("No updates yet"); document.getElementById("restarter" + a).style.display = "none"; "0" == b.State ? ($("#statepar" + a).css({ color: "gray", "font-weight": "normal" }), $("#statepar" + a).html("State: Offline")) : "1" == b.State ? ($("#statepar" + a).css({ color: "white", "font-weight": "normal" }), $("#statepar" + a).html("State: Waiting")) : "2" == b.State ? ($("#statepar" +
10    a).css({ color: "white", "font-weight": "normal", "text-shadow": "2px 2px black" }), $("#statepar" + a).html("State: Transferring")) : "3" == b.State ? ($("#statepar" + a).css({ color: "white", "font-weight": "normal" }), $("#statepar" + a).html("State: Calculating")) : "4" == b.State ? ($("#statepar" + a).css({ color: "white", "font-weight": "normal" }), $("#statepar" + a).html("State: Paused"), document.getElementById("restarter" + a).style.display = "", document.getElementById("restarterbtn" + a).disabled = !1, document.getElementById("restarterbtn" +
11    a).value = "Restart task") : "5" == b.State ? ($("#statepar" + a).css({ color: "#009900", "font-weight": "900", "text-shadow": "1px 1px black" }), $("#statepar" + a).html("State: Finished"), c = new Date(b.StateLog[b.StateLog.length - 1].DateTime), $("#lastupdpar" + a).html("Finished: " + c.toUTCString())) : "6" == b.State ? ($("#statepar" + a).css({ color: "#e60000", "font-weight": "900", "text-shadow": "1px 1px black" }), $("#statepar" + a).html("State: Aborted"), document.getElementById("restarter" + a).style.display = "", document.getElementById("restarterbtn" +
12    a).disabled = !1, document.getElementById("restarterbtn" + a).value = "Restart task") : "7" == b.State && ($("#statepar" + a).css({ color: "#e60000", "font-weight": "900", "text-shadow": "1px 1px black" }), $("#statepar" + a).html("State: Failed"), document.getElementById("restarter" + a).style.display = "", document.getElementById("restarterbtn" + a).disabled = !1, document.getElementById("restarterbtn" + a).value = "Restart task"); $("#executionpar" + a).html(b.ExecutionTime + " executed"); null != b.StateLog[b.StateLog.length - 1].Exception ? "" !=
13    b.StateLog[b.StateLog.length - 1].Exception ? ($("#exceptionpar" + a).html("Exception: " + b.StateLog[b.StateLog.length - 1].Exception), $("#exceptionpar" + a).css({ color: "#e60000", "font-weight": "700", "text-shadow": "1px 1px black" })) : "6" == b.State ? ($("#exceptionpar" + a).html("Task is aborted."), $("#exceptionpar" + a).css({ color: "#e65c00", "font-weight": "700", "text-shadow": "1px 1px black" })) : ($("#exceptionpar" + a).html("No exceptions"), $("#exceptionpar" + a).css({ color: "white", "text-shadow": "2px 2px black" })) : ($("#exceptionpar" +
14    a).html("No exceptions"), $("#exceptionpar" + a).css({ color: "white", "text-shadow": "2px 2px black" })); $("#statechangespar" + a).html("Statelogs: " + b.StateLog.length); var c = new Date(b.StateLog[0].DateTime), d = new Date(b.StateLog[b.StateLog.length - 1].DateTime); $("#graphtitle" + a).html("From " + c.toUTCString() + "<br/> to " + d.toUTCString())
15};
Note: See TracBrowser for help on using the repository browser.