10d0769071
BREAKING: version bump to 1.0.0 New design system: - Emerald/teal color palette with semantic tokens (success, warning, destructive) - Light/dark mode toggle with localStorage persistence and anti-FOUC - CSS custom properties via Tailwind darkMode: 'class' - Zero new dependencies — all primitives hand-rolled Foundation: - 70+ inline SVG icons (no external icon library) - ThemeProvider + useTheme hook - cn() utility for conditional classes UI primitives (web/src/components/ui/): - Button (6 variants, 4 sizes) - Input, Label, Card with slots, Badge (6 variants + sizes) - Switch (animated), Checkbox, Separator - Skeleton, Spinner, EmptyState - Toast system with auto-dismiss (success/error/warning/info) - Dialog with focus trap + escape/click-outside - ConfirmDialog replacing native confirm() - DropdownMenu with keyboard support Layout & navigation: - Sidebar with icon+label nav, active indicator, responsive drawer on mobile - Topbar for <lg viewports with hamburger - PageHeader with title/description/actions pattern - UserMenu with avatar + dropdown (change password, logout) - DirtyBanner redesigned with semantic styling Pages redesigned: - Login: centered card with gradient background - Dashboard: 4 KPI tiles, disk usage bars, services grid, recent activity - Users: table with search, empty state, edit modal - Files: breadcrumbs, drag-drop upload zone, SVG file icons, rename/delete - Samba: card list with badges, edit modal with PathField - NFS: card list with client chips, client editor - Storage: tabs (Mover/SnapRAID/Jobs), real-time job log streaming - Log: timeline grouped by date with filters - Settings: watched mounts, import actions, system info - NotFound: friendly 404 page Polish: - Toast notifications replace all native alert()/confirm() - Tailwind animations (dialog-enter, toast-enter/leave, dropdown-enter) - Custom scrollbar styling - Focus-visible rings - Skeleton loading states across all pages
47 lines
1.9 KiB
Makefile
47 lines
1.9 KiB
Makefile
BINARY=nasctl
|
|
VERSION?=1.0.0
|
|
GO?=go
|
|
LDFLAGS=-s -w -X github.com/darroyo/nasctl/internal/web.Version=$(VERSION) -X github.com/darroyo/nasctl/internal/web.Commit=$(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
|
|
BUILD_FLAGS=CGO_ENABLED=0
|
|
|
|
.PHONY: build build-all frontend run package clean tidy test
|
|
|
|
frontend:
|
|
cd web && npm install && npm run build
|
|
|
|
build: frontend
|
|
$(BUILD_FLAGS) $(GO) build -ldflags "$(LDFLAGS)" -o bin/$(BINARY) ./cmd/nasctl
|
|
|
|
# build-go builds the binary without rebuilding the frontend (dist must exist).
|
|
build-go:
|
|
$(BUILD_FLAGS) $(GO) build -ldflags "$(LDFLAGS)" -o bin/$(BINARY) ./cmd/nasctl
|
|
|
|
build-all: frontend
|
|
$(BUILD_FLAGS) GOOS=linux GOARCH=amd64 $(GO) build -ldflags "$(LDFLAGS)" -o bin/$(BINARY)-linux-amd64 ./cmd/nasctl
|
|
$(BUILD_FLAGS) GOOS=linux GOARCH=arm64 $(GO) build -ldflags "$(LDFLAGS)" -o bin/$(BINARY)-linux-arm64 ./cmd/nasctl
|
|
|
|
run: build
|
|
NASCTL_DB=$${NASCTL_DB:-./.data/nasctl.db} \
|
|
NASCTL_SMB_CONF=$${NASCTL_SMB_CONF:-./.data/smb.conf} \
|
|
NASCTL_EXPORTS=$${NASCTL_EXPORTS:-./.data/exports} \
|
|
NASCTL_EXEC_SYSTEM=false \
|
|
./bin/$(BINARY) --addr :8080
|
|
|
|
package: build-all
|
|
@mkdir -p dist/deb/usr/local/bin dist/deb/etc/systemd/system dist/deb/DEBIAN
|
|
cp bin/$(BINARY)-linux-amd64 dist/deb/usr/local/bin/$(BINARY)
|
|
cp systemd/nasctl.service dist/deb/etc/systemd/system/$(BINARY).service
|
|
printf 'Package: nasctl\nVersion: $(VERSION)\nSection: utils\nPriority: optional\nArchitecture: amd64\nMaintainer: nasctl\nDescription: Monolithic NAS control plane\n' > dist/deb/DEBIAN/control
|
|
printf '#!/bin/sh\nset -e\ninstall -d /var/lib/nasctl\nsystemctl daemon-reload\nsystemctl enable nasctl.service || true\nsystemctl try-restart nasctl.service\n' > dist/deb/DEBIAN/postinst
|
|
chmod 0755 dist/deb/DEBIAN/postinst
|
|
dpkg-deb --build dist/deb dist/nasctl_$(VERSION)_amd64.deb
|
|
|
|
clean:
|
|
rm -rf bin dist .data web/node_modules web/.tsbuild
|
|
|
|
tidy:
|
|
$(GO) mod tidy
|
|
|
|
test:
|
|
$(GO) test ./...
|