mirror of
https://gitcode.com/JianFeeeee/ModelRouter.git
synced 2026-09-21 17:38:00 +00:00
feat(templates): source templates for multi-key balancing
A template stores every source field except name and api_key, so operators spin up N key-bearing sources from one shared skeleton instead of duplicating the whole source block N times. - config: SourceTemplate type + RuntimeConfig.SourceTemplates stored in runtime.json alongside runtime sources - store: UpsertTemplate / ListTemplates / RemoveTemplate - core: Templates / SaveTemplate / RemoveTemplate - gateway: GET/POST/DELETE /api/source_templates - webui: source list gains a Templates button opening a manager with per-template edit/delete; the add-source dialog gains 'from template' (event-delegated picker) and 'as template' (card modal) buttons in its header; z-index fixed so the template editor layers above the manager
This commit is contained in:
@ -218,6 +218,8 @@ func (g *Gateway) routes(w http.ResponseWriter, r *http.Request) {
|
||||
g.handleAdaptersAPI(w, r)
|
||||
case r.URL.Path == "/api/sources" || strings.HasPrefix(r.URL.Path, "/api/sources/"):
|
||||
g.handleSourcesAPI(w, r)
|
||||
case r.URL.Path == "/api/source_templates" || strings.HasPrefix(r.URL.Path, "/api/source_templates/"):
|
||||
g.handleSourceTemplatesAPI(w, r)
|
||||
case r.URL.Path == "/api/chat":
|
||||
g.handleChat(w, r)
|
||||
case r.URL.Path == "/api/status":
|
||||
|
||||
Reference in New Issue
Block a user