forked from x/icebergs
opt some
This commit is contained in:
parent
3f745faa10
commit
aa7fcaf472
@ -38,7 +38,7 @@ func init() {
|
|||||||
_sess_create(m, m.Option(USERNAME), UA, m.Option(ice.MSG_USERUA), IP, m.Option(ice.MSG_USERIP))
|
_sess_create(m, m.Option(USERNAME), UA, m.Option(ice.MSG_USERUA), IP, m.Option(ice.MSG_USERIP))
|
||||||
}},
|
}},
|
||||||
CHECK: {Name: "check sessid*", Hand: func(m *ice.Message, arg ...string) { _sess_check(m, m.Option(ice.MSG_SESSID)) }},
|
CHECK: {Name: "check sessid*", Hand: func(m *ice.Message, arg ...string) { _sess_check(m, m.Option(ice.MSG_SESSID)) }},
|
||||||
}, mdb.HashAction(mdb.EXPIRE, mdb.MONTH, mdb.SHORT, mdb.UNIQ, mdb.FIELD, "time,hash,usernick,username,userrole,ua,ip"), mdb.ImportantDataAction())},
|
}, mdb.HashAction(mdb.EXPIRE, mdb.MONTH, mdb.SHORT, mdb.UNIQ, mdb.FIELD, "time,hash,usernick,username,userrole,ua,ip"), mdb.ImportantHashAction())},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ func init() {
|
|||||||
mdb.CREATE: {Name: "create usernick username* userrole=void,tech userzone", Hand: func(m *ice.Message, arg ...string) {
|
mdb.CREATE: {Name: "create usernick username* userrole=void,tech userzone", Hand: func(m *ice.Message, arg ...string) {
|
||||||
_user_create(m, m.Option(USERNAME), m.OptionSimple(USERNICK, USERROLE, USERZONE)...)
|
_user_create(m, m.Option(USERNAME), m.OptionSimple(USERNICK, USERROLE, USERZONE)...)
|
||||||
}},
|
}},
|
||||||
}, mdb.HashAction(mdb.SHORT, USERNAME, mdb.FIELD, "time,usernick,username,userrole,userzone"), mdb.ImportantDataAction())},
|
}, mdb.HashAction(mdb.SHORT, USERNAME, mdb.FIELD, "time,usernick,username,userrole,userzone"), mdb.ImportantHashAction())},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,11 +89,15 @@ func _hash_prunes(m *ice.Message, prefix, chain string, arg ...string) {
|
|||||||
}
|
}
|
||||||
func _hash_export(m *ice.Message, prefix, chain, file string) {
|
func _hash_export(m *ice.Message, prefix, chain, file string) {
|
||||||
defer Lock(m, prefix, chain)()
|
defer Lock(m, prefix, chain)()
|
||||||
|
count := len(Confm(m, prefix, kit.Keys(chain, HASH)))
|
||||||
|
if count == 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
f, p, e := miss.CreateFile(kit.Keys(file, JSON))
|
f, p, e := miss.CreateFile(kit.Keys(file, JSON))
|
||||||
m.Assert(e)
|
m.Assert(e)
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
defer m.Echo(p)
|
defer m.Echo(p)
|
||||||
m.Logs(EXPORT, KEY, path.Join(prefix, chain), FILE, p, COUNT, len(Confm(m, prefix, kit.Keys(chain, HASH))))
|
m.Logs(EXPORT, KEY, path.Join(prefix, chain), FILE, p, COUNT, count)
|
||||||
en := json.NewEncoder(f)
|
en := json.NewEncoder(f)
|
||||||
if en.SetIndent("", " "); !m.Warn(en.Encode(m.Confv(prefix, kit.Keys(chain, HASH))), EXPORT, prefix) {
|
if en.SetIndent("", " "); !m.Warn(en.Encode(m.Confv(prefix, kit.Keys(chain, HASH))), EXPORT, prefix) {
|
||||||
m.Conf(prefix, kit.Keys(chain, HASH), "")
|
m.Conf(prefix, kit.Keys(chain, HASH), "")
|
||||||
|
@ -29,11 +29,13 @@ func _list_inputs(m *ice.Message, prefix, chain string, field, value string) {
|
|||||||
func _list_insert(m *ice.Message, prefix, chain string, arg ...string) {
|
func _list_insert(m *ice.Message, prefix, chain string, arg ...string) {
|
||||||
m.Logs(INSERT, KEY, path.Join(prefix, chain), arg)
|
m.Logs(INSERT, KEY, path.Join(prefix, chain), arg)
|
||||||
defer Lock(m, prefix, chain)()
|
defer Lock(m, prefix, chain)()
|
||||||
|
saveImportant(m, prefix, chain, kit.Simple(INSERT, prefix, chain, LIST, TIME, m.Time(), arg)...)
|
||||||
m.Echo("%d", Grow(m, prefix, chain, kit.Dict(arg, TARGET, m.Optionv(TARGET))))
|
m.Echo("%d", Grow(m, prefix, chain, kit.Dict(arg, TARGET, m.Optionv(TARGET))))
|
||||||
}
|
}
|
||||||
func _list_modify(m *ice.Message, prefix, chain string, field, value string, arg ...string) {
|
func _list_modify(m *ice.Message, prefix, chain string, field, value string, arg ...string) {
|
||||||
m.Logs(MODIFY, KEY, path.Join(prefix, chain), field, value, arg)
|
m.Logs(MODIFY, KEY, path.Join(prefix, chain), field, value, arg)
|
||||||
defer Lock(m, prefix, chain)()
|
defer Lock(m, prefix, chain)()
|
||||||
|
saveImportant(m, prefix, chain, kit.Simple(MODIFY, prefix, chain, LIST, field, value, arg)...)
|
||||||
Grows(m, prefix, chain, field, value, func(index int, val ice.Map) { _mdb_modify(m, val, field, arg...) })
|
Grows(m, prefix, chain, field, value, func(index int, val ice.Map) { _mdb_modify(m, val, field, arg...) })
|
||||||
}
|
}
|
||||||
func _list_select(m *ice.Message, prefix, chain, field, value string) {
|
func _list_select(m *ice.Message, prefix, chain, field, value string) {
|
||||||
|
@ -253,11 +253,31 @@ func AutoConfig(arg ...Any) *ice.Action {
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
}
|
}
|
||||||
func ImportantDataAction() ice.Actions {
|
func ImportantZoneAction() ice.Actions {
|
||||||
return ice.Actions{ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) { Config(m, "important", ice.TRUE) }}}
|
return ice.Actions{
|
||||||
|
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
Config(m, "important", ice.TRUE)
|
||||||
|
ZoneImport(m)
|
||||||
|
}},
|
||||||
|
ice.CTX_EXIT: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
m.OptionFields("")
|
||||||
|
ZoneExport(m)
|
||||||
|
}},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func ImportantHashAction() ice.Actions {
|
||||||
|
return ice.Actions{
|
||||||
|
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
Config(m, "important", ice.TRUE)
|
||||||
|
HashImport(m)
|
||||||
|
}},
|
||||||
|
ice.CTX_EXIT: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
HashExport(m)
|
||||||
|
}},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
func saveImportant(m *ice.Message, key, sub string, arg ...string) {
|
func saveImportant(m *ice.Message, key, sub string, arg ...string) {
|
||||||
kit.If(m.Conf(key, kit.Keys(sub, META, "important")) == ice.TRUE, func() { ice.SaveImportant(m, arg...) })
|
kit.If(m.Conf(key, kit.Keys(META, "important")) == ice.TRUE, func() { ice.SaveImportant(m, arg...) })
|
||||||
}
|
}
|
||||||
func ToMaps(value Map) Maps {
|
func ToMaps(value Map) Maps {
|
||||||
res := Maps{}
|
res := Maps{}
|
||||||
|
@ -2,6 +2,7 @@ package mdb
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/csv"
|
"encoding/csv"
|
||||||
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
|
||||||
ice "shylinux.com/x/icebergs"
|
ice "shylinux.com/x/icebergs"
|
||||||
@ -84,13 +85,19 @@ func _zone_export(m *ice.Message, prefix, chain, file string) {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
if count == 0 {
|
||||||
|
os.Remove(p)
|
||||||
|
return
|
||||||
|
}
|
||||||
m.Logs(EXPORT, KEY, path.Join(prefix, chain), FILE, p, COUNT, count)
|
m.Logs(EXPORT, KEY, path.Join(prefix, chain), FILE, p, COUNT, count)
|
||||||
m.Conf(prefix, kit.Keys(chain, HASH), "")
|
m.Conf(prefix, kit.Keys(chain, HASH), "")
|
||||||
}
|
}
|
||||||
func _zone_import(m *ice.Message, prefix, chain, file string) {
|
func _zone_import(m *ice.Message, prefix, chain, file string) {
|
||||||
defer Lock(m, prefix, chain)()
|
defer Lock(m, prefix, chain)()
|
||||||
f, e := miss.OpenFile(kit.Keys(file, CSV))
|
f, e := miss.OpenFile(kit.Keys(file, CSV))
|
||||||
m.Assert(e)
|
if m.Warn(e) {
|
||||||
|
return
|
||||||
|
}
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
r := csv.NewReader(f)
|
r := csv.NewReader(f)
|
||||||
head, _ := r.Read()
|
head, _ := r.Read()
|
||||||
|
@ -101,7 +101,7 @@ func init() {
|
|||||||
m.Option(mdb.TYPE, mdb.HashSelects(m.Spawn(), m.Option(mdb.HASH)).Append(mdb.TYPE))
|
m.Option(mdb.TYPE, mdb.HashSelects(m.Spawn(), m.Option(mdb.HASH)).Append(mdb.TYPE))
|
||||||
ctx.Run(m, arg...)
|
ctx.Run(m, arg...)
|
||||||
}},
|
}},
|
||||||
}, ctx.CmdAction(), mdb.HashAction(), mdb.ImportantDataAction()), Hand: func(m *ice.Message, arg ...string) {
|
}, ctx.CmdAction(), mdb.ImportantHashAction(), mdb.HashAction()), Hand: func(m *ice.Message, arg ...string) {
|
||||||
if len(arg) > 0 && arg[0] == ctx.ACTION {
|
if len(arg) > 0 && arg[0] == ctx.ACTION {
|
||||||
m.Option(mdb.TYPE, mdb.HashSelects(m.Spawn(), m.Option(mdb.HASH)).Append(mdb.TYPE))
|
m.Option(mdb.TYPE, mdb.HashSelects(m.Spawn(), m.Option(mdb.HASH)).Append(mdb.TYPE))
|
||||||
gdb.Event(m, FAVOR_ACTION, arg)
|
gdb.Event(m, FAVOR_ACTION, arg)
|
||||||
|
@ -30,22 +30,6 @@ func init() {
|
|||||||
AppInstall(m, "", web.CODE_VIMER)
|
AppInstall(m, "", web.CODE_VIMER)
|
||||||
AppInstall(m, "", web.CHAT_FAVOR)
|
AppInstall(m, "", web.CHAT_FAVOR)
|
||||||
AppInstall(m, "", web.DREAM)
|
AppInstall(m, "", web.DREAM)
|
||||||
if m.Cmd(DESKTOP).Length() == 0 {
|
|
||||||
DeskAppend(m, "Books", web.WIKI_WORD)
|
|
||||||
DeskAppend(m, "Photos", web.WIKI_FEEL)
|
|
||||||
DeskAppend(m, "Grapher", web.WIKI_DRAW)
|
|
||||||
DeskAppend(m, "Calendar", web.TEAM_PLAN, ctx.ARGS, team.MONTH)
|
|
||||||
DeskAppend(m, "", web.CHAT_FAVOR)
|
|
||||||
}
|
|
||||||
if m.Cmd(DOCK).Length() == 0 {
|
|
||||||
DockAppend(m, "Finder", Prefix(FINDER))
|
|
||||||
DockAppend(m, "Safari", web.CHAT_IFRAME)
|
|
||||||
DockAppend(m, "Terminal", web.CODE_XTERM)
|
|
||||||
DockAppend(m, "", web.CODE_GIT_REPOS, mdb.ICON, "usr/icons/git.jpg")
|
|
||||||
DockAppend(m, "", web.CODE_COMPILE, mdb.ICON, "usr/icons/go.png")
|
|
||||||
DockAppend(m, "", web.CODE_VIMER)
|
|
||||||
DockAppend(m, "", web.DREAM)
|
|
||||||
}
|
|
||||||
}},
|
}},
|
||||||
code.INSTALL: {Hand: func(m *ice.Message, arg ...string) { AppInstall(m, arg[0], arg[1], arg[2:]...) }},
|
code.INSTALL: {Hand: func(m *ice.Message, arg ...string) { AppInstall(m, arg[0], arg[1], arg[2:]...) }},
|
||||||
}, CmdHashAction("index,args"))},
|
}, CmdHashAction("index,args"))},
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
fieldset.macos.desktop { background-size:cover; background-position:center; }
|
fieldset.macos.desktop { background-size:cover; background-position:center; }
|
||||||
fieldset.macos.desktop>div.output>fieldset.macos { background-color:transparent; }
|
fieldset.macos.desktop>div.output>fieldset.macos { background-color:transparent; }
|
||||||
fieldset.macos.desktop>div.output>fieldset.macos>div.output { background-color:transparent; }
|
fieldset.macos.desktop>div.output>fieldset.macos>div.output { background-color:transparent; }
|
||||||
fieldset.macos.desktop>div.output>fieldset.macos.menu { font-family:monospace; line-height:25px; border-radius:0; height:25px; width:100%; position:absolute; top:0; }
|
fieldset.macos.desktop>div.output>fieldset.macos.menu { font-family:monospace; line-height:25px; border-radius:0; height:25px; width:100%; position:absolute; top:0; overflow:hidden; }
|
||||||
fieldset.macos.desktop>div.output>fieldset.macos.searchs { position:absolute; }
|
fieldset.macos.desktop>div.output>fieldset.macos.searchs { position:absolute; }
|
||||||
fieldset.macos.desktop>div.output>fieldset.macos.searchs>form.option>div.item.icon.delete { display:none; }
|
fieldset.macos.desktop>div.output>fieldset.macos.searchs>form.option>div.item.icon.delete { display:none; }
|
||||||
fieldset.macos.desktop>div.output>fieldset.macos.searchs>form.option>div.item.keyword input { width:320px; background-color:transparent; border:#404141 solid 1px; }
|
fieldset.macos.desktop>div.output>fieldset.macos.searchs>form.option>div.item.keyword input { width:320px; background-color:transparent; border:#404141 solid 1px; }
|
||||||
@ -11,10 +11,9 @@ fieldset.macos.desktop>div.output>fieldset.macos.notifications>div.action>div.it
|
|||||||
fieldset.macos.desktop>div.output>fieldset.macos.notifications>div.action>div.item input { background-color:transparent; }
|
fieldset.macos.desktop>div.output>fieldset.macos.notifications>div.action>div.item input { background-color:transparent; }
|
||||||
fieldset.macos.desktop>div.output>fieldset.macos.notifications>div.output>div.item { margin-top:10px; margin-right:10px; min-height:60px; clear:both; }
|
fieldset.macos.desktop>div.output>fieldset.macos.notifications>div.output>div.item { margin-top:10px; margin-right:10px; min-height:60px; clear:both; }
|
||||||
fieldset.macos.desktop>div.output>fieldset.macos.notifications div.item div.title { margin-top:10px; width:132px; overflow:hidden; }
|
fieldset.macos.desktop>div.output>fieldset.macos.notifications div.item div.title { margin-top:10px; width:132px; overflow:hidden; }
|
||||||
fieldset.macos.desktop>div.output>fieldset.macos.notifications div.item div.time { color:gray; font-size:12px; margin-top:10px; width:48px; }
|
fieldset.macos.desktop>div.output>fieldset.macos.notifications div.item div.time { font-size:12px; margin-top:10px; width:48px; }
|
||||||
fieldset.macos.desktop>div.output>fieldset.macos.notifications div.item div.content { width:180px; }
|
fieldset.macos.desktop>div.output>fieldset.macos.notifications div.item div.content { width:180px; }
|
||||||
fieldset.macos.desktop>div.output>fieldset.macos.dock { border:#ffffff3d solid 1px; border-radius:20px; position:absolute; bottom:10px; z-index:11; transition:margin-left 0.3s; }
|
fieldset.macos.desktop>div.output>fieldset.macos.dock { border:#ffffff3d solid 1px; border-radius:20px; position:absolute; bottom:10px; z-index:11; transition:margin-left 0.3s; }
|
||||||
fieldset.macos.desktop>div.output>fieldset.macos.dock:hover { margin-left:-40px; transition:margin-left 0.3s; }
|
|
||||||
fieldset.macos.desktop>div.output>div.desktop { padding-top:25px; }
|
fieldset.macos.desktop>div.output>div.desktop { padding-top:25px; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop:not(.select) { display:none; }
|
fieldset.macos.desktop>div.output>div.desktop:not(.select) { display:none; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>div.item { position:absolute; text-align:center; }
|
fieldset.macos.desktop>div.output>div.desktop>div.item { position:absolute; text-align:center; }
|
||||||
@ -22,36 +21,36 @@ fieldset.macos.desktop>div.output>div.desktop>div.item:hover { background-color:
|
|||||||
fieldset.macos.desktop>div.output>div.desktop>div.item img { width:80px; border-radius:80px; }
|
fieldset.macos.desktop>div.output>div.desktop>div.item img { width:80px; border-radius:80px; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>div.item>div.name { font-size:12px; width:80px; overflow:hidden; }
|
fieldset.macos.desktop>div.output>div.desktop>div.item>div.name { font-size:12px; width:80px; overflow:hidden; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset { border-radius:10px; position:absolute; }
|
fieldset.macos.desktop>div.output>div.desktop>fieldset { border-radius:10px; position:absolute; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.item.button { border-radius:20px; height:20px; width:20px; scale:0.7; position:absolute; top:15px; right:10px; }
|
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.item.button { border-radius:20px; height:20px; width:20px; scale:0.7; position:absolute; top:17px; right:10px; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset>legend { background-color:unset; padding-right:10px; margin:10px 0; }
|
fieldset.macos.desktop>div.output>div.desktop>fieldset>legend { background-color:unset; padding-right:10px; margin:10px 0; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset>form.option>*:not(.textarea) { margin:10px 0px 10px 10px; }
|
fieldset.macos.desktop>div.output>div.desktop>fieldset>form.option>*:not(.textarea) { margin:10px 0px 10px 10px; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset>form.option>div.icon { margin-left:0; margin-top:12px; margin-bottom:8px; }
|
fieldset.macos.desktop>div.output>div.desktop>fieldset>form.option>div.icon { margin-left:0; margin-top:12px; margin-bottom:8px; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset>form.option>div.item.icons { margin-left:0; }
|
fieldset.macos.desktop>div.output>div.desktop>fieldset>form.option>div.item.icons { margin-left:0; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset>form.option>div.item:last-child { margin-right:20px; }
|
fieldset.macos.desktop>div.output>div.desktop>fieldset>form.option>div.item:last-child { margin-right:20px; }
|
||||||
|
fieldset.macos.desktop>div.output>div.desktop>fieldset>form.option>div.item:last-child { margin-right:80px; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.action>* { margin:10px 0px 10px 10px; }
|
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.action>* { margin:10px 0px 10px 10px; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.action>div.item.icons>span.icon { margin-top:12px; }
|
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.action>div.item.icons>span.icon { margin-top:12px; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.action>div.item:last-child { margin-right:80px; }
|
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.action>div.item:last-child { margin-right:80px; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset>form.option>div.item:last-child { margin-right:80px; }
|
fieldset.macos.desktop>div.output>div.desktop>fieldset.web.wiki.feel>div.status { display:none; }
|
||||||
|
fieldset.macos.desktop>div.output>div.desktop>fieldset.web.code.vimer>div.status { display:none; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset.web.code.xterm>div.status { display:none; }
|
fieldset.macos.desktop>div.output>div.desktop>fieldset.web.code.xterm>div.status { display:none; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset.web.code.xterm>div.action>div.tabs:only-child { display:none; }
|
fieldset.macos.desktop>div.output>div.desktop>fieldset.web.code.xterm>div.action>div.tabs:only-child { display:none; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset.web.code.vimer>div.status { display:none; }
|
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset.web.wiki.feel>div.status { display:none; }
|
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset.web.chat.iframe>div.status { display:none; }
|
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset.web.chat.macos.finder>div.status { display:none; }
|
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset.web.code.compile>form.option>div.item:last-child { margin-right:80px; }
|
fieldset.macos.desktop>div.output>div.desktop>fieldset.web.code.compile>form.option>div.item:last-child { margin-right:80px; }
|
||||||
|
fieldset.macos.desktop>div.output>div.desktop>fieldset.web.chat.iframe>div.status { display:none; }
|
||||||
|
fieldset.macos.desktop>div.output>div.desktop>fieldset.web.chat.iframe>form.option>div.item.hash>input { width:360px; }
|
||||||
|
fieldset.macos.desktop>div.output>div.desktop>fieldset.web.chat.macos.finder>div.status { display:none; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.output>fieldset>form.option>div.item { margin-right:0px; }
|
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.output>fieldset>form.option>div.item { margin-right:0px; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.output>fieldset>div.action>div.item { margin-right:0px; }
|
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.output>fieldset>div.action>div.item { margin-right:0px; }
|
||||||
fieldset.macos.menu>div.output>div.item { padding:0 5px; float:right; cursor:pointer; }
|
fieldset.macos.menu>div.output>div.item { padding:0 5px; float:right; cursor:pointer; }
|
||||||
|
fieldset.macos.menu>div.output>div.item.avatar>img { height:25px; }
|
||||||
fieldset.macos.menu>div.output>div.menu { float:left; padding:0 20px; cursor:pointer; }
|
fieldset.macos.menu>div.output>div.menu { float:left; padding:0 20px; cursor:pointer; }
|
||||||
fieldset.macos.menu>div.output>div.tabs { float:left; }
|
fieldset.macos.menu>div.output>div.tabs { float:left; }
|
||||||
fieldset.macos.menu>div.output>div.tabs.select { background-color:transparent; color:white; }
|
fieldset.macos.menu>div.output>div.tabs.select { background-color:transparent; color:white; }
|
||||||
fieldset.macos.dock>div.output { height:80px; overflow:visible; display:flex; }
|
fieldset.macos.dock>div.output { height:80px; display:flex; overflow:auto; }
|
||||||
fieldset.macos.dock>div.output>div.space { background-color:#ececec36; margin:10px; height:calc(100% - 20px); width:2px; }
|
fieldset.macos.dock>div.output>div.space { background-color:#ececec36; margin:10px; height:calc(100% - 20px); width:2px; }
|
||||||
fieldset.macos.dock>div.output>div.item { text-align:center; align-self:baseline; transition:margin-top 0.3s; }
|
fieldset.macos.dock>div.output>div.item { text-align:center; align-self:baseline; transition:margin-top 0.3s; }
|
||||||
fieldset.macos.dock>div.output>div.item:hover { background-color:unset; margin-top:-80px; transition:margin-top 0.3s; }
|
|
||||||
fieldset.macos.dock>div.output>div.item>div.name { display:none; }
|
fieldset.macos.dock>div.output>div.item>div.name { display:none; }
|
||||||
fieldset.macos.dock>div.output>div.item img { border-radius:80px; width:80px; transition:width 0.3s; }
|
fieldset.macos.dock>div.output>div.item img { border-radius:80px; width:80px; transition:width 0.3s; }
|
||||||
fieldset.macos.dock>div.output>div.item img:hover { width:160px; transition:width 0.3s; }
|
|
||||||
fieldset.macos.finder>div.output>div.project>div.item input { width:100%; }
|
fieldset.macos.finder>div.output>div.project>div.item input { width:100%; }
|
||||||
fieldset.macos.finder>div.output div.content>div.item { float:left; text-align:center; }
|
fieldset.macos.finder>div.output div.content>div.item { float:left; text-align:center; }
|
||||||
fieldset.macos.finder>div.output div.content>div.item img { width:80px; border-radius:80px; }
|
fieldset.macos.finder>div.output div.content>div.item img { width:80px; border-radius:80px; }
|
||||||
@ -60,43 +59,41 @@ div.carte.macos.float { font-size:14px; padding:10px; border:#ffffff5e solid 1px
|
|||||||
div.carte.macos.float div.item { background:transparent; }
|
div.carte.macos.float div.item { background:transparent; }
|
||||||
div.carte.macos.float hr { border-bottom:gray solid 1px; }
|
div.carte.macos.float hr { border-bottom:gray solid 1px; }
|
||||||
div.carte.macos.float { background-color:#e1e5ea; }
|
div.carte.macos.float { background-color:#e1e5ea; }
|
||||||
fieldset.macos.desktop>div.output { color:black; }
|
body.light fieldset.macos.desktop>div.output { background-color:unset; }
|
||||||
fieldset.macos.desktop>div.output>fieldset.macos.menu { background-color:#daefff99; color:black; }
|
body.light fieldset.macos.desktop>div.output>fieldset.macos { background-color:#daefff99; }
|
||||||
fieldset.macos.desktop>div.output>fieldset.macos.dock { background-color:#e9f1f594; }
|
body.light fieldset.macos.desktop>div.output>fieldset.macos.notifications { background-color:transparent; }
|
||||||
fieldset.macos.desktop>div.output>fieldset.macos.searchs { background-color:#daefff99; }
|
body.light fieldset.macos.desktop>div.output>fieldset.macos.notifications div.item { background-color:#daefff99; }
|
||||||
fieldset.macos.desktop>div.output>fieldset.macos.notifications div.item { background-color:#daefff99; color:black; }
|
body.light fieldset.macos.desktop>div.output>div.desktop>fieldset { background-color:#dee1e6; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset { background-color:#dee1e6; }
|
body.light fieldset.macos.desktop>div.output>div.desktop fieldset input { background-color:white; border:#e4e5e5 solid 1px; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.output { background-color:white; }
|
body.light fieldset.macos.desktop>div.output>div.desktop fieldset table.content tbody tr:nth-child(odd) { background-color:#f4f5f5; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.status { border-top:#dddede solid 1px; }
|
body.light fieldset.macos.desktop>div.output>div.desktop fieldset table.content tbody tr:nth-child(even) { background-color:white; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop fieldset table.content tbody tr:nth-child(odd) { background-color:#f4f5f5; color:black; }
|
body.light fieldset.macos.desktop>div.output>div.desktop fieldset>div.output.card>div.item { border:#d3d4d4 solid 1px; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop fieldset table.content tbody tr:nth-child(even) { background-color:white; color:black; }
|
body.light fieldset.macos.desktop>div.output>div.desktop fieldset>div.output.card>div.item>div.title { border-bottom:#d3d4d4 solid 1px; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop fieldset input { background-color:white; border:#e4e5e5 solid 1px; color:black; caret-color:black; }
|
body.light fieldset.macos.desktop>div.output>div.desktop>fieldset>div.status { border-top:#dddede solid 1px; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop fieldset>div.output.card>div.item { border:#d3d4d4 solid 1px; }
|
body.dark fieldset.macos.desktop>div.output { background-color:unset; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop fieldset>div.output.card>div.item>div.title { border-bottom:#d3d4d4 solid 1px; }
|
body.dark fieldset.macos.desktop>div.output>fieldset.macos { background-color:#08234ad1; }
|
||||||
body.dark fieldset.macos.desktop input { color:#e8eaed; }
|
body.dark fieldset.macos.desktop>div.output>fieldset.macos.notifications { background-color:transparent; }
|
||||||
body.dark fieldset.macos.desktop input[type=button] { background-color:#5e5f5f; }
|
body.dark fieldset.macos.desktop>div.output>fieldset.macos.notifications div.item { background-color:#08234ad1; }
|
||||||
body.dark fieldset.macos.desktop>div.output { background-color:unset; color:white; }
|
body.dark fieldset.macos.desktop>div.output>fieldset.macos.searchs a { color:silver; }
|
||||||
body.dark fieldset.macos.desktop>div.output>fieldset.macos.menu { background-color:#08234ad1; color:#e8eaed; }
|
|
||||||
body.dark fieldset.macos.desktop>div.output>fieldset.macos.dock { background-color:#0e202e70; }
|
|
||||||
body.dark fieldset.macos.desktop>div.output>fieldset.macos.searchs { background-color:#0e202e70; }
|
|
||||||
body.dark fieldset.macos.desktop>div.output>fieldset.macos.searchs a { color:white; }
|
|
||||||
body.dark fieldset.macos.desktop>div.output>fieldset.macos.notifications div.item { background-color:#08234ad1; color:white; }
|
|
||||||
body.dark fieldset.macos.desktop>div.output>div.desktop>fieldset { background-color:#333434; }
|
body.dark fieldset.macos.desktop>div.output>div.desktop>fieldset { background-color:#333434; }
|
||||||
body.dark fieldset.macos.desktop>div.output>div.desktop>fieldset>div.output { background-color:#1a1d1d; }
|
body.dark fieldset.macos.desktop>div.output>div.desktop fieldset input { background-color:#333434; border:#404141 solid 1px; }
|
||||||
body.dark fieldset.macos.desktop>div.output>div.desktop>fieldset>div.status { border-top:#3e4040 solid 1px; }
|
body.dark fieldset.macos.desktop>div.output>div.desktop fieldset table.content tbody tr:nth-child(odd) { background-color:#1a1d1e; }
|
||||||
body.dark fieldset.macos.desktop>div.output>div.desktop fieldset table.content tbody tr:nth-child(odd) { background-color:#1a1d1e; color:white; }
|
body.dark fieldset.macos.desktop>div.output>div.desktop fieldset table.content tbody tr:nth-child(even) { background-color:#282B2F; }
|
||||||
body.dark fieldset.macos.desktop>div.output>div.desktop fieldset table.content tbody tr:nth-child(even) { background-color:#282B2F; color:white; }
|
|
||||||
body.dark fieldset.macos.desktop>div.output>div.desktop fieldset input { background-color:#333434; border:#404141 solid 1px; color:white; caret-color:white; }
|
|
||||||
body.dark fieldset.macos.desktop>div.output>div.desktop fieldset>div.output.card>div.item { border:#3e4040 solid 1px; }
|
body.dark fieldset.macos.desktop>div.output>div.desktop fieldset>div.output.card>div.item { border:#3e4040 solid 1px; }
|
||||||
body.dark fieldset.macos.desktop>div.output>div.desktop fieldset>div.output.card>div.item>div.title { border-bottom:#3e4040 solid 1px; }
|
body.dark fieldset.macos.desktop>div.output>div.desktop fieldset>div.output.card>div.item>div.title { border-bottom:#3e4040 solid 1px; }
|
||||||
body.dark div.carte.macos.float { background-color:#29323beb; color:#e8eaed; }
|
body.dark fieldset.macos.desktop>div.output>div.desktop>fieldset>div.status { border-top:#3e4040 solid 1px; }
|
||||||
body.light fieldset.macos.desktop>div.output { background-color:unset; }
|
body.dark div.carte.macos.float { background-color:#29323beb; }
|
||||||
|
body.black fieldset.macos.desktop>div.output>fieldset.macos.searchs a { color:cyan; }
|
||||||
body.black fieldset.macos.desktop>div.output>div.desktop>fieldset { background-color:#3433337a; }
|
body.black fieldset.macos.desktop>div.output>div.desktop>fieldset { background-color:#3433337a; }
|
||||||
|
body.black fieldset.macos.desktop>div.output>div.desktop fieldset table.content tbody tr:nth-child(odd) { background-color:#1a1d1ee0; }
|
||||||
|
body.black fieldset.macos.desktop>div.output>div.desktop fieldset table.content tbody tr:nth-child(even) { background-color:#282b2fc7; }
|
||||||
body.black fieldset.macos.desktop>div.output>div.desktop>fieldset>div.output { background-color:#1a1d1d9c; }
|
body.black fieldset.macos.desktop>div.output>div.desktop>fieldset>div.output { background-color:#1a1d1d9c; }
|
||||||
body.black fieldset.macos.desktop>div.output>div.desktop fieldset table.content tbody tr:nth-child(odd) { background-color:#1a1d1ee0; color:white; }
|
body.white fieldset.macos.desktop>div.output>fieldset.macos.searchs a { color:black; }
|
||||||
body.black fieldset.macos.desktop>div.output>div.desktop fieldset table.content tbody tr:nth-child(even) { background-color:#282b2fc7; color:white; }
|
|
||||||
body.white fieldset.macos.desktop>div.output>div.desktop>fieldset { background-color:#f5f5f594; }
|
body.white fieldset.macos.desktop>div.output>div.desktop>fieldset { background-color:#f5f5f594; }
|
||||||
body.white fieldset.macos.desktop>div.output>div.desktop>fieldset>legend { color:black; }
|
body.white fieldset.macos.desktop>div.output>div.desktop fieldset table.content tbody tr:nth-child(odd) { background-color:#a5afbdb5; }
|
||||||
|
body.white fieldset.macos.desktop>div.output>div.desktop fieldset table.content tbody tr:nth-child(even) { background-color:#d4dddfd4; }
|
||||||
body.white fieldset.macos.desktop>div.output>div.desktop>fieldset>div.output { background-color:#ffffff94; }
|
body.white fieldset.macos.desktop>div.output>div.desktop>fieldset>div.output { background-color:#ffffff94; }
|
||||||
body.white fieldset.macos.desktop>div.output>div.desktop fieldset table.content tbody tr:nth-child(odd) { background-color:#a5afbdb5; color:black; }
|
body:not(.mobile) fieldset.macos.dock>div.output { overflow:visible; }
|
||||||
body.white fieldset.macos.desktop>div.output>div.desktop fieldset table.content tbody tr:nth-child(even) { background-color:#d4dddfd4; color:black; }
|
body:not(.mobile) fieldset.macos.dock>div.output>div.item:hover { background-color:unset; margin-top:-80px; transition:margin-top 0.3s; }
|
||||||
|
body:not(.mobile) fieldset.macos.dock>div.output>div.item img:hover { width:160px; transition:width 0.3s; }
|
||||||
|
body:not(.mobile) fieldset.macos.desktop>div.output>fieldset.macos.dock:hover { margin-left:-40px; transition:margin-left 0.3s; }
|
||||||
|
@ -1,10 +1,32 @@
|
|||||||
package macos
|
package macos
|
||||||
|
|
||||||
import ice "shylinux.com/x/icebergs"
|
import (
|
||||||
|
ice "shylinux.com/x/icebergs"
|
||||||
|
"shylinux.com/x/icebergs/base/ctx"
|
||||||
|
"shylinux.com/x/icebergs/base/mdb"
|
||||||
|
"shylinux.com/x/icebergs/base/web"
|
||||||
|
"shylinux.com/x/icebergs/core/team"
|
||||||
|
kit "shylinux.com/x/toolkits"
|
||||||
|
)
|
||||||
|
|
||||||
const DESKTOP = "desktop"
|
const DESKTOP = "desktop"
|
||||||
|
|
||||||
func init() { Index.MergeCommands(ice.Commands{DESKTOP: {Actions: CmdHashAction()}}) }
|
func init() {
|
||||||
|
Index.MergeCommands(ice.Commands{DESKTOP: {Actions: ice.MergeActions(ice.Actions{
|
||||||
|
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
if m.Cmd(DESKTOP).Length() == 0 {
|
||||||
|
DeskAppend(m, "Books", web.WIKI_WORD)
|
||||||
|
DeskAppend(m, "Photos", web.WIKI_FEEL)
|
||||||
|
DeskAppend(m, "Grapher", web.WIKI_DRAW)
|
||||||
|
DeskAppend(m, "Calendar", web.TEAM_PLAN, ctx.ARGS, team.MONTH)
|
||||||
|
DeskAppend(m, "", web.CHAT_FAVOR)
|
||||||
|
}
|
||||||
|
}},
|
||||||
|
web.DREAM_TABLES: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
kit.Switch(m.Option(mdb.TYPE), kit.Simple(web.SERVER, web.WORKER), func() { m.PushButton(kit.Dict(m.CommandKey(), "桌面")) })
|
||||||
|
}},
|
||||||
|
}, web.DreamAction(), mdb.ImportantHashAction(), CmdHashAction())}})
|
||||||
|
}
|
||||||
|
|
||||||
func DeskAppend(m *ice.Message, name, index string, arg ...string) {
|
func DeskAppend(m *ice.Message, name, index string, arg ...string) {
|
||||||
install(m, DESKTOP, name, index, arg...)
|
install(m, DESKTOP, name, index, arg...)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
Volcanos(chat.ONIMPORT, {
|
Volcanos(chat.ONIMPORT, {
|
||||||
_init: function(can, msg, cb) { if (can.isCmdMode()) { can.onappend.style(can, html.OUTPUT), can.ConfHeight(can.page.height()) } can.onimport.layout(can)
|
_init: function(can, msg, cb) { if (can.isCmdMode()) { can.onappend.style(can, html.OUTPUT), can.ConfHeight(can.page.height()) }
|
||||||
can.ui = {}, can.base.isFunc(cb) && cb(msg), can.onmotion.clear(can), can.onlayout.background(can, can.user.info.background||"/require/usr/icons/background.jpg", can._fields)
|
can.ui = {}, can.base.isFunc(cb) && cb(msg), can.onmotion.clear(can), can.onlayout.background(can, can.user.info.background||"/require/usr/icons/background.jpg", can._fields)
|
||||||
can.onimport._menu(can), can.onimport._dock(can), can.onimport._searchs(can), can.onimport._notifications(can)
|
can.onimport._menu(can), can.onimport._dock(can), can.onimport._searchs(can), can.onimport._notifications(can), can.onimport.layout(can)
|
||||||
},
|
},
|
||||||
_menu: function(can) { can.onappend.plugin(can, {index: "web.chat.macos.menu", style: html.OUTPUT}, function(sub) { can.ui.menu = sub
|
_menu: function(can) { can.onappend.plugin(can, {index: "web.chat.macos.menu", style: html.OUTPUT}, function(sub) { can.ui.menu = sub
|
||||||
sub.onexport.record = function(_, value, key, item) { delete(can.onfigure._path)
|
sub.onexport.record = function(_, value, key, item) { delete(can.onfigure._path)
|
||||||
@ -10,22 +10,28 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
case "desktop": var carte = can.user.carte(event, can, {}, can.core.Item(can.onfigure), function(event, button, meta, carte) { can.onfigure[button](event, can, carte) }); break
|
case "desktop": var carte = can.user.carte(event, can, {}, can.core.Item(can.onfigure), function(event, button, meta, carte) { can.onfigure[button](event, can, carte) }); break
|
||||||
case "searchs": can.onmotion.toggle(can, can.ui.searchs._target); break
|
case "searchs": can.onmotion.toggle(can, can.ui.searchs._target); break
|
||||||
case "notifications": can.ui.notifications._output.innerHTML && can.onmotion.toggle(can, can.ui.notifications._target); break
|
case "notifications": can.ui.notifications._output.innerHTML && can.onmotion.toggle(can, can.ui.notifications._target); break
|
||||||
|
default: can.onimport._window(can, value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sub.onexport.output = function() { can.onimport._desktop(can, can._msg) }
|
sub.onexport.output = function() { can.onimport._desktop(can, can._msg)
|
||||||
|
can.Conf("session") && can.runActionCommand(event, "session", [can.Conf("session")], function(msg) { var item = msg.TableDetail()
|
||||||
|
can.onimport.session(can, can.base.Obj(item.args))
|
||||||
|
})
|
||||||
|
}
|
||||||
}) },
|
}) },
|
||||||
_searchs: function(can) { can.onappend.plugin(can, {index: "web.chat.macos.searchs"}, function(sub) { can.ui.searchs = sub
|
_searchs: function(can) { can.onappend.plugin(can, {index: "web.chat.macos.searchs"}, function(sub) { can.ui.searchs = sub
|
||||||
can.page.style(can, sub._target, html.LEFT, can.ConfWidth()/4, html.TOP, can.ConfHeight()/4), sub.onimport.size(sub, can.ConfHeight()/2, can.ConfWidth()/2, true)
|
can.page.style(can, sub._target, html.LEFT, can.ConfWidth()/4, html.TOP, can.ConfHeight()/4), sub.onimport.size(sub, can.ConfHeight()/2, can.ConfWidth()/2, true)
|
||||||
sub.onexport.record = function(sub, value, key, item) {
|
sub.onexport.record = function(sub, value, key, item) {
|
||||||
if (item.cmd == ctx.COMMAND) { can.onimport._window(can, {index: can.core.Keys(item.type, item.name.split(lex.SP)[0])}) }
|
if (item.cmd == ctx.COMMAND) { can.onimport._window(can, {index: can.core.Keys(item.type, item.name.split(lex.SP)[0])}) }
|
||||||
if (item.type == nfs.FILE) { can.onimport._window(can, {index: web.CODE_VIMER, args: can.misc.SplitPath(can, item.text) }) }
|
if (item.type == nfs.FILE) { can.onimport._window(can, {index: web.CODE_VIMER, args: can.misc.SplitPath(can, item.text) }) }
|
||||||
}
|
}, can.ConfHeight() < 800 && can.onmotion.delay(can, function() { can.onmotion.hidden(can, sub._target) })
|
||||||
}) },
|
}) },
|
||||||
_notifications: function(can) { can.onappend.plugin(can, {index: "web.chat.macos.notifications", style: html.OUTPUT}, function(sub) { can.ui.notifications = sub
|
_notifications: function(can) { can.onappend.plugin(can, {index: "web.chat.macos.notifications", style: html.OUTPUT}, function(sub) { can.ui.notifications = sub
|
||||||
sub.onexport.record = function(sub, value, key, item) { can.onimport._window(can, item) }
|
sub.onexport.record = function(sub, value, key, item) { can.onimport._window(can, item) }
|
||||||
|
can.ConfHeight() < 800 && can.onmotion.delay(can, function() { can.onmotion.hidden(can, sub._target) })
|
||||||
}) },
|
}) },
|
||||||
_dock: function(can) { can.onappend.plugin(can, {index: "web.chat.macos.dock", style: html.OUTPUT}, function(sub) { can.ui.dock = sub
|
_dock: function(can) { can.onappend.plugin(can, {index: "web.chat.macos.dock", style: html.OUTPUT}, function(sub) { can.ui.dock = sub
|
||||||
sub.onexport.output = function(sub, msg) { can.page.style(can, sub._target, html.LEFT, (can.ConfWidth()-msg.Length()*80)/2) }
|
sub.onexport.output = function(sub, msg) { can.page.style(can, sub._target, html.LEFT, can.base.Min((can.ConfWidth()-msg.Length()*80)/2, 0)) }
|
||||||
sub.onexport.record = function(sub, value, key, item) { can.onimport._window(can, item) }
|
sub.onexport.record = function(sub, value, key, item) { can.onimport._window(can, item) }
|
||||||
}) },
|
}) },
|
||||||
_item: function(can, item) { can.runAction(can.request(event, item), mdb.CREATE, [], function() { can.run(event, [], function(msg) {
|
_item: function(can, item) { can.runAction(can.request(event, item), mdb.CREATE, [], function() { can.run(event, [], function(msg) {
|
||||||
@ -37,13 +43,14 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
remove: function() { can.runAction(event, mdb.REMOVE, [item.hash]) },
|
remove: function() { can.runAction(event, mdb.REMOVE, [item.hash]) },
|
||||||
}); can.page.style(can, carte._target, html.TOP, event.y) },
|
}); can.page.style(can, carte._target, html.TOP, event.y) },
|
||||||
}) }) },
|
}) }) },
|
||||||
_desktop: function(can, msg) { var target = can.page.Append(can, can._output, [{view: html.DESKTOP}])._target; can.onimport.__item(can, msg, target), can.ui.desktop = target
|
_desktop: function(can, msg, name) { var target = can.page.Append(can, can._output, [{view: html.DESKTOP}])._target; can.onimport.__item(can, msg, target), can.ui.desktop = target
|
||||||
target._tabs = can.onimport.tabs(can, [{name: "Desktop"+(can.page.Select(can, can._output, html.DIV_DESKTOP).length-1)}], function() { can.onmotion.select(can, can._output, "div.desktop", target), can.ui.desktop = target }, function() { can.page.Remove(can, target) }, can.ui.menu._output), target._tabs._desktop = target
|
target._tabs = can.onimport.tabs(can, [{name: name||"Desktop"+(can.page.Select(can, can._output, html.DIV_DESKTOP).length-1)}], function() { can.onmotion.select(can, can._output, "div.desktop", target), can.ui.desktop = target }, function() { can.page.Remove(can, target) }, can.ui.menu._output), target._tabs._desktop = target
|
||||||
target.ondragend = function() { can.onimport._item(can, window._drag_item) }
|
target.ondragend = function() { can.onimport._item(can, window._drag_item) }
|
||||||
},
|
},
|
||||||
_window: function(can, item) {
|
_window: function(can, item) { if (!item.index) { return }
|
||||||
item.top = 125, item.height = can.base.Min(can.ConfHeight()-400, 480, 800), item.width = can.base.Min(can.ConfWidth()-400, 640, 1000)
|
item.left = 100, item.top = 125, item.height = can.base.Min(can.ConfHeight()-400, 480, 800), item.width = can.base.Min(can.ConfWidth()-400, 640, 1000)
|
||||||
if (can.ConfHeight() < 800) { item.top = 25, item.height = can.ConfHeight()-165 }
|
if (can.ConfHeight() < 800) { item.top = 25, item.height = can.ConfHeight()-165 }
|
||||||
|
if (can.user.isMobile) { item.left = 0, item.top = 25 }
|
||||||
can.onappend.plugin(can, item, function(sub) { can.ondetail.select(can, sub._target)
|
can.onappend.plugin(can, item, function(sub) { can.ondetail.select(can, sub._target)
|
||||||
var index = 0; can.core.Item({
|
var index = 0; can.core.Item({
|
||||||
"#f95f57": function(event) { sub.onaction.close(event, sub) },
|
"#f95f57": function(event) { sub.onaction.close(event, sub) },
|
||||||
@ -54,7 +61,7 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
},
|
},
|
||||||
"#32c840": function(event) { sub.onaction.full(event, sub) },
|
"#32c840": function(event) { sub.onaction.full(event, sub) },
|
||||||
}, function(color, cb) { can.page.insertBefore(can, [{view: [[html.ITEM, html.BUTTON]], style: {"background-color": color, right: 10+20*index++}, onclick: cb}], sub._output) })
|
}, function(color, cb) { can.page.insertBefore(can, [{view: [[html.ITEM, html.BUTTON]], style: {"background-color": color, right: 10+20*index++}, onclick: cb}], sub._output) })
|
||||||
sub.onimport.size(sub, item.height, item.width, true), can.onmotion.move(can, sub._target, {"z-index": 10, top: item.top, left: 100})
|
sub.onimport.size(sub, item.height, item.width, true), can.onmotion.move(can, sub._target, {"z-index": 10, top: item.top, left: item.left})
|
||||||
sub.onimport._open = function(sub, msg, arg) { can.onimport._window(can, {index: "web.chat.iframe", args: [arg]}) }
|
sub.onimport._open = function(sub, msg, arg) { can.onimport._window(can, {index: "web.chat.iframe", args: [arg]}) }
|
||||||
sub.onmotion.resize(can, sub._target, function(height, width) { sub.onimport.size(sub, height, width) }, 25)
|
sub.onmotion.resize(can, sub._target, function(height, width) { sub.onimport.size(sub, height, width) }, 25)
|
||||||
sub.onexport.record = function(sub, value, key, item) { can.onimport._window(can, item) }
|
sub.onexport.record = function(sub, value, key, item) { can.onimport._window(can, item) }
|
||||||
@ -63,13 +70,18 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
sub.onappend.desktop = function(item) { can.onimport._item(can, item) }
|
sub.onappend.desktop = function(item) { can.onimport._item(can, item) }
|
||||||
sub.onappend.dock = function(item) { can.ui.dock.runAction(can.request(event, item), mdb.CREATE, [], function() { can.ui.dock.Update() }) }
|
sub.onappend.dock = function(item) { can.ui.dock.runAction(can.request(event, item), mdb.CREATE, [], function() { can.ui.dock.Update() }) }
|
||||||
sub.onexport.output = function() { if (item.index == "web.chat.macos.opens") { can.page.Remove(can, sub._target) } }
|
sub.onexport.output = function() { if (item.index == "web.chat.macos.opens") { can.page.Remove(can, sub._target) } }
|
||||||
|
sub._target.onclick = function(event) { can.page.Select(can, sub._target.parentNode, html.FIELDSET, function(target) { can.page.style(can, target, "z-index", target == sub._target? "10": "9") }) }
|
||||||
|
|
||||||
}, can.ui.desktop)
|
}, can.ui.desktop)
|
||||||
},
|
},
|
||||||
session: function(can, list) { can.page.Select(can, can._output, html.DIV_DESKTOP, function(target) { can.page.Remove(can, target) }), can.onmotion.clear(can, can._action)
|
session: function(can, list) { can.page.Select(can, can._output, html.DIV_DESKTOP, function(target) { can.page.Remove(can, target) })
|
||||||
can.core.List(list, function(item) { can.onimport._desktop(can), can.core.List(item.list, function(item) { can.onimport._window(can, item) }) })
|
can.page.Select(can, can.ui.menu._output, html.DIV_TABS, function(target) { can.page.Remove(can, target) })
|
||||||
|
can.core.List(list, function(item) { can.onimport._desktop(can, null, item.name), can.core.List(item.list, function(item) { can.onimport._window(can, item) }) })
|
||||||
|
},
|
||||||
|
layout: function(can) {
|
||||||
|
can.page.style(can, can._output, html.HEIGHT, can.ConfHeight(), html.WIDTH, can.ConfWidth())
|
||||||
|
can.ui.dock && can.page.style(can, can.ui.dock._target, html.LEFT, can.base.Min((can.ConfWidth()-can.ui.dock._target.offsetWidth)/2, 0))
|
||||||
},
|
},
|
||||||
layout: function(can) { can.page.styleHeight(can, can._output, can.ConfHeight()) },
|
|
||||||
}, [""])
|
}, [""])
|
||||||
Volcanos(chat.ONACTION, {list: ["full"],
|
Volcanos(chat.ONACTION, {list: ["full"],
|
||||||
create: function(event, can, button) { can.onimport._desktop(can) },
|
create: function(event, can, button) { can.onimport._desktop(can) },
|
||||||
@ -85,8 +97,8 @@ Volcanos(chat.ONFIGURE, {
|
|||||||
var _carte = can.user.carteRight(event, can, {}, [{view: [html.ITEM, "", mdb.CREATE], onclick: function(event) {
|
var _carte = can.user.carteRight(event, can, {}, [{view: [html.ITEM, "", mdb.CREATE], onclick: function(event) {
|
||||||
can.user.input(event, can, [mdb.NAME], function(list) {
|
can.user.input(event, can, [mdb.NAME], function(list) {
|
||||||
var args = can.page.SelectChild(can, can._output, html.DIV_DESKTOP, function(target) {
|
var args = can.page.SelectChild(can, can._output, html.DIV_DESKTOP, function(target) {
|
||||||
return {name: can.page.Select(can, target._tabs, html.SPAN_NAME).innerText, list: can.page.SelectChild(can, target, html.FIELDSET, function(target) {
|
return {name: can.page.SelectOne(can, target._tabs, html.SPAN_NAME).innerText, list: can.page.SelectChild(can, target, html.FIELDSET, function(target) {
|
||||||
return {index: target._can._index, args: target._can.onexport.args(target._can), style: {left: target.offsetLeft, top: target.offsetTop}}
|
return {index: target._can._index, args: target._can.onexport.args(target._can), style: {left: target.offsetLeft||100, top: target.offsetTop||25}}
|
||||||
})}
|
})}
|
||||||
})
|
})
|
||||||
can.runActionCommand(event, "session", [ctx.ACTION, mdb.CREATE, mdb.NAME, list[0], ctx.ARGS, JSON.stringify(args)], function(msg) {
|
can.runActionCommand(event, "session", [ctx.ACTION, mdb.CREATE, mdb.NAME, list[0], ctx.ARGS, JSON.stringify(args)], function(msg) {
|
||||||
@ -97,6 +109,9 @@ Volcanos(chat.ONFIGURE, {
|
|||||||
return {view: [html.ITEM, "", value.name],
|
return {view: [html.ITEM, "", value.name],
|
||||||
onclick: function() { can.onimport.session(can, can.base.Obj(value.args, [])) },
|
onclick: function() { can.onimport.session(can, can.base.Obj(value.args, [])) },
|
||||||
oncontextmenu: function(event) { can.user.carteRight(event, can, {
|
oncontextmenu: function(event) { can.user.carteRight(event, can, {
|
||||||
|
open: function() {
|
||||||
|
can.user.open(can.misc.MergePodCmd(can, {cmd: "desktop", session: value.name}))
|
||||||
|
},
|
||||||
remove: function() { can.runActionCommand(event, "session", [mdb.REMOVE, value.name], function() { can.user.toastSuccess(can, "session removed") }) },
|
remove: function() { can.runActionCommand(event, "session", [mdb.REMOVE, value.name], function() { can.user.toastSuccess(can, "session removed") }) },
|
||||||
}, [], function() {}, _carte) },
|
}, [], function() {}, _carte) },
|
||||||
}
|
}
|
||||||
@ -116,9 +131,7 @@ Volcanos(chat.ONFIGURE, {
|
|||||||
},
|
},
|
||||||
"window\t>": function(event, can, carte) {
|
"window\t>": function(event, can, carte) {
|
||||||
can.user.carteRight(event, can, {}, [{view: [html.ITEM, "", mdb.CREATE], onclick: function(event) {
|
can.user.carteRight(event, can, {}, [{view: [html.ITEM, "", mdb.CREATE], onclick: function(event) {
|
||||||
can.user.input(event, can, [ctx.INDEX, ctx.ARGS], function(data) {
|
can.user.input(event, can, [ctx.INDEX, ctx.ARGS], function(data) { can.onimport._window(can, data) })
|
||||||
can.onimport._window(can, data)
|
|
||||||
})
|
|
||||||
}}, ""].concat(can.page.Select(can, can.ui.desktop, "fieldset>legend", function(legend) {
|
}}, ""].concat(can.page.Select(can, can.ui.desktop, "fieldset>legend", function(legend) {
|
||||||
return {view: [html.ITEM, "", legend.innerText+(legend.parentNode.style["z-index"] == "10"? " *": "")], onclick: function(event) {
|
return {view: [html.ITEM, "", legend.innerText+(legend.parentNode.style["z-index"] == "10"? " *": "")], onclick: function(event) {
|
||||||
can.ondetail.select(can, legend.parentNode)
|
can.ondetail.select(can, legend.parentNode)
|
||||||
|
@ -2,11 +2,27 @@ package macos
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
ice "shylinux.com/x/icebergs"
|
ice "shylinux.com/x/icebergs"
|
||||||
|
"shylinux.com/x/icebergs/base/mdb"
|
||||||
|
"shylinux.com/x/icebergs/base/web"
|
||||||
)
|
)
|
||||||
|
|
||||||
const DOCK = "dock"
|
const DOCK = "dock"
|
||||||
|
|
||||||
func init() { Index.MergeCommands(ice.Commands{DOCK: {Actions: CmdHashAction()}}) }
|
func init() {
|
||||||
|
Index.MergeCommands(ice.Commands{DOCK: {Actions: ice.MergeActions(ice.Actions{
|
||||||
|
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
if m.Cmd(DOCK).Length() == 0 {
|
||||||
|
DockAppend(m, "Finder", Prefix(FINDER))
|
||||||
|
DockAppend(m, "Safari", web.CHAT_IFRAME)
|
||||||
|
DockAppend(m, "Terminal", web.CODE_XTERM)
|
||||||
|
DockAppend(m, "", web.CODE_GIT_REPOS, mdb.ICON, "usr/icons/git.jpg")
|
||||||
|
DockAppend(m, "", web.CODE_COMPILE, mdb.ICON, "usr/icons/go.png")
|
||||||
|
DockAppend(m, "", web.CODE_VIMER)
|
||||||
|
DockAppend(m, "", web.DREAM)
|
||||||
|
}
|
||||||
|
}},
|
||||||
|
}, mdb.ImportantHashAction(), CmdHashAction())}})
|
||||||
|
}
|
||||||
|
|
||||||
func DockAppend(m *ice.Message, name, index string, arg ...string) {
|
func DockAppend(m *ice.Message, name, index string, arg ...string) {
|
||||||
install(m, DOCK, name, index, arg...)
|
install(m, DOCK, name, index, arg...)
|
||||||
|
@ -5,13 +5,13 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg) { can.onmotion.clear(can)
|
|||||||
remove: function() { item.name != "Finder" && can.runAction(event, mdb.REMOVE, [item.hash]) },
|
remove: function() { item.name != "Finder" && can.runAction(event, mdb.REMOVE, [item.hash]) },
|
||||||
}); can.page.style(can, carte._target, html.LEFT, event.x) },
|
}); can.page.style(can, carte._target, html.LEFT, event.x) },
|
||||||
}) }), can.page.Append(can, can._output, [{view: "space"}])
|
}) }), can.page.Append(can, can._output, [{view: "space"}])
|
||||||
|
can.page.style(can, can._output, html.MAX_WIDTH, can.page.width())
|
||||||
return
|
return
|
||||||
var current = null, before, begin
|
var current = null, before, begin
|
||||||
can.page.SelectChild(can, can._output, mdb.FOREACH, function(target) { target.draggable = true
|
can.page.SelectChild(can, can._output, mdb.FOREACH, function(target) { target.draggable = true
|
||||||
target.ondragstart = function() { current = target, can.page.style(can, target, "visibility", html.HIDDEN) }
|
target.ondragstart = function() { current = target, can.page.style(can, target, "visibility", html.HIDDEN) }
|
||||||
target.ondragenter = function(event) { before = target, begin = {x: event.x, y: event.y} }
|
target.ondragenter = function(event) { before = target, begin = {x: event.x, y: event.y} }
|
||||||
target.ondragover = function(event) { var offset = event.x - begin.x; can.page.style(can, target, {position: "relative", left: -offset}) }
|
target.ondragover = function(event) { var offset = event.x - begin.x; can.page.style(can, target, {position: "relative", left: -offset}) }
|
||||||
target.ondragleave = function(event) { }
|
|
||||||
target.ondragend = function(event) { before && can.page.insertBefore(can, current, before)
|
target.ondragend = function(event) { before && can.page.insertBefore(can, current, before)
|
||||||
can.page.SelectChild(can, can._output, mdb.FOREACH, function(target) { can.page.style(can, target, {position: "", left: "", visibility: html.VISIBLE}) })
|
can.page.SelectChild(can, can._output, mdb.FOREACH, function(target) { can.page.style(can, target, {position: "", left: "", visibility: html.VISIBLE}) })
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,22 @@
|
|||||||
package macos
|
package macos
|
||||||
|
|
||||||
import ice "shylinux.com/x/icebergs"
|
import (
|
||||||
|
ice "shylinux.com/x/icebergs"
|
||||||
|
"shylinux.com/x/icebergs/base/mdb"
|
||||||
|
)
|
||||||
|
|
||||||
const MENU = "menu"
|
const MENU = "menu"
|
||||||
|
|
||||||
func init() { Index.MergeCommands(ice.Commands{MENU: {Actions: CmdHashAction()}}) }
|
func init() {
|
||||||
|
Index.MergeCommands(ice.Commands{MENU: {Actions: ice.MergeActions(ice.Actions{
|
||||||
|
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
if m.Cmd(MENU).Length() == 0 {
|
||||||
|
MenuAppend(m, "", Prefix(NOTIFICATIONS))
|
||||||
|
MenuAppend(m, "", Prefix(SEARCHS))
|
||||||
|
}
|
||||||
|
}},
|
||||||
|
}, mdb.ImportantHashAction(), CmdHashAction())}})
|
||||||
|
}
|
||||||
|
func MenuAppend(m *ice.Message, name, index string, arg ...string) {
|
||||||
|
install(m, MENU, name, index, arg...)
|
||||||
|
}
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
Volcanos(chat.ONIMPORT, {_init: function(can, msg) { can.page.Append(can, can._output, can.user.header(can)), can.page.Append(can, can._output, [
|
Volcanos(chat.ONIMPORT, {_init: function(can, msg) { can.page.Append(can, can._output, can.user.header(can)), can.page.Append(can, can._output, [
|
||||||
{view: [html.ITEM, "", "notifications"], onclick: function(event) { can.sup.onexport.record(can, "notifications") }},
|
{view: [html.ITEM], list: [{img: can.page.drawText(can, "n", 25, 0, 20)}], onclick: function(event) { can.sup.onexport.record(can, "notifications") }},
|
||||||
{view: [html.ITEM, "", "searchs"], onclick: function(event) { can.sup.onexport.record(can, "searchs") }},
|
{view: [html.ITEM], list: [{img: can.page.drawText(can, "s", 25, 0, 20)}], onclick: function(event) { can.sup.onexport.record(can, "searchs") }},
|
||||||
|
].concat(msg.Table(function(item) {
|
||||||
|
return {view: [html.ITEM], list: [{img: can.page.drawText(can, item.index, 25, 0, 20)}], onclick: function(event) { can.sup.onexport.record(can, item) }}
|
||||||
|
}), [
|
||||||
{view: [html.MENU, "", location.hostname], onclick: function(event) { can.sup.onexport.record(can, html.DESKTOP) }},
|
{view: [html.MENU, "", location.hostname], onclick: function(event) { can.sup.onexport.record(can, html.DESKTOP) }},
|
||||||
{view: [html.MENU, "", "+"], onclick: function(event) { can.sup.onexport.record(can, mdb.CREATE) }},
|
{view: [html.MENU, "", "+"], onclick: function(event) { can.sup.onexport.record(can, mdb.CREATE) }},
|
||||||
]) }})
|
])) }})
|
||||||
|
@ -6,7 +6,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg) {
|
|||||||
ui.title.innerHTML = item.name||"", ui.content.innerHTML = item.text||"", ui.time.innerHTML = item.time.split(lex.SP).pop().split(nfs.DF).slice(0, 2).join(nfs.DF)
|
ui.title.innerHTML = item.name||"", ui.content.innerHTML = item.text||"", ui.time.innerHTML = item.time.split(lex.SP).pop().split(nfs.DF).slice(0, 2).join(nfs.DF)
|
||||||
}} })), msg.Length() == 0 && can.onmotion.hidden(can, can._fields), can.onappend._action(can), can.page.style(can, can._action, html.DISPLAY, html.BLOCK)
|
}} })), msg.Length() == 0 && can.onmotion.hidden(can, can._fields), can.onappend._action(can), can.page.style(can, can._action, html.DISPLAY, html.BLOCK)
|
||||||
}})
|
}})
|
||||||
Volcanos(chat.ONACTION, {list: [mdb.PRUNES, web.UPDATE, "toggle"],
|
Volcanos(chat.ONACTION, {list: [web.UPDATE, mdb.PRUNES, web.TOGGLE], _trans: {update: "刷新", toggle: "隐藏"},
|
||||||
update: function(event, can, button) { can.Update(event) },
|
update: function(event, can, button) { can.Update(event) },
|
||||||
toggle: function(event, can, button) { can.onmotion.hidden(can, can._fields) },
|
toggle: function(event, can, button) { can.onmotion.hidden(can, can._fields) },
|
||||||
})
|
})
|
||||||
|
@ -9,7 +9,7 @@ import (
|
|||||||
const SEARCHS = "searchs"
|
const SEARCHS = "searchs"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
Index.MergeCommands(ice.Commands{SEARCHS: {Name: "search keyword list", Hand: func(m *ice.Message, arg ...string) {
|
Index.MergeCommands(ice.Commands{SEARCHS: {Name: "searchs keyword list", Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Cmdy(mdb.SEARCH, mdb.FOREACH, kit.Select("", arg, 0), "ctx,cmd,type,name,text")
|
m.Cmdy(mdb.SEARCH, mdb.FOREACH, kit.Select("", arg, 0), "ctx,cmd,type,name,text")
|
||||||
}}})
|
}}})
|
||||||
}
|
}
|
||||||
|
@ -7,4 +7,10 @@ import (
|
|||||||
|
|
||||||
const SESSION = "session"
|
const SESSION = "session"
|
||||||
|
|
||||||
func init() { Index.MergeCommands(ice.Commands{SESSION: {Actions: CmdHashAction(mdb.NAME)}}) }
|
func init() {
|
||||||
|
Index.MergeCommands(ice.Commands{SESSION: {Actions: ice.MergeActions(mdb.ImportantHashAction(), CmdHashAction(mdb.NAME)), Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
if mdb.HashSelect(m, arg...); len(arg) > 0 {
|
||||||
|
m.EchoIFrame(m.MergePodCmd("", DESKTOP, SESSION, arg[0]))
|
||||||
|
}
|
||||||
|
}}})
|
||||||
|
}
|
||||||
|
@ -55,7 +55,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
gdb.Event(m, RIVER_CREATE, RIVER, m.Option(ice.MSG_RIVER, h), arg)
|
gdb.Event(m, RIVER_CREATE, RIVER, m.Option(ice.MSG_RIVER, h), arg)
|
||||||
}},
|
}},
|
||||||
}, mdb.HashAction(mdb.FIELD, "time,hash,type,name,text,template"), aaa.WhiteAction()), Hand: func(m *ice.Message, arg ...string) {
|
}, mdb.ImportantHashAction(), mdb.HashAction(mdb.FIELD, "time,hash,type,name,text,template"), aaa.WhiteAction()), Hand: func(m *ice.Message, arg ...string) {
|
||||||
if m.Warn(m.Option(ice.MSG_USERNAME) == "", ice.ErrNotLogin) || !aaa.Right(m, RIVER, arg) {
|
if m.Warn(m.Option(ice.MSG_USERNAME) == "", ice.ErrNotLogin) || !aaa.Right(m, RIVER, arg) {
|
||||||
return
|
return
|
||||||
} else if len(arg) == 0 {
|
} else if len(arg) == 0 {
|
||||||
|
@ -74,7 +74,10 @@ func init() {
|
|||||||
m.Cmdy(arg)
|
m.Cmdy(arg)
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
}, TASK, ctx.CmdAction(), aaa.RoleAction(ctx.COMMAND)), Hand: func(m *ice.Message, arg ...string) {
|
web.DREAM_TABLES: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
kit.Switch(m.Option(mdb.TYPE), kit.Simple(web.SERVER, web.WORKER), func() { m.PushButton(kit.Dict(m.CommandKey(), "计划")) })
|
||||||
|
}},
|
||||||
|
}, TASK, web.DreamAction(), ctx.CmdAction(), aaa.RoleAction(ctx.COMMAND)), Hand: func(m *ice.Message, arg ...string) {
|
||||||
begin_time, end_time := _plan_scope(m, kit.Slice(arg, 0, 2)...)
|
begin_time, end_time := _plan_scope(m, kit.Slice(arg, 0, 2)...)
|
||||||
_plan_list(m, begin_time.Format(ice.MOD_TIME), end_time.Format(ice.MOD_TIME))
|
_plan_list(m, begin_time.Format(ice.MOD_TIME), end_time.Format(ice.MOD_TIME))
|
||||||
web.PushPodCmd(m, "", arg...)
|
web.PushPodCmd(m, "", arg...)
|
||||||
|
@ -73,7 +73,6 @@ func init() {
|
|||||||
m.Option(ctx.INDEX, m.Option("extra.index"))
|
m.Option(ctx.INDEX, m.Option("extra.index"))
|
||||||
ctx.CmdInputs(m, arg...)
|
ctx.CmdInputs(m, arg...)
|
||||||
default:
|
default:
|
||||||
m.Debug("what %v", arg)
|
|
||||||
mdb.ZoneInputs(m, arg)
|
mdb.ZoneInputs(m, arg)
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
@ -84,7 +83,7 @@ func init() {
|
|||||||
CANCEL: {Hand: func(m *ice.Message, arg ...string) { _task_modify(m, STATUS, CANCEL) }},
|
CANCEL: {Hand: func(m *ice.Message, arg ...string) { _task_modify(m, STATUS, CANCEL) }},
|
||||||
BEGIN: {Hand: func(m *ice.Message, arg ...string) { _task_modify(m, STATUS, PROCESS) }},
|
BEGIN: {Hand: func(m *ice.Message, arg ...string) { _task_modify(m, STATUS, PROCESS) }},
|
||||||
END: {Hand: func(m *ice.Message, arg ...string) { _task_modify(m, STATUS, FINISH) }},
|
END: {Hand: func(m *ice.Message, arg ...string) { _task_modify(m, STATUS, FINISH) }},
|
||||||
}, mdb.ZoneAction(mdb.FIELD, "begin_time,close_time,id,status,level,score,type,name,text")), Hand: func(m *ice.Message, arg ...string) {
|
}, mdb.ImportantZoneAction(), mdb.ZoneAction(mdb.FIELD, "begin_time,close_time,id,status,level,score,type,name,text")), Hand: func(m *ice.Message, arg ...string) {
|
||||||
if mdb.ZoneSelect(m, arg...); len(arg) > 0 && arg[0] != "" {
|
if mdb.ZoneSelect(m, arg...); len(arg) > 0 && arg[0] != "" {
|
||||||
status := map[string]int{}
|
status := map[string]int{}
|
||||||
m.Table(func(value ice.Maps) { m.PushButton(_task_action(m, value[STATUS])) })
|
m.Table(func(value ice.Maps) { m.PushButton(_task_action(m, value[STATUS])) })
|
||||||
|
@ -26,7 +26,10 @@ func init() {
|
|||||||
defer m.Echo("<html><body>").Echo("</body></html>")
|
defer m.Echo("<html><body>").Echo("</body></html>")
|
||||||
m.Cmdy(nfs.CAT, path.Join(arg[2], arg[1]))
|
m.Cmdy(nfs.CAT, path.Join(arg[2], arg[1]))
|
||||||
}},
|
}},
|
||||||
}, WikiAction("", nfs.SVG), ctx.CmdAction()), Hand: func(m *ice.Message, arg ...string) {
|
web.DREAM_TABLES: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
kit.Switch(m.Option(mdb.TYPE), kit.Simple(web.SERVER, web.WORKER), func() { m.PushButton(kit.Dict(m.CommandKey(), "导图")) })
|
||||||
|
}},
|
||||||
|
}, web.DreamAction(), WikiAction("", nfs.SVG), ctx.CmdAction()), Hand: func(m *ice.Message, arg ...string) {
|
||||||
kit.If(!_wiki_list(m, arg...), func() {
|
kit.If(!_wiki_list(m, arg...), func() {
|
||||||
_wiki_show(m, arg[0])
|
_wiki_show(m, arg[0])
|
||||||
kit.If(m.IsErr(), func() { m.Option(ice.MSG_OUTPUT, "") })
|
kit.If(m.IsErr(), func() { m.Option(ice.MSG_OUTPUT, "") })
|
||||||
|
@ -52,7 +52,10 @@ func init() {
|
|||||||
ls := kit.Split(m.Option(mdb.TEXT))
|
ls := kit.Split(m.Option(mdb.TEXT))
|
||||||
kit.If(kit.IsIn(ls[0], IMAGE, VIDEO, AUDIO), func() { m.Cmdy(FEEL).CutTo(nfs.PATH, mdb.NAME) })
|
kit.If(kit.IsIn(ls[0], IMAGE, VIDEO, AUDIO), func() { m.Cmdy(FEEL).CutTo(nfs.PATH, mdb.NAME) })
|
||||||
}},
|
}},
|
||||||
}, WikiAction("", nfs.SHY), ctx.CmdAction(), aaa.RoleAction("story.field")), Hand: func(m *ice.Message, arg ...string) {
|
web.DREAM_TABLES: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
kit.Switch(m.Option(mdb.TYPE), kit.Simple(web.SERVER, web.WORKER), func() { m.PushButton(kit.Dict(m.CommandKey(), "文档")) })
|
||||||
|
}},
|
||||||
|
}, web.DreamAction(), WikiAction("", nfs.SHY), ctx.CmdAction(), aaa.RoleAction("story.field")), Hand: func(m *ice.Message, arg ...string) {
|
||||||
if m.Option(nfs.DIR_DEEP, ice.TRUE); len(arg) == 0 {
|
if m.Option(nfs.DIR_DEEP, ice.TRUE); len(arg) == 0 {
|
||||||
arg = append(arg, nfs.SRC)
|
arg = append(arg, nfs.SRC)
|
||||||
}
|
}
|
||||||
|
@ -161,7 +161,7 @@ func _repos_status(m *ice.Message, p string, repos *git.Repository) error {
|
|||||||
for k, v := range status {
|
for k, v := range status {
|
||||||
if kit.IsIn(k, ice.SRC_VERSION_GO, ice.SRC_BINPACK_GO, ice.ETC_LOCAL_SHY) {
|
if kit.IsIn(k, ice.SRC_VERSION_GO, ice.SRC_BINPACK_GO, ice.ETC_LOCAL_SHY) {
|
||||||
continue
|
continue
|
||||||
} else if kit.IsIn(kit.Ext(k), "swp", "swo") || kit.IsIn(kit.Split(k, nfs.PS)[0], ice.BIN, ice.VAR, ice.USR) {
|
} else if kit.IsIn(kit.Ext(k), "swp", "swo") || kit.IsIn(kit.Split(k, nfs.PS)[0], ice.BIN, ice.VAR, ice.USR) && !strings.HasPrefix(k, ice.USR_LOCAL_EXPORT) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if m.Push(REPOS, p).Push(STATUS, string(v.Worktree)+string(v.Staging)).Push(nfs.FILE, k); m.Option(ice.MSG_MODE) == mdb.ZONE {
|
if m.Push(REPOS, p).Push(STATUS, string(v.Worktree)+string(v.Staging)).Push(nfs.FILE, k); m.Option(ice.MSG_MODE) == mdb.ZONE {
|
||||||
@ -177,6 +177,29 @@ func _repos_status(m *ice.Message, p string, repos *git.Repository) error {
|
|||||||
m.PushButton(COMMIT)
|
m.PushButton(COMMIT)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if p == path.Base(kit.Path("")) {
|
||||||
|
var tree *object.Tree
|
||||||
|
if refer, err := repos.Head(); err == nil {
|
||||||
|
if commit, err := repos.CommitObject(refer.Hash()); err == nil {
|
||||||
|
tree, err = commit.Tree()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m.Cmd(nfs.DIR, ice.USR_LOCAL_EXPORT, kit.Dict(nfs.DIR_DEEP, ice.TRUE, nfs.DIR_TYPE, nfs.TYPE_CAT), func(value ice.Maps) {
|
||||||
|
if _, ok := status[value[nfs.PATH]]; ok {
|
||||||
|
return
|
||||||
|
} else if tree != nil {
|
||||||
|
if file, err := tree.File(value[nfs.PATH]); err == nil {
|
||||||
|
if content, err := file.Contents(); err == nil && strings.TrimSpace(content) == strings.TrimSpace(m.Cmdx(nfs.CAT, value[nfs.PATH])) {
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
m.Push(REPOS, p).Push(STATUS, "M").Push(nfs.FILE, value[nfs.PATH]).PushButton(ADD)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m.Push(REPOS, p).Push(STATUS, "??").Push(nfs.FILE, value[nfs.PATH]).PushButton(ADD)
|
||||||
|
})
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func _repos_total(m *ice.Message, p string, repos *git.Repository, stats map[string]int) *time.Time {
|
func _repos_total(m *ice.Message, p string, repos *git.Repository, stats map[string]int) *time.Time {
|
||||||
@ -444,6 +467,7 @@ func init() {
|
|||||||
if commit, err := repos.CommitObject(refer.Hash()); err == nil {
|
if commit, err := repos.CommitObject(refer.Hash()); err == nil {
|
||||||
_last := commit.Author.When.Format(ice.MOD_TIME)
|
_last := commit.Author.When.Format(ice.MOD_TIME)
|
||||||
kit.If(_last > last, func() { last = _last })
|
kit.If(_last > last, func() { last = _last })
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if _remote, err := repos.Remote(ORIGIN); err == nil && (remote == "" || remote == path.Base(kit.Path(""))) {
|
if _remote, err := repos.Remote(ORIGIN); err == nil && (remote == "" || remote == path.Base(kit.Path(""))) {
|
||||||
|
@ -154,7 +154,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
m.Push(mdb.TEXT, strings.Join(text, ", "))
|
m.Push(mdb.TEXT, strings.Join(text, ", "))
|
||||||
}},
|
}},
|
||||||
}, aaa.RoleAction(), gdb.EventAction(web.DREAM_TABLES), Prefix(REPOS), mdb.ImportantDataAction()), Hand: func(m *ice.Message, arg ...string) {
|
}, aaa.RoleAction(), gdb.EventAction(web.DREAM_TABLES), Prefix(REPOS), mdb.ImportantHashAction()), Hand: func(m *ice.Message, arg ...string) {
|
||||||
if len(arg) > 0 && arg[0] == ctx.ACTION {
|
if len(arg) > 0 && arg[0] == ctx.ACTION {
|
||||||
m.Cmdy(REPOS, arg)
|
m.Cmdy(REPOS, arg)
|
||||||
} else if config, err := config.LoadConfig(config.GlobalScope); err == nil && config.User.Email == "" && mdb.Config(m, aaa.EMAIL) == "" {
|
} else if config, err := config.LoadConfig(config.GlobalScope); err == nil && config.User.Email == "" && mdb.Config(m, aaa.EMAIL) == "" {
|
||||||
|
4
type.go
4
type.go
@ -144,7 +144,6 @@ func (c *Context) Merge(s *Context) *Context {
|
|||||||
}
|
}
|
||||||
c.Commands[key] = cmd
|
c.Commands[key] = cmd
|
||||||
kit.If(cmd.Meta == nil, func() { cmd.Meta = kit.Dict() })
|
kit.If(cmd.Meta == nil, func() { cmd.Meta = kit.Dict() })
|
||||||
kit.If(cmd.List == nil, func() { cmd.List = SplitCmd(cmd.Name, cmd.Actions) })
|
|
||||||
for sub, action := range cmd.Actions {
|
for sub, action := range cmd.Actions {
|
||||||
if pre, ok := c.Commands[sub]; ok && s == c {
|
if pre, ok := c.Commands[sub]; ok && s == c {
|
||||||
kit.Switch(sub,
|
kit.Switch(sub,
|
||||||
@ -162,6 +161,7 @@ func (c *Context) Merge(s *Context) *Context {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
kit.If(sub == SELECT, func() { cmd.Name = kit.Select(action.Name, cmd.Name) })
|
||||||
if help := kit.Split(action.Help, " ::"); len(help) > 0 {
|
if help := kit.Split(action.Help, " ::"); len(help) > 0 {
|
||||||
if kit.Value(cmd.Meta, kit.Keys("_trans", strings.TrimPrefix(sub, "_")), help[0]); len(help) > 1 {
|
if kit.Value(cmd.Meta, kit.Keys("_trans", strings.TrimPrefix(sub, "_")), help[0]); len(help) > 1 {
|
||||||
kit.Value(cmd.Meta, kit.Keys("_title", sub), help[1])
|
kit.Value(cmd.Meta, kit.Keys("_title", sub), help[1])
|
||||||
@ -173,6 +173,8 @@ func (c *Context) Merge(s *Context) *Context {
|
|||||||
kit.If(action.List == nil, func() { action.List = SplitCmd(action.Name, nil) })
|
kit.If(action.List == nil, func() { action.List = SplitCmd(action.Name, nil) })
|
||||||
kit.If(len(action.List) > 0, func() { cmd.Meta[sub] = action.List })
|
kit.If(len(action.List) > 0, func() { cmd.Meta[sub] = action.List })
|
||||||
}
|
}
|
||||||
|
kit.If(strings.HasPrefix(cmd.Name, "list"), func() { cmd.Name = strings.Replace(cmd.Name, "list", key, 1) })
|
||||||
|
kit.If(cmd.List == nil, func() { cmd.List = SplitCmd(cmd.Name, cmd.Actions) })
|
||||||
}
|
}
|
||||||
kit.If(c.Configs == nil, func() { c.Configs = Configs{} })
|
kit.If(c.Configs == nil, func() { c.Configs = Configs{} })
|
||||||
for k, v := range s.Configs {
|
for k, v := range s.Configs {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user