@adminforth/background-jobs 1.6.2 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build.log +2 -2
- package/custom/JobInfoPopup.vue +13 -2
- package/custom/JobsList.vue +22 -0
- package/dist/custom/JobInfoPopup.vue +13 -2
- package/dist/custom/JobsList.vue +22 -0
- package/package.json +1 -1
package/build.log
CHANGED
|
@@ -11,5 +11,5 @@ custom/StateToIcon.vue
|
|
|
11
11
|
custom/tsconfig.json
|
|
12
12
|
custom/utils.ts
|
|
13
13
|
|
|
14
|
-
sent
|
|
15
|
-
total size is
|
|
14
|
+
sent 14,434 bytes received 134 bytes 29,136.00 bytes/sec
|
|
15
|
+
total size is 13,949 speedup is 0.96
|
package/custom/JobInfoPopup.vue
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="flex flex-col w-full min-w-96">
|
|
2
|
+
<div class="flex flex-col w-full min-w-96 mt-2">
|
|
3
3
|
<div class="flex items-center mb-1">
|
|
4
4
|
<div class="flex flex-col items-start justify-end h-12">
|
|
5
5
|
<h2 class="text-lg font-semibold dark:text-white">{{ job.name }}</h2>
|
|
@@ -11,9 +11,19 @@
|
|
|
11
11
|
</Tooltip>
|
|
12
12
|
</div>
|
|
13
13
|
<div class="ml-auto flex flex-col items-start justify-end h-12">
|
|
14
|
-
<div class="flex items-center">
|
|
14
|
+
<div class="flex items-center mr-6">
|
|
15
15
|
<p class=" text-gray-800 dark:text-white h-full"> {{ t('Progress:') }} <span class="font-semibold" >{{ job.progress }}%</span></p>
|
|
16
16
|
<StateToIcon :job="job" />
|
|
17
|
+
<button
|
|
18
|
+
@click="closeModal()"
|
|
19
|
+
type="button"
|
|
20
|
+
class="absolute top-2 right-2 text-lightDialogCloseButton bg-transparent hover:bg-lightDialogCloseButtonHoverBackground hover:text-lightDialogCloseButtonHover rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center dark:text-darkDialogCloseButton dark:hover:bg-darkDialogCloseButtonHoverBackground dark:hover:text-darkDialogCloseButtonHover"
|
|
21
|
+
>
|
|
22
|
+
<svg class="w-3 h-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14">
|
|
23
|
+
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
|
|
24
|
+
</svg>
|
|
25
|
+
<span class="sr-only">{{ t('Close Modal') }}</span>
|
|
26
|
+
</button>
|
|
17
27
|
</div>
|
|
18
28
|
<Tooltip v-if="job.finishedAt">
|
|
19
29
|
<p class="text-xs text-gray-600 dark:text-gray-200 h-full"> {{ t('Finished:') }} {{ getTimeAgoString(new Date(job.finishedAt)) }}</p>
|
|
@@ -68,6 +78,7 @@ const props = defineProps<{
|
|
|
68
78
|
meta: {
|
|
69
79
|
pluginInstanceId: string;
|
|
70
80
|
};
|
|
81
|
+
closeModal: () => void;
|
|
71
82
|
}>();
|
|
72
83
|
|
|
73
84
|
async function cancelJob() {
|
package/custom/JobsList.vue
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="w-1vw md:w-64 bg-white border border-gray-200 dark:bg-gray-800 dark:border-gray-600 rounded-md">
|
|
3
3
|
<Modal
|
|
4
|
+
ref="modalRef"
|
|
4
5
|
class="p-4"
|
|
5
6
|
v-for="job in props.jobs" :key="job.id"
|
|
6
7
|
:beforeCloseFunction="onBeforeOpen"
|
|
@@ -31,6 +32,7 @@
|
|
|
31
32
|
<JobInfoPopup
|
|
32
33
|
:job="job"
|
|
33
34
|
:meta="meta"
|
|
35
|
+
:closeModal="closeModal"
|
|
34
36
|
/>
|
|
35
37
|
</Modal>
|
|
36
38
|
|
|
@@ -46,6 +48,26 @@ import JobInfoPopup from './JobInfoPopup.vue';
|
|
|
46
48
|
import StateToIcon from './StateToIcon.vue';
|
|
47
49
|
import { ref } from 'vue';
|
|
48
50
|
|
|
51
|
+
const modalRef = ref<any>(null);
|
|
52
|
+
|
|
53
|
+
function closeModal() {
|
|
54
|
+
const m = modalRef.value;
|
|
55
|
+
if (!m) return;
|
|
56
|
+
|
|
57
|
+
if (typeof m.close === 'function') {
|
|
58
|
+
m.close();
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (Array.isArray(m)) {
|
|
63
|
+
m.forEach((inst: any) => {
|
|
64
|
+
if (inst?.close && typeof inst.close === 'function') {
|
|
65
|
+
inst.close();
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
49
71
|
const props = defineProps<{
|
|
50
72
|
jobs: IJob[];
|
|
51
73
|
closeDropdown: () => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="flex flex-col w-full min-w-96">
|
|
2
|
+
<div class="flex flex-col w-full min-w-96 mt-2">
|
|
3
3
|
<div class="flex items-center mb-1">
|
|
4
4
|
<div class="flex flex-col items-start justify-end h-12">
|
|
5
5
|
<h2 class="text-lg font-semibold dark:text-white">{{ job.name }}</h2>
|
|
@@ -11,9 +11,19 @@
|
|
|
11
11
|
</Tooltip>
|
|
12
12
|
</div>
|
|
13
13
|
<div class="ml-auto flex flex-col items-start justify-end h-12">
|
|
14
|
-
<div class="flex items-center">
|
|
14
|
+
<div class="flex items-center mr-6">
|
|
15
15
|
<p class=" text-gray-800 dark:text-white h-full"> {{ t('Progress:') }} <span class="font-semibold" >{{ job.progress }}%</span></p>
|
|
16
16
|
<StateToIcon :job="job" />
|
|
17
|
+
<button
|
|
18
|
+
@click="closeModal()"
|
|
19
|
+
type="button"
|
|
20
|
+
class="absolute top-2 right-2 text-lightDialogCloseButton bg-transparent hover:bg-lightDialogCloseButtonHoverBackground hover:text-lightDialogCloseButtonHover rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center dark:text-darkDialogCloseButton dark:hover:bg-darkDialogCloseButtonHoverBackground dark:hover:text-darkDialogCloseButtonHover"
|
|
21
|
+
>
|
|
22
|
+
<svg class="w-3 h-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14">
|
|
23
|
+
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
|
|
24
|
+
</svg>
|
|
25
|
+
<span class="sr-only">{{ t('Close Modal') }}</span>
|
|
26
|
+
</button>
|
|
17
27
|
</div>
|
|
18
28
|
<Tooltip v-if="job.finishedAt">
|
|
19
29
|
<p class="text-xs text-gray-600 dark:text-gray-200 h-full"> {{ t('Finished:') }} {{ getTimeAgoString(new Date(job.finishedAt)) }}</p>
|
|
@@ -68,6 +78,7 @@ const props = defineProps<{
|
|
|
68
78
|
meta: {
|
|
69
79
|
pluginInstanceId: string;
|
|
70
80
|
};
|
|
81
|
+
closeModal: () => void;
|
|
71
82
|
}>();
|
|
72
83
|
|
|
73
84
|
async function cancelJob() {
|
package/dist/custom/JobsList.vue
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="w-1vw md:w-64 bg-white border border-gray-200 dark:bg-gray-800 dark:border-gray-600 rounded-md">
|
|
3
3
|
<Modal
|
|
4
|
+
ref="modalRef"
|
|
4
5
|
class="p-4"
|
|
5
6
|
v-for="job in props.jobs" :key="job.id"
|
|
6
7
|
:beforeCloseFunction="onBeforeOpen"
|
|
@@ -31,6 +32,7 @@
|
|
|
31
32
|
<JobInfoPopup
|
|
32
33
|
:job="job"
|
|
33
34
|
:meta="meta"
|
|
35
|
+
:closeModal="closeModal"
|
|
34
36
|
/>
|
|
35
37
|
</Modal>
|
|
36
38
|
|
|
@@ -46,6 +48,26 @@ import JobInfoPopup from './JobInfoPopup.vue';
|
|
|
46
48
|
import StateToIcon from './StateToIcon.vue';
|
|
47
49
|
import { ref } from 'vue';
|
|
48
50
|
|
|
51
|
+
const modalRef = ref<any>(null);
|
|
52
|
+
|
|
53
|
+
function closeModal() {
|
|
54
|
+
const m = modalRef.value;
|
|
55
|
+
if (!m) return;
|
|
56
|
+
|
|
57
|
+
if (typeof m.close === 'function') {
|
|
58
|
+
m.close();
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (Array.isArray(m)) {
|
|
63
|
+
m.forEach((inst: any) => {
|
|
64
|
+
if (inst?.close && typeof inst.close === 'function') {
|
|
65
|
+
inst.close();
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
49
71
|
const props = defineProps<{
|
|
50
72
|
jobs: IJob[];
|
|
51
73
|
closeDropdown: () => void;
|