Compare commits

..

3 Commits

Author SHA1 Message Date
Joakim Repomaa
ea315d3a52 allow overriding api url
All checks were successful
Nix Build / build (push) Successful in 1m12s
2026-02-22 23:16:59 +02:00
Joakim Repomaa
0ca657beb1 update readme
All checks were successful
Nix Build / build (push) Successful in 1m11s
2026-02-22 23:05:41 +02:00
Joakim Repomaa
7a3768e1bf setup gitea workflow
All checks were successful
Nix Build / build (push) Successful in 1m12s
2026-02-22 23:01:45 +02:00
4 changed files with 56 additions and 31 deletions

View File

@@ -0,0 +1,15 @@
name: Nix Build
on:
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: nixos-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: nix build

View File

@@ -1,42 +1,53 @@
# sv
# Router Dash
Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli).
[![Nix Build](https://git.freun.dev/repomaa/router-dash/actions/workflows/build.yaml/badge.svg)](https://git.freun.dev/repomaa/router-dash/actions?workflow=build.yaml)
## Creating a project
A modern web dashboard for monitoring network interfaces, routes, and DHCP leases. Built with SvelteKit 5 and designed to work with systemd-networkd's JSON output.
If you're seeing this, you've probably already done this step. Congrats!
## Features
- **Network Interface Monitoring** - View detailed interface information including IP addresses, routes, carrier state, and operational status
- **DHCP Lease Management** - Display active and expired DHCP leases with time remaining
- **Routing Table Visualization** - Show routing policies and network routes
- **Real-time Status** - Monitor operational states, carrier states, and address states
- **Responsive Design** - Clean, modern UI built with Tailwind CSS
## Tech Stack
- **Framework**: SvelteKit 5 with Svelte 5 runes
- **Language**: TypeScript (strict mode)
- **Styling**: Tailwind CSS 4
- **Icons**: Lucide Svelte
- **Build**: Vite
- **CI/CD**: Gitea Actions with Nix
## Development
```sh
# create a new project
npx sv create my-app
```
# Install dependencies
npm install
To recreate this project with the same configuration:
```sh
# recreate this project
deno run npm:sv create --template minimal --types ts --add prettier eslint tailwindcss="plugins:none" sveltekit-adapter="adapter:static" devtools-json mcp="ide:opencode+setup:local" --install deno router-dash
```
## Developing
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
```sh
# Start development server
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
# Type check
npm run check
# Lint and format
npm run lint
npm run format
```
## Building
To create a production version of your app:
```sh
# Create production build
npm run build
# Preview production build
npm run preview
```
You can preview the production build with `npm run preview`.
## License
> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
AGPL-3.0-or-later

View File

@@ -26,11 +26,11 @@
npmDepsHash = "sha256-2XxcsvKeYp+SVBx6Z2uB/34qUr7AderMxXKjm/kS8F0=";
API_PORT = "3000";
API_URL = "/api";
buildPhase = ''
runHook preBuild
PUBLIC_API_PORT="''${API_PORT}" npm run build
PUBLIC_API_URL="''${API_URL}" npm run build
runHook postBuild
'';

View File

@@ -1,12 +1,11 @@
import type { NetworkStatus } from '$lib/types'
import type { PageLoad } from './$types'
import { PUBLIC_API_PORT } from '$env/static/public'
import { PUBLIC_API_URL } from '$env/static/public'
export const ssr = false
export const load: PageLoad = async ({ fetch, url }) => {
const apiUrl = `${url.protocol}//${url.hostname}:${PUBLIC_API_PORT}`
const response = await fetch(apiUrl)
export const load: PageLoad = async ({ fetch }) => {
const response = await fetch(PUBLIC_API_URL)
const networkStatus: NetworkStatus = await response.json()
return {