From 55c8a66e6c2deaffc79d132ab68d5d8987e976ec Mon Sep 17 00:00:00 2001 From: Tommy Mikkelsen Date: Fri, 6 May 2022 02:45:12 +0200 Subject: [PATCH] #476-2 WIP --- public/locales/en.json | 27 ++++--- src/components/modules/General/status.js | 71 +++++++++++++++++++ src/components/modules/General/status.vue | 40 +++++++++++ src/components/modules/General/wtutils.js | 5 +- .../modules/PMS/ViewState/ViewState.vue | 34 +++------ .../PMS/ViewState/scripts/viewstate.js | 61 ++++------------ src/router/index.js | 1 - src/store/index.js | 5 +- src/store/modules/{viewstate.js => status.js} | 12 ++-- 9 files changed, 163 insertions(+), 93 deletions(-) create mode 100644 src/components/modules/General/status.js create mode 100644 src/components/modules/General/status.vue rename src/store/modules/{viewstate.js => status.js} (53%) diff --git a/public/locales/en.json b/public/locales/en.json index 3d64b3f..b477f4f 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -136,20 +136,30 @@ "Global": { "Status": "Status", "Chuncks": "Chunks", + "Item": "Item", "Items": "Items", "Info": "Info", "OutFile": "Output File", "StartTime": "Start time", "EndTime": "End Time", "TimeElapsed": "Time Elapsed", - "RunningTime": "Running time" + "RunningTime": "Running time", + "LibsToProcess": "Libraries to process", + "CurrentLib": "Current Library" }, "Modules": {} }, "Msg": { + "Processing_Lib_1_2": "Processing library {0} of {1} - {2}", "Global": { + "Idle": "Idle", + "Processing": "Processing" + }, - "Modules": {} + "Modules": { + "viewState": { + } + } } } }, @@ -442,18 +452,15 @@ "Status": { "Msg": { "CollectUserInfo": "Collecting user info...Please wait", - "Processing": "Processing", - "Processing2": "Processing library {0} of {1} - {2}", - "Idle": "Idle", + + "GEDDELProcessing2": "Processing library {0} of {1} - {2}", + "GatheringLibs": "Gathering libraries to process", "ProcessItem1": "Processing: ({1} - {2}) - {0}" }, "Names": { - "Status": "Status", - "LibsToProcess": "Libraries to process", - "StartTime": "Start time", - "CurrentLib": "Current Library", - "Item": "Item" + + } } } diff --git a/src/components/modules/General/status.js b/src/components/modules/General/status.js new file mode 100644 index 0000000..e871881 --- /dev/null +++ b/src/components/modules/General/status.js @@ -0,0 +1,71 @@ +import store from '../../../store'; +import i18n from '../../../i18n'; + + +const status = new class Status { + constructor() { + this.statusmsg = {}; + this.msgType = { + // Global stuff range up to 200 + 1: i18n.t("Common.Status.Name.Global.Status"), + 2: i18n.t("Common.Status.Name.Global.Info"), + 3: i18n.t("Common.Status.Name.Global.LibsToProcess"), + 8: i18n.t("Common.Status.Name.Global.CurrentLib"), + 9: i18n.t("Common.Status.Name.Global.Item"), + 10: i18n.t("Common.Status.Name.Global.Items"), + // Time related stuff 201 -> 250 + 201: i18n.t("Common.Status.Name.Global.StartTime"), + 202: i18n.t("Common.Status.Name.Global.EndTime"), + 203: i18n.t("Common.Status.Name.Global.TimeElapsed"), + 204: i18n.t("Common.Status.Name.Global.RunningTime") + // Module ViewState range is 1000 => 1200 + // Module ET range is 1201 => 2400 + + + }; + this.RevMsgType = { + // Global stuff + "Status": 1, + "Info": 2, + "LibsToProcess" : 3, + "StartTime": 201, + "EndTime":202, + "TimeElapsed": 203, + "RunningTime": 204, + "CurrentLib": 8, + "Item": 9, + "Items": 10 + } + } + + // Clear Status Window + async clearStatus() + { + this.statusmsg = {}; + store.commit("UPDATE_Status", ''); + return; + } + + // Update status msg + async updateStatusMsg(msgType, msg) + { + console.log('Ged 55-0 msgType: ' + msgType) + console.log('Ged 55-1 msg: ' + msg) + // Update relevant key + //const translatedMsgType = + this.statusmsg[msgType] = msg; + // Tmp store of new msg + let newMsg = ''; + // Walk each current msg keys + Object.entries(this.statusmsg).forEach(([key, value]) => { + if ( value != '') + { + newMsg += this.msgType[key] + ': ' + value + '\n'; + } + }) + store.commit("UPDATE_Status", newMsg); + } + +} + +export { status }; \ No newline at end of file diff --git a/src/components/modules/General/status.vue b/src/components/modules/General/status.vue new file mode 100644 index 0000000..4b02034 --- /dev/null +++ b/src/components/modules/General/status.vue @@ -0,0 +1,40 @@ + + + \ No newline at end of file diff --git a/src/components/modules/General/wtutils.js b/src/components/modules/General/wtutils.js index 9162d2e..67c5de7 100644 --- a/src/components/modules/General/wtutils.js +++ b/src/components/modules/General/wtutils.js @@ -5,6 +5,10 @@ that we use in our solution. //import i18n from '../../../i18n'; +//import storeStatus from '../../store'; + +//storeStatus + const log = require('electron-log'); console.log = log.log; const electron = require('electron'); @@ -713,5 +717,4 @@ const github = new class GitHub { } } - export {wtutils, wtconfig, dialog, github}; \ No newline at end of file diff --git a/src/components/modules/PMS/ViewState/ViewState.vue b/src/components/modules/PMS/ViewState/ViewState.vue index 0088718..52800b8 100644 --- a/src/components/modules/PMS/ViewState/ViewState.vue +++ b/src/components/modules/PMS/ViewState/ViewState.vue @@ -57,25 +57,7 @@
- - - - - - - - - - - - - + @@ -83,11 +65,15 @@