mirror of
https://github.com/WebTools-NG/WebTools-NG
synced 2025-02-16 19:38:26 +00:00
#359 WIP Time elapsed and total now working
This commit is contained in:
parent
c421de0f74
commit
296e87e692
2 changed files with 26 additions and 19 deletions
|
@ -228,8 +228,9 @@
|
|||
"Status": {
|
||||
"Names":{
|
||||
"Status": "Status",
|
||||
"Chuncks":"Chuncks",
|
||||
"Items":"Items",
|
||||
"Chuncks": "Chuncks",
|
||||
"ChuncksDetails": "Chuncks Details",
|
||||
"Items": "Items",
|
||||
"Info": "Info",
|
||||
"OutFile": "Output File",
|
||||
"StartTime": "Start time",
|
||||
|
@ -242,7 +243,7 @@
|
|||
"Running": "Export in progress",
|
||||
"Status": "Status",
|
||||
"Processing-Chunk": "Processing chunk {current} of {total}",
|
||||
"Processing-Chunk-Detailed": "Processing chunk {current} of {total}.\nitems to export: {urlStr}",
|
||||
"Processing-Chunk-Detailed": "Processing chunk {current} of {total}.Items to export: {urlStr}",
|
||||
"StartExport": "Starting to Export",
|
||||
"GetSectionItems": "Fetching items {idx} in chunks of {chunck} with a total of {totalSize}",
|
||||
"CreateExlsFile": "Creating Excel file",
|
||||
|
|
|
@ -156,7 +156,8 @@ const et = new class ET {
|
|||
'StartTime': 6,
|
||||
'EndTime': 7,
|
||||
'TimeElapsed': 8,
|
||||
'RunningTime': 9
|
||||
'RunningTime': 9,
|
||||
'ChuncksDetails': 10
|
||||
},
|
||||
this.revRawMsgType = {
|
||||
1: 'Status',
|
||||
|
@ -167,7 +168,8 @@ const et = new class ET {
|
|||
6: 'StartTime',
|
||||
7: 'EndTime',
|
||||
8: 'TimeElapsed',
|
||||
9: 'RunningTime'
|
||||
9: 'RunningTime',
|
||||
10: 'ChuncksDetails'
|
||||
},
|
||||
this.msgType = {
|
||||
1: i18n.t("Modules.ET.Status.Names.Status"),
|
||||
|
@ -178,7 +180,8 @@ const et = new class ET {
|
|||
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")
|
||||
9: i18n.t("Modules.ET.Status.Names.RunningTime"),
|
||||
10: i18n.t("Modules.ET.Status.Names.ChuncksDetails")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -205,22 +208,24 @@ const et = new class ET {
|
|||
}
|
||||
|
||||
async getTimeElapsed(){
|
||||
const diff = et.EndTime.getTime() - et.StartTime.getTime();
|
||||
const duration = Math.floor(diff / 1000 % 60);
|
||||
var hrs = Math.floor(duration / 3600);
|
||||
var mins = Math.floor((duration % 3600) / 60);
|
||||
var secs = Math.floor(duration % 60);
|
||||
return hrs + ':' + mins + ':' + secs
|
||||
let elapsedSeconds = Math.floor((et.EndTime.getTime() - et.StartTime.getTime()) / 1000);
|
||||
let elapsedStr = elapsedSeconds.toString().replaceAll('.', '');
|
||||
const hours = Math.floor(parseFloat(elapsedStr) / 3600);
|
||||
elapsedSeconds = parseFloat(elapsedStr) - hours * 3600;
|
||||
const minutes = Math.floor(elapsedSeconds / 60);
|
||||
const seconds = elapsedSeconds - minutes * 60;
|
||||
return hours + ':' + minutes + ':' + seconds
|
||||
}
|
||||
|
||||
async getRunningTimeElapsed(){
|
||||
const now = new Date();
|
||||
const diff = now.getTime() - et.StartTime.getTime();
|
||||
const duration = Math.floor(diff / 1000 % 60);
|
||||
var hrs = Math.floor(duration / 3600);
|
||||
var mins = Math.floor((duration % 3600) / 60);
|
||||
var secs = Math.floor(duration % 60);
|
||||
return hrs + ':' + mins + ':' + secs
|
||||
let elapsedSeconds = Math.floor((now.getTime() - et.StartTime.getTime()) / 1000);
|
||||
let elapsedStr = elapsedSeconds.toString().replaceAll('.', '');
|
||||
const hours = Math.floor(parseFloat(elapsedStr) / 3600);
|
||||
elapsedSeconds = parseFloat(elapsedStr) - hours * 3600;
|
||||
const minutes = Math.floor(elapsedSeconds / 60);
|
||||
const seconds = elapsedSeconds - minutes * 60;
|
||||
return hours + ':' + minutes + ':' + seconds
|
||||
}
|
||||
|
||||
async getNowTime(StartEnd){
|
||||
|
@ -1490,7 +1495,8 @@ const excel2 = new class Excel {
|
|||
const urls = await JSONPath({path: '$..ratingKey', json: sectionChunk});
|
||||
let urlStr = urls.join(',');
|
||||
log.verbose(`Items to lookup are: ${urlStr}`)
|
||||
store.commit("UPDATE_EXPORTSTATUS", i18n.t('Modules.ET.Status.Processing-Chunk-Detailed', {current: x, total: sectionData.length, urlStr: urlStr}));
|
||||
// store.commit("UPDATE_EXPORTSTATUS", i18n.t('Modules.ET.Status.Processing-Chunk-Detailed', {current: x, total: sectionData.length, urlStr: urlStr}));
|
||||
et.updateStatusMsg(et.rawMsgType.ChuncksDetails, i18n.t('Modules.ET.Status.Processing-Chunk-Detailed', {current: x, total: sectionData.length}));
|
||||
const urlWIthPath = '/library/metadata/' + urlStr + '?' + this.uriParams;
|
||||
log.verbose(`Items retrieved`);
|
||||
const contents = await et.getItemData({baseURL: baseURL, accessToken: accessToken, element: urlWIthPath});
|
||||
|
|
Loading…
Add table
Reference in a new issue