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,27 @@ export class ModelService {
107107
108108 const processedOssMountPoints = extractOssMountDir ( ossMountPoints ) ;
109109
110+ const NAS_ROOT_REGEX = / ^ [ \w - ] + \. ( (?: c n | a p | u s | e u | m e | s a ) - [ a - z ] + - [ 0 - 9 ] ) \. n a s \. a l i y u n c s \. c o m : \/ $ / ;
111+
112+ if (
113+ storage === 'oss' &&
114+ processedOssMountPoints [ 0 ] &&
115+ ( ! processedOssMountPoints [ 0 ] . bucketPath || processedOssMountPoints [ 0 ] . bucketPath === '/' )
116+ ) {
117+ throw new Error (
118+ 'The current deleted directory is the OSS root directory. To delete the current model, please go to the OSS console to delete the model.' ,
119+ ) ;
120+ }
121+
122+ if (
123+ storage === 'nas' &&
124+ nasMountPoints [ 0 ] &&
125+ NAS_ROOT_REGEX . test ( nasMountPoints [ 0 ] . serverAddr )
126+ ) {
127+ throw new Error (
128+ 'The current deleted directory is the NAS root directory. To delete the current model, please go to the NAS console to delete the model.' ,
129+ ) ;
130+ }
110131 const fileManagerRmRequest = new $Dev20230714 . FileManagerRmRequest ( {
111132 filepath :
112133 storage === 'nas' ? nasMountPoints [ 0 ] ?. mountDir : processedOssMountPoints [ 0 ] ?. mountDir ,
You can’t perform that action at this time.
0 commit comments