This commit is contained in:
IT 老营长 @云轩领航-创始人 2025-03-15 20:27:02 +08:00
parent f1ab27b595
commit 2a2f9e7b3e
7 changed files with 31 additions and 22 deletions

View File

@ -16,7 +16,7 @@ type Gateway struct {
cluster Cluster
travel travel.Travel
gateway gateway.Gateway
order string `data:"2"`
order string `data:"3"`
fields string `data:"title,content,space,cluster_uid,user_uid"`
payfor string `name:"payfor" help:"购买" style:"notice" role:"leader"`
createProject string `name:"createProject name* repos binary" help:"创建" style:"notice" role:"worker"`

View File

@ -45,20 +45,23 @@ type Cluster struct {
Price int `gorm:"default:0"`
Status uint8 `gorm:"default:0"`
}
type Template struct {
db.ModelNameInfo
Title string `gorm:"type:varchar(64)"`
Icons string `gorm:"type:varchar(255)"`
Repos string `gorm:"type:varchar(255)"`
Binary string `gorm:"type:varchar(255)"`
Status uint8 `gorm:"default:0"`
}
type Gateway struct {
db.ModelContent
Space string `gorm:"type:varchar(64)"`
CloudUID string `gorm:"type:char(32);index"`
ClusterUID string `gorm:"type:char(32);index"`
}
type Template struct {
db.ModelNameInfo
Repos string `gorm:"type:varchar(255)"`
Binary string `gorm:"type:varchar(255)"`
Status uint8 `gorm:"default:0"`
}
type Project struct {
db.ModelNameInfo
Icons string `gorm:"type:varchar(255)"`
Repos string `gorm:"type:varchar(255)"`
Binary string `gorm:"type:varchar(255)"`
CloudUID string `gorm:"type:char(32);index"`

View File

@ -6,11 +6,11 @@
"offline": "danger"
},
"icons": {
"cluster": "https://img.icons8.com/officel/80/activity-grid.png",
"gateway": "https://img.icons8.com/officel/80/activity-grid.png",
"template": "https://img.icons8.com/officel/80/activity-grid.png",
"project": "https://img.icons8.com/officel/80/activity-grid.png",
"product": "https://img.icons8.com/officel/80/activity-grid.png"
"cluster": "activity-grid.png",
"gateway": "activity-grid.png",
"template": "activity-grid.png",
"project": "activity-grid.png",
"product": "activity-grid.png"
},
"input": {
"My Cloud": "我的系统",

View File

@ -34,7 +34,11 @@ func (s product) List(m *ice.Message, arg ...string) {
} else {
m.PushAction(s.Open)
}
m.Display("")
if m.Length() == 0 {
m.SetResult().Echo("请到「云项目」扫描服务")
} else {
m.Display("")
}
s.Fields(m, model.UID, s.Keys(s.gateway, model.UID), s.KeyAS(s.project, mdb.NAME)).SelectJoin(m, s.project, s.Keys(s.project, mdb.NAME), s.Keys(s.gateway, model.UID))
s.Fields(m, model.UID, s.Keys(s.cluster, model.UID), s.KeyAS(s.gateway, model.TITLE), s.KeyAS(s.gateway, model.SPACE)).SelectJoin(m, s.gateway, s.Keys(s.cluster, model.UID), s.Keys(s.gateway, model.SPACE), s.Keys(s.gateway, model.TITLE))
s.Fields(m, model.UID, s.KeyAS(s.cluster, model.SPACE)).SelectJoin(m, s.cluster, s.Keys(s.cluster, model.SPACE))

View File

@ -16,8 +16,8 @@ type project struct {
cluster Cluster
gateway Gateway
order string `data:"4"`
fields string `data:"name,repos,binary,gateway_uid"`
create string `name:"create name* repos binary" style:"notice" role:"worker"`
fields string `data:"name,icons,repos,binary,gateway_uid"`
create string `name:"create name* icons repos binary" style:"notice" role:"worker"`
scanProduct string `name:"scanProduct" help:"扫描" role:"worker"`
open string `name:"open" role:"worker"`
}

View File

@ -9,11 +9,11 @@ import (
type template struct {
Table
order string `data:"3"`
fields string `data:"name,info,repos,binary,template_status"`
create string `name:"create name* info repos* binary*"`
modify string `name:"modify name* info repos* binary*" style:"danger"`
install string `name:"install gateway_uid* name*" style:"notice" role:"worker"`
order string `data:"2"`
fields string `data:"name,info,title,icons,repos,binary,template_status"`
create string `name:"create name* info title icons repos* binary*"`
modify string `name:"modify name* info title icons repos* binary*" style:"danger"`
install string `name:"install name* gateway_uid*" style:"notice" role:"worker"`
}
func (s template) Create(m *ice.Message, arg ...string) {
@ -49,7 +49,9 @@ func (s template) List(m *ice.Message, arg ...string) {
m.Display("")
}
func (s template) Install(m *ice.Message, arg ...string) {
m.Cmdy(project{}, s.Create, m.OptionSimple("name,repos,binary"))
msg := m.Cmd(Gateway{}, m.Option(model.CLOUD_UID), m.Option(model.GATEWAY_UID))
m.Option(model.SPACE, kit.Keys(msg.Append(model.CLUSTER_SPACE), msg.Append(model.SPACE)))
m.Cmdy(project{}, s.Create, m.OptionSimple("name,icons,repos,binary"))
}
func (s template) Offline(m *ice.Message, arg ...string) {
s.Update(m, []string{model.STATUS, kit.Format(TemplateOffline)})

View File

@ -1,7 +1,7 @@
Volcanos(chat.ONIMPORT, {
_init: function(can, msg) {
can.onimport.myView(can, msg, function(value) { return [
{view: html.TITLE, list: [value.name, can.onimport.titleAction(can, value)]},
{view: html.TITLE, list: [value.title||value.name, can.onimport.titleAction(can, value)]},
{view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value)]},
{view: html.OUTPUT, list: [value.info||value.binary||value.repos]},
] })