From fb9dc9e8b681dbcaa74bda281c5f5ed3d7a08def Mon Sep 17 00:00:00 2001 From: Yao Chunlin Date: Tue, 9 Aug 2022 05:57:09 +0000 Subject: [PATCH 1/4] Use $set to make m-form.fieldsChanged reactive. Can watch change in child components. --- base-component/webroot/screen/webroot/js/WebrootVue.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base-component/webroot/screen/webroot/js/WebrootVue.js b/base-component/webroot/screen/webroot/js/WebrootVue.js index 5443e49ab..b9e3e9460 100644 --- a/base-component/webroot/screen/webroot/js/WebrootVue.js +++ b/base-component/webroot/screen/webroot/js/WebrootVue.js @@ -606,12 +606,12 @@ Vue.component('m-form', { // console.log("changed? " + changed + " node " + targetDom.nodeName + " type " + targetEl.attr("type") + " " + targetEl.attr("name") + " to " + targetDom.value + " default " + targetDom.defaultValue); // console.log(targetDom.defaultValue); if (changed) { - this.fieldsChanged[targetEl.attr("name")] = true; + this.$set(this.fieldsChanged, targetEl.attr("name"), true); targetEl.parents(".form-group").children("label").addClass("is-changed"); targetEl.parents(".form-group").find(".select2-selection").addClass("is-changed"); targetEl.addClass("is-changed"); } else { - this.fieldsChanged[targetEl.attr("name")] = false; + this.$set(this.fieldsChanged, targetEl.attr("name"), false); targetEl.parents(".form-group").children("label").removeClass("is-changed"); targetEl.parents(".form-group").find(".select2-selection").removeClass("is-changed"); targetEl.removeClass("is-changed"); From 7f405ad9de3866c6783c8b5de923f2704fe8bdfc Mon Sep 17 00:00:00 2001 From: David E Jones Date: Fri, 9 Sep 2022 09:01:59 -0700 Subject: [PATCH 2/4] On System dashboard show stats for new service job thread pool, add new ServiceJob.priority field to ServiceJobDetail and ServiceJobList --- .../System/ServiceJob/Jobs/ServiceJobDetail.xml | 2 ++ .../System/ServiceJob/Jobs/ServiceJobList.xml | 4 ++++ base-component/tools/screen/System/dashboard.xml | 13 +++++++++++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/base-component/tools/screen/System/ServiceJob/Jobs/ServiceJobDetail.xml b/base-component/tools/screen/System/ServiceJob/Jobs/ServiceJobDetail.xml index 859b70770..fd530c3a9 100644 --- a/base-component/tools/screen/System/ServiceJob/Jobs/ServiceJobDetail.xml +++ b/base-component/tools/screen/System/ServiceJob/Jobs/ServiceJobDetail.xml @@ -82,6 +82,8 @@ along with this software (see the LICENSE.md file). If not, see + + diff --git a/base-component/tools/screen/System/ServiceJob/Jobs/ServiceJobList.xml b/base-component/tools/screen/System/ServiceJob/Jobs/ServiceJobList.xml index f21364293..bbcc2f9ba 100644 --- a/base-component/tools/screen/System/ServiceJob/Jobs/ServiceJobList.xml +++ b/base-component/tools/screen/System/ServiceJob/Jobs/ServiceJobList.xml @@ -73,6 +73,10 @@ along with this software (see the LICENSE.md file). If not, see + + + + diff --git a/base-component/tools/screen/System/dashboard.xml b/base-component/tools/screen/System/dashboard.xml index f15e34f24..69d03ecad 100644 --- a/base-component/tools/screen/System/dashboard.xml +++ b/base-component/tools/screen/System/dashboard.xml @@ -31,6 +31,7 @@ along with this software (see the LICENSE.md file). If not, see + @@ -60,7 +61,7 @@ along with this software (see the LICENSE.md file). If not, see - + @@ -178,7 +179,15 @@ along with this software (see the LICENSE.md file). If not, see style="${workerPool.getActiveCount() == workerPool.getMaximumPoolSize() ? 'text-warning' : ''}"/> + style="${workerPool.queue.remainingCapacity() == 0 ? 'text-danger' : (workerPool.queue.size() > workerPool.queue.remainingCapacity() ? 'text-warning' : '')}"/> + + From 7fee600fd73649ae2ccb8fb89b038bc2cebcf0a1 Mon Sep 17 00:00:00 2001 From: David E Jones Date: Thu, 15 Sep 2022 14:21:07 -0700 Subject: [PATCH 3/4] New approach to pageIndex and history: in vuet and qvt Vue components change setParameters() to update parameters on the current item in the history list so they are preserved when going back to that screen after going to another screen --- .../webroot/screen/webroot/js/WebrootVue.js | 13 +++++++++---- .../webroot/screen/webroot/js/WebrootVue.qvt.js | 13 +++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/base-component/webroot/screen/webroot/js/WebrootVue.js b/base-component/webroot/screen/webroot/js/WebrootVue.js index b9e3e9460..1ecd11a9b 100644 --- a/base-component/webroot/screen/webroot/js/WebrootVue.js +++ b/base-component/webroot/screen/webroot/js/WebrootVue.js @@ -1281,7 +1281,11 @@ moqui.webrootVue = new Vue({ } }, setParameters: function(parmObj) { - if (parmObj) { this.$root.currentParameters = $.extend({}, this.$root.currentParameters, parmObj); } + if (parmObj) { + this.$root.currentParameters = $.extend({}, this.$root.currentParameters, parmObj); + // no path change so just need to update parameters on most recent history item + this.navHistoryList[0].pathWithParams = this.currentLinkUrl; + } this.$root.reloadSubscreens(); }, addSubscreen: function(saComp) { @@ -1393,7 +1397,8 @@ moqui.webrootVue = new Vue({ // update history and document.title var newTitle = (par ? par.title + ' - ' : '') + cur.title; - var curUrl = cur.pathWithParams; var questIdx = curUrl.indexOf("?"); + var curUrl = cur.pathWithParams; + var questIdx = curUrl.indexOf("?"); if (questIdx > 0) { var excludeKeys = ["pageIndex", "orderBySelect", "orderByField", "moquiSessionToken"]; var parmList = curUrl.substring(questIdx+1).split("&"); @@ -1410,7 +1415,7 @@ moqui.webrootVue = new Vue({ if (eqIdx > 0) { var key = parm.substring(0, eqIdx); var value = parm.substring(eqIdx + 1); - if (key.indexOf("_op") > 0 || key.indexOf("_not") > 0 || key.indexOf("_ic") > 0 || excludeKeys.indexOf(key) > 0 || key === value) continue; + if (key.indexOf("_op") > 0 || key.indexOf("_not") > 0 || key.indexOf("_ic") > 0 || excludeKeys.indexOf(key) >= 0 || key === value) continue; if (titleParms.length > 0) titleParms += ", "; titleParms += decodeURIComponent(value); dpCount++; @@ -1456,7 +1461,7 @@ moqui.webrootVue = new Vue({ get: function() { return moqui.objToSearch(this.currentParameters); }, set: function(newSearch) { this.currentParameters = moqui.searchToObj(newSearch); } }, - currentLinkUrl: function() { var srch = this.currentSearch; return this.currentLinkPath + (srch.length > 0 ? '?' + srch : ''); }, + currentLinkUrl: function() { var search = this.currentSearch; return this.currentLinkPath + (search.length > 0 ? '?' + search : ''); }, basePathSize: function() { return this.basePath.split('/').length - this.appRootPath.split('/').length; }, ScreenTitle: function() { return this.navMenuList.length > 0 ? this.navMenuList[this.navMenuList.length - 1].title : ""; }, documentMenuList: function() { diff --git a/base-component/webroot/screen/webroot/js/WebrootVue.qvt.js b/base-component/webroot/screen/webroot/js/WebrootVue.qvt.js index 8dcb01809..2cbd085b5 100644 --- a/base-component/webroot/screen/webroot/js/WebrootVue.qvt.js +++ b/base-component/webroot/screen/webroot/js/WebrootVue.qvt.js @@ -2134,7 +2134,11 @@ moqui.webrootVue = new Vue({ hash:'', query:this.currentParameters, params:this.bodyParameters||{}, fullPath:this.currentLinkUrl, matched:[] }; }, setParameters: function(parmObj) { - if (parmObj) { this.$root.currentParameters = $.extend({}, this.$root.currentParameters, parmObj); } + if (parmObj) { + this.$root.currentParameters = $.extend({}, this.$root.currentParameters, parmObj); + // no path change so just need to update parameters on most recent history item + this.navHistoryList[0].pathWithParams = this.currentLinkUrl; + } this.$root.reloadSubscreens(); }, addSubscreen: function(saComp) { @@ -2256,7 +2260,8 @@ moqui.webrootVue = new Vue({ // update history and document.title var newTitle = (par ? par.title + ' - ' : '') + cur.title; - var curUrl = cur.pathWithParams; var questIdx = curUrl.indexOf("?"); + var curUrl = cur.pathWithParams; + var questIdx = curUrl.indexOf("?"); if (questIdx > 0) { var excludeKeys = ["pageIndex", "orderBySelect", "orderByField", "moquiSessionToken"]; var parmList = curUrl.substring(questIdx+1).split("&"); @@ -2273,7 +2278,7 @@ moqui.webrootVue = new Vue({ if (eqIdx > 0) { var key = parm.substring(0, eqIdx); var value = parm.substring(eqIdx + 1); - if (key.indexOf("_op") > 0 || key.indexOf("_not") > 0 || key.indexOf("_ic") > 0 || excludeKeys.indexOf(key) > 0 || key === value) continue; + if (key.indexOf("_op") > 0 || key.indexOf("_not") > 0 || key.indexOf("_ic") > 0 || excludeKeys.indexOf(key) >= 0 || key === value) continue; if (titleParms.length > 0) titleParms += ", "; titleParms += decodeURIComponent(value); dpCount++; @@ -2319,7 +2324,7 @@ moqui.webrootVue = new Vue({ get: function() { return moqui.objToSearch(this.currentParameters); }, set: function(newSearch) { this.currentParameters = moqui.searchToObj(newSearch); } }, - currentLinkUrl: function() { var srch = this.currentSearch; return this.currentLinkPath + (srch.length > 0 ? '?' + srch : ''); }, + currentLinkUrl: function() { var search = this.currentSearch; return this.currentLinkPath + (search.length > 0 ? '?' + search : ''); }, basePathSize: function() { return this.basePath.split('/').length - this.appRootPath.split('/').length; }, ScreenTitle: function() { return this.navMenuList.length > 0 ? this.navMenuList[this.navMenuList.length - 1].title : ""; }, documentMenuList: function() { From 7c0a531e6b285b86b35b5b52206e10325dca7c04 Mon Sep 17 00:00:00 2001 From: David E Jones Date: Thu, 15 Sep 2022 14:33:40 -0700 Subject: [PATCH 4/4] Along with new approach to pageIndex and history handling, in qvt and vuet also update the url in the browser with the pageIndex (makes the browser history messier, but nice to have in there) --- base-component/webroot/screen/webroot/js/WebrootVue.js | 5 ++++- base-component/webroot/screen/webroot/js/WebrootVue.qvt.js | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/base-component/webroot/screen/webroot/js/WebrootVue.js b/base-component/webroot/screen/webroot/js/WebrootVue.js index 1ecd11a9b..42710614a 100644 --- a/base-component/webroot/screen/webroot/js/WebrootVue.js +++ b/base-component/webroot/screen/webroot/js/WebrootVue.js @@ -1284,7 +1284,10 @@ moqui.webrootVue = new Vue({ if (parmObj) { this.$root.currentParameters = $.extend({}, this.$root.currentParameters, parmObj); // no path change so just need to update parameters on most recent history item - this.navHistoryList[0].pathWithParams = this.currentLinkUrl; + var curUrl = this.currentLinkUrl; + var curHistoryItem = this.navHistoryList[0]; + curHistoryItem.pathWithParams = curUrl; + window.history.pushState(null, curHistoryItem.title || '', curUrl); } this.$root.reloadSubscreens(); }, diff --git a/base-component/webroot/screen/webroot/js/WebrootVue.qvt.js b/base-component/webroot/screen/webroot/js/WebrootVue.qvt.js index 2cbd085b5..ef7c572e8 100644 --- a/base-component/webroot/screen/webroot/js/WebrootVue.qvt.js +++ b/base-component/webroot/screen/webroot/js/WebrootVue.qvt.js @@ -2137,7 +2137,10 @@ moqui.webrootVue = new Vue({ if (parmObj) { this.$root.currentParameters = $.extend({}, this.$root.currentParameters, parmObj); // no path change so just need to update parameters on most recent history item - this.navHistoryList[0].pathWithParams = this.currentLinkUrl; + var curUrl = this.currentLinkUrl; + var curHistoryItem = this.navHistoryList[0]; + curHistoryItem.pathWithParams = curUrl; + window.history.pushState(null, curHistoryItem.title || '', curUrl); } this.$root.reloadSubscreens(); },