fix(images): default arch to node platform; fix node selector placeholder
Some checks failed
Backend Tests / pytest (Python 3.12) (push) Successful in 55s
Deploy to Production / Trigger production update (push) Failing after 10s

- arch filter defaults to amd64 and auto-syncs to the selected node's arch
  (useNodeArch), so amd64 nodes no longer show arm64 images by default
- node Select no longer renders raw '__none__'; shows 'Нода' placeholder
  and a disabled hint when no nodes are reachable

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-22 23:28:04 +05:00
parent 2dff9f8c5c
commit 03b574777c
2 changed files with 23 additions and 3 deletions

View File

@@ -37,6 +37,19 @@ export function useImageLXCTemplates(serverId?: number, node?: string) {
});
}
// Архитектура ноды (amd64|arm64) — для дефолтного фильтра образов.
export function useNodeArch(serverId?: number, node?: string) {
return useQuery({
queryKey: ['image-node-arch', serverId, node],
queryFn: () =>
apiClient.get<{ arch: string | null; machine: string | null }>(
`/proxmox/api/${serverId}/images/node-arch?node=${encodeURIComponent(node!)}`,
),
enabled: !!serverId && !!node,
staleTime: 10 * 60 * 1000,
});
}
// Целевые хранилища ноды по типу контента (import|vztmpl|iso).
export function useImageStorages(serverId?: number, node?: string, content?: string) {
return useQuery({