mirror of
https://github.com/mudler/LocalAI.git
synced 2026-04-07 00:14:46 -04:00
fix(ui): pass by needed values to unbreak model editor
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
@@ -55,20 +55,22 @@ func GetEditModelPage(cl *config.ModelConfigLoader, appConfig *config.Applicatio
|
||||
|
||||
// Render the edit page with the current configuration
|
||||
templateData := struct {
|
||||
Title string
|
||||
ModelName string
|
||||
Config *config.ModelConfig
|
||||
ConfigJSON string
|
||||
ConfigYAML string
|
||||
BaseURL string
|
||||
Version string
|
||||
Title string
|
||||
ModelName string
|
||||
Config *config.ModelConfig
|
||||
ConfigJSON string
|
||||
ConfigYAML string
|
||||
BaseURL string
|
||||
Version string
|
||||
DisableRuntimeSettings bool
|
||||
}{
|
||||
Title: "LocalAI - Edit Model " + modelName,
|
||||
ModelName: modelName,
|
||||
Config: &modelConfig,
|
||||
ConfigYAML: string(configData),
|
||||
BaseURL: httpUtils.BaseURL(c),
|
||||
Version: internal.PrintableVersion(),
|
||||
Title: "LocalAI - Edit Model " + modelName,
|
||||
ModelName: modelName,
|
||||
Config: &modelConfig,
|
||||
ConfigYAML: string(configData),
|
||||
BaseURL: httpUtils.BaseURL(c),
|
||||
Version: internal.PrintableVersion(),
|
||||
DisableRuntimeSettings: appConfig.DisableRuntimeSettings,
|
||||
}
|
||||
|
||||
return c.Render(http.StatusOK, "views/model-editor", templateData)
|
||||
|
||||
@@ -31,9 +31,10 @@ func RegisterLocalAIRoutes(router *echo.Echo,
|
||||
// Import model page
|
||||
router.GET("/import-model", func(c echo.Context) error {
|
||||
return c.Render(200, "views/model-editor", map[string]interface{}{
|
||||
"Title": "LocalAI - Import Model",
|
||||
"BaseURL": middleware.BaseURL(c),
|
||||
"Version": internal.PrintableVersion(),
|
||||
"Title": "LocalAI - Import Model",
|
||||
"BaseURL": middleware.BaseURL(c),
|
||||
"Version": internal.PrintableVersion(),
|
||||
"DisableRuntimeSettings": appConfig.DisableRuntimeSettings,
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -539,8 +539,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "views/partials/footer" .}}
|
||||
</div>
|
||||
|
||||
<!-- Include JS-YAML library -->
|
||||
|
||||
Reference in New Issue
Block a user