This commit is contained in:
IT 老营长 @云轩领航-创始人 2025-03-10 18:38:44 +08:00
parent a7aa40ad65
commit 5376decbf0
3 changed files with 10 additions and 7 deletions

View File

@ -33,24 +33,23 @@ func (s Gateway) List(m *ice.Message, arg ...string) {
} else {
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 {
m.Echo("请到「云集群」购买主机")
} 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) {
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) {
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) {
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) {
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) {
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() {
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 {
m.Echo("主机不够用啦!请等待管理员添加。")
m.Echo("主机不够用啦!请等待平台管理员添加。")
} else {
m.Option(model.TITLE, "我的云主机")
s.Update(m, m.OptionSimple(model.CLOUD_UID, model.USER_UID, model.TITLE), msg.AppendSimple(model.UID)...)

View File

@ -4,8 +4,9 @@ import (
"shylinux.com/x/ice"
"shylinux.com/x/icebergs/base/aaa"
"shylinux.com/x/icebergs/base/web"
"shylinux.com/x/operation/src/operation/model"
kit "shylinux.com/x/toolkits"
"shylinux.com/x/operation/src/operation/model"
)
type studio struct {

View File

@ -68,7 +68,10 @@ Volcanos(chat.ONIMPORT, {
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.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) }
can._plugins = (can._plugins||[]).concat(sub)
}, can.ui.content)