mirror of
https://github.com/WebTools-NG/WebTools-NG
synced 2024-11-22 11:03:13 +00:00
#476-2 WIP
This commit is contained in:
parent
d25db81e57
commit
55c8a66e6c
9 changed files with 163 additions and 93 deletions
|
@ -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"
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
71
src/components/modules/General/status.js
Normal file
71
src/components/modules/General/status.js
Normal file
|
@ -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 };
|
40
src/components/modules/General/status.vue
Normal file
40
src/components/modules/General/status.vue
Normal file
|
@ -0,0 +1,40 @@
|
|||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
statusMsg: this.$t("Common.Status.Msg.Global.Idle")
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
// Watch for status update
|
||||
viewStateStatus: function() {
|
||||
this.statusMsg = this.$store.getters.getStatus;
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
viewStateStatus: function(){
|
||||
return this.$store.getters.getStatus;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<b-container fluid> <!-- Status -->
|
||||
<b-row>
|
||||
<b-col sm="2">
|
||||
<label for="status">{{ $t('Common.Status.Name.Global.Status') }}:</label>
|
||||
</b-col>
|
||||
<b-col sm="10">
|
||||
<b-form-textarea
|
||||
id="status"
|
||||
v-bind:placeholder="$t('Common.Status.Name.Global.Status')"
|
||||
v-model="statusMsg"
|
||||
:disabled=true
|
||||
rows="1"
|
||||
max-rows="8">
|
||||
</b-form-textarea>
|
||||
</b-col>
|
||||
</b-row>
|
||||
</b-container>
|
||||
</template>
|
|
@ -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};
|
|
@ -57,25 +57,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<b-container fluid> <!-- Status -->
|
||||
<b-row>
|
||||
<b-col sm="2">
|
||||
<label for="status">{{ $t('Modules.PMS.ViewState.Status.Names.Status') }}:</label>
|
||||
</b-col>
|
||||
<b-col sm="10">
|
||||
<b-form-textarea
|
||||
id="status"
|
||||
v-bind:placeholder="$t('Modules.PMS.ViewState.Status.Names.Status')"
|
||||
v-model="statusMsg"
|
||||
:disabled=true
|
||||
rows="1"
|
||||
max-rows="8">
|
||||
</b-form-textarea>
|
||||
</b-col>
|
||||
</b-row>
|
||||
</b-container>
|
||||
|
||||
|
||||
<statusDiv /> <!-- Status Div -->
|
||||
</b-container>
|
||||
|
||||
</template>
|
||||
|
@ -83,11 +65,15 @@
|
|||
<script>
|
||||
import i18n from '../../../../i18n';
|
||||
import store from '../../../../store';
|
||||
//import { wtconfig } from '../General/wtutils';
|
||||
//import { status } from '../../../own/status/status';
|
||||
import { status } from '../../General/status';
|
||||
import { viewstate } from "./scripts/viewstate";
|
||||
|
||||
import statusDiv from '../../General/status.vue'
|
||||
const log = require("electron-log");
|
||||
export default {
|
||||
components: {
|
||||
statusDiv
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
optselSrcUsr: [],
|
||||
|
@ -114,9 +100,9 @@
|
|||
// Watch for when selected server address is updated
|
||||
selectedServerAddress: async function(){
|
||||
log.info("ViewState selected server changed");
|
||||
viewstate.clearStatus();
|
||||
status.clearStatus();
|
||||
console.log('Ged 1-2: ' + JSON.stringify(this.$store.getters.getViewStateStatus))
|
||||
viewstate.updateStatusMsg(1, i18n.t("Modules.PMS.ViewState.Status.Msg.CollectUserInfo"));
|
||||
status.updateStatusMsg(1, i18n.t("Modules.PMS.ViewState.Status.Msg.CollectUserInfo"));
|
||||
viewstate.SrcUsr = null;
|
||||
viewstate.TargetUsr = null;
|
||||
console.log('Ged 1-3: ' + JSON.stringify(this.$store.getters.getViewStateStatus))
|
||||
|
@ -131,7 +117,7 @@
|
|||
this.selSrcUsr = '';
|
||||
this.selTargetUsr = '',
|
||||
this.WaitForUsers = true;
|
||||
viewstate.updateStatusMsg(1, i18n.t("Modules.PMS.ViewState.Status.Msg.Idle"));
|
||||
status.updateStatusMsg(1, i18n.t("Common.Status.Msg.Global.Idle"));
|
||||
console.log('Ged 1-6: ' + JSON.stringify(this.$store.getters.getViewStateStatus))
|
||||
},
|
||||
// Watch for status update
|
||||
|
|
|
@ -5,6 +5,7 @@ console.log = log.log;
|
|||
|
||||
|
||||
import {wtutils, wtconfig} from '../../../General/wtutils';
|
||||
import { status } from '../../../General/status';
|
||||
import i18n from '../../../../../i18n';
|
||||
import store from '../../../../../store';
|
||||
import axios from 'axios';
|
||||
|
@ -15,17 +16,6 @@ const viewstate = new class ViewState {
|
|||
#_StartTime = null;
|
||||
#_EndTime = null;
|
||||
#_statusmsg = {};
|
||||
#_msgType = {
|
||||
1: i18n.t("Modules.PMS.ViewState.Status.Names.Status"),
|
||||
2: i18n.t("Modules.PMS.ViewState.Status.Names.LibsToProcess"),
|
||||
3: i18n.t("Modules.PMS.ViewState.Status.Names.StartTime"),
|
||||
4: i18n.t("Modules.PMS.ViewState.Status.Names.CurrentLib"),
|
||||
5: i18n.t("Modules.PMS.ViewState.Status.Names.Item"),
|
||||
6: i18n.t("Modules.ET.Status.Names.StartTime"),
|
||||
7: i18n.t("Modules.ET.Status.Names.EndTime"),
|
||||
8: i18n.t("Modules.ET.Status.Names.TimeElapsed"),
|
||||
9: i18n.t("Modules.ET.Status.Names.RunningTime")
|
||||
}
|
||||
|
||||
constructor() {
|
||||
this.selServerServerToken = '',
|
||||
|
@ -210,7 +200,7 @@ const viewstate = new class ViewState {
|
|||
listProcess[JSONPath({path: `$..ratingKey`, json: medias[media]})[0]] = listProcessDetails;
|
||||
index += 1;
|
||||
this.bumpViewCount( listProcessDetails );
|
||||
this.updateStatusMsg(5, i18n.t("Modules.PMS.ViewState.Status.Msg.ProcessItem1", [listProcessDetails['title'], index, totalSize]));
|
||||
status.updateStatusMsg(5, i18n.t("Modules.PMS.ViewState.Status.Msg.ProcessItem1", [listProcessDetails['title'], index, totalSize]));
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
|
@ -232,7 +222,7 @@ const viewstate = new class ViewState {
|
|||
var keyCount = Object.keys(this.libs).length;
|
||||
let index = 1;
|
||||
for (var libKey in this.libs){
|
||||
this.updateStatusMsg(4, i18n.t("Modules.PMS.ViewState.Status.Msg.Processing2", [index, keyCount, this.libs[libKey]['title']]));
|
||||
status.updateStatusMsg( status.RevMsgType.LibsToProcess, i18n.t("Common.Status.Msg.Processing_Lib_1_2", [index, keyCount, this.libs[libKey]['title']]));
|
||||
await this.processWatchedList( libKey );
|
||||
index += 1;
|
||||
}
|
||||
|
@ -307,39 +297,14 @@ const viewstate = new class ViewState {
|
|||
async copyViewState( SrcUsr, TargetUsr ){
|
||||
log.info('[viewstate.js] Starting copyViewState');
|
||||
const startTime = await this.getNowTime('start');
|
||||
//this.updateStatusMsg( this.RawMsgType.TimeElapsed, await this.getRunningTimeElapsed());
|
||||
//status.updateStatusMsg( this.RawMsgType.TimeElapsed, await this.getRunningTimeElapsed());
|
||||
await this.getLibs( SrcUsr, TargetUsr );
|
||||
//this.updateStatusMsg(3, startTime);
|
||||
//status.updateStatusMsg(3, startTime);
|
||||
startTime
|
||||
this.updateStatusMsg(1, i18n.t("Modules.PMS.ViewState.Status.Msg.Processing"));
|
||||
status.updateStatusMsg(status.RevMsgType.Status, i18n.t("Common.Status.Msg.Global.Processing"));
|
||||
await this.getUsrTokens();
|
||||
await this.walkSourceUsr();
|
||||
this.updateStatusMsg(1, i18n.t("Modules.PMS.ViewState.Status.Msg.Idle"));
|
||||
}
|
||||
|
||||
// Update status msg
|
||||
async updateStatusMsg(msgType, msg)
|
||||
{
|
||||
// Update relevant key
|
||||
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_viewStateStatus", newMsg);
|
||||
}
|
||||
|
||||
// Clear Status Window
|
||||
async clearStatus()
|
||||
{
|
||||
this.#_statusmsg = {};
|
||||
store.commit("UPDATE_viewStateStatus", '');
|
||||
return;
|
||||
status.updateStatusMsg(status.RevMsgType.Status, i18n.t("Common.Status.Msg.Global.Idle"));
|
||||
}
|
||||
|
||||
async getLibs( SrcUsr, TargetUsr ){
|
||||
|
@ -352,13 +317,13 @@ const viewstate = new class ViewState {
|
|||
return;
|
||||
}
|
||||
if ( JSON.stringify(SrcUsr) === JSON.stringify(TargetUsr) ){
|
||||
this.clearStatus();
|
||||
this.updateStatusMsg(1, i18n.t("Modules.PMS.ViewState.Status.Msg.Idle"));
|
||||
status.clearStatus();
|
||||
status.updateStatusMsg(status.MsgType.Status, i18n.t("Common.Status.Msg.Global.Idle"));
|
||||
log.info('[viewstate.js] Same user selected, so aborting');
|
||||
return;
|
||||
}
|
||||
this.clearStatus();
|
||||
this.updateStatusMsg(1, i18n.t("Modules.PMS.ViewState.Status.Msg.GatheringLibs"));
|
||||
status.clearStatus();
|
||||
status.updateStatusMsg(1, i18n.t("Modules.PMS.ViewState.Status.Msg.GatheringLibs"));
|
||||
log.silly(`[viewstate.js] (getLibs) Source usr: ${JSON.stringify(SrcUsr)}`);
|
||||
log.silly(`[viewstate.js] (getLibs) Target usr: ${JSON.stringify(TargetUsr)}`);
|
||||
this.libs = {};
|
||||
|
@ -401,8 +366,8 @@ const viewstate = new class ViewState {
|
|||
for (let lib in this.libs){
|
||||
libstatus.push(this.libs[lib]['title'])
|
||||
}
|
||||
this.updateStatusMsg(1, i18n.t("Modules.PMS.ViewState.Status.Msg.Idle"));
|
||||
this.updateStatusMsg(2, libstatus.join(', '))
|
||||
status.updateStatusMsg(status.RevMsgType.Status, i18n.t("Common.Status.Msg.Global.Idle"));
|
||||
status.updateStatusMsg(2, libstatus.join(', '))
|
||||
}
|
||||
|
||||
// Here we get the server token for the selected server
|
||||
|
|
|
@ -19,7 +19,6 @@ import Store from '../store/index.js';
|
|||
Vue.use(VueRouter)
|
||||
|
||||
const router = new VueRouter({
|
||||
|
||||
mode: process.env.IS_ELECTRON ? 'hash' : 'history',
|
||||
base: process.env.BASE_URL,
|
||||
routes: [
|
||||
|
|
|
@ -6,7 +6,7 @@ import poeditor from './modules/poeditor';
|
|||
import et from './modules/et';
|
||||
import language from './modules/language';
|
||||
import pms from './modules/pms';
|
||||
import viewstate from './modules/viewstate';
|
||||
import status from './modules/status';
|
||||
|
||||
Vue.use(Vuex);
|
||||
|
||||
|
@ -14,7 +14,6 @@ const vuexLocal = new VuexPersistence({
|
|||
storage: window.sessionStorage,
|
||||
});
|
||||
|
||||
|
||||
export default new Vuex.Store({
|
||||
state: {
|
||||
},
|
||||
|
@ -28,7 +27,7 @@ export default new Vuex.Store({
|
|||
et,
|
||||
language,
|
||||
pms,
|
||||
viewstate
|
||||
status
|
||||
},
|
||||
plugins: [vuexLocal.plugin]
|
||||
})
|
||||
|
|
|
@ -4,24 +4,24 @@ const log = require('electron-log');
|
|||
console.log = log.log;
|
||||
|
||||
const state = {
|
||||
viewStateStatus: ''
|
||||
Status: ''
|
||||
};
|
||||
|
||||
const mutations = {
|
||||
UPDATE_viewStateStatus(state, payload) {
|
||||
state.viewStateStatus = payload
|
||||
UPDATE_Status(state, payload) {
|
||||
state.Status = payload
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const getters = {
|
||||
getViewStateStatus: state => state.viewStateStatus
|
||||
getStatus: state => state.Status
|
||||
};
|
||||
|
||||
const viewstateModule = {
|
||||
const statusModule = {
|
||||
state,
|
||||
mutations,
|
||||
getters
|
||||
}
|
||||
|
||||
export default viewstateModule;
|
||||
export default statusModule;
|
Loading…
Reference in a new issue