Compare commits
1 Commits
main
...
cb8722940e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cb8722940e
|
@@ -1,15 +0,0 @@
|
|||||||
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
|
|
||||||
63
README.md
63
README.md
@@ -1,53 +1,42 @@
|
|||||||
# Router Dash
|
# sv
|
||||||
|
|
||||||
[](https://git.freun.dev/repomaa/router-dash/actions?workflow=build.yaml)
|
Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli).
|
||||||
|
|
||||||
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.
|
## Creating a project
|
||||||
|
|
||||||
## Features
|
If you're seeing this, you've probably already done this step. Congrats!
|
||||||
|
|
||||||
- **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
|
```sh
|
||||||
# Install dependencies
|
# create a new project
|
||||||
npm install
|
npx sv create my-app
|
||||||
|
```
|
||||||
|
|
||||||
# Start development server
|
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
|
||||||
npm run dev
|
npm run dev
|
||||||
|
|
||||||
# Type check
|
# or start the server and open the app in a new browser tab
|
||||||
npm run check
|
npm run dev -- --open
|
||||||
|
|
||||||
# Lint and format
|
|
||||||
npm run lint
|
|
||||||
npm run format
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|
||||||
```sh
|
To create a production version of your app:
|
||||||
# Create production build
|
|
||||||
npm run build
|
|
||||||
|
|
||||||
# Preview production build
|
```sh
|
||||||
npm run preview
|
npm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
## License
|
You can preview the production build with `npm run preview`.
|
||||||
|
|
||||||
AGPL-3.0-or-later
|
> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
|
||||||
|
|||||||
@@ -26,11 +26,9 @@
|
|||||||
|
|
||||||
npmDepsHash = "sha256-2XxcsvKeYp+SVBx6Z2uB/34qUr7AderMxXKjm/kS8F0=";
|
npmDepsHash = "sha256-2XxcsvKeYp+SVBx6Z2uB/34qUr7AderMxXKjm/kS8F0=";
|
||||||
|
|
||||||
API_URL = "/api";
|
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
runHook preBuild
|
runHook preBuild
|
||||||
PUBLIC_API_URL="''${API_URL}" npm run build
|
npm run build
|
||||||
runHook postBuild
|
runHook postBuild
|
||||||
'';
|
'';
|
||||||
|
|
||||||
@@ -45,7 +43,7 @@
|
|||||||
|
|
||||||
meta = with pkgs.lib; {
|
meta = with pkgs.lib; {
|
||||||
description = "Router Dashboard - A SvelteKit static web interface";
|
description = "Router Dashboard - A SvelteKit static web interface";
|
||||||
license = licenses.agpl3Only;
|
license = licenses.mit;
|
||||||
platforms = platforms.all;
|
platforms = platforms.all;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
import type { NetworkStatus } from '$lib/types'
|
import type { NetworkStatus } from '$lib/types'
|
||||||
import type { PageLoad } from './$types'
|
import type { PageLoad } from './$types'
|
||||||
import { PUBLIC_API_URL } from '$env/static/public'
|
|
||||||
|
|
||||||
export const ssr = false
|
export const ssr = false
|
||||||
|
|
||||||
export const load: PageLoad = async ({ fetch }) => {
|
const API_PORT = import.meta.env.PUBLIC_API_PORT ?? '8080'
|
||||||
const response = await fetch(PUBLIC_API_URL)
|
|
||||||
|
export const load: PageLoad = async ({ fetch, url }) => {
|
||||||
|
const apiUrl = `${url.protocol}//${url.hostname}:${API_PORT}`
|
||||||
|
const response = await fetch(apiUrl)
|
||||||
const networkStatus: NetworkStatus = await response.json()
|
const networkStatus: NetworkStatus = await response.json()
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user