From 9e1219c1872553eb163d170d33e22f4658b80909 Mon Sep 17 00:00:00 2001 From: Jeremy Clements <79224539+jeclrsg@users.noreply.github.com> Date: Tue, 24 Sep 2024 12:01:38 -0400 Subject: [PATCH 1/3] HPCC-32693 ECL Watch v5 add log filter fields to ZAP dialog fixes an issue where the ECL Watch v5 UI had not been updated to show the fields necessary for WsWorkunits to retrieve relevant log files to be included in a ZAP report Signed-off-by: Jeremy Clements <79224539+jeclrsg@users.noreply.github.com> --- esp/src/eclwatch/WUDetailsWidget.js | 29 +++++++++++++++ esp/src/eclwatch/css/hpcc.css | 4 ++ .../eclwatch/templates/WUDetailsWidget.html | 37 ++++++++++++++++++- 3 files changed, 68 insertions(+), 2 deletions(-) diff --git a/esp/src/eclwatch/WUDetailsWidget.js b/esp/src/eclwatch/WUDetailsWidget.js index c7d2c331af0..411bba32c52 100644 --- a/esp/src/eclwatch/WUDetailsWidget.js +++ b/esp/src/eclwatch/WUDetailsWidget.js @@ -117,6 +117,16 @@ define([ this.emailFrom = registry.byId(this.id + "EmailFrom"); this.emailSubject = registry.byId(this.id + "EmailSubject"); this.emailBody = registry.byId(this.id + "EmailBody"); + + //Zap LogFilters + this.logFilterStartDateTime = dom.byId(this.id + "StartDateTime"); + this.logFilterStartDate = registry.byId(this.id + "StartDate"); + this.logFilterStartTime = registry.byId(this.id + "StartTime"); + this.logFilterEndDateTime = dom.byId(this.id + "EndDateTime"); + this.logFilterEndDate = registry.byId(this.id + "EndDate"); + this.logFilterEndTime = registry.byId(this.id + "EndTime"); + this.logFilterRelativeTimeRangeBuffer = registry.byId(this.id + "RelativeTimeRangeBuffer"); + this.protected = registry.byId(this.id + "Protected"); this.infoGridWidget = registry.byId(this.id + "InfoContainer"); this.zapDialog = registry.byId(this.id + "ZapDialog"); @@ -146,14 +156,33 @@ define([ this.checkThorLogStatus(); }, + formatLogFilterDateTime: function (dateField, timeField, dateTimeField) { + if (dateField.value.toString() !== "Invalid Date") { + const d = new Date(dateField.value); + const date = `${d.getFullYear()}-${(d.getMonth() < 9 ? "0" : "") + parseInt(d.getMonth() + 1, 10)}-${d.getDate()}`; + const time = timeField.value.toString().replace(/.*1970\s(\S+).*/, "$1"); + dateTimeField.value = `${date}T${time}.000Z`; + } + }, + _onSubmitDialog: function () { var context = this; var includeSlaveLogsCheckbox = this.includeSlaveLogsCheckbox.get("checked"); + if (this.logFilterRelativeTimeRangeBuffer.value !== "") { + this.logFilterEndDate.required = ""; + this.logFilterStartDate.required = ""; + } if (this.zapForm.validate()) { //WUCreateAndDownloadZAPInfo is not a webservice so relying on form to submit. //Server treats "on" and '' as the same thing. this.includeSlaveLogsCheckbox.set("value", includeSlaveLogsCheckbox ? "on" : "off"); + + // Log Filters + this.formatLogFilterDateTime(this.logFilterStartDate, this.logFilterStartTime, this.logFilterStartDateTime); + this.formatLogFilterDateTime(this.logFilterEndDate, this.logFilterEndTime, this.logFilterEndDateTime); + this.zapForm.set("action", "/WsWorkunits/WUCreateAndDownloadZAPInfo"); + this.zapDialog.hide(); this.checkThorLogStatus(); if (this.logAccessorMessage !== "") { diff --git a/esp/src/eclwatch/css/hpcc.css b/esp/src/eclwatch/css/hpcc.css index 26559935861..e6d0e6f6f0b 100644 --- a/esp/src/eclwatch/css/hpcc.css +++ b/esp/src/eclwatch/css/hpcc.css @@ -74,6 +74,10 @@ form li label { padding-top: 4px; } +.dijitDialogPaneContent { + overflow-x: hidden !important; +} + .dijitDialogPaneContent form li label { float: left; width: 25%; diff --git a/esp/src/eclwatch/templates/WUDetailsWidget.html b/esp/src/eclwatch/templates/WUDetailsWidget.html index a56d36ec15c..ef58752e1a6 100644 --- a/esp/src/eclwatch/templates/WUDetailsWidget.html +++ b/esp/src/eclwatch/templates/WUDetailsWidget.html @@ -183,7 +183,7 @@