feat(admin): 面板补全 — 插件安装表单+已装列表 / LLM组maxTokens展示编辑 / POST admin/llm 部分编辑合并
- 前端: api.ts(adminPluginInstall带config/uninstall/listInstalledPlugins) + types + plugins/InstalledPlugins.tsx(已装列表+安装表单, Miuix) + llm/LlmProviderForm.tsx(maxTokens输入) ; Plugins.tsx去假安装按钮 - 后端 admin_write_llm_channels.go: llmProviderRequest字段改指针, mergeLlmProvider部分合并(省略保留原值), runtimeconfig/models.go Find - 新增测试 admin_write_test TestAdminAddLlmProviderPartialEditPreservesFields - 前端 build + 后端 build/vet/test 全绿; Docs/api-client v0.29 - (面板无法实机登录, 用 react-dom/server 冒烟渲染 LlmModule/PluginsModule)
This commit is contained in:
1 parent
70c9fba529
commit
18b2040c95
10 files changed
+812
-220
No files matched your search
@@ -184,6 +184,21 @@ func GroupFromEnv(env config.LLMConfig) []Group {
|
||||
}}
|
||||
}
|
||||
|
||||
// Find returns the group with the given id, if present. It is the read half of
|
||||
// the admin read-modify-write merge, so a partial edit starts from the stored
|
||||
// group instead of zero values.
|
||||
func Find(groups []Group, id string) (Group, bool) {
|
||||
if strings.TrimSpace(id) == "" {
|
||||
return Group{}, false
|
||||
}
|
||||
for _, g := range groups {
|
||||
if g.ID == id {
|
||||
return g, true
|
||||
}
|
||||
}
|
||||
return Group{}, false
|
||||
}
|
||||
|
||||
// Upsert returns a copy of groups with g inserted or replaced in place by ID,
|
||||
// preserving order. A blank ID is assigned a generated id so a panel save
|
||||
// without an explicit id still produces a stable, addressable group.
|
||||
|
||||
Reference in new issue
Block a user