This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
:loading="jobActive"
|
:loading="jobActive"
|
||||||
>{{ $ay.t("StartJob") }}</v-btn
|
>{{ $ay.t("StartJob") }}</v-btn
|
||||||
>
|
>
|
||||||
|
|
||||||
</v-expansion-panel-content>
|
</v-expansion-panel-content>
|
||||||
</v-expansion-panel>
|
</v-expansion-panel>
|
||||||
</template>
|
</template>
|
||||||
@@ -36,7 +37,8 @@ export default {
|
|||||||
data: () => ({
|
data: () => ({
|
||||||
jobActive: false,
|
jobActive: false,
|
||||||
rights: window.$gz.role.defaultRightsObject(),
|
rights: window.$gz.role.defaultRightsObject(),
|
||||||
available: false
|
available: false,
|
||||||
|
notes: null
|
||||||
}),
|
}),
|
||||||
methods: {
|
methods: {
|
||||||
goHelp() {
|
goHelp() {
|
||||||
@@ -46,6 +48,7 @@ export default {
|
|||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
async doAction() {
|
async doAction() {
|
||||||
|
let vm = this;
|
||||||
let dialogResult = await window.$gz.dialog.confirmGeneric(
|
let dialogResult = await window.$gz.dialog.confirmGeneric(
|
||||||
"EraseMultipleObjectsWarning",
|
"EraseMultipleObjectsWarning",
|
||||||
"error"
|
"error"
|
||||||
@@ -53,8 +56,9 @@ export default {
|
|||||||
if (dialogResult == false) {
|
if (dialogResult == false) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
vm.notes = null;
|
||||||
//do the bulk action
|
//do the bulk action
|
||||||
let vm = this;
|
|
||||||
let url = "job-operations/bulk-delete";
|
let url = "job-operations/bulk-delete";
|
||||||
let body = this.dataListSelection;
|
let body = this.dataListSelection;
|
||||||
|
|
||||||
@@ -90,14 +94,18 @@ export default {
|
|||||||
`job-operations/status/${jobId}`
|
`job-operations/status/${jobId}`
|
||||||
);
|
);
|
||||||
if (jobStatus.error) {
|
if (jobStatus.error) {
|
||||||
//throw new Error(jobStatus.error);
|
|
||||||
throw new Error(
|
throw new Error(
|
||||||
window.$gz.errorHandler.errorToString(jobStatus, vm)
|
window.$gz.errorHandler.errorToString(jobStatus, vm)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
jobStatus = jobStatus.data;
|
jobStatus = jobStatus.data;
|
||||||
if (jobStatus == 4 || jobStatus == 0) {
|
if (jobStatus == 4 || jobStatus == 0) {
|
||||||
throw new Error("Seeding job failed");
|
if (jobStatus == 4) {
|
||||||
|
|
||||||
|
vm.notes = res.data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new Error("Job failed");
|
||||||
}
|
}
|
||||||
if (jobStatus == 3) {
|
if (jobStatus == 3) {
|
||||||
vm.jobActive = false;
|
vm.jobActive = false;
|
||||||
@@ -108,7 +116,9 @@ export default {
|
|||||||
vm.$emit("ext-close-refresh");
|
vm.$emit("ext-close-refresh");
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
vm.jobActive = false;
|
vm.jobActive = false;
|
||||||
window.$gz.errorHandler.handleFormError(error, vm);
|
|
||||||
|
// vm.notes = window.$gz.errorHandler.errorToString(error);
|
||||||
|
//window.$gz.errorHandler.handleFormError(error, vm);
|
||||||
window.$gz.eventBus.$emit("notify-error", vm.$ay.t("JobFailed"));
|
window.$gz.eventBus.$emit("notify-error", vm.$ay.t("JobFailed"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ export default {
|
|||||||
}
|
}
|
||||||
jobStatus = jobStatus.data;
|
jobStatus = jobStatus.data;
|
||||||
if (jobStatus == 4 || jobStatus == 0) {
|
if (jobStatus == 4 || jobStatus == 0) {
|
||||||
throw new Error("Seeding job failed");
|
throw new Error("Job failed");
|
||||||
}
|
}
|
||||||
if (jobStatus == 3) {
|
if (jobStatus == 3) {
|
||||||
vm.jobActive = false;
|
vm.jobActive = false;
|
||||||
|
|||||||
@@ -4,11 +4,26 @@
|
|||||||
<v-card-title>{{ $ay.t("Extensions") }}</v-card-title>
|
<v-card-title>{{ $ay.t("Extensions") }}</v-card-title>
|
||||||
<v-card-subtitle class="mt-1">{{ titleText() }}</v-card-subtitle>
|
<v-card-subtitle class="mt-1">{{ titleText() }}</v-card-subtitle>
|
||||||
<v-card-text>
|
<v-card-text>
|
||||||
|
<template v-if="errorObj">
|
||||||
|
<v-data-table
|
||||||
|
:headers="headers"
|
||||||
|
:items="errorObj"
|
||||||
|
class="elevation-1"
|
||||||
|
:disable-pagination="true"
|
||||||
|
:disable-filtering="true"
|
||||||
|
hide-default-footer
|
||||||
|
:sort-by="['created']"
|
||||||
|
:sort-desc="[true]"
|
||||||
|
:header-props="{ sortByText: $ay.t('Sort') }"
|
||||||
|
>
|
||||||
|
</v-data-table>
|
||||||
|
</template>
|
||||||
<v-expansion-panels focusable>
|
<v-expansion-panels focusable>
|
||||||
<ExtensionTags :dataListSelection="dataListSelection" />
|
<ExtensionTags :dataListSelection="dataListSelection" />
|
||||||
<ExtensionExport :dataListSelection="dataListSelection" />
|
<ExtensionExport :dataListSelection="dataListSelection" />
|
||||||
<ExtensionDelete
|
<ExtensionDelete
|
||||||
v-on:ext-close-refresh="close({ refresh: true })"
|
v-on:ext-close-refresh="close({ refresh: true })"
|
||||||
|
v-on:ext-show-job-log="handleError(e)"
|
||||||
:dataListSelection="dataListSelection"
|
:dataListSelection="dataListSelection"
|
||||||
/>
|
/>
|
||||||
</v-expansion-panels>
|
</v-expansion-panels>
|
||||||
@@ -40,7 +55,13 @@ export default {
|
|||||||
selectedRowIds: [],
|
selectedRowIds: [],
|
||||||
dataListKey: null,
|
dataListKey: null,
|
||||||
listView: null
|
listView: null
|
||||||
}
|
},
|
||||||
|
headers: [],
|
||||||
|
errorObj: null,
|
||||||
|
//cache display format stuff
|
||||||
|
timeZoneName: window.$gz.locale.getBrowserTimeZoneName(),
|
||||||
|
languageName: window.$gz.locale.getBrowserLanguages(),
|
||||||
|
hour12: window.$gz.locale.getHour12()
|
||||||
}),
|
}),
|
||||||
methods: {
|
methods: {
|
||||||
titleText() {
|
titleText() {
|
||||||
@@ -51,6 +72,45 @@ export default {
|
|||||||
this.dataListSelection.selectedRowIds.length
|
this.dataListSelection.selectedRowIds.length
|
||||||
}`;
|
}`;
|
||||||
},
|
},
|
||||||
|
async handleError(jobId) {
|
||||||
|
console.log("handleError", jobId);
|
||||||
|
return;
|
||||||
|
let res = await window.$gz.api.get(`job-operations/logs/${jobId}`);
|
||||||
|
if (res.data || res.data.length() > 0) {
|
||||||
|
/*{"data":[
|
||||||
|
{"created":"2020-12-09T18:41:58.129408Z","statusText":"Processing job \"Bulk operation: DELETE on HeadOffice (2 specified) - BulkCoreBizObjectOperation:Delete\"","jobId":"00000000-0000-0000-0000-000000000000"},
|
||||||
|
{"created":"2020-12-09T18:41:58.149926Z","statusText":"Bulk job Delete started...","jobId":"00000000-0000-0000-0000-000000000000"},
|
||||||
|
{"created":"2020-12-09T18:41:58.185514Z","statusText":"Error processing item 9: Validation errors:\r\nTarget: errorbox error: LT:Customer\r\n","jobId":"00000000-0000-0000-0000-000000000000"},
|
||||||
|
{"created":"2020-12-09T18:41:58.194434Z","statusText":"Error processing item 7: Validation errors:\r\nTarget: errorbox error: LT:Customer\r\n","jobId":"00000000-0000-0000-0000-000000000000"},
|
||||||
|
{"created":"2020-12-09T18:41:58.196858Z","statusText":"Bulk job Delete processed 2 of 2 with 2 failures","jobId":"00000000-0000-0000-0000-000000000000"}
|
||||||
|
]}
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
//NOPE-----------
|
||||||
|
if (res.data) {
|
||||||
|
vm.rawObj = res.data;
|
||||||
|
let ret = [];
|
||||||
|
for (let i = 0; i < res.data.length; i++) {
|
||||||
|
let o = res.data[i];
|
||||||
|
ret.push({
|
||||||
|
id: i,
|
||||||
|
created: window.$gz.locale.utcDateToShortDateAndTimeLocalized(
|
||||||
|
o.created,
|
||||||
|
this.timeZoneName,
|
||||||
|
this.languageName,
|
||||||
|
this.hour12
|
||||||
|
),
|
||||||
|
status: o.statusText,
|
||||||
|
jobId:
|
||||||
|
o.jobId == "00000000-0000-0000-0000-000000000000" ? "" : o.jobId
|
||||||
|
});
|
||||||
|
}
|
||||||
|
vm.obj = ret;
|
||||||
|
} else {
|
||||||
|
vm.rawObj = [];
|
||||||
|
vm.obj = [];
|
||||||
|
}
|
||||||
|
},
|
||||||
open(dls) {
|
open(dls) {
|
||||||
this.dataListSelection = dls;
|
this.dataListSelection = dls;
|
||||||
this.isVisible = true;
|
this.isVisible = true;
|
||||||
@@ -65,4 +125,30 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
/////////////////////////////////
|
||||||
|
//
|
||||||
|
//
|
||||||
|
async function initForm(vm) {
|
||||||
|
await fetchTranslatedText(vm);
|
||||||
|
await createTableHeaders(vm);
|
||||||
|
}
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Ensures UI translated text is available
|
||||||
|
//
|
||||||
|
async function fetchTranslatedText(vm) {
|
||||||
|
await window.$gz.translation.cacheTranslations(["TimeStamp", "ID", "Status"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
//////////////////////
|
||||||
|
//
|
||||||
|
//
|
||||||
|
async function createTableHeaders(vm) {
|
||||||
|
vm.headers = [
|
||||||
|
{ text: vm.$ay.t("TimeStamp"), value: "created" },
|
||||||
|
{ text: vm.$ay.t("Status"), value: "status" },
|
||||||
|
{ text: vm.$ay.t("ID"), value: "jobId" }
|
||||||
|
];
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -238,7 +238,7 @@ export default {
|
|||||||
}
|
}
|
||||||
jobStatus = jobStatus.data;
|
jobStatus = jobStatus.data;
|
||||||
if (jobStatus == 4 || jobStatus == 0) {
|
if (jobStatus == 4 || jobStatus == 0) {
|
||||||
throw new Error("Seeding job failed");
|
throw new Error("Job failed");
|
||||||
}
|
}
|
||||||
if (jobStatus == 3) {
|
if (jobStatus == 3) {
|
||||||
vm.jobActive = false;
|
vm.jobActive = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user