feat: 增加节点管理 demo 页面

pull/5993/head
zhengkunwang223 4 months ago
parent 2ef7b8b3b1
commit ef03a75aea

@ -93,6 +93,8 @@ func Init() {
migrations.AddShellColumn,
migrations.AddClam,
migrations.AddClamStatus,
migrations.AddHOSTMenu,
})
if err := m.Migrate(); err != nil {
global.LOG.Error(err)

@ -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
},
}

@ -191,7 +191,13 @@
plain
round
size="small"
@click="openBackups(installed.appKey, installed.name, installed.status)"
@click="
openBackups(
installed.appKey,
installed.name,
installed.status,
)
"
v-if="mode === 'installed'"
>
{{ $t('commons.button.backup') }}

@ -258,7 +258,7 @@ require (
google.golang.org/genproto/googleapis/api v0.0.0-20240311132316-a219d84964c2 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect
google.golang.org/grpc v1.63.1 // indirect
google.golang.org/protobuf v1.33.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/apimachinery v0.29.2 // indirect

@ -1165,6 +1165,8 @@ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/cenkalti/backoff.v2 v2.2.1 h1:eJ9UAg01/HIHG987TwxvnzK2MgxXq97YY6rYDpY9aII=

Loading…
Cancel
Save