mirror of
https://shylinux.com/x/operation
synced 2025-04-24 17:08:04 +08:00
add some
This commit is contained in:
parent
a7aa40ad65
commit
5376decbf0
@ -33,24 +33,23 @@ func (s Gateway) List(m *ice.Message, arg ...string) {
|
|||||||
} else {
|
} else {
|
||||||
m.PushAction()
|
m.PushAction()
|
||||||
}
|
}
|
||||||
s.Fields(m, model.UID, s.KeyAS(s.cluster, model.SPACE)).SelectJoin(m, s.cluster, s.Keys(s.cluster, model.SPACE))
|
|
||||||
if m.Action(); m.Length() == 0 {
|
if m.Action(); m.Length() == 0 {
|
||||||
m.Echo("请到「云集群」购买主机")
|
m.Echo("请到「云集群」购买主机")
|
||||||
} else {
|
} else {
|
||||||
m.Display("")
|
s.Fields(m, model.UID, s.KeyAS(s.cluster, model.SPACE)).SelectJoin(m, s.cluster, s.Keys(s.cluster, model.SPACE)).Display("")
|
||||||
}
|
}
|
||||||
if len(arg) == 2 && s.IsLeader(m) {
|
if len(arg) == 2 && s.IsLeader(m) {
|
||||||
m.EchoIFrame(web.S(s.space(m.Spawn().Options(model.CLOUD_UID, arg[0], model.UID, arg[1]))))
|
m.EchoIFrame(web.S(s.space(m.Spawn().Options(model.CLOUD_UID, arg[0], model.UID, arg[1]))))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func (s Gateway) CreateProject(m *ice.Message, arg ...string) {
|
func (s Gateway) CreateProject(m *ice.Message, arg ...string) {
|
||||||
m.Cmdy(project{}, s.Create, arg, model.GATEWAY_UID, m.Option(model.UID), kit.Dict(web.SPACE, s.space(m))).ProcessRefresh()
|
m.Cmdy(project{}, s.Create, arg, model.GATEWAY_UID, m.Option(model.UID), kit.Dict(web.SPACE, s.space(m.Spawn()))).ProcessRefresh()
|
||||||
}
|
}
|
||||||
func (s Gateway) ScanProject(m *ice.Message, arg ...string) {
|
func (s Gateway) ScanProject(m *ice.Message, arg ...string) {
|
||||||
m.Cmdy(project{}, s.Scan, kit.Dict(model.GATEWAY_UID, m.Option(model.UID), web.SPACE, s.space(m.Spawn()))).ProcessRefresh()
|
m.Cmdy(project{}, s.Scan, kit.Dict(model.GATEWAY_UID, m.Option(model.UID), web.SPACE, s.space(m.Spawn()))).ProcessRefresh()
|
||||||
}
|
}
|
||||||
func (s Gateway) Open(m *ice.Message, arg ...string) {
|
func (s Gateway) Open(m *ice.Message, arg ...string) {
|
||||||
m.ProcessOpen(m.Options(ice.MSG_USERPOD, "").MergePodCmd(s.space(m), web.ADMIN))
|
m.ProcessOpen(m.Options(ice.MSG_USERPOD, "").MergePodCmd(s.space(m.Spawn()), web.ADMIN))
|
||||||
}
|
}
|
||||||
func (s Gateway) Modify(m *ice.Message, arg ...string) {
|
func (s Gateway) Modify(m *ice.Message, arg ...string) {
|
||||||
s.Update(m, arg, m.OptionSimple(model.CLOUD_UID, model.UID)...)
|
s.Update(m, arg, m.OptionSimple(model.CLOUD_UID, model.UID)...)
|
||||||
@ -63,7 +62,7 @@ func (s Gateway) Payfor(m *ice.Message, arg ...string) {
|
|||||||
s.Transaction(m, func() {
|
s.Transaction(m, func() {
|
||||||
msg := m.Spawn()
|
msg := m.Spawn()
|
||||||
if msg = s.Orders(msg, mdb.ID).Limit(msg, 1).SelectForUpdate(msg, "cluster_uid = ? AND (cloud_uid IS NULL OR cloud_uid = '')", m.Option(model.CLUSTER_UID)); msg.Length() == 0 {
|
if msg = s.Orders(msg, mdb.ID).Limit(msg, 1).SelectForUpdate(msg, "cluster_uid = ? AND (cloud_uid IS NULL OR cloud_uid = '')", m.Option(model.CLUSTER_UID)); msg.Length() == 0 {
|
||||||
m.Echo("主机不够用啦!请等待管理员添加。")
|
m.Echo("主机不够用啦!请等待平台管理员添加。")
|
||||||
} else {
|
} else {
|
||||||
m.Option(model.TITLE, "我的云主机")
|
m.Option(model.TITLE, "我的云主机")
|
||||||
s.Update(m, m.OptionSimple(model.CLOUD_UID, model.USER_UID, model.TITLE), msg.AppendSimple(model.UID)...)
|
s.Update(m, m.OptionSimple(model.CLOUD_UID, model.USER_UID, model.TITLE), msg.AppendSimple(model.UID)...)
|
||||||
|
@ -4,8 +4,9 @@ import (
|
|||||||
"shylinux.com/x/ice"
|
"shylinux.com/x/ice"
|
||||||
"shylinux.com/x/icebergs/base/aaa"
|
"shylinux.com/x/icebergs/base/aaa"
|
||||||
"shylinux.com/x/icebergs/base/web"
|
"shylinux.com/x/icebergs/base/web"
|
||||||
"shylinux.com/x/operation/src/operation/model"
|
|
||||||
kit "shylinux.com/x/toolkits"
|
kit "shylinux.com/x/toolkits"
|
||||||
|
|
||||||
|
"shylinux.com/x/operation/src/operation/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
type studio struct {
|
type studio struct {
|
||||||
|
@ -68,7 +68,10 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
index = index||item.index||web.DESKTOP, item.plugin = item.plugin||{}
|
index = index||item.index||web.DESKTOP, item.plugin = item.plugin||{}
|
||||||
can.onimport.tabsCache(can, item.plugin[index] = item.plugin[index]||{name: item.name+(index == web.DESKTOP || item.index? "": "."+index), _hash: can.core.Keys(item._hash, index)}, target, function() {
|
can.onimport.tabsCache(can, item.plugin[index] = item.plugin[index]||{name: item.name+(index == web.DESKTOP || item.index? "": "."+index), _hash: can.core.Keys(item._hash, index)}, target, function() {
|
||||||
// can.onappend.plugin(can._root.Action, {space: item.space, index: index, height: can.ConfHeight(), width: can.ConfWidth()-can.ui.project.offsetWidth}, function() {}, can.ui.content)
|
// can.onappend.plugin(can._root.Action, {space: item.space, index: index, height: can.ConfHeight(), width: can.ConfWidth()-can.ui.project.offsetWidth}, function() {}, can.ui.content)
|
||||||
can.onappend.plugin(can._root.Action, {space: item.space, index: index, height: can.ConfHeight(), width: can.ConfWidth()-can.ui.project.offsetWidth}, function(sub) {
|
can.onappend.plugin(can._root.Action, {space: item.space, index: index, args: index == cli.XTERM? ["sh"]: [],
|
||||||
|
height: can.ConfHeight(), width: can.ConfWidth()-can.ui.project.offsetWidth, style: can.base.isIn(index, cli.XTERM, web.DESKTOP)? html.OUTPUT: "",
|
||||||
|
title: index == web.DESKTOP? item.name: "",
|
||||||
|
}, function(sub) {
|
||||||
sub.run = function(event, cmds, cb) { can.runAction(event, item.action, [item.cloud_uid, item.uid, index].concat(cmds), cb) }
|
sub.run = function(event, cmds, cb) { can.runAction(event, item.action, [item.cloud_uid, item.uid, index].concat(cmds), cb) }
|
||||||
can._plugins = (can._plugins||[]).concat(sub)
|
can._plugins = (can._plugins||[]).concat(sub)
|
||||||
}, can.ui.content)
|
}, can.ui.content)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user