forked from x/icebergs
add mall/admin.go
This commit is contained in:
parent
3991619ad0
commit
d9a44bedc5
@ -54,6 +54,10 @@ const (
|
|||||||
TOOLS = "tools"
|
TOOLS = "tools"
|
||||||
RUN = "run"
|
RUN = "run"
|
||||||
SHIP = "ship"
|
SHIP = "ship"
|
||||||
|
|
||||||
|
ICONS = ice.CTX_ICONS
|
||||||
|
TRANS = ice.CTX_TRANS
|
||||||
|
TITLE = ice.CTX_TITLE
|
||||||
)
|
)
|
||||||
const COMMAND = "command"
|
const COMMAND = "command"
|
||||||
|
|
||||||
|
@ -218,9 +218,7 @@ func HashSelect(m *ice.Message, arg ...string) *ice.Message {
|
|||||||
m.Fields(len(kit.Slice(arg, 0, 1)), HashField(m))
|
m.Fields(len(kit.Slice(arg, 0, 1)), HashField(m))
|
||||||
}
|
}
|
||||||
m.Cmdy(SELECT, m.PrefixKey(), m.Option(SUBKEY), HASH, HashShort(m), arg, logs.FileLineMeta(-1))
|
m.Cmdy(SELECT, m.PrefixKey(), m.Option(SUBKEY), HASH, HashShort(m), arg, logs.FileLineMeta(-1))
|
||||||
kit.If(kit.Select(Config(m, SHORT), Config(m, SORT)), func(sort string) {
|
kit.If(kit.Select(Config(m, SHORT), Config(m, SORT)), func(sort string) { kit.If(sort != UNIQ, func() { m.Sort(sort) }) })
|
||||||
kit.If(sort != UNIQ, func() { m.Sort(sort) })
|
|
||||||
})
|
|
||||||
if m.PushAction(Config(m, ACTION), REMOVE); !m.FieldsIsDetail() {
|
if m.PushAction(Config(m, ACTION), REMOVE); !m.FieldsIsDetail() {
|
||||||
return m.Action(CREATE, PRUNES)
|
return m.Action(CREATE, PRUNES)
|
||||||
}
|
}
|
||||||
|
@ -99,6 +99,8 @@ const (
|
|||||||
MD = "md"
|
MD = "md"
|
||||||
PY = "py"
|
PY = "py"
|
||||||
|
|
||||||
|
IMAGE = "image"
|
||||||
|
|
||||||
PNG = "png"
|
PNG = "png"
|
||||||
JPG = "jpg"
|
JPG = "jpg"
|
||||||
MP4 = "mp4"
|
MP4 = "mp4"
|
||||||
|
@ -145,6 +145,7 @@ const (
|
|||||||
USR_PUBLISH = ice.USR_PUBLISH
|
USR_PUBLISH = ice.USR_PUBLISH
|
||||||
USR_ICEBERGS = ice.USR_ICEBERGS
|
USR_ICEBERGS = ice.USR_ICEBERGS
|
||||||
USR_LOCAL_WORK = ice.USR_LOCAL_WORK
|
USR_LOCAL_WORK = ice.USR_LOCAL_WORK
|
||||||
|
USR_LOCAL = ice.USR_LOCAL
|
||||||
SRC_DOCUMENT = ice.SRC_DOCUMENT
|
SRC_DOCUMENT = ice.SRC_DOCUMENT
|
||||||
SRC_TEMPLATE = ice.SRC_TEMPLATE
|
SRC_TEMPLATE = ice.SRC_TEMPLATE
|
||||||
REQUIRE = "/require/"
|
REQUIRE = "/require/"
|
||||||
|
@ -178,11 +178,11 @@ func init() {
|
|||||||
}},
|
}},
|
||||||
mdb.CREATE: {Name: "create name*=hi icon@icon repos binary template", Hand: func(m *ice.Message, arg ...string) {
|
mdb.CREATE: {Name: "create name*=hi icon@icon repos binary template", Hand: func(m *ice.Message, arg ...string) {
|
||||||
kit.If(!strings.Contains(m.Option(mdb.NAME), "-") || !strings.HasPrefix(m.Option(mdb.NAME), "20"), func() { m.Option(mdb.NAME, m.Time("20060102-")+m.Option(mdb.NAME)) })
|
kit.If(!strings.Contains(m.Option(mdb.NAME), "-") || !strings.HasPrefix(m.Option(mdb.NAME), "20"), func() { m.Option(mdb.NAME, m.Time("20060102-")+m.Option(mdb.NAME)) })
|
||||||
|
m.OptionDefault(mdb.ICON, nfs.USR_ICONS_ICEBERGS)
|
||||||
m.OptionDefault(nfs.REPOS, mdb.Config(m, nfs.REPOS)+m.Option(mdb.NAME))
|
m.OptionDefault(nfs.REPOS, mdb.Config(m, nfs.REPOS)+m.Option(mdb.NAME))
|
||||||
m.Option(nfs.REPOS, kit.Select("", kit.Slice(kit.Split(m.Option(nfs.REPOS)), -1), 0))
|
m.Option(nfs.REPOS, kit.Select("", kit.Slice(kit.Split(m.Option(nfs.REPOS)), -1), 0))
|
||||||
m.OptionDefault(mdb.ICON, nfs.USR_ICONS_ICEBERGS)
|
|
||||||
if mdb.HashCreate(m); !m.IsCliUA() {
|
if mdb.HashCreate(m); !m.IsCliUA() {
|
||||||
_dream_start(m, m.OptionDefault(mdb.NAME, path.Base(m.Option(nfs.REPOS))))
|
_dream_start(m, m.Option(mdb.NAME))
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
nfs.REPOS: {Help: "仓库", Hand: func(m *ice.Message, arg ...string) {
|
nfs.REPOS: {Help: "仓库", Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
@ -28,6 +28,7 @@ const (
|
|||||||
OUTPUT = "output"
|
OUTPUT = "output"
|
||||||
LAYOUT = "layout"
|
LAYOUT = "layout"
|
||||||
RESIZE = "resize"
|
RESIZE = "resize"
|
||||||
|
FILTER = "filter"
|
||||||
|
|
||||||
COLOR = "color"
|
COLOR = "color"
|
||||||
BACKGROUND_COLOR = "background-color"
|
BACKGROUND_COLOR = "background-color"
|
||||||
|
@ -72,13 +72,13 @@ func ProcessIframe(m *ice.Message, name, link string, arg ...string) {
|
|||||||
return []string{m.Cmdx(CHAT_IFRAME, mdb.CREATE, mdb.TYPE, LINK, mdb.NAME, name, LINK, link)}
|
return []string{m.Cmdx(CHAT_IFRAME, mdb.CREATE, mdb.TYPE, LINK, mdb.NAME, name, LINK, link)}
|
||||||
}, arg...)
|
}, arg...)
|
||||||
}
|
}
|
||||||
func PushPodCmd(m *ice.Message, cmd string, arg ...string) {
|
func PushPodCmd(m *ice.Message, cmd string, arg ...string) *ice.Message {
|
||||||
list := []string{}
|
list := []string{}
|
||||||
m.Cmds(SPACE, func(value ice.Maps) {
|
m.Cmds(SPACE, func(value ice.Maps) {
|
||||||
kit.If(kit.IsIn(value[mdb.TYPE], WORKER), func() { list = append(list, value[mdb.NAME]) })
|
kit.If(kit.IsIn(value[mdb.TYPE], WORKER), func() { list = append(list, value[mdb.NAME]) })
|
||||||
})
|
})
|
||||||
if len(list) == 0 {
|
if len(list) == 0 {
|
||||||
return
|
return m
|
||||||
}
|
}
|
||||||
kit.If(m.Length() > 0 && len(m.Appendv(SPACE)) == 0, func() { m.Table(func(value ice.Maps) { m.Push(SPACE, "") }) })
|
kit.If(m.Length() > 0 && len(m.Appendv(SPACE)) == 0, func() { m.Table(func(value ice.Maps) { m.Push(SPACE, "") }) })
|
||||||
GoToast(m, "", func(toast func(string, int, int)) []string {
|
GoToast(m, "", func(toast func(string, int, int)) []string {
|
||||||
@ -92,6 +92,7 @@ func PushPodCmd(m *ice.Message, cmd string, arg ...string) {
|
|||||||
})
|
})
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
return m
|
||||||
}
|
}
|
||||||
func PushImages(m *ice.Message, name string) {
|
func PushImages(m *ice.Message, name string) {
|
||||||
if kit.ExtIsImage(name) {
|
if kit.ExtIsImage(name) {
|
||||||
|
@ -127,7 +127,13 @@ func IsNotValidFieldShare(m *ice.Message, msg *ice.Message) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
func SharePath(m *ice.Message, p string) string {
|
func SharePath(m *ice.Message, p string) string {
|
||||||
kit.If(!kit.HasPrefix(p, nfs.PS, ice.HTTP), func() { p = path.Join(SHARE_LOCAL, p) })
|
kit.If(!kit.HasPrefix(p, nfs.PS, ice.HTTP), func() {
|
||||||
|
if kit.HasPrefix(p, nfs.SRC, nfs.USR) && !kit.HasPrefix(p, nfs.USR_LOCAL) {
|
||||||
|
p = kit.MergeURL(path.Join(nfs.REQUIRE, p), ice.POD, m.Option(ice.MSG_USERPOD))
|
||||||
|
} else {
|
||||||
|
p = kit.MergeURL(path.Join(SHARE_LOCAL, p), ice.POD, m.Option(ice.MSG_USERPOD))
|
||||||
|
}
|
||||||
|
})
|
||||||
return p
|
return p
|
||||||
}
|
}
|
||||||
func ShareLocalFile(m *ice.Message, arg ...string) {
|
func ShareLocalFile(m *ice.Message, arg ...string) {
|
||||||
|
@ -293,3 +293,11 @@ func Space(m *ice.Message, arg ice.Any) []string {
|
|||||||
}
|
}
|
||||||
return []string{SPACE, kit.Format(arg)}
|
return []string{SPACE, kit.Format(arg)}
|
||||||
}
|
}
|
||||||
|
func PodCmd(m *ice.Message, key string, arg ...string) bool {
|
||||||
|
if pod := m.Option(key); pod != "" {
|
||||||
|
m.Options(key, "", ice.MSG_USERPOD, pod).Cmdy(SPACE, pod, m.PrefixKey(), arg)
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -91,17 +91,22 @@ func init() {
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if mdb.HashSelect(m, arg...); len(arg) > 0 {
|
if mdb.HashSelect(m, arg...); len(arg) == 0 {
|
||||||
text := m.Append(mdb.TEXT)
|
defer web.PushPodCmd(m, "", arg...)
|
||||||
m.PushQRCode(cli.QRCODE, text)
|
|
||||||
m.PushScript(text)
|
|
||||||
}
|
|
||||||
if len(arg) == 0 {
|
|
||||||
if m.IsMobileUA() {
|
if m.IsMobileUA() {
|
||||||
m.Action(mdb.CREATE, web.UPLOAD, "getClipboardData", "getLocation", "scanQRCode")
|
m.Action(mdb.CREATE, web.UPLOAD, "getClipboardData", "getLocation", "scanQRCode")
|
||||||
} else {
|
} else {
|
||||||
m.Action(mdb.CREATE, web.UPLOAD, "getClipboardData", "record1", "record2")
|
m.Action(mdb.CREATE, web.UPLOAD, "getClipboardData", "record1", "record2")
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if web.PodCmd(m, web.SPACE, arg...) {
|
||||||
|
return
|
||||||
|
} else if m.Length() == 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
text := m.Append(mdb.TEXT)
|
||||||
|
m.PushQRCode(cli.QRCODE, text)
|
||||||
|
m.PushScript(text)
|
||||||
}
|
}
|
||||||
m.Table(func(value ice.Maps) {
|
m.Table(func(value ice.Maps) {
|
||||||
delete(value, ctx.ACTION)
|
delete(value, ctx.ACTION)
|
||||||
|
@ -57,7 +57,9 @@ func init() {
|
|||||||
mdb.HashSelect(m, kit.Slice(arg, 0, 1)...)
|
mdb.HashSelect(m, kit.Slice(arg, 0, 1)...)
|
||||||
// m.Option(LOCATION, m.Cmdx(web.SERVE, tcp.HOST))
|
// m.Option(LOCATION, m.Cmdx(web.SERVE, tcp.HOST))
|
||||||
// m.Option(LOCATION, get(m, "location/v1/ip", aaa.IP, m.Option(ice.MSG_USERIP)))
|
// m.Option(LOCATION, get(m, "location/v1/ip", aaa.IP, m.Option(ice.MSG_USERIP)))
|
||||||
|
web.PushPodCmd(m, "", arg...)
|
||||||
ctx.DisplayLocal(m.Options(nfs.SCRIPT, kit.MergeURL(mdb.Config(m, nfs.SCRIPT), mdb.KEY, mdb.Config(m, web.TOKEN))), "")
|
ctx.DisplayLocal(m.Options(nfs.SCRIPT, kit.MergeURL(mdb.Config(m, nfs.SCRIPT), mdb.KEY, mdb.Config(m, web.TOKEN))), "")
|
||||||
|
ctx.Toolkit(m, "")
|
||||||
}},
|
}},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
37
core/mall/admin.go
Normal file
37
core/mall/admin.go
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
package mall
|
||||||
|
|
||||||
|
import (
|
||||||
|
ice "shylinux.com/x/icebergs"
|
||||||
|
"shylinux.com/x/icebergs/base/ctx"
|
||||||
|
"shylinux.com/x/icebergs/base/mdb"
|
||||||
|
"shylinux.com/x/icebergs/base/nfs"
|
||||||
|
"shylinux.com/x/icebergs/base/web"
|
||||||
|
"shylinux.com/x/icebergs/base/web/html"
|
||||||
|
kit "shylinux.com/x/toolkits"
|
||||||
|
)
|
||||||
|
|
||||||
|
const ADMIN = "admin"
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
Index.MergeCommands(ice.Commands{
|
||||||
|
ADMIN: {Name: "admin hash auto", Help: "管理", Meta: kit.Dict(
|
||||||
|
ctx.TRANS, kit.Dict(html.INPUT, kit.Dict(mdb.TYPE, "单位", PRICE, "价格", AMOUNT, "总价")),
|
||||||
|
), Actions: ice.MergeActions(ice.Actions{
|
||||||
|
web.UPLOAD: {Hand: func(m *ice.Message, arg ...string) { m.Echo(m.Append(mdb.HASH)) }},
|
||||||
|
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) { m.Cmdy(GOODS, mdb.INPUTS, arg) }},
|
||||||
|
}, GOODS, ctx.ConfAction(ctx.TOOLS, Prefix(GOODS))), Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
m.Cmdy(GOODS, arg).PushAction(mdb.MODIFY, mdb.REMOVE)
|
||||||
|
kit.If(m.IsMobileUA(), func() { m.Action(mdb.CREATE) }, func() { m.Action(mdb.CREATE, "filter:text") })
|
||||||
|
kit.If(len(arg) > 0, func() {
|
||||||
|
kit.For(kit.Split(m.Append(nfs.IMAGE)), func(p string) {
|
||||||
|
m.EchoImages(web.MergeURL2(m, web.SHARE_CACHE+p))
|
||||||
|
})
|
||||||
|
})
|
||||||
|
ctx.DisplayTable(m)
|
||||||
|
ctx.Toolkit(m, "")
|
||||||
|
var total float64
|
||||||
|
m.Table(func(value ice.Maps) { total += kit.Float(value[PRICE]) * kit.Float(value[mdb.COUNT]) })
|
||||||
|
m.StatusTimeCount(AMOUNT, kit.Format("%0.2f", total))
|
||||||
|
}},
|
||||||
|
})
|
||||||
|
}
|
@ -4,7 +4,10 @@ import (
|
|||||||
ice "shylinux.com/x/icebergs"
|
ice "shylinux.com/x/icebergs"
|
||||||
"shylinux.com/x/icebergs/base/ctx"
|
"shylinux.com/x/icebergs/base/ctx"
|
||||||
"shylinux.com/x/icebergs/base/mdb"
|
"shylinux.com/x/icebergs/base/mdb"
|
||||||
|
"shylinux.com/x/icebergs/base/nfs"
|
||||||
"shylinux.com/x/icebergs/base/web"
|
"shylinux.com/x/icebergs/base/web"
|
||||||
|
"shylinux.com/x/icebergs/base/web/html"
|
||||||
|
kit "shylinux.com/x/toolkits"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -14,24 +17,20 @@ const GOODS = "goods"
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
Index.MergeCommands(ice.Commands{
|
Index.MergeCommands(ice.Commands{
|
||||||
GOODS: {Name: "goods hash@keyboard place@province date@date name@key count=_number@keyboard auto music", Help: "商品", Actions: ice.MergeActions(ice.Actions{
|
GOODS: {Name: "goods list", Icon: "mall.png", Help: "商品", Meta: kit.Dict(
|
||||||
mdb.MODIFY: {Name: "modify zone type name text price count image=4@img audio video"},
|
ctx.TRANS, kit.Dict(html.INPUT, kit.Dict(mdb.TYPE, "单位", PRICE, "价格", AMOUNT, "总价")),
|
||||||
mdb.CREATE: {Name: "modify zone type name text price count image=4@img audio video"},
|
), Actions: ice.MergeActions(ice.Actions{
|
||||||
web.UPLOAD: {Hand: func(m *ice.Message, arg ...string) { web.Upload(m) }},
|
mdb.CREATE: {Name: "create zone* name* text price* count*=1 type*=件,个,份,斤 image*=4@img"},
|
||||||
"copy": {Hand: func(m *ice.Message, arg ...string) {
|
mdb.MODIFY: {Name: "modify zone* name* text price* count*=1 type*=件,个,份,斤 image*=4@img"},
|
||||||
m.Cmd("", mdb.CREATE, m.OptionSimple("zone,type,name,text,price,count,image"))
|
nfs.IMAGE: {Name: "image image*=4@img", Help: "图片", Hand: func(m *ice.Message, arg ...string) { mdb.HashModify(m, arg) }},
|
||||||
}},
|
ORDER: {Name: "order count*=1", Help: "选购", Hand: func(m *ice.Message, arg ...string) {}},
|
||||||
}, mdb.HashAction(mdb.FIELD, "time,hash,zone,type,name,text,price,count,image,audio,video")), Hand: func(m *ice.Message, arg ...string) {
|
}, mdb.ExportHashAction(ctx.TOOLS, Prefix(ORDER), mdb.FIELD, "time,hash,zone,name,text,price,count,type,image")), Hand: func(m *ice.Message, arg ...string) {
|
||||||
if mdb.HashSelect(m, arg...); len(arg) == 0 || arg[0] == "" {
|
kit.If(len(arg) == 0 && m.IsMobileUA(), func() { m.OptionDefault(ice.MSG_FIELDS, "zone,name,price,count,type,text,hash,time,image") })
|
||||||
m.Action(mdb.CREATE, mdb.EXPORT, mdb.IMPORT)
|
mdb.HashSelect(m, arg...).PushAction(ORDER).Action("filter:text")
|
||||||
m.PushAction("copy", mdb.MODIFY, mdb.REMOVE)
|
web.PushPodCmd(m, "", arg...)
|
||||||
ctx.DisplayLocal(m, "")
|
ctx.DisplayLocal(m, "")
|
||||||
} else {
|
ctx.Toolkit(m, "")
|
||||||
// for _, p := range kit.Split(m.Append("image")) {
|
m.Sort("zone,name")
|
||||||
// m.EchoImages(web.MergeURL2(m, web.SHARE_CACHE+p))
|
|
||||||
// }
|
|
||||||
// m.PushAction("play", "stop", "copy", mdb.MODIFY, mdb.REMOVE)
|
|
||||||
}
|
|
||||||
}},
|
}},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ package mall
|
|||||||
import (
|
import (
|
||||||
ice "shylinux.com/x/icebergs"
|
ice "shylinux.com/x/icebergs"
|
||||||
"shylinux.com/x/icebergs/base/web"
|
"shylinux.com/x/icebergs/base/web"
|
||||||
|
kit "shylinux.com/x/toolkits"
|
||||||
)
|
)
|
||||||
|
|
||||||
const MALL = "mall"
|
const MALL = "mall"
|
||||||
@ -10,3 +11,5 @@ const MALL = "mall"
|
|||||||
var Index = &ice.Context{Name: MALL, Help: "贸易中心"}
|
var Index = &ice.Context{Name: MALL, Help: "贸易中心"}
|
||||||
|
|
||||||
func init() { web.Index.Register(Index, nil, ASSET, SALARY) }
|
func init() { web.Index.Register(Index, nil, ASSET, SALARY) }
|
||||||
|
|
||||||
|
func Prefix(arg ...ice.Any) string { return web.Prefix(MALL, kit.Keys(arg...)) }
|
||||||
|
18
core/mall/order.go
Normal file
18
core/mall/order.go
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
package mall
|
||||||
|
|
||||||
|
import (
|
||||||
|
ice "shylinux.com/x/icebergs"
|
||||||
|
"shylinux.com/x/icebergs/base/mdb"
|
||||||
|
)
|
||||||
|
|
||||||
|
const ORDER = "order"
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
Index.MergeCommands(ice.Commands{
|
||||||
|
ORDER: {Name: "order hash auto", Help: "订单", Actions: ice.MergeActions(ice.Actions{
|
||||||
|
mdb.CREATE: {Name: "create zone* type name* text price* count* image*=4@img"},
|
||||||
|
}), Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
|
||||||
|
}},
|
||||||
|
})
|
||||||
|
}
|
@ -8,6 +8,7 @@ import (
|
|||||||
"shylinux.com/x/icebergs/base/ctx"
|
"shylinux.com/x/icebergs/base/ctx"
|
||||||
"shylinux.com/x/icebergs/base/mdb"
|
"shylinux.com/x/icebergs/base/mdb"
|
||||||
"shylinux.com/x/icebergs/base/web"
|
"shylinux.com/x/icebergs/base/web"
|
||||||
|
"shylinux.com/x/icebergs/base/web/html"
|
||||||
kit "shylinux.com/x/toolkits"
|
kit "shylinux.com/x/toolkits"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -55,7 +56,15 @@ const PLAN = "plan"
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
Index.MergeCommands(ice.Commands{
|
Index.MergeCommands(ice.Commands{
|
||||||
PLAN: {Name: "plan scale=month,day,week,month,year,long begin_time@date list prev next", Icon: "Calendar.png", Help: "计划表", Actions: ice.MergeActions(ice.Actions{
|
PLAN: {Name: "plan scale=month,day,week,month,year,long begin_time@date list insert prev next", Icon: "Calendar.png", Help: "计划表", Meta: kit.Dict(
|
||||||
|
ctx.TRANS, kit.Dict(html.INPUT, kit.Dict(
|
||||||
|
"begin_time", "起始", "end_time", "结束",
|
||||||
|
"level", "优先级", "score", "完成度", "scale", "跨度", "view", "视图",
|
||||||
|
"day", "日", "week", "周", "month", "月", "year", "年", "long", "代",
|
||||||
|
"prepare", "准备中", "process", "进行中", "cancel", "已取消", "finish", "已完成",
|
||||||
|
"once", "一次性", "step", "阶段性",
|
||||||
|
)),
|
||||||
|
), Actions: ice.MergeActions(ice.Actions{
|
||||||
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) { m.Cmdy(TODO, mdb.INPUTS, arg) }},
|
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) { m.Cmdy(TODO, mdb.INPUTS, arg) }},
|
||||||
mdb.PLUGIN: {Name: "plugin extra.index extra.args", Hand: func(m *ice.Message, arg ...string) { m.Cmdy(TASK, mdb.MODIFY, arg) }},
|
mdb.PLUGIN: {Name: "plugin extra.index extra.args", Hand: func(m *ice.Message, arg ...string) { m.Cmdy(TASK, mdb.MODIFY, arg) }},
|
||||||
ctx.RUN: {Hand: func(m *ice.Message, arg ...string) {
|
ctx.RUN: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
@ -77,7 +77,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
kit.If(arg[0] == mdb.ZONE, func() { m.Push(arg[0], kit.Split(nfs.TemplateText(m, mdb.ZONE))) })
|
kit.If(arg[0] == mdb.ZONE, func() { m.Push(arg[0], kit.Split(nfs.TemplateText(m, mdb.ZONE))) })
|
||||||
}},
|
}},
|
||||||
mdb.INSERT: {Name: "insert space zone* type=once,step,week name* text begin_time@date end_time@date", Hand: func(m *ice.Message, arg ...string) {
|
mdb.INSERT: {Name: "insert space zone* type*=once,step,week name* text begin_time*@date end_time@date", Hand: func(m *ice.Message, arg ...string) {
|
||||||
if space, arg := arg[1], arg[2:]; space != "" {
|
if space, arg := arg[1], arg[2:]; space != "" {
|
||||||
m.Cmdy(web.SPACE, space, TASK, mdb.INSERT, web.SPACE, "", arg)
|
m.Cmdy(web.SPACE, space, TASK, mdb.INSERT, web.SPACE, "", arg)
|
||||||
} else {
|
} else {
|
||||||
|
@ -20,8 +20,6 @@ body.dark fieldset.web.wiki.portal>div.output>div.header div.story[data-name=nav
|
|||||||
body.dark fieldset.web.wiki.portal>div.output>div.header div.story[data-name=navmenu] div.item:hover { background-color:var(--plugin-bg-color); }
|
body.dark fieldset.web.wiki.portal>div.output>div.header div.story[data-name=navmenu] div.item:hover { background-color:var(--plugin-bg-color); }
|
||||||
fieldset.web.wiki.portal.home>div.output>div.layout>div.main p { white-space:pre-wrap; text-align:center; }
|
fieldset.web.wiki.portal.home>div.output>div.layout>div.main p { white-space:pre-wrap; text-align:center; }
|
||||||
fieldset.web.wiki.portal>div.output>div.layout>div.main>* { margin:20px auto; }
|
fieldset.web.wiki.portal>div.output>div.layout>div.main>* { margin:20px auto; }
|
||||||
// fieldset.web.wiki.portal>div.output>div.layout>div.main h2 { margin-top:40px; }
|
|
||||||
// fieldset.web.wiki.portal>div.output>div.layout>div.main h3 { margin-top:20px; }
|
|
||||||
fieldset.web.wiki.portal>div.output>div.layout>div.main ul { margin:20px 40px; }
|
fieldset.web.wiki.portal>div.output>div.layout>div.main ul { margin:20px 40px; }
|
||||||
fieldset.web.wiki.portal>div.output>div.layout>div.main ol { margin:20px 40px; }
|
fieldset.web.wiki.portal>div.output>div.layout>div.main ol { margin:20px 40px; }
|
||||||
fieldset.web.wiki.portal>div.output>div.layout>div.main p code {
|
fieldset.web.wiki.portal>div.output>div.layout>div.main p code {
|
||||||
@ -32,12 +30,14 @@ fieldset.web.wiki.portal>div.output>div.layout>div.main div.story[data-type=spar
|
|||||||
padding:10px; margin:10px auto;
|
padding:10px; margin:10px auto;
|
||||||
box-shadow:var(--box-shadow);
|
box-shadow:var(--box-shadow);
|
||||||
}
|
}
|
||||||
fieldset.web.wiki.portal>div.output>div.layout>div.main div.story[data-type=spark][data-name=shell] kbd:hover {
|
|
||||||
/* background-color:white; color:black; */
|
|
||||||
}
|
|
||||||
fieldset.web.wiki.portal>div.output>div.layout>div.main fieldset.inner.output div.content {
|
fieldset.web.wiki.portal>div.output>div.layout>div.main fieldset.inner.output div.content {
|
||||||
background-color:var(--code-bg-color); color:var(--code-fg-color); padding:10px 0;
|
background-color:var(--code-bg-color); color:var(--code-fg-color); padding:10px 0;
|
||||||
--code-comment:silver; --code-keyword:orange; --code-package:silver;
|
--code-comment:silver; --code-keyword:orange; --code-package:silver;
|
||||||
--code-datatype:silver; --code-function:cyan;
|
--code-datatype:silver; --code-function:cyan;
|
||||||
--code-constant:silver; --code-string:silver; --code-object:silver;
|
--code-constant:silver; --code-string:silver; --code-object:silver;
|
||||||
}
|
}
|
||||||
|
body.cmd.web.wiki.portal { background-color:rgb(22 31 49); }
|
||||||
|
body.mobile fieldset.web.wiki.portal>div.output>div.layout { display:block; }
|
||||||
|
body.mobile fieldset.web.wiki.portal>div.output>div.layout>div.nav { padding:10px; height:unset; }
|
||||||
|
body.mobile fieldset.web.wiki.portal>div.output>div.layout>div.main { padding:10px; height:unset; min-width:unset; }
|
||||||
|
body.mobile fieldset.web.wiki.portal>div.output>div.header div.story[data-name=navmenu] div.item { padding:10px; }
|
||||||
|
@ -2,6 +2,7 @@ package wiki
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"strings"
|
||||||
|
|
||||||
ice "shylinux.com/x/icebergs"
|
ice "shylinux.com/x/icebergs"
|
||||||
"shylinux.com/x/icebergs/base/aaa"
|
"shylinux.com/x/icebergs/base/aaa"
|
||||||
@ -36,17 +37,44 @@ func init() {
|
|||||||
WordAlias(m, SEQUENCE, CHART, SEQUENCE)
|
WordAlias(m, SEQUENCE, CHART, SEQUENCE)
|
||||||
}},
|
}},
|
||||||
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Option(nfs.DIR_DEEP, ice.TRUE)
|
if len(arg) > 0 {
|
||||||
_wiki_list(m, nfs.SRC)
|
m.OptionFields("path,size,time")
|
||||||
_wiki_list(m, nfs.USR_ICEBERGS)
|
mdb.HashSelect(m)
|
||||||
m.Cut("path,size,time")
|
}
|
||||||
|
msg := m.Spawn(kit.Dict(nfs.DIR_DEEP, ice.TRUE))
|
||||||
|
_wiki_list(msg, nfs.SRC)
|
||||||
|
_wiki_list(msg, nfs.USR_ICEBERGS)
|
||||||
|
msg.Table(func(value ice.Maps) {
|
||||||
|
if !kit.HasPrefix(value[nfs.PATH], nfs.SRC_TEMPLATE, nfs.SRC_DOCUMENT) {
|
||||||
|
m.Push("", value, kit.Split("path,size,time"))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
web.PushPodCmd(m.Spawn(), "").Table(func(value ice.Maps) {
|
||||||
|
if !kit.HasPrefix(value[nfs.PATH], nfs.SRC_TEMPLATE, nfs.SRC_DOCUMENT) {
|
||||||
|
value[nfs.PATH] = value[web.SPACE] + nfs.DF + value[nfs.PATH]
|
||||||
|
m.Push("", value, kit.Split("path,size,time"))
|
||||||
|
}
|
||||||
|
})
|
||||||
}},
|
}},
|
||||||
code.COMPLETE: {Hand: func(m *ice.Message, arg ...string) {
|
code.COMPLETE: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
kit.If(kit.IsIn(kit.Split(m.Option(mdb.TEXT))[0], IMAGE, VIDEO, AUDIO), func() { m.Cmdy(FEEL).CutTo(nfs.PATH, mdb.NAME) })
|
kit.If(kit.IsIn(kit.Split(m.Option(mdb.TEXT))[0], IMAGE, VIDEO, AUDIO), func() { m.Cmdy(FEEL).CutTo(nfs.PATH, mdb.NAME) })
|
||||||
}},
|
}},
|
||||||
}, aaa.RoleAction(), WikiAction("", nfs.SHY)), Hand: func(m *ice.Message, arg ...string) {
|
}, aaa.RoleAction(), WikiAction("", nfs.SHY), mdb.HashAction(mdb.SHORT, nfs.PATH, mdb.FIELD, "time,path")), Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Option(nfs.DIR_DEEP, ice.TRUE)
|
if len(arg) > 0 {
|
||||||
kit.If(len(arg) == 0, func() { arg = append(arg, nfs.SRC) })
|
mdb.HashCreate(m.Spawn(), nfs.PATH, arg[0])
|
||||||
|
}
|
||||||
|
if len(arg) > 0 && strings.Contains(arg[0], nfs.DF) {
|
||||||
|
ls := kit.Split(arg[0], nfs.DF)
|
||||||
|
arg[0] = ls[1]
|
||||||
|
defer web.ToastProcess(m)()
|
||||||
|
defer m.StatusTime(web.SPACE, m.Option(web.SPACE, ls[0]))
|
||||||
|
}
|
||||||
|
if len(arg) == 0 {
|
||||||
|
m.Option(nfs.DIR_DEEP, ice.TRUE)
|
||||||
|
arg = append(arg, nfs.SRC)
|
||||||
|
} else if web.PodCmd(m, web.SPACE, arg...) {
|
||||||
|
return
|
||||||
|
}
|
||||||
kit.If(!_wiki_list(m, arg...), func() { _word_show(m, arg[0]) })
|
kit.If(!_wiki_list(m, arg...), func() { _word_show(m, arg[0]) })
|
||||||
}},
|
}},
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user