feat: вкладки конфигуратора только из qt_settings, без JS-копии
- кнопки вкладок строятся из tab_config (порядок, label); удалённая на сервере вкладка (SW) больше не висит статической кнопкой; - TAB_CONFIG на странице содержит только «Other», остальное — из /api/configurator-settings; убраны захардкоженные фильтры категорий по типу и ALWAYS_VISIBLE_TABS; тип без allowlist видит все категории; - настройки грузятся до категорий и до фильтрации по типу конфигурации; - единственный fallback — Go-дефолты в handlers/component.go; always_visible_tabs по умолчанию ["base"]. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
aefe167590
commit
673a207079
4 files changed
+77
-110
No files matched your search
@@ -118,6 +118,11 @@ func (h *ComponentHandler) GetCategories(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, models.DefaultCategories)
|
||||
}
|
||||
|
||||
// GetConfiguratorSettings serves the synced qt_settings. The default*() values
|
||||
// below are the only client-side fallback, used per key when the local cache has
|
||||
// no such setting (e.g. before the first sync); they are not kept in step with
|
||||
// the server — edit qt_settings in MariaDB, not these. The configurator page has
|
||||
// no fallback of its own.
|
||||
func (h *ComponentHandler) GetConfiguratorSettings(c *gin.Context) {
|
||||
s, _ := h.localDB.GetConfiguratorSettings()
|
||||
if s == nil {
|
||||
@@ -131,7 +136,7 @@ func (h *ComponentHandler) GetConfiguratorSettings(c *gin.Context) {
|
||||
s.TabConfig = defaultTabConfig()
|
||||
}
|
||||
if len(s.AlwaysVisibleTabs) == 0 {
|
||||
s.AlwaysVisibleTabs = []string{"base", "storage", "pci"}
|
||||
s.AlwaysVisibleTabs = []string{"base"}
|
||||
}
|
||||
if len(s.RequiredCategories) == 0 {
|
||||
s.RequiredCategories = map[string][]string{"server": {"CPU", "MEM", "BB"}}
|
||||
|
||||
Reference in new issue
Block a user