MCPcopy Create free account
hub / github.com/VirtualHotBar/NetMount / delStorage

Function delStorage

src/controller/storage/storage.ts:150–173  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

148
149//删除存储
150async function delStorage(name: string) {
151 const storage = searchStorage(name)
152
153 //删除挂载
154 for (const mount of nmConfig.mount.lists) {
155 if (mount.storageName === storage?.name) {
156 await delMountStorage(mount.mountPath)
157 }
158 }
159
160 switch (storage?.framework) {
161 case 'rclone':
162 await rclone_api_post('/config/delete', {
163 name: storage.name,
164 })
165 break
166 case 'openlist':
167 await openlist_api_post('/api/admin/storage/delete', undefined, {
168 id: storage.other?.openlist?.id,
169 })
170 break
171 }
172 reupStorage()
173}
174
175//获取存储
176async function getStorageParams(name: string): Promise<ParametersType> {

Callers 2

Storage_pageFunction · 0.90
stopRcloneFunction · 0.90

Calls 5

delMountStorageFunction · 0.90
rclone_api_postFunction · 0.90
openlist_api_postFunction · 0.90
searchStorageFunction · 0.85
reupStorageFunction · 0.85

Tested by

no test coverage detected