(name: string)
| 148 | |
| 149 | //删除存储 |
| 150 | async 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 | //获取存储 |
| 176 | async function getStorageParams(name: string): Promise<ParametersType> { |
no test coverage detected