2023-01-06 10:09:23 +08:00
|
|
|
package model
|
|
|
|
|
2023-03-23 18:03:09 +08:00
|
|
|
// Node 节点信息
|
2023-01-06 10:09:23 +08:00
|
|
|
type Node struct {
|
2023-03-23 18:03:09 +08:00
|
|
|
NodeId int64 `xorm:"not null pk autoincr INT(11)" json:"nodeId"`
|
|
|
|
NodeGuid string `xorm:"varchar(100) index" json:"nodeGuid"`
|
|
|
|
NodeName string `xorm:"varchar(100)" json:"nodeName"`
|
|
|
|
NodeType int `xorm:"not null SMALLINT default 0" json:"nodeType"`
|
|
|
|
NodeStatus int `xorm:"not null SMALLINT default 0" json:"nodeStatus"`
|
|
|
|
Platform string `xorm:"varchar(100)" json:"platform,omitempty"`
|
|
|
|
PlatformVersion string `xorm:"varchar(100)" json:"platformVersion,omitempty"`
|
|
|
|
CPU string `xorm:"varchar(1000)" json:"cpu,omitempty"`
|
|
|
|
MemTotal uint64 `xorm:"BIGINT" json:"memTotal,omitempty"`
|
|
|
|
DiskTotal uint64 `xorm:"BIGINT" json:"diskTotal,omitempty"`
|
|
|
|
SwapTotal uint64 `xorm:"BIGINT" json:"swapTotal,omitempty"`
|
|
|
|
Arch string `xorm:"varchar(1000)" json:"arch,omitempty"`
|
|
|
|
Virtualization string `xorm:"varchar(1000)" json:"virtualization,omitempty"`
|
|
|
|
BootTime uint64 `xorm:"BIGINT" json:"bootTime,omitempty"`
|
|
|
|
IP string `xorm:"varchar(100)" json:"ip"`
|
2023-06-17 09:38:26 +08:00
|
|
|
LocalIP string `xorm:"VARCHAR(100)" json:"localIP"` //本地局域网IP地址
|
2023-03-23 18:03:09 +08:00
|
|
|
IsGpu bool `xorm:"TINYINT(1) default 0" json:"isGpu"`
|
|
|
|
IsTaskExecute bool `xorm:"TINYINT(1) default 0" json:"isTaskExecute"`
|
|
|
|
CountryCode string `xorm:"varchar(100)" json:"countryCode,omitempty"`
|
|
|
|
Version string `xorm:"varchar(100)" json:"version,omitempty"`
|
|
|
|
CreateAt int64 `xorm:"created" json:"createAt"`
|
|
|
|
UpdateAt int64 `xorm:"updated" json:"updateAt"`
|
2023-01-06 10:09:23 +08:00
|
|
|
}
|
2023-06-17 09:38:26 +08:00
|
|
|
|
|
|
|
func GetNodeName(nodeId int64) string {
|
|
|
|
item := new(Node)
|
|
|
|
h, err := DB.ID(nodeId).Get(item)
|
|
|
|
if err != nil || !h {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
return item.NodeName
|
|
|
|
}
|