From 2ecb558d9068ff959c4d1c2b6b80ef1e2d9d331c Mon Sep 17 00:00:00 2001 From: srinijammula Date: Sat, 24 Aug 2024 14:32:55 -0400 Subject: [PATCH] Displays process name in history chart --- src/main/resources/static/js/gw.chart.js | 8 ++++---- src/main/resources/static/js/gw.process.js | 1 + src/main/resources/static/js/gw.process.sidepanel.js | 1 + src/main/resources/static/js/gw.process.util.js | 5 +++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main/resources/static/js/gw.chart.js b/src/main/resources/static/js/gw.chart.js index 2fba773bf..4f82a1639 100644 --- a/src/main/resources/static/js/gw.chart.js +++ b/src/main/resources/static/js/gw.chart.js @@ -155,7 +155,7 @@ GW.chart = { return isin; }, - renderUtil: function (type, msg, process_history_container_id) { + renderUtil: function (type, msg, pname, process_history_container_id) { this.utils.srand(Date.now()); var labels = [], @@ -349,7 +349,7 @@ GW.chart = { responsive: true, title: { display: true, - text: type + " Execution History Chart", + text: pname + " " + type + " Execution History Chart", }, tooltips: { mode: "index", @@ -385,11 +385,11 @@ GW.chart = { this.history_chart[type] = new Chart(ctx, config); }, - renderProcessHistoryChart: function (msg, process_history_container_id) { + renderProcessHistoryChart: function (msg, pname, process_history_container_id) { msg = msg.sort(function (x, y) { return x["history_begin_time"] - y["history_begin_time"]; }); - this.renderUtil("process", msg, process_history_container_id); + this.renderUtil("process", msg, pname, process_history_container_id); }, renderWorkflowHistoryChart: function (msg) { diff --git a/src/main/resources/static/js/gw.process.js b/src/main/resources/static/js/gw.process.js index 4546b6241..8a3ce9060 100644 --- a/src/main/resources/static/js/gw.process.js +++ b/src/main/resources/static/js/gw.process.js @@ -873,6 +873,7 @@ GW.process = { history: function (pid, pname) { GW.process.util.history( pid, + pname, "#process-history-container", "#process_history_table", "#closeHistory", diff --git a/src/main/resources/static/js/gw.process.sidepanel.js b/src/main/resources/static/js/gw.process.sidepanel.js index fb112867d..515cc8aa6 100644 --- a/src/main/resources/static/js/gw.process.sidepanel.js +++ b/src/main/resources/static/js/gw.process.sidepanel.js @@ -523,6 +523,7 @@ GW.process.sidepanel = { history: function (process_id, process_name) { GW.process.util.history( process_id, + process_name, "#prompt-panel-process-history-container", "#process_history_table", "#closeHistory", diff --git a/src/main/resources/static/js/gw.process.util.js b/src/main/resources/static/js/gw.process.util.js index 85602ad82..42b8ee6bc 100644 --- a/src/main/resources/static/js/gw.process.util.js +++ b/src/main/resources/static/js/gw.process.util.js @@ -455,6 +455,7 @@ GW.process.util = { history: function ( pid, + pname, process_history_container_id, process_history_table_id, close_history, @@ -466,7 +467,7 @@ GW.process.util = { method: "POST", - data: "type=process&id=" + pid, + data: "type=process&id=" + pid + "&pname=" + pname, }) .done(function (msg) { // for process dialog @@ -496,7 +497,7 @@ GW.process.util = { var table_selector = `${process_history_container_id} ${process_history_table_id}`; GW.history.applyBootstrapTable(table_selector); - GW.chart.renderProcessHistoryChart(msg, process_history_container_id); + GW.chart.renderProcessHistoryChart(msg, pname, process_history_container_id); $(close_history).click(function () { $(process_history_container_id).html("");