1
0
mirror of https://shylinux.com/x/icebergs synced 2025-06-26 02:17:30 +08:00
This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-01-22 11:03:51 +08:00
parent 2c5be00d12
commit ec2c270301
3 changed files with 7 additions and 11 deletions

View File

@ -23,9 +23,6 @@ import (
)
func _dream_list(m *ice.Message) *ice.Message {
if ice.Info.NodeType == WORKER {
return m
}
list := m.CmdMap(SPACE, mdb.NAME)
mdb.HashSelect(m).Table(func(value ice.Maps) {
if space, ok := list[value[mdb.NAME]]; ok {

View File

@ -4,19 +4,20 @@ import (
ice "shylinux.com/x/icebergs"
"shylinux.com/x/icebergs/base/cli"
"shylinux.com/x/icebergs/base/mdb"
"shylinux.com/x/icebergs/base/web"
)
const SCRIPT = "script"
func init() {
Index.MergeCommands(ice.Commands{
SCRIPT: {Name: "script zone id auto", Help: "脚本化", Icon: "script.png", Actions: ice.MergeActions(ice.Actions{
mdb.INSERT: {Name: "insert zone space index"},
}, mdb.ImportantZoneAction(mdb.FIELDS, "time,id,space,index,play,status,style"), mdb.ExportZoneAction()), Hand: func(m *ice.Message, arg ...string) {
SCRIPT: {Name: "script zone id auto", Help: "脚本化", Icon: "script.png", Actions: ice.MergeActions(
mdb.ImportantZoneAction(mdb.FIELDS, "time,id,space,index,play,status,style"), mdb.ExportZoneAction(),
), Hand: func(m *ice.Message, arg ...string) {
if mdb.ZoneSelect(m.Options(mdb.CACHE_LIMIT, "30"), arg...).Display(""); len(arg) == 0 {
m.PushAction(cli.RECORD, mdb.REMOVE).Action(mdb.CREATE, cli.STOP)
} else {
m.Sort(mdb.ID, ice.INT).PushAction("preview").Action(mdb.INSERT, cli.PLAY)
m.Sort(mdb.ID, ice.INT).PushAction(web.PREVIEW).Action(mdb.INSERT, cli.PLAY)
}
}},
})

View File

@ -9,15 +9,13 @@ Volcanos(chat.ONIMPORT, {
})
Volcanos(chat.ONACTION, {
record: function(event, can, msg) { can.misc.sessionStorage(can, SCRIPT_ZONE, msg.Option(mdb.ZONE)), can.user.toastSuccess(can, msg.Option(mdb.ZONE)), can.Update(event) },
enable: function(event, can, msg) { can.runAction(event, mdb.MODIFY, [mdb.STATUS, mdb.ENABLE]) },
disable: function(event, can, msg) { can.runAction(event, mdb.MODIFY, [mdb.STATUS, mdb.DISABLE]) },
stop: function(event, can, msg) { can.misc.sessionStorage(can, SCRIPT_ZONE, ""), can.Update(event) },
play: function(event, can) { var begin = new Date().getTime(); can.core.Next(can._msg.Table(), function(value, next, index, list) {
can.Status(cli.STEP, index), can.Status(cli.COST, can.base.Duration((new Date().getTime()-begin)))
can.Status(cli.STEP, index), can.Status(cli.COST, can.base.Duration(new Date().getTime()-begin))
can.user.toastProcess(can, `${can.core.Keys(value.space, value.index)} ${value.play} ${index}/${can._msg.Length()}`, "", index*100/list.length)
var tr = can.page.Select(can, can._output, html.TR)[1]; can.onmotion.select(can, tr.parentNode, html.TR, index)
value.status == mdb.DISABLE? next(): can.onaction.preview({}, can, can.request({}, value), next)
}, function(list) { can.Status(cli.STEP, list.length), can.Status(cli.COST, can.base.Duration((new Date().getTime()-begin))), can.user.toastSuccess(can) }) },
}, function(list) { can.Status(cli.STEP, list.length), can.Status(cli.COST, can.base.Duration(new Date().getTime()-begin)), can.user.toastSuccess(can) }) },
preview: function(event, can, msg, next) {
can.onappend.plugin(can, {space: msg.Option(web.SPACE), index: msg.Option(ctx.INDEX), style: msg.Option(ctx.STYLE)}, function(sub) { var done = false
function action(skip) { sub.Update(sub.request({}, {_handle: ice.TRUE}), [ctx.ACTION, msg.Option(cli.PLAY)], function(msg) {