From a7e08e1341b896f72f2999529b495a8ce9de0f24 Mon Sep 17 00:00:00 2001 From: Wangjunqi123 Date: Wed, 21 Jun 2023 10:58:57 +0800 Subject: [PATCH] add field to agent struct --- gala-ops/server/agentmanager/command.go | 6 +++++ gala-ops/server/database/DBmodel.go | 31 ++++++++++++++++++------- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/gala-ops/server/agentmanager/command.go b/gala-ops/server/agentmanager/command.go index 2ad8c5a1..587b382c 100644 --- a/gala-ops/server/agentmanager/command.go +++ b/gala-ops/server/agentmanager/command.go @@ -32,6 +32,12 @@ func GetPkgVersion(machines []*database.Agent, batch *common.Batch, pkgname stri switch pkgname { case "gala-gopher": m.Gopher_version = v + case "gala-anteater": + m.Anteater_version = v + case "gala-inference": + m.Inference_version = v + case "gala-spider": + m.Spider_version = v } } } diff --git a/gala-ops/server/database/DBmodel.go b/gala-ops/server/database/DBmodel.go index d7e86078..5b629177 100644 --- a/gala-ops/server/database/DBmodel.go +++ b/gala-ops/server/database/DBmodel.go @@ -1,13 +1,26 @@ package database type Agent struct { - ID uint `gorm:"primary_key;AUTO_INCREMENT" json:"id"` - UUID string `gorm:"not null" json:"uuid"` - IP string `gorm:"not null" json:"ip"` - Port string `gorm:"not null" json:"port"` - Department string `json:"department"` - Statu string `gorm:"not null" json:"state"` - Gopher_deploy bool // ture:installed false:uninstalled - Gopher_running bool // true:running false:not running - Gopher_version string `gorm:"type:varchar(20)"` + ID uint `gorm:"primary_key;AUTO_INCREMENT" json:"id"` + UUID string `gorm:"not null" json:"uuid"` + IP string `gorm:"not null" json:"ip"` + Port string `gorm:"not null" json:"port"` + Department string `json:"department"` + State string `gorm:"not null" json:"state"` + Gopher_deploy bool // ture:installed false:uninstalled + Gopher_running bool // true:running false:not running + Gopher_version string `gorm:"type:varchar(20)"` + Gopher_installtime string + Spider_deploy bool // ture:installed false:uninstalled + Spider_running bool // true:running false:not running + Spider_version string `gorm:"type:varchar(20)"` + Spider_installtime string + Anteater_deploy bool // ture:installed false:uninstalled + Anteater_running bool // true:running false:not running + Anteater_version string `gorm:"type:varchar(20)"` + Anteater_installtime string + Inference_deploy bool // ture:installed false:uninstalled + Inference_running bool // true:running false:not running + Inference_version string `gorm:"type:varchar(20)"` + Inference_installtime string } -- Gitee