From a785a6a4a8da5ca407f41cd0e4ec4276a7ed3eca Mon Sep 17 00:00:00 2001 From: ltbam Date: Fri, 15 Sep 2023 10:17:19 +0200 Subject: [PATCH] Update index.html --- static/index.html | 784 +++++++++++++++++++++++----------------------- 1 file changed, 392 insertions(+), 392 deletions(-) diff --git a/static/index.html b/static/index.html index 7c56185..cadaa7c 100644 --- a/static/index.html +++ b/static/index.html @@ -1,404 +1,404 @@ - + - - - KARP GUI -

KARP - KADAS Routing Packager

- - - - - - - - - - - - - - + + + KARP GUI +

KARP - KADAS Routing Packager

+ + + + + + + + + + + + + + - -
- -
-
-
-
- - -
- - -
- - -
- - -
- - -
- - -
- - -

v.1.0

-
- -
-
-
- -
- Job History - - -
- -
- +

v.1.0

+
+ +
+
+
+ +
+ Job History + + +
+ +
+ -
-
-
+ title: 'Del' + }, + ], + + // background color of row according to jobstatus, working=green, failed/deleted=red + "createdRow": function (row, data, dataIndex) { + if (data[1] == "Failed" || data[1] == "Deleted") { + $(row).addClass('failedjob'); + } else if (data[1] == "Compressing" || data[1] == "Queued") { + $(row).addClass('workingjob'); + } + } + + }); + }); + + // error if GET jobs fails + } else { + console.log("GET ERROR: CAN NOT BUILD JOBS TABLE"); + } + }); + }; + + //destroy existing jobs table if exists + function destroyTable() { + if (typeof table == "object") { + table.destroy(); + } + }; + + // nested function to destroy and recreate table in single function + function destroyRecreateTable() { + destroyTable(); + jobresult(); + }; + + //refresh table during page load + destroyRecreateTable(); + + // delete job by jobid with DELETE request + function delJob(jid) { + //console.log("del Job: "+jid); + $.ajax({ + url: "https://l0t2511a.lt.admin.ch/api/v1/jobs/" + jid, + type: 'DELETE', + headers: { + "Authorization": "Basic YWRtaW5AZXhhbXBsZS5vcmc6YWRtaW4=", + "Content-Type": "application/json" + }, + crossDomain: true, + dataType: "json", + + success: function (result) { + document.getElementById("jobdelstatus").innerHTML = "Job " + jid + " successfully deleted!"; + } + }); + }; + + + + +