@adminforth/bulk-ai-flow 1.24.5 → 1.25.1
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/VisionAction.vue +25 -4
- package/dist/custom/VisionAction.vue +25 -4
- package/dist/index.js +22 -4
- package/index.ts +25 -4
- package/package.json +2 -2
package/build.log
CHANGED
|
@@ -14,5 +14,5 @@ custom/package.json
|
|
|
14
14
|
custom/pnpm-lock.yaml
|
|
15
15
|
custom/tsconfig.json
|
|
16
16
|
|
|
17
|
-
sent 113,
|
|
18
|
-
total size is
|
|
17
|
+
sent 113,871 bytes received 191 bytes 228,124.00 bytes/sec
|
|
18
|
+
total size is 113,167 speedup is 0.99
|
package/custom/VisionAction.vue
CHANGED
|
@@ -12,10 +12,8 @@
|
|
|
12
12
|
:class="popupMode === 'generation' ? 'lg:w-auto !lg:max-w-[1600px]'
|
|
13
13
|
: popupMode === 'settings' ? 'lg:w-[1000px] !lg:max-w-[1000px]'
|
|
14
14
|
: 'lg:w-[500px] !lg:max-w-[500px]'"
|
|
15
|
-
:beforeCloseFunction="
|
|
15
|
+
:beforeCloseFunction="handleBeforeClose"
|
|
16
16
|
:closable="false"
|
|
17
|
-
:askForCloseConfirmation="popupMode === 'generation' ? true : false"
|
|
18
|
-
:closeConfirmationText="t('Are you sure you want to close without saving?')"
|
|
19
17
|
:buttons="popupMode === 'generation' ? generationModeButtons : popupMode === 'settings' ? [
|
|
20
18
|
{
|
|
21
19
|
label: t('Save settings'),
|
|
@@ -185,6 +183,7 @@ import { useFiltersStore } from '@/stores/filters';
|
|
|
185
183
|
|
|
186
184
|
const coreStore = useCoreStore();
|
|
187
185
|
const filtersStore = useFiltersStore();
|
|
186
|
+
const showCloseConfirmModal = ref(false);
|
|
188
187
|
|
|
189
188
|
const { t } = useI18n();
|
|
190
189
|
const props = defineProps<{
|
|
@@ -319,7 +318,7 @@ const generationModeButtons = computed(() => {
|
|
|
319
318
|
options: {
|
|
320
319
|
class: 'bg-white hover:!bg-gray-100 !text-gray-900 hover:!text-gray-800 dark:!bg-gray-800 dark:!text-gray-100 dark:hover:!bg-gray-700 !border-gray-200 dark:!border-gray-600'
|
|
321
320
|
},
|
|
322
|
-
onclick: (dialog) =>
|
|
321
|
+
onclick: async (dialog) => { await handleBeforeClose(dialog); }
|
|
323
322
|
},
|
|
324
323
|
]
|
|
325
324
|
|
|
@@ -336,6 +335,28 @@ const generationModeButtons = computed(() => {
|
|
|
336
335
|
return arrayToReturn;
|
|
337
336
|
});
|
|
338
337
|
|
|
338
|
+
const handleBeforeClose = async (dialog?: any) => {
|
|
339
|
+
if (popupMode.value === 'generation') {
|
|
340
|
+
const confirmed = await adminforth.confirm({
|
|
341
|
+
title: t('Close without saving?'),
|
|
342
|
+
message: t('Are you sure you want to close without saving?'),
|
|
343
|
+
yes: t('Yes'),
|
|
344
|
+
no: t('Cancel'),
|
|
345
|
+
});
|
|
346
|
+
|
|
347
|
+
if (confirmed) {
|
|
348
|
+
closeDialog();
|
|
349
|
+
|
|
350
|
+
if (confirmDialog.value && typeof confirmDialog.value.hide === 'function') {
|
|
351
|
+
confirmDialog.value.hide();
|
|
352
|
+
} else if (dialog && typeof dialog.hide === 'function') {
|
|
353
|
+
dialog.hide();
|
|
354
|
+
}
|
|
355
|
+
return true;
|
|
356
|
+
}
|
|
357
|
+
return false;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
339
360
|
|
|
340
361
|
const isSavingCurrent = ref(false);
|
|
341
362
|
function checkIfDialogOpen() {
|
|
@@ -12,10 +12,8 @@
|
|
|
12
12
|
:class="popupMode === 'generation' ? 'lg:w-auto !lg:max-w-[1600px]'
|
|
13
13
|
: popupMode === 'settings' ? 'lg:w-[1000px] !lg:max-w-[1000px]'
|
|
14
14
|
: 'lg:w-[500px] !lg:max-w-[500px]'"
|
|
15
|
-
:beforeCloseFunction="
|
|
15
|
+
:beforeCloseFunction="handleBeforeClose"
|
|
16
16
|
:closable="false"
|
|
17
|
-
:askForCloseConfirmation="popupMode === 'generation' ? true : false"
|
|
18
|
-
:closeConfirmationText="t('Are you sure you want to close without saving?')"
|
|
19
17
|
:buttons="popupMode === 'generation' ? generationModeButtons : popupMode === 'settings' ? [
|
|
20
18
|
{
|
|
21
19
|
label: t('Save settings'),
|
|
@@ -185,6 +183,7 @@ import { useFiltersStore } from '@/stores/filters';
|
|
|
185
183
|
|
|
186
184
|
const coreStore = useCoreStore();
|
|
187
185
|
const filtersStore = useFiltersStore();
|
|
186
|
+
const showCloseConfirmModal = ref(false);
|
|
188
187
|
|
|
189
188
|
const { t } = useI18n();
|
|
190
189
|
const props = defineProps<{
|
|
@@ -319,7 +318,7 @@ const generationModeButtons = computed(() => {
|
|
|
319
318
|
options: {
|
|
320
319
|
class: 'bg-white hover:!bg-gray-100 !text-gray-900 hover:!text-gray-800 dark:!bg-gray-800 dark:!text-gray-100 dark:hover:!bg-gray-700 !border-gray-200 dark:!border-gray-600'
|
|
321
320
|
},
|
|
322
|
-
onclick: (dialog) =>
|
|
321
|
+
onclick: async (dialog) => { await handleBeforeClose(dialog); }
|
|
323
322
|
},
|
|
324
323
|
]
|
|
325
324
|
|
|
@@ -336,6 +335,28 @@ const generationModeButtons = computed(() => {
|
|
|
336
335
|
return arrayToReturn;
|
|
337
336
|
});
|
|
338
337
|
|
|
338
|
+
const handleBeforeClose = async (dialog?: any) => {
|
|
339
|
+
if (popupMode.value === 'generation') {
|
|
340
|
+
const confirmed = await adminforth.confirm({
|
|
341
|
+
title: t('Close without saving?'),
|
|
342
|
+
message: t('Are you sure you want to close without saving?'),
|
|
343
|
+
yes: t('Yes'),
|
|
344
|
+
no: t('Cancel'),
|
|
345
|
+
});
|
|
346
|
+
|
|
347
|
+
if (confirmed) {
|
|
348
|
+
closeDialog();
|
|
349
|
+
|
|
350
|
+
if (confirmDialog.value && typeof confirmDialog.value.hide === 'function') {
|
|
351
|
+
confirmDialog.value.hide();
|
|
352
|
+
} else if (dialog && typeof dialog.hide === 'function') {
|
|
353
|
+
dialog.hide();
|
|
354
|
+
}
|
|
355
|
+
return true;
|
|
356
|
+
}
|
|
357
|
+
return false;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
339
360
|
|
|
340
361
|
const isSavingCurrent = ref(false);
|
|
341
362
|
function checkIfDialogOpen() {
|
package/dist/index.js
CHANGED
|
@@ -989,16 +989,34 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
|
|
|
989
989
|
server.endpoint({
|
|
990
990
|
method: 'POST',
|
|
991
991
|
path: `/plugin/${this.pluginInstanceId}/get-job-status`,
|
|
992
|
-
handler: (_a) => __awaiter(this, [_a], void 0, function* ({ body, adminUser, headers }) {
|
|
992
|
+
handler: (_a) => __awaiter(this, [_a], void 0, function* ({ body, adminUser, headers, response }) {
|
|
993
993
|
const jobId = body.jobId;
|
|
994
994
|
if (!jobId) {
|
|
995
|
-
|
|
995
|
+
response.setStatus(400);
|
|
996
|
+
return {
|
|
997
|
+
ok: false,
|
|
998
|
+
error: "Can't find job id",
|
|
999
|
+
};
|
|
996
1000
|
}
|
|
997
1001
|
const job = jobs.get(jobId);
|
|
998
1002
|
if (!job) {
|
|
999
|
-
|
|
1003
|
+
response.setStatus(404);
|
|
1004
|
+
return {
|
|
1005
|
+
ok: false,
|
|
1006
|
+
error: "Job not found",
|
|
1007
|
+
};
|
|
1000
1008
|
}
|
|
1001
|
-
|
|
1009
|
+
if (job.status === 'failed') {
|
|
1010
|
+
response.setStatus(500);
|
|
1011
|
+
return {
|
|
1012
|
+
ok: false,
|
|
1013
|
+
error: job.error
|
|
1014
|
+
};
|
|
1015
|
+
}
|
|
1016
|
+
return {
|
|
1017
|
+
ok: true,
|
|
1018
|
+
job,
|
|
1019
|
+
};
|
|
1002
1020
|
})
|
|
1003
1021
|
});
|
|
1004
1022
|
server.endpoint({
|
package/index.ts
CHANGED
|
@@ -1017,16 +1017,37 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
|
|
|
1017
1017
|
server.endpoint({
|
|
1018
1018
|
method: 'POST',
|
|
1019
1019
|
path: `/plugin/${this.pluginInstanceId}/get-job-status`,
|
|
1020
|
-
handler: async ({ body, adminUser, headers }) => {
|
|
1020
|
+
handler: async ({ body, adminUser, headers, response }) => {
|
|
1021
1021
|
const jobId = body.jobId;
|
|
1022
1022
|
if (!jobId) {
|
|
1023
|
-
|
|
1023
|
+
response.setStatus(400);
|
|
1024
|
+
|
|
1025
|
+
return {
|
|
1026
|
+
ok: false,
|
|
1027
|
+
error: "Can't find job id",
|
|
1028
|
+
};
|
|
1024
1029
|
}
|
|
1025
1030
|
const job = jobs.get(jobId);
|
|
1026
1031
|
if (!job) {
|
|
1027
|
-
|
|
1032
|
+
response.setStatus(404);
|
|
1033
|
+
|
|
1034
|
+
return {
|
|
1035
|
+
ok: false,
|
|
1036
|
+
error: "Job not found",
|
|
1037
|
+
};
|
|
1028
1038
|
}
|
|
1029
|
-
|
|
1039
|
+
if (job.status === 'failed') {
|
|
1040
|
+
response.setStatus(500);
|
|
1041
|
+
|
|
1042
|
+
return {
|
|
1043
|
+
ok: false,
|
|
1044
|
+
error: job.error
|
|
1045
|
+
};
|
|
1046
|
+
}
|
|
1047
|
+
return {
|
|
1048
|
+
ok: true,
|
|
1049
|
+
job,
|
|
1050
|
+
};
|
|
1030
1051
|
}
|
|
1031
1052
|
});
|
|
1032
1053
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adminforth/bulk-ai-flow",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.25.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"description": "Bulk AI workflow plugin for AdminForth for batch field generation and image processing",
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/node": "latest",
|
|
28
|
-
"adminforth": "^2.
|
|
28
|
+
"adminforth": "^2.60.2",
|
|
29
29
|
"semantic-release": "^24.2.1",
|
|
30
30
|
"semantic-release-slack-bot": "^4.0.2",
|
|
31
31
|
"typescript": "^5.7.3"
|