@adminforth/bulk-ai-flow 1.26.8 → 1.26.9

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 CHANGED
@@ -14,5 +14,5 @@ custom/package.json
14
14
  custom/pnpm-lock.yaml
15
15
  custom/tsconfig.json
16
16
 
17
- sent 130,647 bytes received 191 bytes 261,676.00 bytes/sec
18
- total size is 129,924 speedup is 0.99
17
+ sent 130,454 bytes received 191 bytes 261,290.00 bytes/sec
18
+ total size is 129,741 speedup is 0.99
@@ -54,9 +54,10 @@
54
54
  <div
55
55
  class="bulk-vision-table flex flex-col gap-3 w-full"
56
56
  :class="{
57
- 'h-[830px]': popupMode === 'generation',
58
- 'h-auto max-h-[720px]': popupMode !== 'generation'
57
+ 'h-[calc(100vh_-_200px)] max-h-[830px]': popupMode === 'generation',
58
+ 'h-auto': popupMode !== 'generation'
59
59
  }"
60
+ :style="popupMode !== 'generation' ? { maxHeight: 'min(720px, calc(100vh - 200px))' } : {}"
60
61
  >
61
62
  <template v-if="recordsList.length && popupMode === 'generation'" >
62
63
  <div class="w-full min-w-[980px]">
@@ -113,7 +114,7 @@
113
114
  </div>
114
115
 
115
116
  <ProgressBar
116
- class="progress-bar w-full"
117
+ class="w-full"
117
118
  :class="isGenerationPaused ? 'opacity-80' : ''"
118
119
  :current-value="Math.floor((displayedProcessedCount / totalRecords) * 100)"
119
120
  :max-value="100"
@@ -567,6 +568,7 @@ const handleBeforeCancel = async () => {
567
568
  message: t('Are you sure you want to close without saving?'),
568
569
  yes: t('Yes'),
569
570
  no: t('Cancel'),
571
+ dangerous: true,
570
572
  });
571
573
 
572
574
  if (confirmed) {
@@ -142,14 +142,6 @@
142
142
  @click="() => zoomImage(item.data?.[n])"
143
143
  style="image-rendering: auto;"
144
144
  />
145
- <p
146
- v-if="isImageHasPreviewUrl[n]"
147
- class="text-xs text-blue-500 hover:underline cursor-pointer transition-opacity"
148
- :class="{ 'opacity-0': !isHovered(item.id, n) }"
149
- @click="() => { item.openImageCompare[n] = true }"
150
- >
151
- {{ $t('old image') }}
152
- </p>
153
145
  </div>
154
146
  <div v-else>
155
147
  <div class="text-gray-400 dark:text-gray-500 flex flex-col items-center justify-center w-full h-[258px] bg-gray-50 dark:bg-gray-700 border border-dashed border-gray-200 dark:border-gray-600">
@@ -342,6 +334,8 @@ function regenerateRecord(recordId: any) {
342
334
  }
343
335
 
344
336
  function canRegenerate(item: any): boolean {
337
+ if (item.status === 'processing') return false;
338
+ if (item.status === 'completed' || item.status === 'failed') return true;
345
339
  if (props.overwriteExistingValues) return true;
346
340
  for (const n of props.customFieldNames) {
347
341
  const val = item.data?.[n];
@@ -54,9 +54,10 @@
54
54
  <div
55
55
  class="bulk-vision-table flex flex-col gap-3 w-full"
56
56
  :class="{
57
- 'h-[830px]': popupMode === 'generation',
58
- 'h-auto max-h-[720px]': popupMode !== 'generation'
57
+ 'h-[calc(100vh_-_200px)] max-h-[830px]': popupMode === 'generation',
58
+ 'h-auto': popupMode !== 'generation'
59
59
  }"
60
+ :style="popupMode !== 'generation' ? { maxHeight: 'min(720px, calc(100vh - 200px))' } : {}"
60
61
  >
61
62
  <template v-if="recordsList.length && popupMode === 'generation'" >
62
63
  <div class="w-full min-w-[980px]">
@@ -113,7 +114,7 @@
113
114
  </div>
114
115
 
115
116
  <ProgressBar
116
- class="progress-bar w-full"
117
+ class="w-full"
117
118
  :class="isGenerationPaused ? 'opacity-80' : ''"
118
119
  :current-value="Math.floor((displayedProcessedCount / totalRecords) * 100)"
119
120
  :max-value="100"
@@ -567,6 +568,7 @@ const handleBeforeCancel = async () => {
567
568
  message: t('Are you sure you want to close without saving?'),
568
569
  yes: t('Yes'),
569
570
  no: t('Cancel'),
571
+ dangerous: true,
570
572
  });
571
573
 
572
574
  if (confirmed) {
@@ -142,14 +142,6 @@
142
142
  @click="() => zoomImage(item.data?.[n])"
143
143
  style="image-rendering: auto;"
144
144
  />
145
- <p
146
- v-if="isImageHasPreviewUrl[n]"
147
- class="text-xs text-blue-500 hover:underline cursor-pointer transition-opacity"
148
- :class="{ 'opacity-0': !isHovered(item.id, n) }"
149
- @click="() => { item.openImageCompare[n] = true }"
150
- >
151
- {{ $t('old image') }}
152
- </p>
153
145
  </div>
154
146
  <div v-else>
155
147
  <div class="text-gray-400 dark:text-gray-500 flex flex-col items-center justify-center w-full h-[258px] bg-gray-50 dark:bg-gray-700 border border-dashed border-gray-200 dark:border-gray-600">
@@ -342,6 +334,8 @@ function regenerateRecord(recordId: any) {
342
334
  }
343
335
 
344
336
  function canRegenerate(item: any): boolean {
337
+ if (item.status === 'processing') return false;
338
+ if (item.status === 'completed' || item.status === 'failed') return true;
345
339
  if (props.overwriteExistingValues) return true;
346
340
  for (const n of props.customFieldNames) {
347
341
  const val = item.data?.[n];
package/dist/index.js CHANGED
@@ -772,6 +772,10 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
772
772
  method: 'POST',
773
773
  path: `/plugin/${this.pluginInstanceId}/get_records`,
774
774
  handler: (body) => __awaiter(this, void 0, void 0, function* () {
775
+ var _a;
776
+ if (!Array.isArray((_a = body.body) === null || _a === void 0 ? void 0 : _a.record)) {
777
+ return { records: [] };
778
+ }
775
779
  let records = [];
776
780
  const primaryKeyColumn = this.resourceConfig.columns.find((col) => col.primaryKey);
777
781
  records = yield this.adminforth.resource(this.resourceConfig.resourceId).list([Filters.IN(primaryKeyColumn.name, body.body.record)]);
package/index.ts CHANGED
@@ -780,6 +780,9 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
780
780
  method: 'POST',
781
781
  path: `/plugin/${this.pluginInstanceId}/get_records`,
782
782
  handler: async ( body ) => {
783
+ if (!Array.isArray(body.body?.record)) {
784
+ return { records: [] };
785
+ }
783
786
  let records = [];
784
787
  const primaryKeyColumn = this.resourceConfig.columns.find((col) => col.primaryKey);
785
788
  records = await this.adminforth.resource(this.resourceConfig.resourceId).list([Filters.IN(primaryKeyColumn.name, body.body.record)]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/bulk-ai-flow",
3
- "version": "1.26.8",
3
+ "version": "1.26.9",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },