mirror of
https://shylinux.com/x/operation
synced 2025-04-24 17:08:04 +08:00
add some
This commit is contained in:
parent
f1ab27b595
commit
2a2f9e7b3e
@ -16,7 +16,7 @@ type Gateway struct {
|
|||||||
cluster Cluster
|
cluster Cluster
|
||||||
travel travel.Travel
|
travel travel.Travel
|
||||||
gateway gateway.Gateway
|
gateway gateway.Gateway
|
||||||
order string `data:"2"`
|
order string `data:"3"`
|
||||||
fields string `data:"title,content,space,cluster_uid,user_uid"`
|
fields string `data:"title,content,space,cluster_uid,user_uid"`
|
||||||
payfor string `name:"payfor" help:"购买" style:"notice" role:"leader"`
|
payfor string `name:"payfor" help:"购买" style:"notice" role:"leader"`
|
||||||
createProject string `name:"createProject name* repos binary" help:"创建" style:"notice" role:"worker"`
|
createProject string `name:"createProject name* repos binary" help:"创建" style:"notice" role:"worker"`
|
||||||
|
@ -45,20 +45,23 @@ type Cluster struct {
|
|||||||
Price int `gorm:"default:0"`
|
Price int `gorm:"default:0"`
|
||||||
Status uint8 `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 {
|
type Gateway struct {
|
||||||
db.ModelContent
|
db.ModelContent
|
||||||
Space string `gorm:"type:varchar(64)"`
|
Space string `gorm:"type:varchar(64)"`
|
||||||
CloudUID string `gorm:"type:char(32);index"`
|
CloudUID string `gorm:"type:char(32);index"`
|
||||||
ClusterUID 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 {
|
type Project struct {
|
||||||
db.ModelNameInfo
|
db.ModelNameInfo
|
||||||
|
Icons string `gorm:"type:varchar(255)"`
|
||||||
Repos string `gorm:"type:varchar(255)"`
|
Repos string `gorm:"type:varchar(255)"`
|
||||||
Binary string `gorm:"type:varchar(255)"`
|
Binary string `gorm:"type:varchar(255)"`
|
||||||
CloudUID string `gorm:"type:char(32);index"`
|
CloudUID string `gorm:"type:char(32);index"`
|
||||||
|
@ -6,11 +6,11 @@
|
|||||||
"offline": "danger"
|
"offline": "danger"
|
||||||
},
|
},
|
||||||
"icons": {
|
"icons": {
|
||||||
"cluster": "https://img.icons8.com/officel/80/activity-grid.png",
|
"cluster": "activity-grid.png",
|
||||||
"gateway": "https://img.icons8.com/officel/80/activity-grid.png",
|
"gateway": "activity-grid.png",
|
||||||
"template": "https://img.icons8.com/officel/80/activity-grid.png",
|
"template": "activity-grid.png",
|
||||||
"project": "https://img.icons8.com/officel/80/activity-grid.png",
|
"project": "activity-grid.png",
|
||||||
"product": "https://img.icons8.com/officel/80/activity-grid.png"
|
"product": "activity-grid.png"
|
||||||
},
|
},
|
||||||
"input": {
|
"input": {
|
||||||
"My Cloud": "我的系统",
|
"My Cloud": "我的系统",
|
||||||
|
@ -34,7 +34,11 @@ func (s product) List(m *ice.Message, arg ...string) {
|
|||||||
} else {
|
} else {
|
||||||
m.PushAction(s.Open)
|
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.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.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))
|
s.Fields(m, model.UID, s.KeyAS(s.cluster, model.SPACE)).SelectJoin(m, s.cluster, s.Keys(s.cluster, model.SPACE))
|
||||||
|
@ -16,8 +16,8 @@ type project struct {
|
|||||||
cluster Cluster
|
cluster Cluster
|
||||||
gateway Gateway
|
gateway Gateway
|
||||||
order string `data:"4"`
|
order string `data:"4"`
|
||||||
fields string `data:"name,repos,binary,gateway_uid"`
|
fields string `data:"name,icons,repos,binary,gateway_uid"`
|
||||||
create string `name:"create name* repos binary" style:"notice" role:"worker"`
|
create string `name:"create name* icons repos binary" style:"notice" role:"worker"`
|
||||||
scanProduct string `name:"scanProduct" help:"扫描" role:"worker"`
|
scanProduct string `name:"scanProduct" help:"扫描" role:"worker"`
|
||||||
open string `name:"open" role:"worker"`
|
open string `name:"open" role:"worker"`
|
||||||
}
|
}
|
||||||
|
@ -9,11 +9,11 @@ import (
|
|||||||
|
|
||||||
type template struct {
|
type template struct {
|
||||||
Table
|
Table
|
||||||
order string `data:"3"`
|
order string `data:"2"`
|
||||||
fields string `data:"name,info,repos,binary,template_status"`
|
fields string `data:"name,info,title,icons,repos,binary,template_status"`
|
||||||
create string `name:"create name* info repos* binary*"`
|
create string `name:"create name* info title icons repos* binary*"`
|
||||||
modify string `name:"modify name* info repos* binary*" style:"danger"`
|
modify string `name:"modify name* info title icons repos* binary*" style:"danger"`
|
||||||
install string `name:"install gateway_uid* name*" style:"notice" role:"worker"`
|
install string `name:"install name* gateway_uid*" style:"notice" role:"worker"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s template) Create(m *ice.Message, arg ...string) {
|
func (s template) Create(m *ice.Message, arg ...string) {
|
||||||
@ -49,7 +49,9 @@ func (s template) List(m *ice.Message, arg ...string) {
|
|||||||
m.Display("")
|
m.Display("")
|
||||||
}
|
}
|
||||||
func (s template) Install(m *ice.Message, arg ...string) {
|
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) {
|
func (s template) Offline(m *ice.Message, arg ...string) {
|
||||||
s.Update(m, []string{model.STATUS, kit.Format(TemplateOffline)})
|
s.Update(m, []string{model.STATUS, kit.Format(TemplateOffline)})
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
Volcanos(chat.ONIMPORT, {
|
Volcanos(chat.ONIMPORT, {
|
||||||
_init: function(can, msg) {
|
_init: function(can, msg) {
|
||||||
can.onimport.myView(can, msg, function(value) { return [
|
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.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value)]},
|
||||||
{view: html.OUTPUT, list: [value.info||value.binary||value.repos]},
|
{view: html.OUTPUT, list: [value.info||value.binary||value.repos]},
|
||||||
] })
|
] })
|
||||||
|
Loading…
x
Reference in New Issue
Block a user