fix(images): default arch to node platform; fix node selector placeholder
- 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:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user