diff --git a/.github/workflows/ui-tests.yml b/.github/workflows/ui-tests.yml index 235f7b4a..b0aded15 100644 --- a/.github/workflows/ui-tests.yml +++ b/.github/workflows/ui-tests.yml @@ -19,9 +19,6 @@ jobs: run-tests: runs-on: ubuntu-latest - defaults: - run: - working-directory: ui-svelte steps: - uses: actions/checkout@v4 @@ -32,11 +29,5 @@ jobs: cache: 'npm' cache-dependency-path: ui-svelte/package-lock.json - - name: Install dependencies - run: npm ci - - - name: Type check - run: npm run check - - - name: Run tests - run: npm test + - name: Run UI tests + run: make test-ui diff --git a/AGENTS.md b/AGENTS.md index 471ea06a..13e1f9c2 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -24,6 +24,7 @@ llama-swap is a light weight, transparent proxy server that provides automatic m - Run `gofmt -l .` before committing to verify formatting. Fix any reported files with `gofmt -w `. - Use `make test-dev` after running new tests for a quick over all test run. This runs `go test` and `staticcheck`. Fix any static checking errors. Use this only when changes are made to any code under the `proxy/` directory - Use `make test-all` before completing work. This includes long running concurrency tests. +- Use `make test-ui` after making changes to the UI in ui-svelte/ ### Commit message example format: diff --git a/Makefile b/Makefile index 7b852242..243d16c3 100644 --- a/Makefile +++ b/Makefile @@ -97,6 +97,9 @@ wol-proxy: $(BUILD_DIR) @echo "Building wol-proxy" go build -o $(BUILD_DIR)/wol-proxy-$(GOOS)-$(GOARCH)-$(shell date +%Y-%m-%d) cmd/wol-proxy/wol-proxy.go +test-ui: + cd ui-svelte && npm ci && npm run check && npm test + # Phony targets -.PHONY: all clean ui mac windows simple-responder simple-responder-windows test test-all test-dev wol-proxy +.PHONY: all clean ui mac windows simple-responder simple-responder-windows test test-all test-dev test-ui wol-proxy .PHONE: linux linux-arm64 linux-amd64 diff --git a/ui-svelte/src/components/ActivityStats.svelte b/ui-svelte/src/components/ActivityStats.svelte new file mode 100644 index 00000000..527967d3 --- /dev/null +++ b/ui-svelte/src/components/ActivityStats.svelte @@ -0,0 +1,72 @@ + + +
+ + {#if !$histogramCollapsed} + {#if stats.histogramData} + + {:else} +
+ No token speed data yet +
+ {/if} + {/if} +
+
Requests
+
Processed
+
Generated
+
+ {nf.format(stats.totalRequests)} completed, + {nf.format(stats.inFlightRequests)} waiting +
+
+ {nf.format(stats.totalInputTokens)} tokens +
+
+ {nf.format(stats.totalOutputTokens)} tokens +
+
+
diff --git a/ui-svelte/src/components/StatsPanel.svelte b/ui-svelte/src/components/StatsPanel.svelte deleted file mode 100644 index 33075e13..00000000 --- a/ui-svelte/src/components/StatsPanel.svelte +++ /dev/null @@ -1,167 +0,0 @@ - - -
-
- - - - - - - - - - - - - - - - - - - - - -
Requests - Processed - - Generated - - Token Stats (tokens/sec) -
-
- Completed: {nf.format(stats.totalRequests)} - Waiting: {nf.format(stats.inFlightRequests)} -
-
-
- {nf.format(stats.totalInputTokens)} - tokens -
-
-
- {nf.format(stats.totalOutputTokens)} - tokens -
-
-
-
-
-
P50
-
- {stats.tokenStats.p50} -
-
- -
-
P95
-
- {stats.tokenStats.p95} -
-
- -
-
P99
-
- {stats.tokenStats.p99} -
-
-
- {#if stats.histogramData} - - {/if} -
-
-
-
diff --git a/ui-svelte/src/components/TokenHistogram.svelte b/ui-svelte/src/components/TokenHistogram.svelte index 5523c571..0d4fc45d 100644 --- a/ui-svelte/src/components/TokenHistogram.svelte +++ b/ui-svelte/src/components/TokenHistogram.svelte @@ -1,23 +1,11 @@