1
0
forked from x/icebergs
This commit is contained in:
IT 老营长 @云轩领航-创始人 2023-12-11 19:08:33 +08:00
parent 8684e804d3
commit afdebbdc67
7 changed files with 10 additions and 6 deletions

View File

@ -20,7 +20,7 @@ const TAIL = "tail"
func init() { func init() {
Index.MergeCommands(ice.Commands{ Index.MergeCommands(ice.Commands{
TAIL: {Name: "tail name id auto page create", Help: "日志流", Actions: ice.MergeActions(ice.Actions{ TAIL: {Name: "tail name id auto page", Help: "日志流", Actions: ice.MergeActions(ice.Actions{
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) { ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
mdb.HashSelect(m.Spawn(ice.OptionFields("name,file"))).Table(func(value ice.Maps) { mdb.HashSelect(m.Spawn(ice.OptionFields("name,file"))).Table(func(value ice.Maps) {
m.Cmd("", mdb.CREATE, kit.SimpleKV("name,file", value)) m.Cmd("", mdb.CREATE, kit.SimpleKV("name,file", value))

View File

@ -28,7 +28,7 @@ const TRASH = "trash"
func init() { func init() {
Index.MergeCommands(ice.Commands{ Index.MergeCommands(ice.Commands{
TRASH: {Name: "trash hash auto prunes", Help: "回收站", Actions: ice.MergeActions(ice.Actions{ TRASH: {Name: "trash hash auto", Help: "回收站", Actions: ice.MergeActions(ice.Actions{
mdb.CREATE: {Hand: func(m *ice.Message, arg ...string) { mdb.CREATE: {Hand: func(m *ice.Message, arg ...string) {
_trash_create(m, kit.Paths(m.Option(FROM))) _trash_create(m, kit.Paths(m.Option(FROM)))
}}, }},

View File

@ -69,7 +69,7 @@ func init() {
}) })
} }
}}, }},
SOCKET: {Hand: func(m *ice.Message, arg ...string) { SOCKET: {Help: "端口", Hand: func(m *ice.Message, arg ...string) {
parse := func(str string) int64 { port, _ := strconv.ParseInt(str, 16, 32); return port } parse := func(str string) int64 { port, _ := strconv.ParseInt(str, 16, 32); return port }
trans := func(str string) string { trans := func(str string) string {
switch str { switch str {

View File

@ -69,7 +69,8 @@ func (g *Group) EchoPath(group string, str string, arg ...ice.Any) *ice.Message
return g.Echo(group, `<path d="%s"></path>`, kit.Format(str, arg...)) return g.Echo(group, `<path d="%s"></path>`, kit.Format(str, arg...))
} }
func (g *Group) EchoText(group string, x, y int, text string, arg ...string) *ice.Message { func (g *Group) EchoText(group string, x, y int, text string, arg ...string) *ice.Message {
offset := kit.Int(kit.Select("8", "4", g.Get(group).IsMobileUA())) m := g.Get(group)
offset := kit.Int(kit.Select("8", "4", m.IsMobileUA()))
return g.Echo(group, "<text x=%d y=%d %s>%s</text>", x, y+offset, formatStyle(arg...), text) return g.Echo(group, "<text x=%d y=%d %s>%s</text>", x, y+offset, formatStyle(arg...), text)
} }
func (g *Group) EchoArrowLine(group string, x1, y1, x2, y2 int, arg ...string) *ice.Message { // marker-end func (g *Group) EchoArrowLine(group string, x1, y1, x2, y2 int, arg ...string) *ice.Message { // marker-end

View File

@ -30,7 +30,7 @@ fieldset.web.wiki.portal>div.output>div.layout>div.main fieldset.inner.output di
--code-object:silver; --code-datatype:silver; --code-package:silver; --code-object:silver; --code-datatype:silver; --code-package:silver;
} }
fieldset.web.wiki.portal>div.output>div.layout>div.main div.story[data-type=spark][data-name=shell] { fieldset.web.wiki.portal>div.output>div.layout>div.main div.story[data-type=spark][data-name=shell] {
background-color:var(--code-bg-color); color:var(--code-fg-color); padding:var(--input-padding); margin:var(--plugin-margin) 0; box-shadow:var(--box-shadow); background-color:var(--code-bg-color); color:var(--code-fg-color); padding:var(--button-padding) var(--input-padding); margin:var(--plugin-margin) 0; box-shadow:var(--box-shadow);
} }
fieldset.web.wiki.portal>div.output>div.layout>div.main table.content div.story[data-type=spark][data-name=shell] { fieldset.web.wiki.portal>div.output>div.layout>div.main table.content div.story[data-type=spark][data-name=shell] {
margin-top:unset; margin-top:unset;

View File

@ -612,7 +612,7 @@ func init() {
}}, }},
}, aaa.RoleAction(REMOTE), web.StatsAction("", "代码库总数"), web.DreamAction(), mdb.HashAction(mdb.SHORT, REPOS, mdb.FIELD, "time,repos,branch,version,message,origin"), mdb.ClearOnExitHashAction()), Hand: func(m *ice.Message, arg ...string) { }, aaa.RoleAction(REMOTE), web.StatsAction("", "代码库总数"), web.DreamAction(), mdb.HashAction(mdb.SHORT, REPOS, mdb.FIELD, "time,repos,branch,version,message,origin"), mdb.ClearOnExitHashAction()), Hand: func(m *ice.Message, arg ...string) {
if len(arg) == 0 { if len(arg) == 0 {
mdb.HashSelect(m, arg...).Sort(REPOS).PushAction(STATUS, mdb.REMOVE).Action(STATUS, PULL, PUSH, CLONE) mdb.HashSelect(m, arg...).Sort(REPOS).PushAction(STATUS, mdb.REMOVE).Action(CLONE, PULL, PUSH, STATUS)
} else if len(arg) == 1 { } else if len(arg) == 1 {
_repos_branch(m, _repos_open(m, arg[0])) _repos_branch(m, _repos_open(m, arg[0]))
} else if len(arg) == 2 { } else if len(arg) == 2 {

View File

@ -123,6 +123,9 @@ func (m *Message) IsMobileUA() bool {
func (m *Message) IsWeixinUA() bool { func (m *Message) IsWeixinUA() bool {
return strings.Contains(m.Option(MSG_USERUA), "MicroMessenger") return strings.Contains(m.Option(MSG_USERUA), "MicroMessenger")
} }
func (m *Message) IsChromeUA() bool {
return strings.Contains(m.Option(MSG_USERUA), "Chrome")
}
func (m *Message) PushSearch(arg ...Any) { func (m *Message) PushSearch(arg ...Any) {
data := kit.Dict(arg...) data := kit.Dict(arg...)
kit.For(arg, func(k, v Any) { kit.For(arg, func(k, v Any) {