File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -273,7 +273,7 @@ const onFileChange = async (e) => {
273
273
});
274
274
if (! success ) {
275
275
adminforth .alert ({
276
- messageHtml: ` <div>${t (' Sorry but the file was not uploaded because of S3 Request Error:' )}</div>
276
+ messageHtml: ` <div>${t (' Sorry but the file was not uploaded because of internal storage Request Error:' )}</div>
277
277
<pre style="white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; max-width: 100%;">${
278
278
xhr .responseText .replace (/ </ g , ' <' ).replace (/ >/ g , ' >' )
279
279
}</pre> ` ,
Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ export default class UploadPlugin extends AdminForthPlugin {
14
14
totalCalls : number ;
15
15
totalDuration : number ;
16
16
17
+ resourceConfig : AdminForthResource ;
18
+
17
19
constructor ( options : PluginOptions ) {
18
20
super ( options , import . meta. url ) ;
19
21
this . options = options ;
@@ -28,7 +30,8 @@ export default class UploadPlugin extends AdminForthPlugin {
28
30
}
29
31
30
32
async setupLifecycleRule ( ) {
31
- this . options . storageAdapter . setupLifecycle ( ) ;
33
+ const adapterUserUniqueRepresentation = `${ this . resourceConfig . resourceId } -${ this . pluginInstanceId } ` ;
34
+ this . options . storageAdapter . setupLifecycle ( adapterUserUniqueRepresentation ) ;
32
35
}
33
36
34
37
async genPreviewUrl ( record : any ) {
@@ -43,6 +46,7 @@ export default class UploadPlugin extends AdminForthPlugin {
43
46
44
47
async modifyResourceConfig ( adminforth : IAdminForth , resourceConfig : AdminForthResource ) {
45
48
super . modifyResourceConfig ( adminforth , resourceConfig ) ;
49
+ this . resourceConfig = resourceConfig ;
46
50
// after column to store the path of the uploaded file, add new VirtualColumn,
47
51
// show only in edit and create views
48
52
// use component uploader.vue
You can’t perform that action at this time.
0 commit comments