feat(frontend): switch to Inter Variable, bump type scale, fix TS errors
Some checks failed
Deploy to Production / Trigger production update (push) Failing after 10s
Some checks failed
Deploy to Production / Trigger production update (push) Failing after 10s
- Replace DM Sans with Inter Variable (better screen rendering at small sizes) - Bump text-xs 12→13px, text-sm 14→15px globally via theme tokens - Fix hardcoded text-[13px] → text-sm in AppLayout, CommandPalette, DashboardPage - Fix button sm variant text-[0.8rem] → text-xs for consistency - Fix TS: ScriptExecuteDialog unused isRunning, setResult → setExecutionId(r.id) - Fix TS: InstanceActionDialogs onValueChange null guards (string | null → string) - Dockerfile: npm ci → npm install (cross-platform lockfile, Linux optional deps)
This commit is contained in:
@@ -2,9 +2,11 @@
|
|||||||
FROM node:22-alpine AS deps
|
FROM node:22-alpine AS deps
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package.json package-lock.json ./
|
COPY package.json package-lock.json ./
|
||||||
# BuildKit-кеш npm — повторные сборки переиспользуют скачанные пакеты
|
# BuildKit-кеш npm — повторные сборки переиспользуют скачанные пакеты.
|
||||||
|
# npm install вместо npm ci: кросс-платформенный lockfile (Windows-host)
|
||||||
|
# не резолвит Linux-optional deps (@emnapi/core и др.), npm ci падает.
|
||||||
RUN --mount=type=cache,target=/root/.npm \
|
RUN --mount=type=cache,target=/root/.npm \
|
||||||
npm ci --prefer-offline --no-audit --no-fund
|
npm install --prefer-offline --no-audit --no-fund
|
||||||
|
|
||||||
# ── Dev stage: Vite HMR (используется compose.dev.yml) ───────────────────────
|
# ── Dev stage: Vite HMR (используется compose.dev.yml) ───────────────────────
|
||||||
FROM deps AS dev
|
FROM deps AS dev
|
||||||
|
|||||||
30
frontend/package-lock.json
generated
30
frontend/package-lock.json
generated
@@ -9,7 +9,7 @@
|
|||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@base-ui/react": "^1.3.0",
|
"@base-ui/react": "^1.3.0",
|
||||||
"@fontsource-variable/dm-sans": "^5.2.8",
|
"@fontsource-variable/inter": "^5.3.0",
|
||||||
"@fontsource-variable/jetbrains-mono": "^5.2.8",
|
"@fontsource-variable/jetbrains-mono": "^5.2.8",
|
||||||
"@novnc/novnc": "^1.6.0",
|
"@novnc/novnc": "^1.6.0",
|
||||||
"@tailwindcss/vite": "^4.2.2",
|
"@tailwindcss/vite": "^4.2.2",
|
||||||
@@ -692,20 +692,20 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@emnapi/core": {
|
"node_modules/@emnapi/core": {
|
||||||
"version": "1.9.2",
|
"version": "1.11.3",
|
||||||
"resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.9.2.tgz",
|
"resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.11.3.tgz",
|
||||||
"integrity": "sha512-UC+ZhH3XtczQYfOlu3lNEkdW/p4dsJ1r/bP7H8+rhao3TTTMO1ATq/4DdIi23XuGoFY+Cz0JmCbdVl0hz9jZcA==",
|
"integrity": "sha512-zLpS5asjEb7lq8jYLq37N6XKaE41DIexlY1rF/z4/tIl3wo13Sqm28fRyfIsKZD+NZ8mM5RoKkpW/rBcuoSZSg==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@emnapi/wasi-threads": "1.2.1",
|
"@emnapi/wasi-threads": "1.2.3",
|
||||||
"tslib": "^2.4.0"
|
"tslib": "^2.4.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@emnapi/runtime": {
|
"node_modules/@emnapi/runtime": {
|
||||||
"version": "1.9.2",
|
"version": "1.11.3",
|
||||||
"resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.9.2.tgz",
|
"resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.3.tgz",
|
||||||
"integrity": "sha512-3U4+MIWHImeyu1wnmVygh5WlgfYDtyf0k8AbLhMFxOipihf6nrWC4syIm/SwEeec0mNSafiiNnMJwbza/Is6Lw==",
|
"integrity": "sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -713,9 +713,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@emnapi/wasi-threads": {
|
"node_modules/@emnapi/wasi-threads": {
|
||||||
"version": "1.2.1",
|
"version": "1.2.3",
|
||||||
"resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.3.tgz",
|
||||||
"integrity": "sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==",
|
"integrity": "sha512-ELEBe8PsLvvJ6QMr0zLt8ffvOHW/dc1m3CEzNMg7aJUv3bMaoDtw2TXyDAwkYBuroxxuHEwhRTLJSe5sya547g==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -917,10 +917,10 @@
|
|||||||
"integrity": "sha512-RiB/yIh78pcIxl6lLMG0CgBXAZ2Y0eVHqMPYugu+9U0AeT6YBeiJpf7lbdJNIugFP5SIjwNRgo4DhR1Qxi26Gg==",
|
"integrity": "sha512-RiB/yIh78pcIxl6lLMG0CgBXAZ2Y0eVHqMPYugu+9U0AeT6YBeiJpf7lbdJNIugFP5SIjwNRgo4DhR1Qxi26Gg==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/@fontsource-variable/dm-sans": {
|
"node_modules/@fontsource-variable/inter": {
|
||||||
"version": "5.2.8",
|
"version": "5.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/dm-sans/-/dm-sans-5.2.8.tgz",
|
"resolved": "https://registry.npmjs.org/@fontsource-variable/inter/-/inter-5.3.0.tgz",
|
||||||
"integrity": "sha512-AxkvMTvNWgfrmlyjiV05vlHYJa+nRQCf1EfvIrQAPBpFJW0O9VTz7oAFr9S3lvbWdmnFoBk7yFqQL86u64nl2g==",
|
"integrity": "sha512-OupL48va4JNofb97w6NYeF9S7W/kHNKM0Er8Dem5nqi4jeOLrVJDoE8tZEpnMJmtkvNbB1EIPPwHcdkF6b1oUA==",
|
||||||
"license": "OFL-1.1",
|
"license": "OFL-1.1",
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://github.com/sponsors/ayuhito"
|
"url": "https://github.com/sponsors/ayuhito"
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@base-ui/react": "^1.3.0",
|
"@base-ui/react": "^1.3.0",
|
||||||
"@fontsource-variable/dm-sans": "^5.2.8",
|
"@fontsource-variable/inter": "^5.3.0",
|
||||||
"@fontsource-variable/jetbrains-mono": "^5.2.8",
|
"@fontsource-variable/jetbrains-mono": "^5.2.8",
|
||||||
"@novnc/novnc": "^1.6.0",
|
"@novnc/novnc": "^1.6.0",
|
||||||
"@tailwindcss/vite": "^4.2.2",
|
"@tailwindcss/vite": "^4.2.2",
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ export default function CommandPalette() {
|
|||||||
onMouseEnter={() => setActiveIndex(i)}
|
onMouseEnter={() => setActiveIndex(i)}
|
||||||
onClick={() => go(item.path)}
|
onClick={() => go(item.path)}
|
||||||
className={cn(
|
className={cn(
|
||||||
'flex w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-left text-[13px] font-medium transition-colors',
|
'flex w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-left text-sm font-medium transition-colors',
|
||||||
i === activeIndex
|
i === activeIndex
|
||||||
? 'bg-primary/10 text-primary'
|
? 'bg-primary/10 text-primary'
|
||||||
: 'text-foreground hover:bg-accent'
|
: 'text-foreground hover:bg-accent'
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ const buttonVariants = cva(
|
|||||||
default:
|
default:
|
||||||
"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
||||||
xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
||||||
sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
||||||
lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
||||||
icon: "size-8",
|
icon: "size-8",
|
||||||
"icon-xs":
|
"icon-xs":
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ function CircularGauge({ label, value }: { label: string; value: number }) {
|
|||||||
/>
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
<div className="absolute inset-0 flex items-center justify-center">
|
<div className="absolute inset-0 flex items-center justify-center">
|
||||||
<span className="font-mono text-[13px] font-bold tabular-nums">{Math.round(clamped)}</span>
|
<span className="font-mono text-sm font-bold tabular-nums">{Math.round(clamped)}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<span className="text-2xs font-mono text-muted-foreground tracking-wide uppercase">{label}</span>
|
<span className="text-2xs font-mono text-muted-foreground tracking-wide uppercase">{label}</span>
|
||||||
|
|||||||
@@ -1010,7 +1010,7 @@ function BackupDialog({ open, onClose, serverId, vmid, type, node, name }: Omit<
|
|||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<Label>{t('backups.storage')}</Label>
|
<Label>{t('backups.storage')}</Label>
|
||||||
<Select value={storage} onValueChange={setStorage}>
|
<Select value={storage} onValueChange={(v) => setStorage(v ?? '')}>
|
||||||
<SelectTrigger>
|
<SelectTrigger>
|
||||||
<SelectValue placeholder={t('backups.select_storage')} />
|
<SelectValue placeholder={t('backups.select_storage')} />
|
||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
@@ -1031,7 +1031,7 @@ function BackupDialog({ open, onClose, serverId, vmid, type, node, name }: Omit<
|
|||||||
<div className="grid grid-cols-2 gap-3">
|
<div className="grid grid-cols-2 gap-3">
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<Label>{t('backups.mode')}</Label>
|
<Label>{t('backups.mode')}</Label>
|
||||||
<Select value={mode} onValueChange={setMode}>
|
<Select value={mode} onValueChange={(v) => setMode(v ?? '')}>
|
||||||
<SelectTrigger><SelectValue /></SelectTrigger>
|
<SelectTrigger><SelectValue /></SelectTrigger>
|
||||||
<SelectContent>
|
<SelectContent>
|
||||||
<SelectItem value="snapshot">Snapshot</SelectItem>
|
<SelectItem value="snapshot">Snapshot</SelectItem>
|
||||||
@@ -1042,7 +1042,7 @@ function BackupDialog({ open, onClose, serverId, vmid, type, node, name }: Omit<
|
|||||||
</div>
|
</div>
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<Label>{t('backups.compression')}</Label>
|
<Label>{t('backups.compression')}</Label>
|
||||||
<Select value={compress} onValueChange={setCompress}>
|
<Select value={compress} onValueChange={(v) => setCompress(v ?? '')}>
|
||||||
<SelectTrigger><SelectValue /></SelectTrigger>
|
<SelectTrigger><SelectValue /></SelectTrigger>
|
||||||
<SelectContent>
|
<SelectContent>
|
||||||
<SelectItem value="zstd">ZSTD</SelectItem>
|
<SelectItem value="zstd">ZSTD</SelectItem>
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ export default function ScriptExecuteDialog({ script, onOpenChange }: Props) {
|
|||||||
// дальше поллим его до завершения (см. useScriptExecution).
|
// дальше поллим его до завершения (см. useScriptExecution).
|
||||||
const { data: liveExec } = useScriptExecution(executionId ?? 0);
|
const { data: liveExec } = useScriptExecution(executionId ?? 0);
|
||||||
const result: ScriptExecution | null = liveExec ?? null;
|
const result: ScriptExecution | null = liveExec ?? null;
|
||||||
const isRunning = result?.status === 'running';
|
|
||||||
|
|
||||||
const serverIdNum = serverId ? Number(serverId) : 0;
|
const serverIdNum = serverId ? Number(serverId) : 0;
|
||||||
const { data: nodesData } = useNodes(serverIdNum || 0);
|
const { data: nodesData } = useNodes(serverIdNum || 0);
|
||||||
@@ -87,7 +86,7 @@ export default function ScriptExecuteDialog({ script, onOpenChange }: Props) {
|
|||||||
params: paramValues,
|
params: paramValues,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
onSuccess: (r) => setResult(r),
|
onSuccess: (r) => setExecutionId(r.id),
|
||||||
onError: (e) => toast.error((e as Error).message),
|
onError: (e) => toast.error((e as Error).message),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
2
frontend/src/fontsource.d.ts
vendored
2
frontend/src/fontsource.d.ts
vendored
@@ -1,5 +1,5 @@
|
|||||||
// @fontsource-variable/* packages ship CSS with no type declarations, so a
|
// @fontsource-variable/* packages ship CSS with no type declarations, so a
|
||||||
// bare side-effect import isn't matched by Vite's `*.css` module glob. Declare
|
// bare side-effect import isn't matched by Vite's `*.css` module glob. Declare
|
||||||
// them as typeless modules to satisfy `tsc` (see main.tsx font imports).
|
// them as typeless modules to satisfy `tsc` (see main.tsx font imports).
|
||||||
declare module '@fontsource-variable/dm-sans';
|
declare module '@fontsource-variable/inter';
|
||||||
declare module '@fontsource-variable/jetbrains-mono';
|
declare module '@fontsource-variable/jetbrains-mono';
|
||||||
|
|||||||
@@ -5,14 +5,19 @@
|
|||||||
@custom-variant dark (&:is(.dark *));
|
@custom-variant dark (&:is(.dark *));
|
||||||
|
|
||||||
@theme inline {
|
@theme inline {
|
||||||
--font-sans: "DM Sans Variable", system-ui, sans-serif;
|
--font-sans: "Inter Variable", system-ui, sans-serif;
|
||||||
--font-mono: "JetBrains Mono Variable", ui-monospace, monospace;
|
--font-mono: "JetBrains Mono Variable", ui-monospace, monospace;
|
||||||
--font-heading: var(--font-sans);
|
--font-heading: var(--font-sans);
|
||||||
|
|
||||||
/* One named step below text-xs (12px) for micro labels / meta text, so the
|
/* Micro step for kbd hints, chart axis ticks, and compact badges.
|
||||||
type scale is 11·12·14·16·18·24·32 instead of ad-hoc text-[10px]/[11px]. */
|
Type scale: 11·12·13·14·16·18·24·32 */
|
||||||
--text-2xs: 0.6875rem; /* 11px */
|
--text-2xs: 0.6875rem; /* 11px */
|
||||||
--text-2xs--line-height: 1rem;
|
--text-2xs--line-height: 1rem;
|
||||||
|
/* Bump xs/sm/base up by 1px for better readability at density. */
|
||||||
|
--text-xs: 0.8125rem; /* 13px, default 12px */
|
||||||
|
--text-xs--line-height: 1.125rem;
|
||||||
|
--text-sm: 0.9375rem; /* 15px, default 14px */
|
||||||
|
--text-sm--line-height: 1.375rem;
|
||||||
|
|
||||||
/* Semantic status tokens — use text-success / bg-warning / text-danger etc.
|
/* Semantic status tokens — use text-success / bg-warning / text-danger etc.
|
||||||
instead of hardcoded green-500 / amber-500 / red-500 so both themes and
|
instead of hardcoded green-500 / amber-500 / red-500 so both themes and
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ function SidebarContent() {
|
|||||||
<Link
|
<Link
|
||||||
key={item.path}
|
key={item.path}
|
||||||
to={item.path}
|
to={item.path}
|
||||||
className={`flex items-center gap-2.5 rounded-md px-2.5 py-1.5 text-[13px] font-medium transition-colors ${
|
className={`flex items-center gap-2.5 rounded-md px-2.5 py-1.5 text-sm font-medium transition-colors ${
|
||||||
isActive
|
isActive
|
||||||
? 'bg-primary/10 text-primary'
|
? 'bg-primary/10 text-primary'
|
||||||
: 'text-muted-foreground hover:bg-accent hover:text-accent-foreground'
|
: 'text-muted-foreground hover:bg-accent hover:text-accent-foreground'
|
||||||
@@ -118,7 +118,7 @@ function UserSection() {
|
|||||||
{user?.username?.[0]?.toUpperCase() ?? '?'}
|
{user?.username?.[0]?.toUpperCase() ?? '?'}
|
||||||
</div>
|
</div>
|
||||||
<div className="min-w-0 flex-1">
|
<div className="min-w-0 flex-1">
|
||||||
<p className="truncate text-[13px] font-medium">{user?.username ?? 'User'}</p>
|
<p className="truncate text-sm font-medium">{user?.username ?? 'User'}</p>
|
||||||
<p className="truncate text-2xs text-muted-foreground">
|
<p className="truncate text-2xs text-muted-foreground">
|
||||||
{user?.is_admin ? 'Admin' : 'User'}
|
{user?.is_admin ? 'Admin' : 'User'}
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { StrictMode } from 'react'
|
import { StrictMode } from 'react'
|
||||||
import { createRoot } from 'react-dom/client'
|
import { createRoot } from 'react-dom/client'
|
||||||
// Self-hosted fonts (font-display: swap built in) — no render-blocking
|
// Self-hosted fonts (font-display: swap built in) — no render-blocking
|
||||||
// external Google Fonts request. Family names: "DM Sans Variable" /
|
// external Google Fonts request. Family names: "Inter Variable" /
|
||||||
// "JetBrains Mono Variable" (see --font-sans / --font-mono in index.css).
|
// "JetBrains Mono Variable" (see --font-sans / --font-mono in index.css).
|
||||||
import '@fontsource-variable/dm-sans'
|
import '@fontsource-variable/inter'
|
||||||
import '@fontsource-variable/jetbrains-mono'
|
import '@fontsource-variable/jetbrains-mono'
|
||||||
import './lib/i18n'
|
import './lib/i18n'
|
||||||
import './index.css'
|
import './index.css'
|
||||||
|
|||||||
Reference in New Issue
Block a user