mirror of
https://shylinux.com/x/icebergs
synced 2025-04-28 10:12:02 +08:00
add some
This commit is contained in:
parent
45e2bcfeb6
commit
000804dd06
@ -460,10 +460,7 @@ func DreamEach(m *ice.Message, name string, status string, cb func(string)) *ice
|
|||||||
return m
|
return m
|
||||||
}
|
}
|
||||||
GoToast(m, "", func(toast func(string, int, int)) []string {
|
GoToast(m, "", func(toast func(string, int, int)) []string {
|
||||||
kit.For(list, func(index int, name string) {
|
kit.For(list, func(index int, name string) { toast(name, index, len(list)); cb(name) })
|
||||||
toast(name, index, len(list))
|
|
||||||
cb(name)
|
|
||||||
})
|
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
return m
|
return m
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package web
|
package web
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"path"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
ice "shylinux.com/x/icebergs"
|
ice "shylinux.com/x/icebergs"
|
||||||
@ -19,28 +20,50 @@ func init() {
|
|||||||
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Cmds(SPIDE).Table(func(value ice.Maps) { kit.If(value[CLIENT_TYPE] == nfs.REPOS, func() { m.Push("", value, arg[0]) }) })
|
m.Cmds(SPIDE).Table(func(value ice.Maps) { kit.If(value[CLIENT_TYPE] == nfs.REPOS, func() { m.Push("", value, arg[0]) }) })
|
||||||
}},
|
}},
|
||||||
"install": {Help: "安装", Hand: func(m *ice.Message, arg ...string) {
|
|
||||||
if strings.HasPrefix(m.Option(mdb.ICON), nfs.REQUIRE) {
|
|
||||||
m.Option(mdb.ICON, strings.TrimSuffix(strings.TrimPrefix(m.Option(mdb.ICON), nfs.REQUIRE), "?pod="+m.Option(mdb.NAME)))
|
|
||||||
}
|
|
||||||
m.OptionDefault(nfs.BINARY, m.Option(ORIGIN)+S(m.Option(mdb.NAME)))
|
|
||||||
m.Cmdy(DREAM, mdb.CREATE, m.OptionSimple(mdb.NAME, mdb.ICON, nfs.REPOS, nfs.BINARY))
|
|
||||||
m.Cmdy(DREAM, cli.START, m.OptionSimple(mdb.NAME))
|
|
||||||
}},
|
|
||||||
PORTAL: {Help: "详情", Hand: func(m *ice.Message, arg ...string) {
|
|
||||||
ctx.ProcessField(m, CHAT_IFRAME, m.Option(ORIGIN)+S(m.Option(mdb.NAME))+C(PORTAL), arg...)
|
|
||||||
}},
|
|
||||||
mdb.CREATE: {Name: "create name* origin*", Hand: func(m *ice.Message, arg ...string) {
|
mdb.CREATE: {Name: "create name* origin*", Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Option(mdb.TYPE, nfs.REPOS)
|
m.Option(mdb.TYPE, nfs.REPOS)
|
||||||
m.Cmd(SPIDE, mdb.CREATE, m.OptionSimple("name,origin,type"))
|
m.Cmd(SPIDE, mdb.CREATE, m.OptionSimple("name,origin,type"))
|
||||||
}},
|
}},
|
||||||
|
"install": {Help: "安装", Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
if !kit.HasPrefixList(arg, ctx.RUN) {
|
||||||
|
if !nfs.Exists(m, path.Join(ice.USR_LOCAL_WORK, m.Option(mdb.NAME))) {
|
||||||
|
if strings.HasPrefix(m.Option(mdb.ICON), nfs.REQUIRE) {
|
||||||
|
m.Option(mdb.ICON, strings.TrimSuffix(strings.TrimPrefix(m.Option(mdb.ICON), nfs.REQUIRE), "?pod="+m.Option(mdb.NAME)))
|
||||||
|
}
|
||||||
|
m.OptionDefault(nfs.BINARY, m.Option(ORIGIN)+S(m.Option(mdb.NAME)))
|
||||||
|
m.Cmdy(DREAM, mdb.CREATE, m.OptionSimple(mdb.NAME, mdb.ICON, nfs.REPOS, nfs.BINARY))
|
||||||
|
m.Cmdy(DREAM, cli.START, m.OptionSimple(mdb.NAME))
|
||||||
|
}
|
||||||
|
defer m.Push("title", m.Option(mdb.NAME))
|
||||||
|
}
|
||||||
|
ctx.ProcessField(m, CHAT_IFRAME, S(m.Option(mdb.NAME)), arg...)
|
||||||
|
}},
|
||||||
|
OPEN: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
if !kit.HasPrefixList(arg, ctx.RUN) {
|
||||||
|
defer m.Push("title", m.Option(mdb.NAME))
|
||||||
|
}
|
||||||
|
ctx.ProcessField(m, CHAT_IFRAME, S(m.Option(mdb.NAME)), arg...)
|
||||||
|
}},
|
||||||
|
PORTAL: {Help: "官网", Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
if !kit.HasPrefixList(arg, ctx.RUN) {
|
||||||
|
defer m.Push("title", m.Option(mdb.NAME))
|
||||||
|
}
|
||||||
|
ctx.ProcessField(m, CHAT_IFRAME, m.Option(ORIGIN)+S(m.Option(mdb.NAME))+C(PORTAL), arg...)
|
||||||
|
}},
|
||||||
}, ctx.ConfAction(ctx.TOOLS, DREAM)), Hand: func(m *ice.Message, arg ...string) {
|
}, ctx.ConfAction(ctx.TOOLS, DREAM)), Hand: func(m *ice.Message, arg ...string) {
|
||||||
if len(arg) == 0 {
|
if len(arg) == 0 {
|
||||||
m.Cmdy(SPIDE, arg, kit.Dict(ice.MSG_FIELDS, "time,client.type,client.name,client.origin")).Action(mdb.CREATE).Display("")
|
m.Cmdy(SPIDE, arg, kit.Dict(ice.MSG_FIELDS, "time,client.type,client.name,client.origin")).Action(mdb.CREATE).Display("")
|
||||||
ctx.Toolkit(m)
|
ctx.Toolkit(m)
|
||||||
} else {
|
} else {
|
||||||
origin := SpideOrigin(m, arg[0])
|
origin := SpideOrigin(m, arg[0])
|
||||||
m.SetAppend().SplitIndex(m.Cmdx(SPIDE, arg[0], C(DREAM))).Table(func(value ice.Maps) { m.Push(ORIGIN, origin) }).PushAction("install", PORTAL)
|
m.SetAppend().SplitIndex(m.Cmdx(SPIDE, arg[0], C(DREAM))).Table(func(value ice.Maps) {
|
||||||
|
if !nfs.Exists(m, path.Join(ice.USR_LOCAL_WORK, value[mdb.NAME])) {
|
||||||
|
m.PushButton("install", PORTAL)
|
||||||
|
} else {
|
||||||
|
m.PushButton(OPEN, PORTAL)
|
||||||
|
}
|
||||||
|
m.Push(ORIGIN, origin)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
})
|
})
|
||||||
|
@ -2,6 +2,9 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
_init: function(can, msg) {
|
_init: function(can, msg) {
|
||||||
can.ui = can.onappend.layout(can), can.onappend.style(can, "output card", can.ui.content), can.onimport._project(can, msg)
|
can.ui = can.onappend.layout(can), can.onappend.style(can, "output card", can.ui.content), can.onimport._project(can, msg)
|
||||||
can.onmotion.delay(can, function() { can.onimport.layout(can) })
|
can.onmotion.delay(can, function() { can.onimport.layout(can) })
|
||||||
|
can.sup.onimport._field = function(sup, msg) { msg.Table(function(item) {
|
||||||
|
can.onappend._plugin(can, item, {style: html.FLOAT}, function(sub) {})
|
||||||
|
}) }
|
||||||
},
|
},
|
||||||
_project: function(can, msg) { var select
|
_project: function(can, msg) { var select
|
||||||
msg.Table(function(value) { if (value["client.type"] != nfs.REPOS) { return } value.name = `${value["client.name"]}`
|
msg.Table(function(value) { if (value["client.type"] != nfs.REPOS) { return } value.name = `${value["client.name"]}`
|
||||||
@ -30,9 +33,10 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
layout: function(can) {
|
layout: function(can) {
|
||||||
can.page.style(can, can.ui.project, html.HEIGHT, can.ConfHeight())
|
can.ui.layout(can.ConfHeight(), can.ConfWidth())
|
||||||
can.page.style(can, can.ui.content, html.HEIGHT, can.ConfHeight())
|
// can.page.style(can, can.ui.project, html.HEIGHT, can.ConfHeight())
|
||||||
can.page.style(can, can._output, html.HEIGHT, can.ConfHeight(), html.WIDTH, can.ConfWidth())
|
// can.page.style(can, can.ui.content, html.HEIGHT, can.ConfHeight())
|
||||||
|
// can.page.style(can, can._output, html.HEIGHT, can.ConfHeight(), html.WIDTH, can.ConfWidth())
|
||||||
can.onlayout.expand(can, can.ui.content, can.user.isMobile && !can.user.isLandscape()? can.ConfWidth(): 320)
|
can.onlayout.expand(can, can.ui.content, can.user.isMobile && !can.user.isLandscape()? can.ConfWidth(): 320)
|
||||||
},
|
},
|
||||||
}, [""])
|
}, [""])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user