1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-26 01:24:05 +08:00
This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-01-21 17:02:00 +08:00
parent 2db2f39649
commit 73731c898a
3 changed files with 5 additions and 4 deletions

View File

@ -156,7 +156,7 @@ func GoToast(m *ice.Message, title string, cb func(toast func(name string, count
icon := Icons[ice.PROCESS]
toast := func(name string, count, total int) {
kit.If(total == 0, func() { total = 1 })
Toast(m, kit.Format("%s %s %s/%s", icon, kit.JoinWord(m.ActionKey(), name), strings.TrimSuffix(kit.FmtSize(int64(count)), "B"), strings.TrimSuffix(kit.FmtSize(int64(total)), "B")),
Toast(m, kit.Format("%s %s %s/%s", icon, kit.JoinWord(kit.Select(m.ActionKey(), m.Option(ice.MSG_TITLE)), name), strings.TrimSuffix(kit.FmtSize(int64(count)), "B"), strings.TrimSuffix(kit.FmtSize(int64(total)), "B")),
"", m.OptionDefault(ice.TOAST_DURATION, "30s"), count*100/total)
_total = total
}

View File

@ -13,14 +13,13 @@ Volcanos(chat.ONACTION, {
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) { can.core.Next(can._msg.Table(), function(value, next, index) {
can.user.toastProcess(can, `${value.index} ${value.play} ${index} / ${can._msg.Length()}`)
can.Status(cli.STEP, value.index)
can.Status(cli.STEP, index), can.user.toastProcess(can, `${value.index} ${value.play} ${index} / ${can._msg.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() { can.user.toastSuccess(can) }) },
preview: function(event, can, msg, next) {
can.onappend.plugin(can, {space: msg.Option(web.SPACE), index: msg.Option(ctx.INDEX)}, function(sub) { var done = false
function action(skip) { sub.Update(can.request({}, {_handle: ice.TRUE}), [ctx.ACTION, msg.Option(cli.PLAY)], function(msg) {
function action(skip) { sub.Update(sub.request({}, {_handle: ice.TRUE}), [ctx.ACTION, msg.Option(cli.PLAY)], function(msg) {
sub.onimport._process(sub, msg) || msg.Length() == 0 && msg.Result() == "" || can.onappend._output(sub, msg), next && next() }) }
can.onmotion.delay(can, function() { if (done || sub._auto) { return } done = true, action() }, 300)
sub.onexport.output = function() { if (done) { return } done = true, action(true)

View File

@ -293,6 +293,7 @@ func (s relay) Install(m *ice.Message, arg ...string) {
s.Modify(m, kit.Simple(m.OptionSimple(MACHINE, web.DREAM))...)
}
func (s relay) Upgrade(m *ice.Message, arg ...string) {
m.Option(ice.MSG_TITLE, m.ActionKey())
if len(arg) == 0 && (m.Option(MACHINE) == "" || strings.Contains(m.Option(MACHINE), ",")) {
s.foreach(m, func(msg *ice.Message, cmd []string) {
ssh.PushShell(msg.Message, strings.Split(msg.Template(UPGRADE_SH), lex.NL), func(res string) {
@ -304,6 +305,7 @@ func (s relay) Upgrade(m *ice.Message, arg ...string) {
}
}
func (s relay) Version(m *ice.Message, arg ...string) {
m.Option(ice.MSG_TITLE, m.ActionKey())
s.foreach(m, func(msg *ice.Message, cmd []string) {
ssh.PushShell(msg.Message, strings.Split(msg.Template(VERSION_SH), lex.NL), func(res string) {
web.PushNoticeGrow(m.Options(ctx.DISPLAY, web.PLUGIN_XTERM).Message, res)