File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 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) => {
273273 });
274274 if (! success ) {
275275 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>
277277 <pre style="white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; max-width: 100%;">${
278278 xhr .responseText .replace (/ </ g , ' <' ).replace (/ >/ g , ' >' )
279279 }</pre> ` ,
Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ export default class UploadPlugin extends AdminForthPlugin {
1414 totalCalls : number ;
1515 totalDuration : number ;
1616
17+ resourceConfig : AdminForthResource ;
18+
1719 constructor ( options : PluginOptions ) {
1820 super ( options , import . meta. url ) ;
1921 this . options = options ;
@@ -28,7 +30,8 @@ export default class UploadPlugin extends AdminForthPlugin {
2830 }
2931
3032 async setupLifecycleRule ( ) {
31- this . options . storageAdapter . setupLifecycle ( ) ;
33+ const adapterUserUniqueRepresentation = `${ this . resourceConfig . resourceId } -${ this . pluginInstanceId } ` ;
34+ this . options . storageAdapter . setupLifecycle ( adapterUserUniqueRepresentation ) ;
3235 }
3336
3437 async genPreviewUrl ( record : any ) {
@@ -43,6 +46,7 @@ export default class UploadPlugin extends AdminForthPlugin {
4346
4447 async modifyResourceConfig ( adminforth : IAdminForth , resourceConfig : AdminForthResource ) {
4548 super . modifyResourceConfig ( adminforth , resourceConfig ) ;
49+ this . resourceConfig = resourceConfig ;
4650 // after column to store the path of the uploaded file, add new VirtualColumn,
4751 // show only in edit and create views
4852 // use component uploader.vue
You can’t perform that action at this time.
0 commit comments