Skip to content

Commit 352b8aa

Browse files
committed
fix(ui): pass by needed values to unbreak model editor
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
1 parent df792d6 commit 352b8aa

File tree

3 files changed

+19
-18
lines changed

3 files changed

+19
-18
lines changed

core/http/endpoints/localai/edit_model.go

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,22 @@ func GetEditModelPage(cl *config.ModelConfigLoader, appConfig *config.Applicatio
5555

5656
// Render the edit page with the current configuration
5757
templateData := struct {
58-
Title string
59-
ModelName string
60-
Config *config.ModelConfig
61-
ConfigJSON string
62-
ConfigYAML string
63-
BaseURL string
64-
Version string
58+
Title string
59+
ModelName string
60+
Config *config.ModelConfig
61+
ConfigJSON string
62+
ConfigYAML string
63+
BaseURL string
64+
Version string
65+
DisableRuntimeSettings bool
6566
}{
66-
Title: "LocalAI - Edit Model " + modelName,
67-
ModelName: modelName,
68-
Config: &modelConfig,
69-
ConfigYAML: string(configData),
70-
BaseURL: httpUtils.BaseURL(c),
71-
Version: internal.PrintableVersion(),
67+
Title: "LocalAI - Edit Model " + modelName,
68+
ModelName: modelName,
69+
Config: &modelConfig,
70+
ConfigYAML: string(configData),
71+
BaseURL: httpUtils.BaseURL(c),
72+
Version: internal.PrintableVersion(),
73+
DisableRuntimeSettings: appConfig.DisableRuntimeSettings,
7274
}
7375

7476
return c.Render(http.StatusOK, "views/model-editor", templateData)

core/http/routes/localai.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ func RegisterLocalAIRoutes(router *echo.Echo,
3131
// Import model page
3232
router.GET("/import-model", func(c echo.Context) error {
3333
return c.Render(200, "views/model-editor", map[string]interface{}{
34-
"Title": "LocalAI - Import Model",
35-
"BaseURL": middleware.BaseURL(c),
36-
"Version": internal.PrintableVersion(),
34+
"Title": "LocalAI - Import Model",
35+
"BaseURL": middleware.BaseURL(c),
36+
"Version": internal.PrintableVersion(),
37+
"DisableRuntimeSettings": appConfig.DisableRuntimeSettings,
3738
})
3839
})
3940

core/http/views/model-editor.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,8 +539,6 @@ <h2 class="text-xl font-semibold text-[var(--color-text-primary)] flex items-cen
539539
</div>
540540
</div>
541541
</div>
542-
543-
{{template "views/partials/footer" .}}
544542
</div>
545543

546544
<!-- Include JS-YAML library -->

0 commit comments

Comments
 (0)