refactor: remove standalone proxies, add Traefik provider with Docker labels
Standalone proxy removal: - Delete store, API handlers, proxy manager, health monitor, validator, hints - Delete frontend pages (proxies list, create, edit) and components (ProxyCard, ProxyForm, ProxyFilter, ProxyGroup, ValidationChecklist) - Remove proxy routes from router, nav items, dashboard references - Clean up SystemHealthCard to remove proxy section Traefik provider: - Add TraefikProvider implementing proxy.Provider via Docker labels - ContainerLabels() returns traefik.enable, router rule, entrypoints, service port, TLS cert resolver, docker network - ConfigureRoute() returns router name (labels handle routing at container creation) - DeleteRoute() is no-op (container removal auto-deregisters) - Ping() checks Traefik API health (optional) - Wire ContainerLabels into deployer (executeDeploy + blueGreenDeploy) - Add Traefik settings: entrypoint, cert_resolver, network, api_url - Add traefik option to proxy provider selector in settings UI - Show conditional Traefik config fields - Add i18n keys (EN + RU)
This commit is contained in:
@@ -1,16 +1,14 @@
|
||||
<!--
|
||||
Dashboard summary card: container counts, proxy health, recent errors.
|
||||
Dashboard summary card: container counts and recent errors.
|
||||
-->
|
||||
<script lang="ts">
|
||||
import type { Instance, ProxyView, EventLogStats } from '$lib/types';
|
||||
import type { Instance, EventLogStats } from '$lib/types';
|
||||
import * as api from '$lib/api';
|
||||
import { IconServer, IconProxies, IconAlert } from '$lib/components/icons';
|
||||
import { IconServer, IconAlert } from '$lib/components/icons';
|
||||
import { t } from '$lib/i18n';
|
||||
|
||||
let runningCount = $state(0);
|
||||
let stoppedCount = $state(0);
|
||||
let healthyProxies = $state(0);
|
||||
let unhealthyProxies = $state(0);
|
||||
let recentErrors = $state(0);
|
||||
let loading = $state(true);
|
||||
|
||||
@@ -19,9 +17,8 @@
|
||||
|
||||
async function load() {
|
||||
try {
|
||||
const [projects, proxies, eventStats] = await Promise.all([
|
||||
const [projects, eventStats] = await Promise.all([
|
||||
api.listProjects(),
|
||||
api.listAllProxies().catch(() => [] as ProxyView[]),
|
||||
api.fetchEventLogStats().catch(() => ({ info: 0, warn: 0, error: 0, total: 0 }) as EventLogStats)
|
||||
]);
|
||||
|
||||
@@ -42,8 +39,6 @@
|
||||
if (!cancelled) {
|
||||
runningCount = allInstances.filter((i) => i.status === 'running').length;
|
||||
stoppedCount = allInstances.filter((i) => i.status !== 'running').length;
|
||||
healthyProxies = proxies.filter((p) => p.health_status === 'healthy').length;
|
||||
unhealthyProxies = proxies.filter((p) => p.health_status === 'unhealthy').length;
|
||||
recentErrors = eventStats.error;
|
||||
loading = false;
|
||||
}
|
||||
@@ -65,10 +60,10 @@
|
||||
{#if !loading}
|
||||
<div class="rounded-xl border border-[var(--border-primary)] bg-[var(--surface-card)] p-5 shadow-[var(--shadow-sm)]">
|
||||
<h3 class="mb-4 text-sm font-semibold text-[var(--text-primary)]">{$t('systemHealth.title')}</h3>
|
||||
<div class="grid grid-cols-1 gap-3 sm:grid-cols-3">
|
||||
<div class="grid grid-cols-1 gap-3 sm:grid-cols-2">
|
||||
<!-- Containers -->
|
||||
<a href="/projects" class="flex items-center gap-3 rounded-lg p-3 transition-colors hover:bg-[var(--surface-card-hover)]">
|
||||
<div class="flex h-9 w-9 items-center justify-center rounded-lg bg-emerald-50 text-emerald-600">
|
||||
<div class="flex h-9 w-9 items-center justify-center rounded-lg bg-emerald-50 dark:bg-emerald-950/30 text-emerald-600">
|
||||
<IconServer size={18} />
|
||||
</div>
|
||||
<div>
|
||||
@@ -81,26 +76,9 @@
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<!-- Proxies -->
|
||||
<a href="/proxies" class="flex items-center gap-3 rounded-lg p-3 transition-colors hover:bg-[var(--surface-card-hover)]">
|
||||
<div class="flex h-9 w-9 items-center justify-center rounded-lg {unhealthyProxies > 0 ? 'bg-red-50 text-red-600' : 'bg-blue-50 text-blue-600'}">
|
||||
<IconProxies size={18} />
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-xs text-[var(--text-secondary)]">{$t('systemHealth.proxies')}</p>
|
||||
<p class="text-sm font-semibold text-[var(--text-primary)]">
|
||||
<span class="text-emerald-600">{healthyProxies}</span>
|
||||
{#if unhealthyProxies > 0}
|
||||
<span class="text-[var(--text-tertiary)]"> / </span>
|
||||
<span class="text-red-600">{unhealthyProxies}</span>
|
||||
{/if}
|
||||
</p>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<!-- Recent errors -->
|
||||
<a href="/events" class="flex items-center gap-3 rounded-lg p-3 transition-colors hover:bg-[var(--surface-card-hover)]">
|
||||
<div class="flex h-9 w-9 items-center justify-center rounded-lg {recentErrors > 0 ? 'bg-red-50 text-red-600' : 'bg-gray-50 text-gray-400'}">
|
||||
<div class="flex h-9 w-9 items-center justify-center rounded-lg {recentErrors > 0 ? 'bg-red-50 dark:bg-red-950/30 text-red-600' : 'bg-gray-50 dark:bg-gray-900/30 text-gray-400'}">
|
||||
<IconAlert size={18} />
|
||||
</div>
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user