@adminforth/bulk-ai-flow 1.1.1 → 1.1.2
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 +6 -6
- package/dist/custom/visionAction.vue +6 -6
- package/dist/index.js +14 -25
- package/index.ts +16 -26
- package/package.json +1 -1
package/build.log
CHANGED
|
@@ -10,5 +10,5 @@ custom/tsconfig.json
|
|
|
10
10
|
custom/visionAction.vue
|
|
11
11
|
custom/visionTable.vue
|
|
12
12
|
|
|
13
|
-
sent 24,
|
|
14
|
-
total size is 23,
|
|
13
|
+
sent 24,084 bytes received 115 bytes 48,398.00 bytes/sec
|
|
14
|
+
total size is 23,659 speedup is 0.98
|
package/custom/visionAction.vue
CHANGED
|
@@ -84,9 +84,9 @@ const openDialog = async () => {
|
|
|
84
84
|
analyzeFields();
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
watch(selected, (val) => {
|
|
88
|
-
|
|
89
|
-
}, { deep: true });
|
|
87
|
+
// watch(selected, (val) => {
|
|
88
|
+
// console.log('Selected changed:', val);
|
|
89
|
+
// }, { deep: true });
|
|
90
90
|
|
|
91
91
|
const closeDialog = () => {
|
|
92
92
|
confirmDialog.value.close();
|
|
@@ -194,12 +194,12 @@ function prepareDataForSave() {
|
|
|
194
194
|
const checkedItems = selected.value
|
|
195
195
|
.filter(item => item.isChecked === true)
|
|
196
196
|
.map(item => {
|
|
197
|
-
const { isChecked,
|
|
197
|
+
const { isChecked, primaryKey, ...itemWithoutIsCheckedAndId } = item;
|
|
198
198
|
return itemWithoutIsCheckedAndId;
|
|
199
199
|
});
|
|
200
200
|
const checkedItemsIDs = selected.value
|
|
201
201
|
.filter(item => item.isChecked === true)
|
|
202
|
-
.map(item => item
|
|
202
|
+
.map(item => item[primaryKey]);
|
|
203
203
|
return [checkedItemsIDs, checkedItems];
|
|
204
204
|
}
|
|
205
205
|
|
|
@@ -222,7 +222,7 @@ async function analyzeFields() {
|
|
|
222
222
|
...res.result.map((item, idx) => ({
|
|
223
223
|
...item,
|
|
224
224
|
isChecked: true,
|
|
225
|
-
|
|
225
|
+
[primaryKey]: selected.value[idx]?.[primaryKey],
|
|
226
226
|
}))
|
|
227
227
|
)
|
|
228
228
|
}
|
|
@@ -84,9 +84,9 @@ const openDialog = async () => {
|
|
|
84
84
|
analyzeFields();
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
watch(selected, (val) => {
|
|
88
|
-
|
|
89
|
-
}, { deep: true });
|
|
87
|
+
// watch(selected, (val) => {
|
|
88
|
+
// console.log('Selected changed:', val);
|
|
89
|
+
// }, { deep: true });
|
|
90
90
|
|
|
91
91
|
const closeDialog = () => {
|
|
92
92
|
confirmDialog.value.close();
|
|
@@ -194,12 +194,12 @@ function prepareDataForSave() {
|
|
|
194
194
|
const checkedItems = selected.value
|
|
195
195
|
.filter(item => item.isChecked === true)
|
|
196
196
|
.map(item => {
|
|
197
|
-
const { isChecked,
|
|
197
|
+
const { isChecked, primaryKey, ...itemWithoutIsCheckedAndId } = item;
|
|
198
198
|
return itemWithoutIsCheckedAndId;
|
|
199
199
|
});
|
|
200
200
|
const checkedItemsIDs = selected.value
|
|
201
201
|
.filter(item => item.isChecked === true)
|
|
202
|
-
.map(item => item
|
|
202
|
+
.map(item => item[primaryKey]);
|
|
203
203
|
return [checkedItemsIDs, checkedItems];
|
|
204
204
|
}
|
|
205
205
|
|
|
@@ -222,7 +222,7 @@ async function analyzeFields() {
|
|
|
222
222
|
...res.result.map((item, idx) => ({
|
|
223
223
|
...item,
|
|
224
224
|
isChecked: true,
|
|
225
|
-
|
|
225
|
+
[primaryKey]: selected.value[idx]?.[primaryKey],
|
|
226
226
|
}))
|
|
227
227
|
)
|
|
228
228
|
}
|
package/dist/index.js
CHANGED
|
@@ -52,31 +52,20 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
|
|
|
52
52
|
throw new Error(`⚠️ No column found for key "${key}"`);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
// if (!plugin) {
|
|
70
|
-
// throw new Error(`Plugin for attachment field '${this.options.attachments!.attachmentFieldName}' not found in resource '${this.options.attachments!.attachmentResource}', please check if Upload Plugin is installed on the field ${this.options.attachments!.attachmentFieldName}`);
|
|
71
|
-
// }
|
|
72
|
-
// if (!plugin.pluginOptions.storageAdapter.objectCanBeAccesedPublicly()) {
|
|
73
|
-
// throw new Error(`Upload Plugin for attachment field '${this.options.attachments!.attachmentFieldName}' in resource '${this.options.attachments!.attachmentResource}'
|
|
74
|
-
// uses adapter which is not configured to store objects in public way, so it will produce only signed private URLs which can not be used in HTML text of blog posts.
|
|
75
|
-
// Please configure adapter in such way that it will store objects publicly (e.g. for S3 use 'public-read' ACL).
|
|
76
|
-
// `);
|
|
77
|
-
// }
|
|
78
|
-
// this.uploadPlugin = plugin;
|
|
79
|
-
// }
|
|
55
|
+
if (this.options.generateImages) {
|
|
56
|
+
console.log('Generate Images options:', this.options.generateImages);
|
|
57
|
+
for (const [key, value] of Object.entries(this.options.generateImages)) {
|
|
58
|
+
const column = columns.find(c => c.name.toLowerCase() === key.toLowerCase());
|
|
59
|
+
if (!column) {
|
|
60
|
+
throw new Error(`⚠️ No column found for key "${key}"`);
|
|
61
|
+
}
|
|
62
|
+
const plugin = adminforth.activatedPlugins.find(p => p.resourceConfig.resourceId === key &&
|
|
63
|
+
p.pluginOptions.pathColumnName === this.resourceConfig.resourceId);
|
|
64
|
+
// if (!plugin) {
|
|
65
|
+
// throw new Error(`Plugin for attachment field '${key}' not found in resource '${this.options.attachments!.attachmentResource}', please check if Upload Plugin is installed on the field ${this.options.attachments!.attachmentFieldName}`);
|
|
66
|
+
// }
|
|
67
|
+
}
|
|
68
|
+
}
|
|
80
69
|
const primaryKeyColumn = this.resourceConfig.columns.find((col) => col.primaryKey);
|
|
81
70
|
//console.log('Primary Key Column:', primaryKeyColumn);
|
|
82
71
|
const pageInjection = {
|
package/index.ts
CHANGED
|
@@ -50,32 +50,22 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
// }
|
|
70
|
-
|
|
71
|
-
// if (!plugin.pluginOptions.storageAdapter.objectCanBeAccesedPublicly()) {
|
|
72
|
-
// throw new Error(`Upload Plugin for attachment field '${this.options.attachments!.attachmentFieldName}' in resource '${this.options.attachments!.attachmentResource}'
|
|
73
|
-
// uses adapter which is not configured to store objects in public way, so it will produce only signed private URLs which can not be used in HTML text of blog posts.
|
|
74
|
-
// Please configure adapter in such way that it will store objects publicly (e.g. for S3 use 'public-read' ACL).
|
|
75
|
-
// `);
|
|
76
|
-
// }
|
|
77
|
-
// this.uploadPlugin = plugin;
|
|
78
|
-
// }
|
|
53
|
+
if (this.options.generateImages) {
|
|
54
|
+
console.log('Generate Images options:', this.options.generateImages);
|
|
55
|
+
for (const [key, value] of Object.entries(this.options.generateImages)) {
|
|
56
|
+
const column = columns.find(c => c.name.toLowerCase() === key.toLowerCase());
|
|
57
|
+
if (!column) {
|
|
58
|
+
throw new Error(`⚠️ No column found for key "${key}"`);
|
|
59
|
+
}
|
|
60
|
+
const plugin = adminforth.activatedPlugins.find(p =>
|
|
61
|
+
p.resourceConfig!.resourceId === key &&
|
|
62
|
+
p.pluginOptions.pathColumnName === this.resourceConfig.resourceId
|
|
63
|
+
);
|
|
64
|
+
// if (!plugin) {
|
|
65
|
+
// throw new Error(`Plugin for attachment field '${key}' not found in resource '${this.options.attachments!.attachmentResource}', please check if Upload Plugin is installed on the field ${this.options.attachments!.attachmentFieldName}`);
|
|
66
|
+
// }
|
|
67
|
+
}
|
|
68
|
+
}
|
|
79
69
|
|
|
80
70
|
|
|
81
71
|
const primaryKeyColumn = this.resourceConfig.columns.find((col) => col.primaryKey);
|