forked from x/icebergs
add some
This commit is contained in:
parent
1060a60a5e
commit
b2b4616ec1
@ -73,8 +73,6 @@ func _dream_list_icon(m *ice.Message) {
|
||||
return m.Spawn(kit.Dict(ice.MSG_USERPOD, m.Appendv(mdb.NAME)[index])).FileURI(value)
|
||||
} else if nfs.ExistsFile(m, value) {
|
||||
return m.FileURI(value)
|
||||
} else {
|
||||
return m.FileURI(nfs.USR_ICONS_ICEBERGS)
|
||||
}
|
||||
}
|
||||
return value
|
||||
@ -233,7 +231,7 @@ func init() {
|
||||
DREAM: {Name: "dream refresh", Help: "梦想家", Icon: "Launchpad.png", Role: aaa.VOID, Meta: kit.Dict(
|
||||
ice.CTX_TRANS, kit.Dict(html.INPUT, kit.Dict(WORKER, "空间", SERVER, "门户", ORIGIN, "主机")),
|
||||
), Actions: ice.MergeActions(ice.Actions{
|
||||
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
||||
ice.AFTER_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
||||
AddPortalProduct(m, "云空间", `
|
||||
比虚拟机和容器,更加轻量,每个空间都是一个完整的系统,拥有各种软件与独立的环境。
|
||||
空间内所有的软件、配置、数据以源码库形式保存,每个空间都可以随时启动、停止、上传、下载、分享。
|
||||
|
@ -13,15 +13,12 @@ const PRODUCT = "product"
|
||||
|
||||
func init() {
|
||||
Index.MergeCommands(ice.Commands{
|
||||
PRODUCT: {Name: "product refresh", Help: "产品展示", Actions: mdb.HashAction(mdb.SHORT, "index", mdb.FIELD, "time,name,text,order,enable,index,args"), Hand: func(m *ice.Message, arg ...string) {
|
||||
PRODUCT: {Name: "product refresh", Help: "产品展示", Actions: mdb.HashAction(mdb.SHORT, "index", mdb.FIELD, "time,name,text,order,disable,index,args"), Hand: func(m *ice.Message, arg ...string) {
|
||||
mdb.HashSelect(m, arg...).SortInt(mdb.ORDER)
|
||||
}},
|
||||
})
|
||||
}
|
||||
|
||||
func AddPortalProduct(m *ice.Message, name, text string, order float64, arg ...string) {
|
||||
msg := m.Spawn()
|
||||
m.GoSleep("300ms", func() {
|
||||
msg.Cmd("web.product", mdb.CREATE, mdb.NAME, name, mdb.TEXT, strings.TrimSpace(text), mdb.ORDER, order, ctx.INDEX, msg.PrefixKey(), ctx.ARGS, kit.Format(arg))
|
||||
})
|
||||
m.Cmd("web.product", mdb.CREATE, mdb.NAME, name, mdb.TEXT, strings.TrimSpace(text), mdb.ORDER, order, ctx.INDEX, m.PrefixKey(), ctx.ARGS, kit.Format(arg))
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ const STORE = "store"
|
||||
func init() {
|
||||
Index.MergeCommands(ice.Commands{
|
||||
STORE: {Name: "store refresh", Help: "商店", Icon: "App Store.png", Role: aaa.VOID, Actions: ice.MergeActions(ice.Actions{
|
||||
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
||||
ice.AFTER_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
||||
AddPortalProduct(m, "云商店", `
|
||||
每个用户都可以将自己的空间列表,以系统商店的方式分享给其它用户。
|
||||
同样的每个用户,也可以添加任意多个商店,直接将空间下载到本机使用。
|
||||
|
1
conf.go
1
conf.go
@ -329,6 +329,7 @@ const ( // CTX
|
||||
CTX_TRANS = "_trans"
|
||||
CTX_ICONS = "_icons"
|
||||
CTX_STYLE = "_style"
|
||||
AFTER_INIT = "afterInit"
|
||||
)
|
||||
const ( // LOG
|
||||
LOG_CMDS = "cmds"
|
||||
|
@ -42,7 +42,7 @@ func init() {
|
||||
Notify(m, "usr/icons/Infomation.png", cli.RUNTIME, "系统启动成功", ctx.INDEX, cli.RUNTIME)
|
||||
}},
|
||||
DESKTOP: {Help: "桌面", Role: aaa.VOID, Actions: ice.MergeActions(ice.Actions{
|
||||
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
||||
ice.AFTER_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
||||
web.AddPortalProduct(m, "云桌面", `
|
||||
一款网页版的电脑桌面,打开网页即可随时随地的使用各种软件,
|
||||
无论这些软件是运行在本机,还是远程,还是任何虚拟的空间,无论是内存还是磁盘。
|
||||
|
@ -75,7 +75,7 @@ const INNER = "inner"
|
||||
func init() {
|
||||
Index.MergeCommands(ice.Commands{
|
||||
INNER: {Name: "inner path=src/ file=main.go line=1 auto", Help: "源代码", Role: aaa.VOID, Actions: ice.Actions{
|
||||
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
||||
ice.AFTER_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
||||
web.AddPortalProduct(m, "编辑器", `
|
||||
一款网页版的编辑器,打开网页即可随时随地的编程,
|
||||
无论这些代码是保存在本机,还是远程,还是任何虚拟的空间,无论是内存还是磁盘。
|
||||
|
@ -69,7 +69,7 @@ const XTERM = "xterm"
|
||||
func init() {
|
||||
Index.MergeCommands(ice.Commands{
|
||||
XTERM: {Name: "xterm refresh", Help: "终端", Icon: "Terminal.png", Actions: ice.MergeActions(ice.Actions{
|
||||
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
||||
ice.AFTER_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
||||
web.AddPortalProduct(m, "命令行", `
|
||||
一款网页版的命令行,打开网页即可随时随地的敲命令,
|
||||
无论这些命令是运行在本机,还是远程,还是任何虚拟的空间,无论是内存还是磁盘。
|
||||
|
@ -140,7 +140,7 @@ open http://localhost:9020
|
||||
func _spark_product(m *ice.Message, arg ...string) {
|
||||
if len(arg) == 0 {
|
||||
m.Cmd("web.product").Table(func(value ice.Maps) {
|
||||
if value[mdb.ENABLE] == ice.TRUE {
|
||||
if value[mdb.DISABLE] == ice.TRUE {
|
||||
_spark_product(m, value[ctx.INDEX], value[mdb.NAME], value[mdb.TEXT])
|
||||
}
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user