Skip to content

Commit d30e255

Browse files
authored
Merge pull request #306 from TimothyYe/ui-optimize
New web panel
2 parents 60e8ba3 + 115e811 commit d30e255

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+4458
-2693
lines changed

.github/workflows/go.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- name: Set up Node.js
1212
uses: actions/setup-node@v4
1313
with:
14-
node-version: 20
14+
node-version: 22.13.0
1515
cache: 'npm'
1616
cache-dependency-path: 'web/package-lock.json'
1717
- name: Set up Go

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Set up Node.js
2020
uses: actions/setup-node@v4
2121
with:
22-
node-version: 20
22+
node-version: 22.13.0
2323
cache: 'npm'
2424
cache-dependency-path: 'web/package-lock.json'
2525
- name: Set up Go

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ test_configs/
4444
.DS_Store
4545
/vendor
4646

47+
.next-dev
48+
4749
dist/
4850
out/
4951

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Stage 1: Build the Next.js frontend
2-
FROM node:20-alpine AS web-builder
2+
FROM node:22.13.0-alpine AS web-builder
33
RUN apk add --no-cache libc6-compat
44
WORKDIR /app
55
COPY web/package.json web/package-lock.json ./web/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1342,7 +1342,7 @@ Contributions are welcome! Please feel free to submit a Pull Request.
13421342

13431343
Requirements:
13441344

1345-
- Node.js `18.19.0` or higher
1345+
- Node.js `22.13.0` or higher
13461346
- Go `1.17` or higher
13471347

13481348
The frontend project is built with [Next.js](https://nextjs.org/) and [daisyUI](https://daisyui.com/). To start the development environment, run:

README_CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1340,7 +1340,7 @@ nssm remove YOURSERVICENAME
13401340

13411341
要求:
13421342

1343-
- Node.js `18.19.0` 或更高版本
1343+
- Node.js `22.13.0` 或更高版本
13441344
- Go `1.17` 或更高版本
13451345

13461346
前端项目使用 [Next.js](https://nextjs.org/)[daisyUI](https://daisyui.com/) 构建。要启动开发环境,运行:

assets/snapshots/web-panel.jpg

131 KB
Loading

internal/server/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
log "github.com/sirupsen/logrus"
1717
)
1818

19-
//go:embed out/*
19+
//go:embed all:out
2020
var embeddedFiles embed.FS
2121

2222
type Server struct {

web/api/logs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export interface LogEntry {
44
timestamp: string;
55
level: string;
66
message: string;
7-
fields?: { [key: string]: any };
7+
fields?: Record<string, unknown>;
88
}
99

1010
export interface LogsResponse {
@@ -82,4 +82,4 @@ export async function get_log_levels(credentials: string): Promise<string[]> {
8282
}
8383

8484
return [];
85-
}
85+
}

web/api/provider.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ export interface MultiProviderConfig {
3333
};
3434
}
3535

36+
export type ProviderConfig = MultiProviderConfig[string];
37+
3638
export async function get_provider_settings(credentials: string): Promise<ProviderSetting[]> {
3739
if (credentials) {
3840
const resp = await fetch(get_api_server() + '/api/v1/provider/settings', {
@@ -122,7 +124,7 @@ export async function update_multi_providers(credentials: string, providers: Mul
122124
return false;
123125
}
124126

125-
export async function add_provider_config(credentials: string, providerName: string, config: any): Promise<boolean> {
127+
export async function add_provider_config(credentials: string, providerName: string, config: ProviderConfig): Promise<boolean> {
126128
if (credentials) {
127129
const resp = await fetch(get_api_server() + `/api/v1/providers/${providerName}`, {
128130
method: 'PUT',
@@ -156,4 +158,4 @@ export async function delete_provider_config(credentials: string, providerName:
156158
}
157159

158160
return false;
159-
}
161+
}

0 commit comments

Comments
 (0)