File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -107,6 +107,23 @@ export class ModelService {
107107
108108 const processedOssMountPoints = extractOssMountDir ( ossMountPoints ) ;
109109
110+ if (
111+ storage === 'oss' &&
112+ processedOssMountPoints [ 0 ] &&
113+ ( ! processedOssMountPoints [ 0 ] . bucketPath || processedOssMountPoints [ 0 ] . bucketPath === '/' )
114+ ) {
115+ throw new Error (
116+ 'The current deleted directory is the OSS root directory. To delete the current model, please go to the OSS console to delete the model.' ,
117+ ) ;
118+ }
119+
120+ const nasPath = nasMountPoints [ 0 ] . serverAddr . split ( ':' ) [ 1 ] ;
121+
122+ if ( storage === 'nas' && nasMountPoints [ 0 ] && nasPath . trim ( ) === '/' ) {
123+ throw new Error (
124+ 'The current deleted directory is the NAS root directory. To delete the current model, please go to the NAS console to delete the model.' ,
125+ ) ;
126+ }
110127 const fileManagerRmRequest = new $Dev20230714 . FileManagerRmRequest ( {
111128 filepath :
112129 storage === 'nas' ? nasMountPoints [ 0 ] ?. mountDir : processedOssMountPoints [ 0 ] ?. mountDir ,
You can’t perform that action at this time.
0 commit comments