fix(frontend): IPAM translations, dialog width cap, workspace counts

This commit is contained in:
2026-06-13 08:45:31 +05:00
parent 8659ba5a92
commit 82a6e0e24a
5 changed files with 53 additions and 3 deletions

View File

@@ -53,7 +53,9 @@ function DialogContent({
<DialogPrimitive.Popup
data-slot="dialog-content"
className={cn(
"fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
// Default width: capped at max-w-lg and centered; on small screens w-[calc(100%-2rem)]
// keeps a 1rem gap on each side. Individual dialogs override width via their own max-w-*.
"fixed top-1/2 left-1/2 z-50 grid w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
className
)}
{...props}

View File

@@ -82,8 +82,8 @@ export default function WorkspacesPage() {
</CardHeader>
<CardContent className="space-y-2">
<div className="flex items-center gap-4 text-sm text-muted-foreground">
<div className="flex items-center gap-1"><Server className="h-3.5 w-3.5" />{ws.servers?.length ?? 0} {t('workspaces.servers')}</div>
<div className="flex items-center gap-1"><Users className="h-3.5 w-3.5" />{ws.users?.length ?? 0} {t('workspaces.users')}</div>
<div className="flex items-center gap-1"><Server className="h-3.5 w-3.5" />{ws.server_count ?? ws.servers?.length ?? 0} {t('workspaces.servers')}</div>
<div className="flex items-center gap-1"><Users className="h-3.5 w-3.5" />{ws.user_count ?? ws.users?.length ?? 0} {t('workspaces.users')}</div>
</div>
{ws.servers && ws.servers.length > 0 && (
<div className="flex flex-wrap gap-1">

View File

@@ -85,6 +85,7 @@
"saved": "Saved",
"optional": "optional",
"cancel": "Cancel",
"clear": "Clear",
"delete": "Delete",
"edit": "Edit",
"create": "Create",
@@ -335,6 +336,19 @@
"unique_mac": "Generate unique MAC addresses",
"restore_started": "Restore started",
"restore_failed": "Failed to start restore",
"selected_count": "Selected: {{count}}",
"restore_selected": "Restore selected",
"select_all_one_per_vmid": "Select one (latest) backup per VMID",
"bulk_restore_title": "Bulk restore",
"bulk_mode": "Restore mode",
"mode_in_place": "In place (same VMID)",
"mode_new_vmid": "As new VMIDs",
"mode_in_place_hint": "Each backup is restored onto its original VMID, overwriting the existing VM/container (must be stopped).",
"mode_new_vmid_hint": "Each backup is restored as a new guest with an automatically assigned free VMID.",
"bulk_in_place_warning": "Warning: existing VMs/containers with these VMIDs will be overwritten. Make sure they are stopped.",
"confirm_overwrite": "I understand existing guests will be overwritten",
"bulk_restore_done": "Restore started for {{count}} backup(s)",
"bulk_restore_partial": "Started: {{ok}}, failed: {{fail}}",
"node_required": "Could not determine node for the operation",
"invalid_vmid": "Invalid VMID",
"delete_title": "Delete backup",
@@ -376,6 +390,15 @@
"ipam": {
"dashboard": "IPAM Dashboard",
"networks": "Networks",
"networks_count": "Networks",
"total_allocated": "Total allocated",
"total_reserved": "Total reserved",
"vm_count": "VMs / containers",
"view_all_networks": "View all networks",
"add_network": "Add network",
"no_networks": "No networks found",
"ips_used": "IPs used",
"network_created": "Network created",
"allocations": "Allocations",
"history": "History",
"total_ips": "Total IPs",

View File

@@ -85,6 +85,7 @@
"saved": "Сохранено",
"optional": "необязательно",
"cancel": "Отмена",
"clear": "Очистить",
"delete": "Удалить",
"edit": "Редактировать",
"create": "Создать",
@@ -335,6 +336,19 @@
"unique_mac": "Сгенерировать уникальные MAC-адреса",
"restore_started": "Восстановление запущено",
"restore_failed": "Не удалось запустить восстановление",
"selected_count": "Выбрано: {{count}}",
"restore_selected": "Восстановить выбранные",
"select_all_one_per_vmid": "Выбрать по одному (последнему) бэкапу на VMID",
"bulk_restore_title": "Массовое восстановление",
"bulk_mode": "Режим восстановления",
"mode_in_place": "Поверх (тот же VMID)",
"mode_new_vmid": "Как новые VMID",
"mode_in_place_hint": "Каждый бэкап восстанавливается на свой исходный VMID, перезаписывая существующую VM/контейнер (должны быть остановлены).",
"mode_new_vmid_hint": "Каждый бэкап восстанавливается как новый гость с автоматически назначенным свободным VMID.",
"bulk_in_place_warning": "Внимание: существующие VM/контейнеры с этими VMID будут перезаписаны. Убедитесь, что они остановлены.",
"confirm_overwrite": "Я понимаю, что существующие гости будут перезаписаны",
"bulk_restore_done": "Восстановление запущено для {{count}} бэкап(ов)",
"bulk_restore_partial": "Запущено: {{ok}}, с ошибкой: {{fail}}",
"node_required": "Не удалось определить узел для операции",
"invalid_vmid": "Некорректный VMID",
"delete_title": "Удалить бэкап",
@@ -376,6 +390,15 @@
"ipam": {
"dashboard": "IPAM Дашборд",
"networks": "Сети",
"networks_count": "Сетей",
"total_allocated": "Всего выделено",
"total_reserved": "Всего зарезервировано",
"vm_count": "VM / контейнеров",
"view_all_networks": "Показать все сети",
"add_network": "Добавить сеть",
"no_networks": "Сети не найдены",
"ips_used": "IP использовано",
"network_created": "Сеть создана",
"allocations": "Распределения",
"history": "История",
"total_ips": "Всего IP",

View File

@@ -290,6 +290,8 @@ export interface Workspace {
is_active: boolean;
created_at: string;
updated_at: string;
server_count?: number;
user_count?: number;
servers?: WorkspaceServer[];
users?: WorkspaceUser[];
}