From 9a091a5a7ae3a1020031151470fd33458e9a7649 Mon Sep 17 00:00:00 2001 From: wcgunter Date: Wed, 8 Nov 2023 19:12:27 -0500 Subject: [PATCH] Fix merge mis-formatting --- install/cws-ui/deployments.ftl | 1132 ++++++++++++++++---------------- 1 file changed, 562 insertions(+), 570 deletions(-) diff --git a/install/cws-ui/deployments.ftl b/install/cws-ui/deployments.ftl index 108fbd18..cc9b8c32 100644 --- a/install/cws-ui/deployments.ftl +++ b/install/cws-ui/deployments.ftl @@ -14,7 +14,7 @@ - + @@ -47,27 +47,35 @@ //GET PROCESS DEFINITIONS AS AN ARRAY (USES FREEMARKER SYNTAX) <#list procDefs as x> - statsVal.${x.key} = {pending:'...', disabled:'...', active:'...', completed:'...', error:'...', fts:'...', incident:'...'}; - var procDef = { - "key": "${x.key}", - "name": "${x.name}", - "version": "${x.version}", - "suspended": "${x.suspended?c}", - "id": "${x.id}" - }; - procDefArray.push(procDef); + statsVal.${x.key} = { + pending: '...', + disabled: '...', + active: '...', + completed: '...', + error: '...', + fts: '...', + incident: '...' + }; + var procDef = { + "key": "${x.key}", + "name": "${x.name}", + "version": "${x.version}", + "suspended": "${x.suspended?c}", + "id": "${x.id}" + }; + procDefArray.push(procDef); // REFRESH THE TEXTUAL STATS SUMMARY function refreshStatUI(name, statsCounts) { var statTotal = - statsCounts.pending + - statsCounts.disabled + - statsCounts.active + - statsCounts.completed + - statsCounts.error + - statsCounts.fts + - statsCounts.incident; + statsCounts.pending + + statsCounts.disabled + + statsCounts.active + + statsCounts.completed + + statsCounts.error + + statsCounts.fts + + statsCounts.incident; var instanceTextString = ""; if (statsCounts.pending) { @@ -97,7 +105,7 @@ $("#stat-txt-" + name).html(instanceTextString); } else { $("#stat-txt-" + name).html( - "No stats for this process" + "No stats for this process" ); } @@ -137,9 +145,9 @@ } /** - * because of the possible additional percentage, calculate the number of - * each dimension corresponding to the adjusted percentage - **/ + * because of the possible additional percentage, calculate the number of + * each dimension corresponding to the adjusted percentage + **/ var statsTemp = {}; statsTemp.pending = statsPercent.pending * statTotal; @@ -151,11 +159,11 @@ statsTemp.incident = statsPercent.incident * statTotal; statTotal = statsTemp.pending + statsTemp.disabled + statsTemp.error + statsTemp.active + - statsTemp.completed + statsTemp.fts + statsTemp.incident; + statsTemp.completed + statsTemp.fts + statsTemp.incident; /** - * recalculate percentage distribution using the recalculated values - **/ + * recalculate percentage distribution using the recalculated values + **/ statsPercent.pending = statsTemp.pending / statTotal * 100; statsPercent.disabled = statsTemp.disabled / statTotal * 100; statsPercent.active = statsTemp.active / statTotal * 100; @@ -205,7 +213,7 @@ return "Process definition was not found. Maybe it was already deleted. Try refreshing the page..."; } else if (message.indexOf("(Running)") > 0) { return "Before deleting this process definition, you must wait for it to finish running or stop it, then disable it on all workers."; - } else { + } else { return "An unknown error occured."; } } @@ -227,8 +235,7 @@ } deleteProcDefEsLogs(proc_def_key); - } - else { + } else { var deleteError = getDeleteErrorMessage(data.message); @@ -300,7 +307,9 @@ // SKIP AN INVALID KEY // THIS IS NECESSARY, IF SOMEHOW AN INVALID PROC GOT SCHEDULED OR PUT IN A DATABASE ROW // - if (statsVal[key] == undefined) { return true; } + if (statsVal[key] == undefined) { + return true; + } // UPDATE THE STATS VALUE ARRAYS // @@ -389,8 +398,8 @@ columns: [ //ICONS COLUMN { - data: { suspended: "suspended", id: "id", key: "key" }, - render: function(data, type) { + data: {suspended: "suspended", id: "id", key: "key"}, + render: function (data, type) { if (type !== 'display') { return data.id; } else { @@ -398,20 +407,20 @@ var returnVal = `
`; if (data.suspended == "true") { returnVal += `` - + `` - + ``; + + `` + + ``; } else { returnVal += `` - + ``; + + ``; } - + returnVal += `` - + `` - + `` - + ``; + + `` + + `` + + ``; returnVal += `
`; return returnVal; @@ -420,7 +429,7 @@ }, //NAME COLUMN { - data: { name: "name", id: "id", key: "key" }, + data: {name: "name", id: "id", key: "key"}, render: function (data, type) { if (type !== 'display') { return data.name; @@ -439,8 +448,7 @@ } else { if (data === null || data === undefined || data === "null") { return "ERROR"; - } - else { + } else { return data; } } @@ -455,8 +463,7 @@ } else { if (data === null || data === undefined || data === "null") { return "ERROR"; - } - else { + } else { return data; } } @@ -470,29 +477,27 @@ return ""; } else { var html = ``; + + `data-proc-key="` + data + `">view`; return html; } } }, //STATUS COLUMN { - data: { suspended: "suspended", key: "key" }, + data: {suspended: "suspended", key: "key"}, render: function (data, type) { if (type !== 'display') { if (data.suspended === "true") { return "Suspended"; - } - else { + } else { return "Active"; } } else { var status = ""; var html = ""; if (data.suspended == "true") { - html =`
Suspended
`; - } - else { + html = `
Suspended
`; + } else { html = `
Active
`; } return html; @@ -507,37 +512,37 @@ return ""; } else { var html = `
` - + `
` - + `
` - + `` - + `
` - + `
` - + `` - + `
` - + `
` - + `` - + `
` - + `
` - + `` - + `
` - + `
` - + `` - + `
` - + `
` - + `` - + `
` - + `
` - + `` - + `
` - + `No Instance Statistics...` - + `
`; + + `
` + + `
` + + `` + + `
` + + `
` + + `` + + `
` + + `
` + + `` + + `
` + + `
` + + `` + + `
` + + `
` + + `` + + `
` + + `
` + + `` + + `
` + + `
` + + `` + + `
` + + `No Instance Statistics...` + + `
`; return html; } } @@ -547,7 +552,7 @@ rowId: "key", //DISABLES ORDERING ON BUTTON, WORKER, AND INSTANCE STATISTICS COLUMNS (https://datatables.net/reference/option/columnDefs) columnDefs: [ - { orderable: false, targets: [ 0,6,4 ]} + {orderable: false, targets: [0, 6, 4]} ], //SETS DEFAULT ORDERING TO BE THE "NAME" COLUMN, ASCENDING (https://datatables.net/reference/option/order) order: [[1, "asc"]], @@ -555,8 +560,8 @@ "paging": false, //SETS WHAT ELEMENTS ARE CREATED BY DATATABLE AND WHERE ELEMENTS ARE PUT (https://datatables.net/reference/option/dom) dom: "<'above-table-div'<'above-table-buttons'>f>" - + "t" - + "<'below-table-div'i>", + + "t" + + "<'below-table-div'i>", }); //OUR DATA COMES FROM FREEMARKER TEMPLATE - ADD THAT ARRAY TO THE DATATABLE @@ -579,50 +584,48 @@ $("#process-table").DataTable().column(5).search("Active", false, true).draw(); localStorage.setItem(hideSuspendedProcVar, "1"); refreshStats(); - } - else { + } else { $("#process-table").DataTable().column(5).search("").draw(); localStorage.setItem(hideSuspendedProcVar, "0"); refreshStats(); } $("#process-table").DataTable().rows().every(function () { - $("#process-table").DataTable().rows().every( function (rowIdx, tableLoop, rowLoop) { - var status = this.data()["suspended"]; - var procDefKey = this.data()["key"]; - var procDefId = this.data()["id"]; - if (status == "false") { - $("#suspend-" + procDefKey).removeClass("glyphicon-play"); - $("#suspend-" + procDefKey).addClass("glyphicon-pause"); - $("#suspend-" + procDefKey).css("color", "#d9534f"); - $("#btn-suspend-" + procDefKey).attr("onclick", "suspendProcDef('" + procDefId + "', '" + procDefKey + "')"); - $("#status-txt-" + procDefKey).html("Active"); - $("#" + procDefKey).removeClass("disabled"); - $("#pv-" + procDefKey).removeClass("disabled"); - } else { - $("#suspend-" + procDefKey).removeClass("glyphicon-pause"); - $("#suspend-" + procDefKey).addClass("glyphicon-play"); - $("#suspend-" + procDefKey).css("color", "green"); - $("#btn-suspend-" + procDefKey).attr("onclick", "resumeProcDef('" + procDefId + "', '" + procDefKey + "')"); - $("#status-txt-" + procDefKey).html("Suspended"); - $("#" + procDefKey).addClass("disabled"); - $("#pv-" + procDefKey).addClass("disabled"); - } - }); + $("#process-table").DataTable().rows().every(function (rowIdx, tableLoop, rowLoop) { + var status = this.data()["suspended"]; + var procDefKey = this.data()["key"]; + var procDefId = this.data()["id"]; + if (status == "false") { + $("#suspend-" + procDefKey).removeClass("glyphicon-play"); + $("#suspend-" + procDefKey).addClass("glyphicon-pause"); + $("#suspend-" + procDefKey).css("color", "#d9534f"); + $("#btn-suspend-" + procDefKey).attr("onclick", "suspendProcDef('" + procDefId + "', '" + procDefKey + "')"); + $("#status-txt-" + procDefKey).html("Active"); + $("#" + procDefKey).removeClass("disabled"); + $("#pv-" + procDefKey).removeClass("disabled"); + } else { + $("#suspend-" + procDefKey).removeClass("glyphicon-pause"); + $("#suspend-" + procDefKey).addClass("glyphicon-play"); + $("#suspend-" + procDefKey).css("color", "green"); + $("#btn-suspend-" + procDefKey).attr("onclick", "resumeProcDef('" + procDefId + "', '" + procDefKey + "')"); + $("#status-txt-" + procDefKey).html("Suspended"); + $("#" + procDefKey).addClass("disabled"); + $("#pv-" + procDefKey).addClass("disabled"); + } }); + }); }); //INIT STATE OF HIDE SUSPENDED PROC DEF CHECKBOX if (parseInt(localStorage.getItem(hideSuspendedProcVar)) == 0) { $("#hide-sus-btn").prop("checked", false); $("#process-table").DataTable().column(5).search("").draw(); - } - else { + } else { $("#hide-sus-btn").prop("checked", true); $("#process-table").DataTable().column(5).search("Active", false, true).draw(); } //PULL LATEST STATS refreshStats(); - + //INIT STATE OF REFRESH RATE if (parseInt(localStorage.getItem(refreshRateVar)) !== 0) { pageRefId = setInterval(pageRefresh, parseInt(localStorage.getItem(refreshRateVar))); @@ -660,8 +663,7 @@ id = $(this).parent().attr("data-pdk"); if (id) { window.location = "/${base}/processes?procDefKey=" + id + "&status=fail&cache=false"; - } - else { + } else { window.location = "/${base}/processes?status=fail&cache=false"; } }); @@ -669,8 +671,7 @@ id = $(this).parent().attr("data-pdk"); if (id) { window.location = "/${base}/processes?procDefKey=" + id + "&status=complete,resolved&cache=false"; - } - else { + } else { window.location = "/${base}/processes?status=complete,resolved&cache=false"; } }); @@ -678,8 +679,7 @@ id = $(this).parent().attr("data-pdk"); if (id) { window.location = "/${base}/processes?procDefKey=" + id + "&status=pending&cache=false"; - } - else { + } else { window.location = "/${base}/processes?status=pending&cache=false"; } }); @@ -687,8 +687,7 @@ id = $(this).parent().attr("data-pdk"); if (id) { window.location = "/${base}/processes?procDefKey=" + id + "&status=disabled&cache=false"; - } - else { + } else { window.location = "/${base}/processes?status=disabled&cache=false"; } }); @@ -696,8 +695,7 @@ id = $(this).parent().attr("data-pdk"); if (id) { window.location = "/${base}/processes?procDefKey=" + id + "&status=running&cache=false"; - } - else { + } else { window.location = "/${base}/processes?status=running&cache=false"; } }); @@ -705,8 +703,7 @@ id = $(this).parent().attr("data-pdk"); if (id) { window.location = "/${base}/processes?procDefKey=" + id + "&status=failedToStart&cache=false"; - } - else { + } else { window.location = "/${base}/processes?status=failedToStart&cache=false"; } }); @@ -714,8 +711,7 @@ id = $(this).parent().attr("data-pdk"); if (id) { window.location = "/${base}/processes?procDefKey=" + id + "&status=incident&cache=false"; - } - else { + } else { window.location = "/${base}/processes?status=incident&cache=false"; } }); @@ -758,7 +754,7 @@ $("#" + procDefKey).addClass("disabled"); $("#pv-" + procDefKey).addClass("disabled"); }, - error: function(data) { + error: function (data) { console.log("error suspending"); } }) @@ -784,7 +780,7 @@ $("#" + procDefKey).removeClass("disabled"); $("#pv-" + procDefKey).removeClass("disabled"); }, - error: function(data) { + error: function (data) { console.log("error activating"); } }) @@ -793,7 +789,8 @@ - + + + + +
-
+
+
+ +
+
+
+ +
+
+ +
+ +
-
+
+
+ +
- <#include "sidebar.ftl"> - -
- ${msg} - -
-
-

Deployed Process Definitions

-
-
-
-
- Open File - -
- - -
-
+
+
-
- -
-
-
- -
-
-
- -
-
- -
- -
-
-
-
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- - No Summary Statistics... -
-
+ +
+
- - - - - - - - - - - - - - -
NameKeyVersionWorkersStatusInstance Statistics
+
+ +
+
+ +
+ +
+ +
+ +
+ +
+ + No Summary Statistics...
+
-
- + + + + +
+
+
- - -