feat: scan NFS server for available exports in storage-add dialog
Add a "scan exports" button next to the server field for NFS storages
that calls Proxmox's /nodes/{node}/scan/nfs and turns the export path
input into a select populated with the real exports found on the
target server, instead of requiring the path to be typed by hand.
This commit is contained in:
@@ -239,6 +239,16 @@ class StorageMixin:
|
||||
logger.error(f"Ошибка получения статусов хранилищ с {self.host}: {e}")
|
||||
return status
|
||||
|
||||
def scan_nfs_exports(self, node: str, server: str) -> List[Dict]:
|
||||
"""
|
||||
Получить список NFS-экспортов удалённого сервера через
|
||||
GET /nodes/{node}/scan/nfs — для выбора export в диалоге добавления
|
||||
хранилища вместо ручного ввода пути.
|
||||
"""
|
||||
if not self.proxmox:
|
||||
return []
|
||||
return self.proxmox.nodes(node).scan.nfs.get(server=server)
|
||||
|
||||
def get_node_storages(self, node: str, content: str = None) -> List[Dict]:
|
||||
"""Get storages available on a specific node, optionally filtered by content type"""
|
||||
if not self.proxmox:
|
||||
|
||||
Reference in New Issue
Block a user