feat(storge):添加存储重置功能

This commit is contained in:
qiaoyun680
2025-05-08 17:44:44 +08:00
parent 0cdea3318c
commit 435a04da0c
5 changed files with 43 additions and 0 deletions
+11
View File
@@ -71,3 +71,14 @@ class StorageHelper:
config=conf
))
self.systemconfig.set(SystemConfigKey.Storages, [s.dict() for s in storagies])
def reset_storage(self, storage: str):
"""
重置存储配置
"""
storagies = self.get_storagies()
for s in storagies:
if s.type == storage:
s.config = {}
break
self.systemconfig.set(SystemConfigKey.Storages, [s.dict() for s in storagies])