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:
@ -9,6 +9,6 @@ RUN apt-get update \
|
|||||||
USER node
|
USER node
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
EXPOSE 5173 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
CMD ["npm", "run", "dev"]
|
CMD ["npm", "run", "dev"]
|
||||||
|
|||||||
2
Makefile
2
Makefile
@ -9,7 +9,7 @@ help:
|
|||||||
@echo " ╚════════════════════════════════════════════════╝"
|
@echo " ╚════════════════════════════════════════════════╝"
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo " make install Install npm dependencies inside the container"
|
@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 build Production build into ./build (adapter-node)"
|
||||||
@echo " make db-init Create data/avtoambor.db from schema + seed (skip if exists)"
|
@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)"
|
@echo " make db-reset DELETE and recreate data/avtoambor.db (asks first)"
|
||||||
|
|||||||
@ -15,7 +15,7 @@ inside the container.
|
|||||||
```sh
|
```sh
|
||||||
make install # install dependencies inside the container
|
make install # install dependencies inside the container
|
||||||
make db-init # create data/avtoambor.db with schema + seed
|
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.
|
`make help` lists every target.
|
||||||
|
|||||||
@ -8,7 +8,6 @@ services:
|
|||||||
working_dir: /app
|
working_dir: /app
|
||||||
user: node
|
user: node
|
||||||
ports:
|
ports:
|
||||||
- "5173:5173"
|
|
||||||
- "3000:3000"
|
- "3000:3000"
|
||||||
volumes:
|
volumes:
|
||||||
- .:/app
|
- .:/app
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite dev --host 0.0.0.0 --port 5173",
|
"dev": "vite dev --host 0.0.0.0 --port 3000",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
"preview": "node build/index.js",
|
"preview": "node build/index.js",
|
||||||
"start": "node build/index.js",
|
"start": "node build/index.js",
|
||||||
|
|||||||
@ -1,14 +1,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { locale, t, toggleLocale } from '$lib/i18n/store.js';
|
import { locale, t, toggleLocale } from '$lib/i18n/store.js';
|
||||||
import { page } from '$app/stores';
|
|
||||||
|
|
||||||
$: lang = $locale;
|
$: lang = $locale;
|
||||||
$: path = $page.url.pathname;
|
|
||||||
|
|
||||||
function isActive(prefix) {
|
|
||||||
if (prefix === '/') return path === '/';
|
|
||||||
return path === prefix || path.startsWith(prefix + '/');
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<header class="header">
|
<header class="header">
|
||||||
@ -20,11 +13,11 @@
|
|||||||
</a>
|
</a>
|
||||||
|
|
||||||
<nav class="nav">
|
<nav class="nav">
|
||||||
<a href="/" class:active={isActive('/')}>{$t('nav.dashboard')}</a>
|
<a href="/">{$t('nav.dashboard')}</a>
|
||||||
<a href="/parts" class:active={isActive('/parts')}>{$t('nav.parts')}</a>
|
<a href="/parts">{$t('nav.parts')}</a>
|
||||||
<a href="/movements/new" class:active={isActive('/movements')}>{$t('nav.movements')}</a>
|
<a href="/movements/new">{$t('nav.movements')}</a>
|
||||||
<a href="/suppliers" class:active={isActive('/suppliers')}>{$t('nav.suppliers')}</a>
|
<a href="/suppliers">{$t('nav.suppliers')}</a>
|
||||||
<a href="/admin" class:active={isActive('/admin')}>{$t('nav.admin')}</a>
|
<a href="/admin">{$t('nav.admin')}</a>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<button class="lang" type="button" on:click={toggleLocale} aria-label="Switch language">
|
<button class="lang" type="button" on:click={toggleLocale} aria-label="Switch language">
|
||||||
@ -84,12 +77,6 @@
|
|||||||
border-color: rgba(255,255,255,0.4);
|
border-color: rgba(255,255,255,0.4);
|
||||||
}
|
}
|
||||||
.nav a:active { transform: translateY(1px); }
|
.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 {
|
.lang {
|
||||||
background: rgba(255,255,255,0.12);
|
background: rgba(255,255,255,0.12);
|
||||||
color: inherit;
|
color: inherit;
|
||||||
|
|||||||
@ -44,8 +44,7 @@
|
|||||||
"low_stock": "At or below reorder level",
|
"low_stock": "At or below reorder level",
|
||||||
"inventory_value": "Inventory value (at cost)",
|
"inventory_value": "Inventory value (at cost)",
|
||||||
"low_stock_list": "Low stock",
|
"low_stock_list": "Low stock",
|
||||||
"recent_movements": "Recent movements",
|
"recent_movements": "Recent movements"
|
||||||
"quick_actions": "Quick actions"
|
|
||||||
},
|
},
|
||||||
"parts": {
|
"parts": {
|
||||||
"title": "Parts",
|
"title": "Parts",
|
||||||
|
|||||||
@ -44,8 +44,7 @@
|
|||||||
"low_stock": "Дар сатҳи фармоиш ё камтар",
|
"low_stock": "Дар сатҳи фармоиш ё камтар",
|
||||||
"inventory_value": "Арзиши захира (бо нархи харид)",
|
"inventory_value": "Арзиши захира (бо нархи харид)",
|
||||||
"low_stock_list": "Захираи кам",
|
"low_stock_list": "Захираи кам",
|
||||||
"recent_movements": "Ҳаракатҳои охирин",
|
"recent_movements": "Ҳаракатҳои охирин"
|
||||||
"quick_actions": "Амалҳои тез"
|
|
||||||
},
|
},
|
||||||
"parts": {
|
"parts": {
|
||||||
"title": "Қисмҳо",
|
"title": "Қисмҳо",
|
||||||
|
|||||||
@ -26,13 +26,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</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>
|
<h2>{$t('dashboard.low_stock_list')}</h2>
|
||||||
{#if lowStock.length === 0}
|
{#if lowStock.length === 0}
|
||||||
<p class="muted">{$t('common.none')}</p>
|
<p class="muted">{$t('common.none')}</p>
|
||||||
@ -103,7 +96,4 @@
|
|||||||
}
|
}
|
||||||
.stat .value.warn { color: #b8443f; }
|
.stat .value.warn { color: #b8443f; }
|
||||||
.stat .cur { font-size: 0.85rem; color: #6b7388; margin-left: 0.25rem; }
|
.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>
|
</style>
|
||||||
|
|||||||
@ -5,7 +5,7 @@ const config = {
|
|||||||
plugins: [sveltekit()],
|
plugins: [sveltekit()],
|
||||||
server: {
|
server: {
|
||||||
host: '0.0.0.0',
|
host: '0.0.0.0',
|
||||||
port: 5173,
|
port: 3000,
|
||||||
strictPort: true,
|
strictPort: true,
|
||||||
watch: {
|
watch: {
|
||||||
usePolling: true
|
usePolling: true
|
||||||
|
|||||||
Reference in New Issue
Block a user