Switch dev port to 3000, drop dashboard quick actions and header active highlight

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
David Beccue
2026-05-16 07:41:38 +05:00
parent 83030bff3a
commit 8817b5bc07
10 changed files with 12 additions and 38 deletions

View File

@ -9,6 +9,6 @@ RUN apt-get update \
USER node
WORKDIR /app
EXPOSE 5173 3000
EXPOSE 3000
CMD ["npm", "run", "dev"]

View File

@ -9,7 +9,7 @@ help:
@echo " ╚════════════════════════════════════════════════╝"
@echo ""
@echo " make install Install npm dependencies inside the container"
@echo " make run Start the dev server (http://localhost:5173)"
@echo " make run Start the dev server (http://localhost:3000)"
@echo " make build Production build into ./build (adapter-node)"
@echo " make db-init Create data/avtoambor.db from schema + seed (skip if exists)"
@echo " make db-reset DELETE and recreate data/avtoambor.db (asks first)"

View File

@ -15,7 +15,7 @@ inside the container.
```sh
make install # install dependencies inside the container
make db-init # create data/avtoambor.db with schema + seed
make run # dev server at http://localhost:5173
make run # dev server at http://localhost:3000
```
`make help` lists every target.

View File

@ -8,7 +8,6 @@ services:
working_dir: /app
user: node
ports:
- "5173:5173"
- "3000:3000"
volumes:
- .:/app

View File

@ -4,7 +4,7 @@
"private": true,
"type": "module",
"scripts": {
"dev": "vite dev --host 0.0.0.0 --port 5173",
"dev": "vite dev --host 0.0.0.0 --port 3000",
"build": "vite build",
"preview": "node build/index.js",
"start": "node build/index.js",

View File

@ -1,14 +1,7 @@
<script>
import { locale, t, toggleLocale } from '$lib/i18n/store.js';
import { page } from '$app/stores';
$: lang = $locale;
$: path = $page.url.pathname;
function isActive(prefix) {
if (prefix === '/') return path === '/';
return path === prefix || path.startsWith(prefix + '/');
}
</script>
<header class="header">
@ -20,11 +13,11 @@
</a>
<nav class="nav">
<a href="/" class:active={isActive('/')}>{$t('nav.dashboard')}</a>
<a href="/parts" class:active={isActive('/parts')}>{$t('nav.parts')}</a>
<a href="/movements/new" class:active={isActive('/movements')}>{$t('nav.movements')}</a>
<a href="/suppliers" class:active={isActive('/suppliers')}>{$t('nav.suppliers')}</a>
<a href="/admin" class:active={isActive('/admin')}>{$t('nav.admin')}</a>
<a href="/">{$t('nav.dashboard')}</a>
<a href="/parts">{$t('nav.parts')}</a>
<a href="/movements/new">{$t('nav.movements')}</a>
<a href="/suppliers">{$t('nav.suppliers')}</a>
<a href="/admin">{$t('nav.admin')}</a>
</nav>
<button class="lang" type="button" on:click={toggleLocale} aria-label="Switch language">
@ -84,12 +77,6 @@
border-color: rgba(255,255,255,0.4);
}
.nav a:active { transform: translateY(1px); }
.nav a.active {
background: #fff;
color: #b00d27;
border-color: #fff;
box-shadow: 0 1px 2px rgba(0,0,0,0.18);
}
.lang {
background: rgba(255,255,255,0.12);
color: inherit;

View File

@ -44,8 +44,7 @@
"low_stock": "At or below reorder level",
"inventory_value": "Inventory value (at cost)",
"low_stock_list": "Low stock",
"recent_movements": "Recent movements",
"quick_actions": "Quick actions"
"recent_movements": "Recent movements"
},
"parts": {
"title": "Parts",

View File

@ -44,8 +44,7 @@
"low_stock": "Дар сатҳи фармоиш ё камтар",
"inventory_value": "Арзиши захира (бо нархи харид)",
"low_stock_list": "Захираи кам",
"recent_movements": "Ҳаракатҳои охирин",
"quick_actions": "Амалҳои тез"
"recent_movements": "Ҳаракатҳои охирин"
},
"parts": {
"title": "Қисмҳо",

View File

@ -26,13 +26,6 @@
</div>
</div>
<div class="card quick">
<strong>{$t('dashboard.quick_actions')}</strong>
<a href="/parts/new">{$t('nav.new_part')}</a>
<a href="/movements/new">{$t('nav.new_movement')}</a>
<a href="/parts">{$t('nav.parts')}</a>
</div>
<h2>{$t('dashboard.low_stock_list')}</h2>
{#if lowStock.length === 0}
<p class="muted">{$t('common.none')}</p>
@ -103,7 +96,4 @@
}
.stat .value.warn { color: #b8443f; }
.stat .cur { font-size: 0.85rem; color: #6b7388; margin-left: 0.25rem; }
.quick { display: flex; align-items: center; gap: 1rem; margin: 1rem 0; }
.quick strong { margin-right: auto; }
</style>

View File

@ -5,7 +5,7 @@ const config = {
plugins: [sveltekit()],
server: {
host: '0.0.0.0',
port: 5173,
port: 3000,
strictPort: true,
watch: {
usePolling: true