diff --git a/backend/init/migration/migrate.go b/backend/init/migration/migrate.go index 8711fb0fe..926f7f510 100644 --- a/backend/init/migration/migrate.go +++ b/backend/init/migration/migrate.go @@ -93,6 +93,8 @@ func Init() { migrations.AddShellColumn, migrations.AddClam, migrations.AddClamStatus, + + migrations.AddHOSTMenu, }) if err := m.Migrate(); err != nil { global.LOG.Error(err) diff --git a/backend/init/migration/migrations/v_1_10.go b/backend/init/migration/migrations/v_1_10.go index c87545da6..e0ac6be2f 100644 --- a/backend/init/migration/migrations/v_1_10.go +++ b/backend/init/migration/migrations/v_1_10.go @@ -288,3 +288,29 @@ var AddClamStatus = &gormigrate.Migration{ return nil }, } + +var AddHOSTMenu = &gormigrate.Migration{ + ID: "20240722-add-xpack-host-menu", + Migrate: func(tx *gorm.DB) error { + var ( + setting model.Setting + menu dto.XpackHideMenu + ) + tx.Model(&model.Setting{}).Where("key", "XpackHideMenu").First(&setting) + if err := json.Unmarshal([]byte(setting.Value), &menu); err != nil { + return err + } + menu.Children = append(menu.Children, dto.XpackHideMenu{ + ID: "7", + Title: "多主机", + Path: "/xpack/multihost/manage", + Label: "Multihost", + IsCheck: true, + }) + data, err := json.Marshal(menu) + if err != nil { + return err + } + return tx.Model(&model.Setting{}).Where("key", "XpackHideMenu").Updates(map[string]interface{}{"value": string(data)}).Error + }, +} diff --git a/frontend/src/views/app-store/installed/index.vue b/frontend/src/views/app-store/installed/index.vue index 0c17cb3b6..4bbb6494c 100644 --- a/frontend/src/views/app-store/installed/index.vue +++ b/frontend/src/views/app-store/installed/index.vue @@ -176,57 +176,63 @@ - - {{ $t('database.loadBackup') }} - - - {{ $t('commons.button.backup') }} - - - {{ $t('commons.button.ignore') }} - - - {{ $t('commons.button.upgrade') }} - - -
- - {{ $t('app.version') }}:{{ installed.version }} - + + {{ $t('database.loadBackup') }} + + + {{ $t('commons.button.backup') }} + + + {{ $t('commons.button.ignore') }} + + + {{ $t('commons.button.upgrade') }} + +
+
+ + {{ $t('app.version') }}:{{ installed.version }} +