更新若干功能

This commit is contained in:
李琦
2026-08-15 17:18:00 +08:00
parent 4954295961
commit 6a81e479ef
77 changed files with 8165 additions and 2372 deletions

View File

@@ -9,6 +9,7 @@ type Project struct {
Description string `json:"description"`
GroupID int64 `json:"groupId"`
GroupName string `json:"groupName"`
Icon string `json:"icon"` // 本地 dataURL不同步
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
Stats ProjectStats `json:"stats"`
@@ -256,7 +257,7 @@ type AppSettings struct {
AIProvider string `json:"aiProvider"` // spark | deepseek
SparkKey string `json:"sparkKey"`
DeepSeekKey string `json:"deepSeekKey"`
// SyncAPIKeys 开启后 API Key 会加密同步到 MySQL(密钥由登录密码派生,服务器不可解密)。
// SyncAPIKeys 开启后 AI API Key 会加密同步到云端(密钥由登录密码派生,服务器不可解密)。
SyncAPIKeys bool `json:"syncApiKeys"`
// 用户头像AvatarMode 为 ""(未设置) | base64 | url | pathAvatarValue 依模式存 dataURL / 图片 URL / 本地文件路径。
AvatarMode string `json:"avatarMode"`
@@ -330,7 +331,7 @@ type Dashboard struct {
type FileStorageConfig struct {
Mode string `json:"mode"` // local | server
BaseURL string `json:"baseUrl"` // nl-pms-api 地址,如 http://192.168.1.10:8788
APIKey string `json:"apiKey"` // 上传密钥Authorization: Bearer <apiKey>
APIKey string `json:"apiKey"` // 已废弃;上传改用登录 JWT
}
// ServerFile 是 nl-pms-api 素材库中的一条文件记录(含上传者用户名与公开访问 URL
@@ -353,13 +354,9 @@ type ServerFileList struct {
Items []ServerFile `json:"items"`
}
// SyncConfig 是 MySQL 同步服务器的连接配置(保存在本地 SQLite
// SyncConfig 是 nl-pms-api 的 HTTP 基址配置(保存在本地 SQLite meta)。
type SyncConfig struct {
Host string `json:"host"`
Port int `json:"port"`
User string `json:"user"`
Password string `json:"password"`
Database string `json:"database"`
BaseURL string `json:"baseUrl"`
}
// SyncStatus 描述当前登录与同步状态,供设置页展示。
@@ -435,37 +432,65 @@ type CloneInput struct {
Description string `json:"description"`
}
// LaunchApp 是启动台保存的应用(含启停命令)。
type LaunchApp struct {
// LaunchCategory 是启动台一级分类(用户自定义,仅本地)。
type LaunchCategory struct {
ID int64 `json:"id"`
Name string `json:"name"`
Kind string `json:"kind"`
Port int `json:"port"`
Dir string `json:"dir"`
StartCmd string `json:"startCmd"`
StopCmd string `json:"stopCmd"`
LastPID int64 `json:"lastPid"`
Sort int `json:"sort"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
// LaunchApp 是启动台保存的应用(含启停命令)。
type LaunchApp struct {
ID int64 `json:"id"`
Name string `json:"name"`
Kind string `json:"kind"`
Port int `json:"port"`
Dir string `json:"dir"`
StartCmd string `json:"startCmd"`
StopCmd string `json:"stopCmd"`
LastPID int64 `json:"lastPid"`
Icon string `json:"icon"` // dataURL本地抓取或用户选图
CategoryID int64 `json:"categoryId"` // 一级分类 id0=未归类
Category string `json:"category"` // 二级分类(自由文本)
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
// LaunchEntry 是启动台卡片条目:保存的应用与实时扫描到的监听进程合并后的视图。
type LaunchEntry struct {
ID int64 `json:"id"` // launch_apps id0 表示未保存的扫描条目
Name string `json:"name"`
Kind string `json:"kind"`
Port int `json:"port"`
Dir string `json:"dir"`
StartCmd string `json:"startCmd"`
StopCmd string `json:"stopCmd"`
Running bool `json:"running"`
PID int32 `json:"pid"`
Exe string `json:"exe"`
Cmdline string `json:"cmdline"`
Ports []int `json:"ports"`
CPU float64 `json:"cpu"` // 占全机 CPU 百分比
MemMB float64 `json:"memMB"` // 常驻内存
IOKBs float64 `json:"ioKBs"` // 磁盘读写吞吐
ID int64 `json:"id"` // launch_apps id0 表示未保存的扫描条目
Name string `json:"name"`
Kind string `json:"kind"`
Port int `json:"port"`
Dir string `json:"dir"`
StartCmd string `json:"startCmd"`
StopCmd string `json:"stopCmd"`
Running bool `json:"running"`
PID int32 `json:"pid"`
Exe string `json:"exe"`
Cmdline string `json:"cmdline"`
Ports []int `json:"ports"`
CPU float64 `json:"cpu"` // 占全机 CPU 百分比
MemMB float64 `json:"memMB"` // 常驻内存
IOKBs float64 `json:"ioKBs"` // 磁盘读写吞吐
ProjectID int64 `json:"projectId"` // 若目录匹配到「我的项目」则带上
Icon string `json:"icon"` // dataURL
CategoryID int64 `json:"categoryId"` // 一级分类
Category string `json:"category"` // 二级分类
// Status: starting | running | stopped | failed内存态失败会标红
Status string `json:"status"`
LastError string `json:"lastError"`
LastLog string `json:"lastLog"`
}
// LaunchLogLine 启动台本地进程日志行(不同步)。
type LaunchLogLine struct {
ID int64 `json:"id"`
AppID int64 `json:"appId"`
Level string `json:"level"`
Line string `json:"line"`
CreatedAt string `json:"createdAt"`
}
// LaunchSuggest 是按项目种类推荐的启停命令。
@@ -473,3 +498,16 @@ type LaunchSuggest struct {
Start []string `json:"start"`
Stop []string `json:"stop"`
}
// LaunchProfile 根据目录/项目探测出的启动草稿(种类、推荐命令、默认端口)。
type LaunchProfile struct {
Name string `json:"name"`
Kind string `json:"kind"`
Port int `json:"port"`
Dir string `json:"dir"`
StartCmd string `json:"startCmd"`
StopCmd string `json:"stopCmd"`
Start []string `json:"start"`
Stop []string `json:"stop"`
ProjectID int64 `json:"projectId"`
}