fix: extract hardcoded English strings to i18n system with Russian translations
- Extract ~40 hardcoded strings from project detail, deploy, settings, credentials, registries, auth, env editor pages - Add corresponding Russian translations - Replace native confirm() default labels with i18n keys in ConfirmDialog - Fix InstanceCard pluralization to use i18n
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
open,
|
||||
title,
|
||||
message,
|
||||
confirmLabel = 'Confirm',
|
||||
confirmLabel = $t('common.confirm'),
|
||||
confirmVariant = 'primary',
|
||||
onconfirm,
|
||||
oncancel
|
||||
|
||||
@@ -155,7 +155,7 @@
|
||||
open={confirmAction !== null}
|
||||
title={confirmAction ? $t(`confirm.${confirmAction}Instance`) : ''}
|
||||
message={confirmAction ? $t(`instance.${confirmAction}Confirm`) : ''}
|
||||
confirmLabel={confirmAction ? confirmAction.charAt(0).toUpperCase() + confirmAction.slice(1) : ''}
|
||||
confirmLabel={confirmAction ? $t(`confirm.${confirmAction}Action`) : ''}
|
||||
confirmVariant={confirmAction === 'remove' ? 'danger' : 'primary'}
|
||||
onconfirm={() => { if (confirmAction) handleAction(confirmAction); }}
|
||||
oncancel={() => { confirmAction = null; }}
|
||||
|
||||
@@ -55,7 +55,10 @@
|
||||
"selectImage": "Select an image",
|
||||
"noImages": "No images found",
|
||||
"loadingImages": "Loading images...",
|
||||
"imageLoadFailed": "Failed to load images"
|
||||
"imageLoadFailed": "Failed to load images",
|
||||
"alreadyAdded": "Already added",
|
||||
"portHelpText": "Auto-detected from EXPOSE if empty",
|
||||
"healthcheckHelpText": "Auto-detected from image if empty"
|
||||
},
|
||||
"projectDetail": {
|
||||
"deleteProject": "Delete Project",
|
||||
@@ -86,7 +89,29 @@
|
||||
"deleteConfirmMessage": "This will permanently delete the project '{name}' and all its stages, instances, and deploy history. This cannot be undone.",
|
||||
"loadFailed": "Failed to load project",
|
||||
"deleteFailed": "Failed to delete project",
|
||||
"deployFailed": "Deploy failed"
|
||||
"deployFailed": "Deploy failed",
|
||||
"nameLabel": "Name *",
|
||||
"imageLabel": "Image *",
|
||||
"portLabel": "Port",
|
||||
"healthcheckLabel": "Healthcheck Path",
|
||||
"saving": "Saving...",
|
||||
"addStage": "Add Stage",
|
||||
"tagPattern": "Tag Pattern",
|
||||
"tagPatternHelp": "Glob pattern (e.g., dev-*, v*)",
|
||||
"maxInstances": "Max Instances",
|
||||
"autoDeployLabel": "Auto Deploy",
|
||||
"npmProxy": "NPM Proxy",
|
||||
"creating": "Creating...",
|
||||
"createStage": "Create Stage",
|
||||
"noProxy": "No Proxy",
|
||||
"deleteStage": "Delete stage",
|
||||
"deleteStageConfirm": "Delete stage \"{name}\"?",
|
||||
"stageCreated": "Stage \"{name}\" created",
|
||||
"stageDeleted": "Stage \"{name}\" deleted",
|
||||
"projectUpdated": "Project updated",
|
||||
"updateFailed": "Failed to update project",
|
||||
"stageCreateFailed": "Failed to create stage",
|
||||
"stageDeleteFailed": "Failed to delete stage"
|
||||
},
|
||||
"envEditor": {
|
||||
"title": "Environment Variables",
|
||||
@@ -117,7 +142,8 @@
|
||||
"addFailed": "Failed to add env var",
|
||||
"updateFailed": "Failed to update env var",
|
||||
"deleteFailed": "Failed to delete env var",
|
||||
"loadEnvFailed": "Failed to load env vars"
|
||||
"loadEnvFailed": "Failed to load env vars",
|
||||
"leaveEmptyToKeep": "Leave empty to keep current"
|
||||
},
|
||||
"volumeEditor": {
|
||||
"title": "Volume Mounts",
|
||||
@@ -196,7 +222,8 @@
|
||||
"selectImage": "Select an image from a registry",
|
||||
"noImages": "No images found",
|
||||
"loadingImages": "Loading...",
|
||||
"imageLoadFailed": "Failed to load images"
|
||||
"imageLoadFailed": "Failed to load images",
|
||||
"lowercaseHint": "Lowercase with hyphens"
|
||||
},
|
||||
"settings": {
|
||||
"title": "Settings",
|
||||
@@ -264,7 +291,9 @@
|
||||
"testConnection": "Test Connection",
|
||||
"testingConnection": "Testing...",
|
||||
"connectionSuccess": "Connection successful",
|
||||
"connectionFailed": "Connection failed"
|
||||
"connectionFailed": "Connection failed",
|
||||
"baseVolumePath": "Base Volume Path",
|
||||
"baseVolumePathHelp": "Prepended to relative volume sources (e.g., /data + my-app/uploads = /data/my-app/uploads)"
|
||||
},
|
||||
"settingsRegistries": {
|
||||
"title": "Container Registries",
|
||||
@@ -300,7 +329,10 @@
|
||||
"deleteFailed": "Failed to delete registry",
|
||||
"testFailed": "Connection test failed",
|
||||
"loadFailed": "Failed to load registries",
|
||||
"deleteConfirm": "Delete registry \"{name}\"? This cannot be undone."
|
||||
"deleteConfirm": "Delete registry \"{name}\"? This cannot be undone.",
|
||||
"healthChecking": "Checking...",
|
||||
"healthConnected": "Connected",
|
||||
"healthUnreachable": "Unreachable"
|
||||
},
|
||||
"settingsCredentials": {
|
||||
"title": "Credentials",
|
||||
@@ -324,7 +356,8 @@
|
||||
"registryTokens": "Registry Tokens",
|
||||
"registryTokensDesc": "Registry authentication tokens are managed per-registry in the",
|
||||
"registriesLink": "Registries",
|
||||
"registryTokensSuffix": "section. Each registry stores its token encrypted in the database."
|
||||
"registryTokensSuffix": "section. Each registry stores its token encrypted in the database.",
|
||||
"notSet": "Not set"
|
||||
},
|
||||
"settingsBackup": {
|
||||
"title": "Backup Management",
|
||||
@@ -395,6 +428,7 @@
|
||||
"deleteFailed": "Failed to delete user",
|
||||
"deleteConfirm": "Are you sure you want to delete this user?",
|
||||
"usernameRequired": "Username and password are required",
|
||||
"networkError": "Network error",
|
||||
"password": "Password"
|
||||
},
|
||||
"login": {
|
||||
@@ -486,7 +520,10 @@
|
||||
"stopInstance": "Stop Instance",
|
||||
"startInstance": "Start Instance",
|
||||
"restartInstance": "Restart Instance",
|
||||
"removeInstance": "Remove Instance"
|
||||
"removeInstance": "Remove Instance",
|
||||
"stopAction": "Stop",
|
||||
"restartAction": "Restart",
|
||||
"removeAction": "Remove"
|
||||
},
|
||||
"theme": {
|
||||
"light": "Light",
|
||||
|
||||
@@ -55,7 +55,10 @@
|
||||
"selectImage": "Выберите образ",
|
||||
"noImages": "Образы не найдены",
|
||||
"loadingImages": "Загрузка образов...",
|
||||
"imageLoadFailed": "Не удалось загрузить образы"
|
||||
"imageLoadFailed": "Не удалось загрузить образы",
|
||||
"alreadyAdded": "Уже добавлен",
|
||||
"portHelpText": "Автоопределение из EXPOSE, если пусто",
|
||||
"healthcheckHelpText": "Автоопределение из образа, если пусто"
|
||||
},
|
||||
"projectDetail": {
|
||||
"deleteProject": "Удалить проект",
|
||||
@@ -86,7 +89,29 @@
|
||||
"deleteConfirmMessage": "Это безвозвратно удалит проект '{name}' и все его стадии, экземпляры и историю деплоев.",
|
||||
"loadFailed": "Не удалось загрузить проект",
|
||||
"deleteFailed": "Не удалось удалить проект",
|
||||
"deployFailed": "Деплой не удался"
|
||||
"deployFailed": "Деплой не удался",
|
||||
"nameLabel": "Название *",
|
||||
"imageLabel": "Образ *",
|
||||
"portLabel": "Порт",
|
||||
"healthcheckLabel": "Путь проверки",
|
||||
"saving": "Сохранение...",
|
||||
"addStage": "Добавить стадию",
|
||||
"tagPattern": "Шаблон тега",
|
||||
"tagPatternHelp": "Glob-шаблон (напр., dev-*, v*)",
|
||||
"maxInstances": "Макс. экземпляров",
|
||||
"autoDeployLabel": "Авто-деплой",
|
||||
"npmProxy": "NPM прокси",
|
||||
"creating": "Создание...",
|
||||
"createStage": "Создать стадию",
|
||||
"noProxy": "Без прокси",
|
||||
"deleteStage": "Удалить стадию",
|
||||
"deleteStageConfirm": "Удалить стадию \"{name}\"?",
|
||||
"stageCreated": "Стадия \"{name}\" создана",
|
||||
"stageDeleted": "Стадия \"{name}\" удалена",
|
||||
"projectUpdated": "Проект обновлён",
|
||||
"updateFailed": "Не удалось обновить проект",
|
||||
"stageCreateFailed": "Не удалось создать стадию",
|
||||
"stageDeleteFailed": "Не удалось удалить стадию"
|
||||
},
|
||||
"envEditor": {
|
||||
"title": "Переменные окружения",
|
||||
@@ -117,7 +142,8 @@
|
||||
"addFailed": "Не удалось добавить переменную",
|
||||
"updateFailed": "Не удалось обновить переменную",
|
||||
"deleteFailed": "Не удалось удалить переменную",
|
||||
"loadEnvFailed": "Не удалось загрузить переменные"
|
||||
"loadEnvFailed": "Не удалось загрузить переменные",
|
||||
"leaveEmptyToKeep": "Оставьте пустым, чтобы сохранить текущее"
|
||||
},
|
||||
"volumeEditor": {
|
||||
"title": "Тома",
|
||||
@@ -196,7 +222,8 @@
|
||||
"selectImage": "Выберите образ из реестра",
|
||||
"noImages": "Образы не найдены",
|
||||
"loadingImages": "Загрузка...",
|
||||
"imageLoadFailed": "Не удалось загрузить образы"
|
||||
"imageLoadFailed": "Не удалось загрузить образы",
|
||||
"lowercaseHint": "Строчные буквы и дефисы"
|
||||
},
|
||||
"settings": {
|
||||
"title": "Настройки",
|
||||
@@ -264,7 +291,9 @@
|
||||
"testConnection": "Проверить соединение",
|
||||
"testingConnection": "Проверка...",
|
||||
"connectionSuccess": "Соединение успешно",
|
||||
"connectionFailed": "Ошибка соединения"
|
||||
"connectionFailed": "Ошибка соединения",
|
||||
"baseVolumePath": "Базовый путь томов",
|
||||
"baseVolumePathHelp": "Добавляется к относительным путям источников (напр., /data + my-app/uploads = /data/my-app/uploads)"
|
||||
},
|
||||
"settingsRegistries": {
|
||||
"title": "Реестры контейнеров",
|
||||
@@ -300,7 +329,10 @@
|
||||
"deleteFailed": "Не удалось удалить реестр",
|
||||
"testFailed": "Тест подключения не удался",
|
||||
"loadFailed": "Не удалось загрузить реестры",
|
||||
"deleteConfirm": "Удалить реестр «{name}»? Это действие необратимо."
|
||||
"deleteConfirm": "Удалить реестр «{name}»? Это действие необратимо.",
|
||||
"healthChecking": "Проверка...",
|
||||
"healthConnected": "Подключено",
|
||||
"healthUnreachable": "Недоступно"
|
||||
},
|
||||
"settingsCredentials": {
|
||||
"title": "Учётные данные",
|
||||
@@ -324,7 +356,8 @@
|
||||
"registryTokens": "Токены реестров",
|
||||
"registryTokensDesc": "Токены аутентификации реестров управляются для каждого реестра в разделе",
|
||||
"registriesLink": "Реестры",
|
||||
"registryTokensSuffix": ". Каждый реестр хранит свой токен в зашифрованном виде."
|
||||
"registryTokensSuffix": ". Каждый реестр хранит свой токен в зашифрованном виде.",
|
||||
"notSet": "Не задано"
|
||||
},
|
||||
"settingsBackup": {
|
||||
"title": "Управление резервными копиями",
|
||||
@@ -395,6 +428,7 @@
|
||||
"deleteFailed": "Не удалось удалить пользователя",
|
||||
"deleteConfirm": "Вы уверены, что хотите удалить этого пользователя?",
|
||||
"usernameRequired": "Имя пользователя и пароль обязательны",
|
||||
"networkError": "Ошибка сети",
|
||||
"password": "Пароль"
|
||||
},
|
||||
"login": {
|
||||
@@ -486,7 +520,10 @@
|
||||
"stopInstance": "Остановить экземпляр",
|
||||
"startInstance": "Запустить экземпляр",
|
||||
"restartInstance": "Перезапустить экземпляр",
|
||||
"removeInstance": "Удалить экземпляр"
|
||||
"removeInstance": "Удалить экземпляр",
|
||||
"stopAction": "Остановить",
|
||||
"restartAction": "Перезапустить",
|
||||
"removeAction": "Удалить"
|
||||
},
|
||||
"theme": {
|
||||
"light": "Светлая",
|
||||
|
||||
@@ -227,7 +227,7 @@
|
||||
<p class="mb-4 text-sm text-[var(--text-secondary)]">{$t('quickDeploy.reviewDesc')}</p>
|
||||
|
||||
<div class="grid grid-cols-1 gap-4 md:grid-cols-2">
|
||||
<FormField label={$t('quickDeploy.projectName')} name="projectName" bind:value={projectName} placeholder="my-app" required error={errors.projectName ?? ''} helpText="Lowercase with hyphens" />
|
||||
<FormField label={$t('quickDeploy.projectName')} name="projectName" bind:value={projectName} placeholder="my-app" required error={errors.projectName ?? ''} helpText={$t('quickDeploy.lowercaseHint')} />
|
||||
<FormField label={$t('quickDeploy.port')} name="port" type="number" bind:value={port} placeholder="3000" required error={errors.port ?? ''} helpText={$t('quickDeploy.portHelp')} />
|
||||
<FormField label={$t('quickDeploy.healthCheckPath')} name="healthcheck" bind:value={healthcheck} placeholder="/api/health" helpText={$t('quickDeploy.healthCheckHelp')} />
|
||||
<div class="flex flex-col gap-1.5">
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
description: alreadyAdded ? undefined : reg.name,
|
||||
group: reg.name,
|
||||
disabled: alreadyAdded,
|
||||
disabledHint: alreadyAdded ? 'Already added' : undefined
|
||||
disabledHint: alreadyAdded ? $t('projects.alreadyAdded') : undefined
|
||||
});
|
||||
}
|
||||
} catch {
|
||||
@@ -184,8 +184,8 @@
|
||||
onselect={selectPickedImage}
|
||||
onclose={() => { showImagePicker = false; }}
|
||||
/>
|
||||
<FormField label={$t('projects.port')} name="port" type="number" bind:value={formPort} helpText="Auto-detected from EXPOSE if empty" />
|
||||
<FormField label={$t('projects.healthcheck')} name="healthcheck" bind:value={formHealthcheck} placeholder="/api/health" helpText="Auto-detected from image if empty" />
|
||||
<FormField label={$t('projects.port')} name="port" type="number" bind:value={formPort} helpText={$t('projects.portHelpText')} />
|
||||
<FormField label={$t('projects.healthcheck')} name="healthcheck" bind:value={formHealthcheck} placeholder="/api/health" helpText={$t('projects.healthcheckHelpText')} />
|
||||
</div>
|
||||
|
||||
<div class="mt-6 flex justify-end">
|
||||
|
||||
@@ -47,12 +47,12 @@
|
||||
enable_proxy: stageEnableProxy,
|
||||
max_instances: parseInt(stageMaxInstances) || 1,
|
||||
});
|
||||
toasts.success(`Stage "${stageName}" created`);
|
||||
toasts.success($t('projectDetail.stageCreated', { name: stageName }));
|
||||
stageName = ''; stageTagPattern = '*'; stageAutoDeploy = true; stageEnableProxy = true; stageMaxInstances = '1';
|
||||
showAddStage = false;
|
||||
await loadProject();
|
||||
} catch (e) {
|
||||
toasts.error(e instanceof Error ? e.message : 'Failed to create stage');
|
||||
toasts.error(e instanceof Error ? e.message : $t('projectDetail.stageCreateFailed'));
|
||||
} finally {
|
||||
addingStage = false;
|
||||
}
|
||||
@@ -85,11 +85,11 @@
|
||||
port: parseInt(editPort) || 0,
|
||||
healthcheck: editHealthcheck.trim(),
|
||||
});
|
||||
toasts.success('Project updated');
|
||||
toasts.success($t('projectDetail.projectUpdated'));
|
||||
editing = false;
|
||||
await loadProject();
|
||||
} catch (e) {
|
||||
toasts.error(e instanceof Error ? e.message : 'Failed to update project');
|
||||
toasts.error(e instanceof Error ? e.message : $t('projectDetail.updateFailed'));
|
||||
} finally {
|
||||
saving = false;
|
||||
}
|
||||
@@ -98,10 +98,10 @@
|
||||
async function handleDeleteStage(stageId: string, name: string) {
|
||||
try {
|
||||
await api.deleteStage(projectId, stageId);
|
||||
toasts.success(`Stage "${name}" deleted`);
|
||||
toasts.success($t('projectDetail.stageDeleted', { name }));
|
||||
await loadProject();
|
||||
} catch (e) {
|
||||
toasts.error(e instanceof Error ? e.message : 'Failed to delete stage');
|
||||
toasts.error(e instanceof Error ? e.message : $t('projectDetail.stageDeleteFailed'));
|
||||
}
|
||||
}
|
||||
let tagsLoading = $state(false);
|
||||
@@ -268,10 +268,10 @@
|
||||
<div class="rounded-xl border border-[var(--border-primary)] bg-[var(--surface-card)] p-5 shadow-[var(--shadow-sm)]">
|
||||
{#if editing}
|
||||
<div class="grid grid-cols-1 gap-3 sm:grid-cols-2">
|
||||
<FormField label="Name *" name="editName" bind:value={editName} />
|
||||
<FormField label="Image *" name="editImage" bind:value={editImage} />
|
||||
<FormField label="Port" name="editPort" type="number" bind:value={editPort} />
|
||||
<FormField label="Healthcheck Path" name="editHealthcheck" bind:value={editHealthcheck} placeholder="/api/health" />
|
||||
<FormField label={$t('projectDetail.nameLabel')} name="editName" bind:value={editName} />
|
||||
<FormField label={$t('projectDetail.imageLabel')} name="editImage" bind:value={editImage} />
|
||||
<FormField label={$t('projectDetail.portLabel')} name="editPort" type="number" bind:value={editPort} />
|
||||
<FormField label={$t('projectDetail.healthcheckLabel')} name="editHealthcheck" bind:value={editHealthcheck} placeholder="/api/health" />
|
||||
</div>
|
||||
<div class="mt-4 flex items-center gap-2 justify-end">
|
||||
<button
|
||||
@@ -289,7 +289,7 @@
|
||||
class="inline-flex items-center gap-1.5 rounded-lg bg-[var(--color-brand-600)] px-3 py-1.5 text-sm font-medium text-white hover:bg-[var(--color-brand-700)] disabled:opacity-50 transition-colors"
|
||||
>
|
||||
<IconCheck size={14} />
|
||||
{saving ? 'Saving...' : $t('common.save')}
|
||||
{saving ? $t('projectDetail.saving') : $t('common.save')}
|
||||
</button>
|
||||
</div>
|
||||
{:else}
|
||||
@@ -334,26 +334,26 @@
|
||||
class="inline-flex items-center gap-1.5 rounded-lg {showAddStage ? 'border border-[var(--border-primary)] text-[var(--text-secondary)]' : 'bg-[var(--color-brand-600)] text-white'} px-3 py-1.5 text-xs font-medium transition-all hover:opacity-90"
|
||||
>
|
||||
{#if !showAddStage}<IconPlus size={14} />{/if}
|
||||
{showAddStage ? $t('projects.cancel') : 'Add Stage'}
|
||||
{showAddStage ? $t('projects.cancel') : $t('projectDetail.addStage')}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{#if showAddStage}
|
||||
<div class="mt-3 rounded-xl border border-[var(--border-primary)] bg-[var(--surface-card)] p-4 animate-scale-in">
|
||||
<div class="grid grid-cols-2 gap-3 sm:grid-cols-5">
|
||||
<FormField label="Name *" name="stageName" bind:value={stageName} placeholder="dev" />
|
||||
<FormField label="Tag Pattern" name="stagePattern" bind:value={stageTagPattern} placeholder="dev-*" helpText="Glob pattern (e.g., dev-*, v*)" />
|
||||
<FormField label="Max Instances" name="stageMax" type="number" bind:value={stageMaxInstances} />
|
||||
<FormField label={$t('projectDetail.nameLabel')} name="stageName" bind:value={stageName} placeholder="dev" />
|
||||
<FormField label={$t('projectDetail.tagPattern')} name="stagePattern" bind:value={stageTagPattern} placeholder="dev-*" helpText={$t('projectDetail.tagPatternHelp')} />
|
||||
<FormField label={$t('projectDetail.maxInstances')} name="stageMax" type="number" bind:value={stageMaxInstances} />
|
||||
<div class="flex flex-col gap-1.5">
|
||||
<label class="text-sm font-medium text-[var(--text-primary)]">Auto Deploy</label>
|
||||
<label class="text-sm font-medium text-[var(--text-primary)]">{$t('projectDetail.autoDeployLabel')}</label>
|
||||
<div class="flex items-center h-[38px]">
|
||||
<ToggleSwitch bind:checked={stageAutoDeploy} label="Auto Deploy" />
|
||||
<ToggleSwitch bind:checked={stageAutoDeploy} label={$t('projectDetail.autoDeployLabel')} />
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col gap-1.5">
|
||||
<label class="text-sm font-medium text-[var(--text-primary)]">NPM Proxy</label>
|
||||
<label class="text-sm font-medium text-[var(--text-primary)]">{$t('projectDetail.npmProxy')}</label>
|
||||
<div class="flex items-center h-[38px]">
|
||||
<ToggleSwitch bind:checked={stageEnableProxy} label="NPM Proxy" />
|
||||
<ToggleSwitch bind:checked={stageEnableProxy} label={$t('projectDetail.npmProxy')} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -364,7 +364,7 @@
|
||||
disabled={addingStage || !stageName.trim()}
|
||||
class="rounded-lg bg-[var(--color-brand-600)] px-4 py-2 text-sm font-medium text-white hover:bg-[var(--color-brand-700)] disabled:opacity-50 transition-all"
|
||||
>
|
||||
{addingStage ? 'Creating...' : 'Create Stage'}
|
||||
{addingStage ? $t('projectDetail.creating') : $t('projectDetail.createStage')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -391,7 +391,7 @@
|
||||
<span class="rounded-full bg-amber-50 px-2 py-0.5 text-xs font-medium text-amber-700">{$t('projectDetail.requiresConfirm')}</span>
|
||||
{/if}
|
||||
{#if !stage.enable_proxy}
|
||||
<span class="rounded-full bg-gray-100 px-2 py-0.5 text-xs font-medium text-gray-600">No Proxy</span>
|
||||
<span class="rounded-full bg-gray-100 px-2 py-0.5 text-xs font-medium text-gray-600">{$t('projectDetail.noProxy')}</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="flex items-center gap-3">
|
||||
@@ -408,8 +408,8 @@
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
title="Delete stage"
|
||||
onclick={() => { if (confirm(`Delete stage "${stage.name}"?`)) handleDeleteStage(stage.id, stage.name); }}
|
||||
title={$t('projectDetail.deleteStage')}
|
||||
onclick={() => { if (confirm($t('projectDetail.deleteStageConfirm', { name: stage.name }))) handleDeleteStage(stage.id, stage.name); }}
|
||||
class="rounded-lg p-1.5 text-[var(--text-tertiary)] hover:bg-[var(--color-danger-light)] hover:text-[var(--color-danger)] transition-colors"
|
||||
>
|
||||
<IconTrash size={14} />
|
||||
|
||||
+3
-3
@@ -250,10 +250,10 @@
|
||||
<input type="text" bind:value={editKey} class="block w-full rounded-lg border border-[var(--border-input)] bg-[var(--surface-input)] px-2 py-1 font-mono text-sm text-[var(--text-primary)] focus:border-[var(--color-brand-500)] focus:ring-1 focus:ring-[var(--color-brand-500)] focus:outline-none" />
|
||||
</td>
|
||||
<td class="px-4 py-2.5">
|
||||
<input type={editEncrypted ? 'password' : 'text'} bind:value={editValue} placeholder={env.encrypted ? 'Leave empty to keep current' : ''} class="block w-full rounded-lg border border-[var(--border-input)] bg-[var(--surface-input)] px-2 py-1 font-mono text-sm text-[var(--text-primary)] focus:border-[var(--color-brand-500)] focus:ring-1 focus:ring-[var(--color-brand-500)] focus:outline-none" />
|
||||
<input type={editEncrypted ? 'password' : 'text'} bind:value={editValue} placeholder={env.encrypted ? $t('envEditor.leaveEmptyToKeep') : ''} class="block w-full rounded-lg border border-[var(--border-input)] bg-[var(--surface-input)] px-2 py-1 font-mono text-sm text-[var(--text-primary)] focus:border-[var(--color-brand-500)] focus:ring-1 focus:ring-[var(--color-brand-500)] focus:outline-none" />
|
||||
</td>
|
||||
<td class="px-4 py-2.5">
|
||||
<ToggleSwitch bind:checked={editEncrypted} label="Secret" />
|
||||
<ToggleSwitch bind:checked={editEncrypted} label={$t('envEditor.secret')} />
|
||||
</td>
|
||||
<td class="px-4 py-2.5"></td>
|
||||
<td class="px-4 py-2.5 text-right">
|
||||
@@ -311,7 +311,7 @@
|
||||
<input type={newEncrypted ? 'password' : 'text'} bind:value={newValue} placeholder="value" class="block w-full rounded-lg border border-[var(--border-input)] bg-[var(--surface-input)] px-2 py-1 font-mono text-sm text-[var(--text-primary)] focus:border-[var(--color-brand-500)] focus:ring-1 focus:ring-[var(--color-brand-500)] focus:outline-none" />
|
||||
</td>
|
||||
<td class="px-4 py-2.5">
|
||||
<ToggleSwitch bind:checked={newEncrypted} label="Secret" />
|
||||
<ToggleSwitch bind:checked={newEncrypted} label={$t('envEditor.secret')} />
|
||||
</td>
|
||||
<td class="px-4 py-2.5"></td>
|
||||
<td class="px-4 py-2.5 text-right">
|
||||
|
||||
@@ -290,7 +290,7 @@
|
||||
<FormField label={$t('settingsGeneral.dockerNetwork')} name="network" bind:value={network} placeholder="staging-net" helpText={$t('settingsGeneral.dockerNetworkHelp')} />
|
||||
<FormField label={$t('settingsGeneral.subdomainPattern')} name="subdomainPattern" bind:value={subdomainPattern} placeholder="stage-{'{stage}'}-{'{project}'}" helpText={$t('settingsGeneral.subdomainPatternHelp')} />
|
||||
<FormField label={$t('settingsGeneral.pollingInterval')} name="pollingInterval" type="number" bind:value={pollingInterval} placeholder="60" error={errors.pollingInterval ?? ''} helpText={$t('settingsGeneral.pollingIntervalHelp')} />
|
||||
<FormField label="Base Volume Path" name="baseVolumePath" bind:value={baseVolumePath} placeholder="/data" helpText="Prepended to relative volume sources (e.g., /data + my-app/uploads = /data/my-app/uploads)" />
|
||||
<FormField label={$t('settingsGeneral.baseVolumePath')} name="baseVolumePath" bind:value={baseVolumePath} placeholder="/data" helpText={$t('settingsGeneral.baseVolumePathHelp')} />
|
||||
<FormField label={$t('settingsGeneral.notificationUrl')} name="notificationUrl" bind:value={notificationUrl} placeholder="https://notify.example.com/webhook" error={errors.notificationUrl ?? ''} helpText={$t('settingsGeneral.notificationUrlHelp')} />
|
||||
</div>
|
||||
<!-- SSL Certificate -->
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
const res = await fetch('/api/auth/settings', { method: 'PUT', headers: authHeaders(), body: JSON.stringify(settings) });
|
||||
const envelope = await res.json();
|
||||
if (envelope.success) message = $t('settingsAuth.saved'); else error = envelope.error ?? $t('settingsAuth.saveFailed');
|
||||
} catch (err: unknown) { error = err instanceof Error ? err.message : 'Network error'; } finally { saving = false; }
|
||||
} catch (err: unknown) { error = err instanceof Error ? err.message : $t('settingsAuth.networkError'); } finally { saving = false; }
|
||||
}
|
||||
|
||||
async function addUser() {
|
||||
@@ -67,7 +67,7 @@
|
||||
const envelope = await res.json();
|
||||
if (envelope.success) { newUsername = ''; newPassword = ''; newEmail = ''; newRole = 'viewer'; await loadUsers(); message = $t('settingsAuth.userCreated'); }
|
||||
else error = envelope.error ?? $t('settingsAuth.createFailed');
|
||||
} catch (err: unknown) { error = err instanceof Error ? err.message : 'Network error'; }
|
||||
} catch (err: unknown) { error = err instanceof Error ? err.message : $t('settingsAuth.networkError'); }
|
||||
}
|
||||
|
||||
async function deleteUser(id: string) {
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
<div class="flex items-center justify-between rounded-lg bg-[var(--surface-card-hover)] px-4 py-2.5">
|
||||
<div>
|
||||
<p class="text-xs font-medium text-[var(--text-tertiary)]">{item.label}</p>
|
||||
<p class="text-sm text-[var(--text-secondary)] {item.label === $t('settingsCredentials.password') ? 'font-mono' : ''}">{item.value || 'Not set'}</p>
|
||||
<p class="text-sm text-[var(--text-secondary)] {item.label === $t('settingsCredentials.password') ? 'font-mono' : ''}">{item.value || $t('settingsCredentials.notSet')}</p>
|
||||
</div>
|
||||
</div>
|
||||
{/each}
|
||||
|
||||
@@ -159,11 +159,11 @@
|
||||
<div>
|
||||
<div class="flex items-center gap-2">
|
||||
{#if healthStatus[registry.id] === 'checking'}
|
||||
<span class="h-2.5 w-2.5 shrink-0 rounded-full bg-yellow-400 animate-pulse" title="Checking..."></span>
|
||||
<span class="h-2.5 w-2.5 shrink-0 rounded-full bg-yellow-400 animate-pulse" title={$t('settingsRegistries.healthChecking')}></span>
|
||||
{:else if healthStatus[registry.id] === 'healthy'}
|
||||
<span class="h-2.5 w-2.5 shrink-0 rounded-full bg-emerald-500" title="Connected"></span>
|
||||
<span class="h-2.5 w-2.5 shrink-0 rounded-full bg-emerald-500" title={$t('settingsRegistries.healthConnected')}></span>
|
||||
{:else if healthStatus[registry.id] === 'unhealthy'}
|
||||
<span class="h-2.5 w-2.5 shrink-0 rounded-full bg-red-500" title="Unreachable"></span>
|
||||
<span class="h-2.5 w-2.5 shrink-0 rounded-full bg-red-500" title={$t('settingsRegistries.healthUnreachable')}></span>
|
||||
{/if}
|
||||
<h3 class="text-sm font-semibold text-[var(--text-primary)]">{registry.name}</h3>
|
||||
<span class="rounded-full bg-[var(--surface-card-hover)] px-2 py-0.5 text-xs font-medium text-[var(--text-tertiary)]">{registry.type}</span>
|
||||
|
||||
Reference in New Issue
Block a user