mirror of
https://shylinux.com/x/operation
synced 2025-07-01 21:21:19 +08:00
opt some
This commit is contained in:
parent
832fe1fc15
commit
2d2774c7f2
71
src/operation/cluster.go
Normal file
71
src/operation/cluster.go
Normal file
@ -0,0 +1,71 @@
|
||||
package operation
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
"shylinux.com/x/icebergs/base/web"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"2025-dev.shylinux.com/x/20250215-cluster/src/travel"
|
||||
"shylinux.com/x/operation/src/operation/model"
|
||||
)
|
||||
|
||||
type cluster struct {
|
||||
Table
|
||||
travel travel.Travel
|
||||
order string `data:"1"`
|
||||
fields string `data:"title,content,space,total,stock,price"`
|
||||
payfor string `name:"payfor" help:"购买" style:"notice" role:"leader"`
|
||||
scanService string `name:"scanService" help:"扫描"`
|
||||
modify string `name:"modify title content price" style:"danger"`
|
||||
}
|
||||
|
||||
func (s cluster) Scan(m *ice.Message, arg ...string) {
|
||||
m.Cmd(s.travel, s.travel.Concurrent, "2025-dev.shylinux.com/x/20250215-cluster", "web.chat.dev.cluster.travel").Table(func(value ice.Maps) {
|
||||
s.InsertIfNeed(m, web.SPACE, value[web.SPACE])
|
||||
})
|
||||
m.ProcessRefresh()
|
||||
}
|
||||
func (s cluster) List(m *ice.Message, arg ...string) {
|
||||
if s.Select(m); m.Length() == 0 {
|
||||
if m.IsTech() {
|
||||
m.EchoInfoButton("请扫描集群", s.Scan)
|
||||
} else {
|
||||
m.Echo("请联系平台管理员部署集群").Action()
|
||||
}
|
||||
} else {
|
||||
if m.Display(""); m.IsTech() {
|
||||
m.Table(func(value ice.Maps) {
|
||||
if kit.Int(value[model.STOCK]) > 0 {
|
||||
m.PushButton(s.Payfor, s.ScanService, s.Modify)
|
||||
} else {
|
||||
m.PushButton(s.ScanService, s.Modify)
|
||||
}
|
||||
}).Action(s.Scan)
|
||||
} else if s.IsLeader(m) {
|
||||
m.Table(func(value ice.Maps) {
|
||||
if kit.Int(value[model.STOCK]) > 0 {
|
||||
m.PushButton(s.Payfor)
|
||||
} else {
|
||||
m.PushButton()
|
||||
}
|
||||
}).Action()
|
||||
} else {
|
||||
m.PushAction().Action()
|
||||
}
|
||||
}
|
||||
}
|
||||
func (s cluster) Payfor(m *ice.Message, arg ...string) {
|
||||
m.Option(model.CLUSTER_UID, m.Option(model.UID))
|
||||
m.Cmdy(gateway{}, s.Payfor, arg)
|
||||
}
|
||||
func (s cluster) ScanService(m *ice.Message, arg ...string) {
|
||||
m.Option(model.CLUSTER_UID, m.Option(model.UID))
|
||||
m.Cmdy(gateway{}, s.Scan, arg)
|
||||
s.Update(m, m.AppendSimple(model.TOTAL, model.STOCK), m.OptionSimple(model.UID)...)
|
||||
m.ProcessRefresh()
|
||||
}
|
||||
func (s cluster) Modify(m *ice.Message, arg ...string) {
|
||||
s.Update(m, s.TransPrice(m, arg), m.OptionSimple(model.UID)...)
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(cluster{}) }
|
9
src/operation/cluster.js
Normal file
9
src/operation/cluster.js
Normal file
@ -0,0 +1,9 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
can.onimport.myView(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list: [value.title||value.space, value.price+" 元/月", can.onimport.titleAction(can, value)]},
|
||||
{view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value)]},
|
||||
{view: html.OUTPUT, list: [value.content]},
|
||||
] }, function() {})
|
||||
},
|
||||
})
|
@ -31,6 +31,8 @@ func (s Table) RewriteAppend(m *ice.Message, arg ...string) *ice.Message {
|
||||
value = UserCloudRole(kit.Int(value)).String()
|
||||
case model.CLOUD_TYPE:
|
||||
value = CloudType(kit.Int(value)).String()
|
||||
case model.PRICE:
|
||||
value = kit.Format("%.2f", kit.Float(value)/100)
|
||||
}
|
||||
return value
|
||||
})
|
||||
|
@ -1,3 +0,0 @@
|
||||
$output div.code {
|
||||
padding:0;
|
||||
}
|
@ -1,81 +0,0 @@
|
||||
package operation
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
"shylinux.com/x/icebergs/base/aaa"
|
||||
"shylinux.com/x/icebergs/base/mdb"
|
||||
"shylinux.com/x/icebergs/base/nfs"
|
||||
"shylinux.com/x/icebergs/base/web"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/operation/src/operation/model"
|
||||
)
|
||||
|
||||
type container struct {
|
||||
ice.Space
|
||||
Table
|
||||
order string `data:"1"`
|
||||
fields string `data:"space,name"`
|
||||
foreach string `name:"foreach" help:"遍历" icon:"bi bi-card-list"`
|
||||
create string `name:"create uid* domain module version" role:"leader"`
|
||||
remove string `name:"remove" role:"leader"`
|
||||
apply string `name:"apply" role:"void"`
|
||||
rename string `name:"rename name" role:"void"`
|
||||
open string `name:"open" role:"void"`
|
||||
}
|
||||
|
||||
func (s container) Inputs(m *ice.Message, arg ...string) {
|
||||
switch arg[0] {
|
||||
case model.UID:
|
||||
m.Cmdy(web.SPACE, ice.OPS, web.DREAM, web.SERVER, mdb.NAME, nfs.MODULE, nfs.VERSION)
|
||||
default:
|
||||
s.Table.Inputs(m, arg...)
|
||||
}
|
||||
}
|
||||
func (s container) Foreach(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(web.SPACE, "20250211-service", "web.chat.dev.service.gateway", m.ActionKey()).Table(func(value ice.Maps) {
|
||||
if s.Select(m.Spawn(), web.SPACE, value[web.SPACE]).Length() == 0 {
|
||||
s.Insert(m, web.SPACE, value[web.SPACE])
|
||||
}
|
||||
})
|
||||
}
|
||||
func (s container) Create(m *ice.Message, arg ...string) {
|
||||
s.Table.Insert(m, kit.Simple(arg, m.OptionSimple(model.CLOUD_UID))...)
|
||||
}
|
||||
func (s container) Rename(m *ice.Message, arg ...string) {
|
||||
s.Table.Update(m, m.OptionSimple(model.NAME), m.OptionSimple(model.CLOUD_UID, model.UID)...)
|
||||
}
|
||||
func (s container) List(m *ice.Message, arg ...string) {
|
||||
if len(arg) == 1 {
|
||||
s.Select(m, model.CLOUD_UID, arg[0], model.USER_UID, m.Option(model.USER_UID)).PushAction(s.Open, s.Rename)
|
||||
kit.If(m.Length() == 0, func() { m.EchoInfoButton("请申请云主机", s.Apply) })
|
||||
if m.IsTech() {
|
||||
m.Action(s.Foreach, s.Create, s.Apply)
|
||||
} else if s.IsLeader(m) {
|
||||
m.Action(s.Create, s.Apply)
|
||||
} else if m.Length() > 0 {
|
||||
m.Action()
|
||||
}
|
||||
} else {
|
||||
s.SelectDetail(m, model.UID, arg[1], model.CLOUD_UID, arg[0], model.USER_UID, m.Option(model.USER_UID)).PushAction(s.Open, s.Rename)
|
||||
m.EchoIFrame(web.S(m.Append(web.SPACE)))
|
||||
}
|
||||
m.Display("").DisplayCSS("")
|
||||
}
|
||||
func (s container) Apply(m *ice.Message, arg ...string) {
|
||||
s.Transaction(m, func() {
|
||||
msg := m.Spawn()
|
||||
msg = s.Limit(msg, 1).SelectForUpdate(msg, "(user_uid IS NULL OR user_uid = '') AND (cloud_uid = ? OR cloud_uid IS NULL OR cloud_uid = '')", m.Option(model.CLOUD_UID))
|
||||
if msg.Length() == 0 {
|
||||
m.Echo("主机不够用啦!请等待管理员添加。")
|
||||
return
|
||||
}
|
||||
s.Update(m, m.OptionSimple(model.CLOUD_UID, model.USER_UID), msg.AppendSimple(model.UID)...)
|
||||
m.Cmd(web.SPACE, msg.Append(web.SPACE), aaa.USER, mdb.CREATE, aaa.TECH, m.Option(model.USER_UID), kit.Dict(ice.MSG_USERROLE, aaa.TECH))
|
||||
})
|
||||
}
|
||||
func (s container) Open(m *ice.Message, arg ...string) {
|
||||
m.ProcessOpen(m.Options(ice.MSG_USERPOD, "").MergePod(m.Option(web.SPACE)))
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(container{}) }
|
@ -1,9 +0,0 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
can.onimport.myView(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list: [value.name||"container", can.onimport.titleAction(can, value)]},
|
||||
{view: html.STATUS, list: [value.uid && value.uid.slice(0, 6), can.onimport.timeView(can, value), value.user_name]},
|
||||
{view: html.STATUS, list: [value.space]},
|
||||
] })
|
||||
},
|
||||
})
|
85
src/operation/gateway.go
Normal file
85
src/operation/gateway.go
Normal file
@ -0,0 +1,85 @@
|
||||
package operation
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
"shylinux.com/x/icebergs/base/mdb"
|
||||
"shylinux.com/x/icebergs/base/web"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"2025-dev.shylinux.com/x/20250215-cluster/src/travel"
|
||||
"shylinux.com/x/operation/src/operation/model"
|
||||
)
|
||||
|
||||
type gateway struct {
|
||||
Table
|
||||
cluster cluster
|
||||
travel travel.Travel
|
||||
order string `data:"2"`
|
||||
fields string `data:"title,content,space,cluster_uid"`
|
||||
createProject string `name:"createProject name* repos binary" help:"创建" style:"notice" role:"worker"`
|
||||
scanProject string `name:"scanProject" help:"扫描" role:"worker"`
|
||||
open string `name:"open" role:"leader"`
|
||||
modify string `name:"modify title content" style:"danger" role:"leader"`
|
||||
}
|
||||
|
||||
func (s gateway) List(m *ice.Message, arg ...string) {
|
||||
if s.ValueList(m, arg); s.IsLeader(m) {
|
||||
m.PushAction(s.CreateProject, s.ScanProject, s.Open, s.Modify)
|
||||
} else if s.IsWorker(m) {
|
||||
m.PushAction(s.CreateProject, s.ScanProject)
|
||||
} else {
|
||||
m.PushAction()
|
||||
}
|
||||
if m.Action(); m.Length() == 0 {
|
||||
m.Echo("请到「云集群」购买主机")
|
||||
} else {
|
||||
s.SelectJoinUser(m).Display("")
|
||||
}
|
||||
}
|
||||
func (s gateway) CreateProject(m *ice.Message, arg ...string) {
|
||||
m.Option(web.SPACE, s.space(m))
|
||||
m.Cmd(project{}, s.Create, arg, model.GATEWAY_UID, m.Option(model.UID))
|
||||
m.ProcessRefresh()
|
||||
}
|
||||
func (s gateway) ScanProject(m *ice.Message, arg ...string) {
|
||||
m.Cmd(web.SPACE, s.space(m.Spawn()), web.DREAM).Table(func(value ice.Maps) {
|
||||
if value[mdb.TYPE] == web.WORKER {
|
||||
m.Cmd(project{}, s.InsertIfNeed, mdb.NAME, value[mdb.NAME], model.GATEWAY_UID, m.Option(model.UID), m.OptionSimple(model.CLOUD_UID))
|
||||
}
|
||||
})
|
||||
m.ProcessRefresh()
|
||||
}
|
||||
func (s gateway) Open(m *ice.Message, arg ...string) {
|
||||
m.ProcessOpen(m.Options(ice.MSG_USERPOD, "").MergePodCmd(s.space(m), web.ADMIN))
|
||||
}
|
||||
func (s gateway) Modify(m *ice.Message, arg ...string) {
|
||||
s.Update(m, arg, m.OptionSimple(model.CLOUD_UID, model.UID)...)
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(gateway{}) }
|
||||
|
||||
func (s gateway) Payfor(m *ice.Message, arg ...string) {
|
||||
s.Transaction(m, func() {
|
||||
msg := m.Spawn()
|
||||
if msg = s.Orders(msg, "id").Limit(msg, 1).SelectForUpdate(msg, "(cloud_uid IS NULL OR cloud_uid = '') AND (cluster_uid = ?)", m.Option(model.CLUSTER_UID)); msg.Length() == 0 {
|
||||
m.Echo("主机不够用啦!请等待管理员添加。")
|
||||
} else {
|
||||
s.Update(m, m.OptionSimple(model.CLOUD_UID, model.USER_UID), msg.AppendSimple(model.UID)...)
|
||||
}
|
||||
})
|
||||
}
|
||||
func (s gateway) Scan(m *ice.Message, arg ...string) {
|
||||
m.Cmd(web.SPACE, m.Option(web.SPACE), s.travel, s.travel.Concurrent, "2025-dev.shylinux.com/x/20250211-service", "web.chat.dev.service.gateway").Table(func(value ice.Maps) {
|
||||
s.InsertIfNeed(m, web.SPACE, value[web.SPACE], model.CLUSTER_UID, m.Option(model.CLUSTER_UID))
|
||||
})
|
||||
s.Fields(m, "count(*) AS total")
|
||||
s.Select(m, model.CLUSTER_UID, m.Option(model.CLUSTER_UID))
|
||||
s.Fields(m, "count(*) AS stock")
|
||||
s.Select(m, "cluster_uid = ? AND (cloud_uid IS NULL OR cloud_uid = '')", m.Option(model.CLUSTER_UID))
|
||||
m.Info("hwat %v ", m.FormatMeta())
|
||||
}
|
||||
func (s gateway) space(m *ice.Message, arg ...string) string {
|
||||
s.Tables(m, s.cluster).Fields(m, s.Key(s, web.SPACE), s.KeyAS(s.cluster, web.SPACE))
|
||||
s.Select(m, kit.Simple(m.OptionSimple(model.CLOUD_UID), s.Key(s, model.UID), m.Option(model.UID))...)
|
||||
return kit.Keys(m.Append(model.CLUSTER_SPACE), m.Append(web.SPACE))
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
can.onimport.myView(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list: [value.title]},
|
||||
{view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value), value.user_name]},
|
||||
{view: html.TITLE, list: [value.title||value.space, can.onimport.titleAction(can, value)]},
|
||||
{view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value)]},
|
||||
{view: html.OUTPUT, list: [value.content]},
|
||||
] })
|
||||
},
|
@ -7,13 +7,21 @@ const (
|
||||
NAME = "name"
|
||||
INFO = "info"
|
||||
TYPE = "type"
|
||||
TOTAL = "total"
|
||||
STOCK = "stock"
|
||||
PRICE = "price"
|
||||
TITLE = "title"
|
||||
CONTENT = "content"
|
||||
USER_UID = "user_uid"
|
||||
USER_CLOUD_ROLE = "user_cloud_role"
|
||||
CLOUD_UID = "cloud_uid"
|
||||
CLOUD_TYPE = "cloud_type"
|
||||
RELEASE_UID = "release_uid"
|
||||
CLUSTER_UID = "cluster_uid"
|
||||
CLUSTER_SPACE = "cluster_space"
|
||||
GATEWAY_UID = "gateway_uid"
|
||||
GATEWAY_SPACE = "gateway_space"
|
||||
PROJECT_UID = "project_uid"
|
||||
PROJECT_NAME = "project_name"
|
||||
)
|
||||
|
||||
type UserCloud struct {
|
||||
@ -24,16 +32,33 @@ type Cloud struct {
|
||||
db.ModelPlace
|
||||
CompanyUID string `gorm:"type:char(32);index"`
|
||||
}
|
||||
type Release struct {
|
||||
type Cluster struct {
|
||||
db.ModelContent
|
||||
CloudUID string `gorm:"type:char(32);index"`
|
||||
Space string `gorm:"type:varchar(64)"`
|
||||
Total int
|
||||
Stock int
|
||||
Price int
|
||||
}
|
||||
type Container struct {
|
||||
type Gateway struct {
|
||||
db.ModelContent
|
||||
CloudUID string `gorm:"type:char(32);index"`
|
||||
ClusterUID string `gorm:"type:char(32);index"`
|
||||
Space string `gorm:"type:varchar(64)"`
|
||||
}
|
||||
type Project struct {
|
||||
db.ModelWithUID
|
||||
CloudUID string `gorm:"type:char(32);index"`
|
||||
UserUID string `gorm:"type:char(32);index"`
|
||||
Space string `gorm:"type:char(128);uniqueIndex"`
|
||||
Name string `gorm:"type:char(64)"`
|
||||
CloudUID string `gorm:"type:char(32);index"`
|
||||
GatewayUID string `gorm:"type:char(32);index"`
|
||||
Name string `gorm:"type:varchar(64)"`
|
||||
Repos string `gorm:"type:varchar(255)"`
|
||||
Binary string `gorm:"type:varchar(255)"`
|
||||
}
|
||||
type Product struct {
|
||||
db.ModelWithUID
|
||||
CloudUID string `gorm:"type:char(32);index"`
|
||||
ProjectUID string `gorm:"type:char(32);index"`
|
||||
Index string `gorm:"type:varchar(128)"`
|
||||
Name string `gorm:"type:varchar(64)"`
|
||||
}
|
||||
|
||||
func init() { db.CmdModels("", &UserCloud{}, &Cloud{}, &Release{}, &Container{}) }
|
||||
func init() { db.CmdModels("", &UserCloud{}, &Cloud{}, &Cluster{}, &Gateway{}, &Project{}, &Product{}) }
|
||||
|
@ -1,10 +1,11 @@
|
||||
{
|
||||
"portal": "系统运维",
|
||||
"container": "云主机",
|
||||
"release": "发布",
|
||||
"cluster": "云集群", "gateway": "云主机", "project": "云项目", "product": "云应用",
|
||||
"icons": {
|
||||
"container": "https://img.icons8.com/officel/80/activity-grid.png",
|
||||
"release": "https://img.icons8.com/officel/80/activity-grid.png"
|
||||
"cluster": "https://img.icons8.com/officel/80/activity-grid.png",
|
||||
"gateway": "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"
|
||||
},
|
||||
"input": {
|
||||
"My Cloud": "我的系统",
|
||||
|
37
src/operation/product.go
Normal file
37
src/operation/product.go
Normal file
@ -0,0 +1,37 @@
|
||||
package operation
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
"shylinux.com/x/icebergs/base/ctx"
|
||||
"shylinux.com/x/icebergs/base/mdb"
|
||||
"shylinux.com/x/icebergs/base/web"
|
||||
"shylinux.com/x/operation/src/operation/model"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
)
|
||||
|
||||
type product struct {
|
||||
Table
|
||||
cluster cluster
|
||||
gateway gateway
|
||||
project project
|
||||
order string `data:"4"`
|
||||
fields string `data:"index,name,project_uid"`
|
||||
open string `name:"open" role:"void"`
|
||||
}
|
||||
|
||||
func (s product) List(m *ice.Message, arg ...string) {
|
||||
s.ValueList(m, arg).PushAction(s.Open).Display("")
|
||||
s.Fields(m, model.UID, s.Keys(s.gateway, model.UID)).SelectJoin(m, s.project, s.Keys(s.gateway, model.UID))
|
||||
s.Fields(m, model.UID, s.KeyAS(s.gateway, model.TITLE)).SelectJoin(m, s.gateway, s.Keys(s.gateway, model.TITLE))
|
||||
}
|
||||
func (s product) Open(m *ice.Message, arg ...string) {
|
||||
m.ProcessOpen(m.Options(ice.MSG_USERPOD, "").MergePodCmd(s.space(m.Spawn()), m.Option(ctx.INDEX)))
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(product{}) }
|
||||
|
||||
func (s product) space(m *ice.Message, arg ...string) string {
|
||||
s.Tables(m, s.project, s.gateway, s.cluster).Fields(m, s.Key(s.project, mdb.NAME), s.KeyAS(s.gateway, web.SPACE), s.KeyAS(s.cluster, web.SPACE))
|
||||
s.Select(m, kit.Simple(s.Key(s, model.CLOUD_UID), m.Option(model.CLOUD_UID), s.Key(s, model.UID), m.Option(model.UID))...)
|
||||
return kit.Keys(m.Append(model.CLUSTER_SPACE), m.Append(model.GATEWAY_SPACE), m.Append(model.NAME))
|
||||
}
|
9
src/operation/product.js
Normal file
9
src/operation/product.js
Normal file
@ -0,0 +1,9 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
can.onimport.myView(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list: [value.title||value.name||value.user_name, can.onimport.titleAction(can, value)]},
|
||||
{view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value), value.gateway_title]},
|
||||
{view: html.OUTPUT, list: [value.content||value.info]},
|
||||
] })
|
||||
},
|
||||
})
|
56
src/operation/project.go
Normal file
56
src/operation/project.go
Normal file
@ -0,0 +1,56 @@
|
||||
package operation
|
||||
|
||||
import (
|
||||
"shylinux.com/x/community/src/api"
|
||||
"shylinux.com/x/ice"
|
||||
"shylinux.com/x/icebergs/base/aaa"
|
||||
"shylinux.com/x/icebergs/base/ctx"
|
||||
"shylinux.com/x/icebergs/base/mdb"
|
||||
"shylinux.com/x/icebergs/base/web"
|
||||
"shylinux.com/x/operation/src/operation/model"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
)
|
||||
|
||||
type project struct {
|
||||
Table
|
||||
cluster cluster
|
||||
gateway gateway
|
||||
order string `data:"3"`
|
||||
fields string `data:"name,repos,binary,gateway_uid"`
|
||||
create string `name:"create name* repos binary" style:"notice" role:"worker"`
|
||||
scanProduct string `name:"scanProduct" help:"扫描" role:"worker"`
|
||||
open string `name:"name" role:"worker"`
|
||||
}
|
||||
|
||||
func (s project) Create(m *ice.Message, arg ...string) {
|
||||
if s.Select(m.Spawn(), m.OptionSimple(model.CLOUD_UID, model.GATEWAY_UID, mdb.NAME)...).Length() > 0 {
|
||||
return
|
||||
}
|
||||
msg := m.Cmd(web.SPACE, m.Option(web.SPACE), web.DREAM, mdb.CREATE, arg, kit.Dict(ice.MSG_USERROLE, aaa.TECH))
|
||||
s.Insert(m, kit.Simple(arg, msg.OptionSimple(model.CLOUD_UID, model.GATEWAY_UID, mdb.NAME))...)
|
||||
}
|
||||
func (s project) List(m *ice.Message, arg ...string) {
|
||||
s.ValueList(m, arg).PushAction(s.ScanProduct, s.Open).Action().Display("")
|
||||
if m.Length() == 0 {
|
||||
m.SetResult().Echo("请到「云主机」创建项目")
|
||||
}
|
||||
s.Fields(m, model.UID, s.KeyAS(s.gateway, model.TITLE)).SelectJoin(m, s.gateway, s.Keys(s.gateway, model.TITLE))
|
||||
}
|
||||
func (s project) ScanProduct(m *ice.Message, arg ...string) {
|
||||
m.Cmd(web.SPACE, s.space(m), api.GONGANXITONG_PORTAL)
|
||||
m.Cmd(web.SPACE, s.space(m), api.GONGANXITONG_SERVICE).Table(func(value ice.Maps) {
|
||||
m.Cmd(product{}, s.InsertIfNeed, ctx.INDEX, value[ctx.INDEX], mdb.NAME, value[mdb.NAME], model.PROJECT_UID, m.Option(model.UID), m.OptionSimple(model.CLOUD_UID))
|
||||
})
|
||||
m.ProcessRefresh()
|
||||
}
|
||||
func (s project) Open(m *ice.Message, arg ...string) {
|
||||
m.ProcessOpen(m.Options(ice.MSG_USERPOD, "").MergePodCmd(s.space(m), web.ADMIN))
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(project{}) }
|
||||
|
||||
func (s project) space(m *ice.Message, arg ...string) string {
|
||||
s.Tables(m, s.gateway, s.cluster).Fields(m, s.Key(s, mdb.NAME), s.KeyAS(s.gateway, web.SPACE), s.KeyAS(s.cluster, web.SPACE))
|
||||
s.Select(m, kit.Simple(s.Key(s, model.CLOUD_UID), m.Option(model.CLOUD_UID), s.Key(s, model.UID), m.Option(model.UID))...)
|
||||
return kit.Keys(m.Append(model.CLUSTER_SPACE), m.Append(model.GATEWAY_SPACE), m.Append(mdb.NAME))
|
||||
}
|
9
src/operation/project.js
Normal file
9
src/operation/project.js
Normal file
@ -0,0 +1,9 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
can.onimport.myView(can, msg, function(value) { return [
|
||||
{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), value.gateway_title]},
|
||||
{view: html.OUTPUT, list: [value.content||value.repos||value.binary]},
|
||||
] })
|
||||
},
|
||||
})
|
@ -1,16 +0,0 @@
|
||||
package operation
|
||||
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
type release struct {
|
||||
Table
|
||||
fields string `data:"title,content,user_uid"`
|
||||
create string `name:"create title* content*" role:"leader"`
|
||||
remove string `name:"remove" role:"leader"`
|
||||
}
|
||||
|
||||
func (s release) List(m *ice.Message, arg ...string) {
|
||||
s.ValueList(m, arg).Display("")
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(release{}) }
|
@ -1,7 +1,7 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
can.onimport.myView(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list: [value.title||value.name||value.user_name]},
|
||||
{view: html.TITLE, list: [value.title||value.name||value.user_name, can.onimport.titleAction(can, value)]},
|
||||
{view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value), value.user_name]},
|
||||
{view: html.OUTPUT, list: [value.content||value.info]},
|
||||
] })
|
||||
|
@ -2,6 +2,7 @@
|
||||
"03f7f410d292fb30026cbcd99290e943": {
|
||||
"meta": {
|
||||
"auth": "issued",
|
||||
"enable": "false",
|
||||
"icons": "https://img.icons8.com/officel/80/online-store.png",
|
||||
"index": "web.team.operation.goodslist",
|
||||
"name": "在线商城",
|
||||
@ -13,6 +14,7 @@
|
||||
"2511b9e18bf167ae0171c740e8f0513c": {
|
||||
"meta": {
|
||||
"auth": "issued",
|
||||
"enable": "false",
|
||||
"icons": "https://img.icons8.com/officel/80/agreement.png",
|
||||
"index": "web.team.operation.contract",
|
||||
"name": "在线合同",
|
||||
@ -40,6 +42,15 @@
|
||||
"time": "2024-09-03 10:22:15.258"
|
||||
}
|
||||
},
|
||||
"64be90144c205e73b1fc216962d7ad25": {
|
||||
"meta": {
|
||||
"icons": "https://img.icons8.com/officel/80/activity-grid.png",
|
||||
"index": "web.team.operation.product",
|
||||
"name": "云应用",
|
||||
"order": "4",
|
||||
"time": "2025-03-05 10:40:39.748"
|
||||
}
|
||||
},
|
||||
"6ca4f1fc571350c2498bc5c1d7ac3563": {
|
||||
"meta": {
|
||||
"icons": "https://img.icons8.com/officel/80/qr-code.png",
|
||||
@ -53,6 +64,7 @@
|
||||
"700c65f09a19cb53ee5c2dfbb98a5a0b": {
|
||||
"meta": {
|
||||
"auth": "issued",
|
||||
"enable": "false",
|
||||
"icons": "https://img.icons8.com/officel/80/video-conference.png",
|
||||
"index": "web.team.operation.meeting",
|
||||
"name": "在线会议",
|
||||
@ -61,14 +73,13 @@
|
||||
"time": "2024-11-20 22:03:43.566"
|
||||
}
|
||||
},
|
||||
"7633ddfc1c6052b7dd2f00096248e1f7": {
|
||||
"7abb3b3760a9b686457938511c0ee7df": {
|
||||
"meta": {
|
||||
"enable": "false",
|
||||
"icons": "https://img.icons8.com/officel/80/activity-grid.png",
|
||||
"index": "web.team.operation.release",
|
||||
"name": "发布",
|
||||
"order": "1",
|
||||
"time": "2024-09-03 10:22:15.265"
|
||||
"index": "web.team.operation.project",
|
||||
"name": "云项目",
|
||||
"order": "3",
|
||||
"time": "2025-03-05 10:40:39.740"
|
||||
}
|
||||
},
|
||||
"85c8678d4af08bb0c3e9560155b7c98f": {
|
||||
@ -84,6 +95,7 @@
|
||||
"91b0ca086b5b8aa00e84737c4395a19f": {
|
||||
"meta": {
|
||||
"auth": "issued",
|
||||
"enable": "false",
|
||||
"icons": "https://img.icons8.com/officel/50/ios-photos.png",
|
||||
"index": "web.team.operation.photo",
|
||||
"name": "在线相册",
|
||||
@ -92,15 +104,6 @@
|
||||
"time": "2024-11-28 17:54:45.766"
|
||||
}
|
||||
},
|
||||
"92e6595ec0b5b436695bc827c23ecbf3": {
|
||||
"meta": {
|
||||
"icons": "https://img.icons8.com/officel/80/activity-grid.png",
|
||||
"index": "web.team.operation.container",
|
||||
"name": "云主机",
|
||||
"order": "1",
|
||||
"time": "2025-02-12 15:09:43.924"
|
||||
}
|
||||
},
|
||||
"aa58390a9fac9f8210eca564d1ad82ff": {
|
||||
"meta": {
|
||||
"icons": "https://img.icons8.com/officel/80/passport.png",
|
||||
@ -119,6 +122,15 @@
|
||||
"time": "2024-09-03 10:22:15.259"
|
||||
}
|
||||
},
|
||||
"c8159ab932f400dbafa08fb995e16355": {
|
||||
"meta": {
|
||||
"icons": "https://img.icons8.com/officel/80/activity-grid.png",
|
||||
"index": "web.team.operation.cluster",
|
||||
"name": "云集群",
|
||||
"order": "1",
|
||||
"time": "2025-03-05 10:40:39.838"
|
||||
}
|
||||
},
|
||||
"ca74fb83cfd850b1ca03fe18976c253a": {
|
||||
"meta": {
|
||||
"icons": "https://img.icons8.com/officel/80/test-partial-passed.png",
|
||||
@ -148,9 +160,19 @@
|
||||
"time": "2024-09-03 10:22:15.260"
|
||||
}
|
||||
},
|
||||
"d8f6d139d6a5f9b5aa504702e7777eb3": {
|
||||
"meta": {
|
||||
"icons": "https://img.icons8.com/officel/80/activity-grid.png",
|
||||
"index": "web.team.operation.gateway",
|
||||
"name": "云主机",
|
||||
"order": "2",
|
||||
"time": "2025-03-05 12:13:06.405"
|
||||
}
|
||||
},
|
||||
"d953e8b2c9159b1f4d32ff1c15793314": {
|
||||
"meta": {
|
||||
"auth": "issued",
|
||||
"enable": "false",
|
||||
"icons": "https://img.icons8.com/officel/50/documents.png",
|
||||
"index": "web.team.operation.document",
|
||||
"name": "在线文档",
|
||||
@ -181,6 +203,7 @@
|
||||
"e9150ed09fcdb4da60f1e9f0d5fe54ea": {
|
||||
"meta": {
|
||||
"auth": "issued",
|
||||
"enable": "false",
|
||||
"icons": "https://img.icons8.com/officel/80/online-payment-with-a-credit-card.png",
|
||||
"index": "web.team.operation.paymentlist",
|
||||
"name": "在线支付",
|
||||
|
Loading…
x
Reference in New Issue
Block a user