mirror of
https://shylinux.com/x/icebergs
synced 2025-07-01 04:14:42 +08:00
Compare commits
No commits in common. "master" and "v1.9.73" have entirely different histories.
@ -54,7 +54,9 @@ func init() {
|
|||||||
), Actions: ice.MergeActions(ice.Actions{
|
), 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) {
|
||||||
ice.AddRender(ice.RENDER_QRCODE, func(m *ice.Message, args ...ice.Any) string {
|
ice.AddRender(ice.RENDER_QRCODE, func(m *ice.Message, args ...ice.Any) string {
|
||||||
kit.If(m.IsMobileUA(), func() { m.Option(SIZE, "280") })
|
if m.IsMobileUA() {
|
||||||
|
m.Option(SIZE, "280")
|
||||||
|
}
|
||||||
return m.Cmd(Prefix(QRCODE), kit.Simple(args...)).Result()
|
return m.Cmd(Prefix(QRCODE), kit.Simple(args...)).Result()
|
||||||
})
|
})
|
||||||
}},
|
}},
|
||||||
@ -64,13 +66,6 @@ func init() {
|
|||||||
m.Push(arg[0], kit.SortedKey(_color_map))
|
m.Push(arg[0], kit.SortedKey(_color_map))
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
"view": {Name: "view text icon link", Hand: func(m *ice.Message, arg ...string) {
|
|
||||||
defer m.Echo("<div class='code qrcode'>").Echo("</div>")
|
|
||||||
// m.Cmdy("", kit.MergeURL2(m.Option(ice.MSG_USERWEB), arg[2]))
|
|
||||||
m.Cmdy("", arg[2])
|
|
||||||
m.Echo("<img class='avatar' src='%s'></img>", arg[1])
|
|
||||||
m.Echo(arg[0])
|
|
||||||
}},
|
|
||||||
}), Hand: func(m *ice.Message, arg ...string) {
|
}), Hand: func(m *ice.Message, arg ...string) {
|
||||||
if m.IsCliUA() {
|
if m.IsCliUA() {
|
||||||
m.OptionDefault(FG, BLACK, BG, WHITE)
|
m.OptionDefault(FG, BLACK, BG, WHITE)
|
||||||
|
@ -149,15 +149,16 @@ const (
|
|||||||
)
|
)
|
||||||
const (
|
const (
|
||||||
CTX_SHY = "ctx_shy"
|
CTX_SHY = "ctx_shy"
|
||||||
CTX_DEV = "ctx_dev"
|
CTX_WEB = "ctx_web"
|
||||||
|
CTX_GIT = "ctx_git"
|
||||||
CTX_DEV_IP = "ctx_dev_ip"
|
CTX_DEV_IP = "ctx_dev_ip"
|
||||||
|
CTX_DEV = "ctx_dev"
|
||||||
CTX_OPS = "ctx_ops"
|
CTX_OPS = "ctx_ops"
|
||||||
CTX_REPOS = "ctx_repos"
|
CTX_REPOS = "ctx_repos"
|
||||||
CTX_NAME = "ctx_name"
|
CTX_NAME = "ctx_name"
|
||||||
CTX_DEMO = "ctx_demo"
|
CTX_DEMO = "ctx_demo"
|
||||||
CTX_MAIL = "ctx_mail"
|
CTX_MAIL = "ctx_mail"
|
||||||
CTX_ROOT = "ctx_root"
|
CTX_ROOT = "ctx_root"
|
||||||
CTX_DOMAIN = "ctx_domain"
|
|
||||||
|
|
||||||
CTX_PID = "ctx_pid"
|
CTX_PID = "ctx_pid"
|
||||||
CTX_LOG = "ctx_log"
|
CTX_LOG = "ctx_log"
|
||||||
|
@ -21,12 +21,8 @@ func _command_list(m *ice.Message, name string) *ice.Message {
|
|||||||
m.Option(ice.MSG_NODEICON, m.Resource(ice.Info.NodeIcon))
|
m.Option(ice.MSG_NODEICON, m.Resource(ice.Info.NodeIcon))
|
||||||
m.Spawn(m.Source()).Search(name, func(p *ice.Context, s *ice.Context, key string, cmd *ice.Command) {
|
m.Spawn(m.Source()).Search(name, func(p *ice.Context, s *ice.Context, key string, cmd *ice.Command) {
|
||||||
icon := kit.Format(kit.Value(cmd.Meta, kit.Keys(ice.CTX_ICONS, key)))
|
icon := kit.Format(kit.Value(cmd.Meta, kit.Keys(ice.CTX_ICONS, key)))
|
||||||
icons := kit.Select(cmd.Icon, icon, !kit.HasPrefix(icon, "bi ", "{"))
|
|
||||||
if icons != "" {
|
|
||||||
icons = m.Resource(icons)
|
|
||||||
}
|
|
||||||
m.Push(mdb.INDEX, kit.Keys(s.Prefix(), key))
|
m.Push(mdb.INDEX, kit.Keys(s.Prefix(), key))
|
||||||
m.Push(mdb.ICONS, icons)
|
m.Push(mdb.ICONS, kit.Select(cmd.Icon, icon, !kit.HasPrefix(icon, "bi ", "{")))
|
||||||
m.Push(mdb.NAME, kit.Format(cmd.Name)).Push(mdb.HELP, kit.Format(cmd.Help))
|
m.Push(mdb.NAME, kit.Format(cmd.Name)).Push(mdb.HELP, kit.Format(cmd.Help))
|
||||||
m.Push(mdb.LIST, kit.Format(cmd.List)).Push(mdb.META, kit.Format(cmd.Meta))
|
m.Push(mdb.LIST, kit.Format(cmd.List)).Push(mdb.META, kit.Format(cmd.Meta))
|
||||||
m.Push("_command", ShortCmd(kit.Keys(s.Prefix(), key)))
|
m.Push("_command", ShortCmd(kit.Keys(s.Prefix(), key)))
|
||||||
@ -47,7 +43,7 @@ func _command_search(m *ice.Message, kind, name, text string) {
|
|||||||
}
|
}
|
||||||
m.PushSearch(ice.CTX, kit.PathName(1), ice.CMD, kit.FileName(1),
|
m.PushSearch(ice.CTX, kit.PathName(1), ice.CMD, kit.FileName(1),
|
||||||
kit.SimpleKV("", s.Prefix(), kit.Select(key, cmd.Name), cmd.Help),
|
kit.SimpleKV("", s.Prefix(), kit.Select(key, cmd.Name), cmd.Help),
|
||||||
INDEX, kit.Keys(s.Prefix(), key), mdb.HELP, cmd.Help)
|
INDEX, kit.Keys(s.Prefix(), key))
|
||||||
}).Sort(m.OptionFields())
|
}).Sort(m.OptionFields())
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,7 +120,7 @@ func init() {
|
|||||||
}},
|
}},
|
||||||
}), Hand: func(m *ice.Message, arg ...string) {
|
}), Hand: func(m *ice.Message, arg ...string) {
|
||||||
if len(arg) == 0 {
|
if len(arg) == 0 {
|
||||||
m.OptionFields(INDEX, mdb.HELP)
|
m.OptionFields(INDEX)
|
||||||
m.Cmdy("", mdb.SEARCH, COMMAND)
|
m.Cmdy("", mdb.SEARCH, COMMAND)
|
||||||
} else {
|
} else {
|
||||||
kit.For(arg, func(k string) { _command_list(m, k) })
|
kit.For(arg, func(k string) { _command_list(m, k) })
|
||||||
@ -217,9 +213,6 @@ func ShortCmd(key string) string {
|
|||||||
return key
|
return key
|
||||||
}
|
}
|
||||||
func ResourceFile(m *ice.Message, file string, arg ...string) string {
|
func ResourceFile(m *ice.Message, file string, arg ...string) string {
|
||||||
if strings.Contains(file, "bi ") {
|
|
||||||
return file
|
|
||||||
}
|
|
||||||
if kit.HasPrefix(file, nfs.PS, ice.HTTP) {
|
if kit.HasPrefix(file, nfs.PS, ice.HTTP) {
|
||||||
return file
|
return file
|
||||||
} else if nfs.Exists(m, file) {
|
} else if nfs.Exists(m, file) {
|
||||||
|
@ -5,7 +5,6 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"strings"
|
|
||||||
|
|
||||||
ice "shylinux.com/x/icebergs"
|
ice "shylinux.com/x/icebergs"
|
||||||
"shylinux.com/x/icebergs/base/aaa"
|
"shylinux.com/x/icebergs/base/aaa"
|
||||||
@ -184,18 +183,12 @@ func init() {
|
|||||||
}
|
}
|
||||||
// if m.Options(mdb.HASH, up[0], mdb.NAME, up[1]); watch {
|
// if m.Options(mdb.HASH, up[0], mdb.NAME, up[1]); watch {
|
||||||
if watch {
|
if watch {
|
||||||
m.Cmdy(CACHE, WATCH, up[0], path.Join(kit.Select(m.Option(nfs.PATH), msg.Append(nfs.PATH)), up[1]))
|
m.Cmdy(CACHE, WATCH, up[0], path.Join(msg.Append(nfs.PATH), up[1]))
|
||||||
}
|
}
|
||||||
}, action.Hand)
|
}, action.Hand)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
func UploadSave(m *ice.Message, p string) string {
|
|
||||||
up := kit.Simple(m.Optionv(ice.MSG_UPLOAD))
|
|
||||||
kit.If(strings.HasSuffix(p, nfs.PS), func() { p = path.Join(p, up[1]) })
|
|
||||||
m.Cmd(CACHE, WATCH, up[0], p)
|
|
||||||
return p
|
|
||||||
}
|
|
||||||
func Upload(m *ice.Message) []string {
|
func Upload(m *ice.Message) []string {
|
||||||
if up := kit.Simple(m.Optionv(ice.MSG_UPLOAD)); len(up) == 1 {
|
if up := kit.Simple(m.Optionv(ice.MSG_UPLOAD)); len(up) == 1 {
|
||||||
msg := m.Cmd(CACHE, UPLOAD)
|
msg := m.Cmd(CACHE, UPLOAD)
|
||||||
|
@ -28,7 +28,6 @@ func _dream_list(m *ice.Message) *ice.Message {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if space, ok := list[value[mdb.NAME]]; ok {
|
if space, ok := list[value[mdb.NAME]]; ok {
|
||||||
value[mdb.HELP] = space[mdb.HELP]
|
|
||||||
value[ice.MAIN] = space[ice.MAIN]
|
value[ice.MAIN] = space[ice.MAIN]
|
||||||
value[mdb.ICONS] = space[mdb.ICONS]
|
value[mdb.ICONS] = space[mdb.ICONS]
|
||||||
m.Push("", value, kit.Slice(head, 0, -1))
|
m.Push("", value, kit.Slice(head, 0, -1))
|
||||||
@ -87,23 +86,21 @@ func _dream_list_more(m *ice.Message) *ice.Message {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
value[mdb.TEXT] = kit.JoinLine(value[nfs.MODULE], value[mdb.TEXT])
|
value[mdb.TEXT] = kit.JoinLine(value[nfs.MODULE], value[mdb.TEXT])
|
||||||
kit.If(aaa.IsTechOrRoot(m), func() { button = append(button, GETTOKEN) })
|
button = append(button, GETTOKEN, OPEN)
|
||||||
kit.If(value[aaa.ACCESS] == "", func() { button = []ice.Any{PORTAL} })
|
kit.If(value[aaa.ACCESS] == "", func() { button = []ice.Any{PORTAL, OPEN} })
|
||||||
button = append(button, OPEN)
|
|
||||||
case SERVER:
|
case SERVER:
|
||||||
if !m.IsCliUA() {
|
if !m.IsCliUA() {
|
||||||
value[mdb.TEXT] = kit.JoinLine(value[nfs.MODULE], value[mdb.TEXT])
|
value[mdb.TEXT] = kit.JoinLine(value[nfs.MODULE], value[mdb.TEXT])
|
||||||
} else if !strings.HasPrefix(value[mdb.TEXT], ice.HTTP) {
|
} else if !strings.HasPrefix(value[mdb.TEXT], ice.HTTP) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
kit.If(aaa.IsTechOrRoot(m), func() { button = append(button, SETTOKEN) })
|
button = append(button, SETTOKEN, OPEN)
|
||||||
button = append(button, OPEN)
|
|
||||||
case aaa.LOGIN:
|
case aaa.LOGIN:
|
||||||
if m.IsCliUA() {
|
if m.IsCliUA() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
value[mdb.TEXT] = kit.JoinWord(value[AGENT], value[cli.SYSTEM], value[aaa.IP], kit.Format(PublicIP(m, value[aaa.IP])))
|
value[mdb.TEXT] = kit.JoinWord(value[AGENT], value[cli.SYSTEM], value[aaa.IP], kit.Format(PublicIP(m, value[aaa.IP])))
|
||||||
defer func() { button = []ice.Any{GRANT} }()
|
button = []ice.Any{GRANT}
|
||||||
default:
|
default:
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -177,8 +174,7 @@ func _dream_binary(m *ice.Message, p string) {
|
|||||||
if bin := path.Join(m.Option(cli.CMD_DIR), ice.BIN_ICE_BIN); nfs.Exists(m, bin) {
|
if bin := path.Join(m.Option(cli.CMD_DIR), ice.BIN_ICE_BIN); nfs.Exists(m, bin) {
|
||||||
return
|
return
|
||||||
} else if kit.IsUrl(p) || strings.HasPrefix(p, S()) {
|
} else if kit.IsUrl(p) || strings.HasPrefix(p, S()) {
|
||||||
// m.Cmd(DREAM, DOWNLOAD, bin, kit.MergeURL2(p, kit.Format("/publish/ice.%s.%s", runtime.GOOS, runtime.GOARCH), ice.POD, m.Option(mdb.NAME)))
|
m.Cmd(DREAM, DOWNLOAD, bin, kit.MergeURL2(p, kit.Format("/publish/ice.%s.%s", runtime.GOOS, runtime.GOARCH), ice.POD, m.Option(mdb.NAME)))
|
||||||
m.Cmd(DREAM, DOWNLOAD, bin, kit.MergeURL(p, cli.GOOS, runtime.GOOS, cli.GOARCH, runtime.GOARCH))
|
|
||||||
} else {
|
} else {
|
||||||
m.Cmd(nfs.LINK, bin, kit.Path(p))
|
m.Cmd(nfs.LINK, bin, kit.Path(p))
|
||||||
}
|
}
|
||||||
@ -374,12 +370,12 @@ func init() {
|
|||||||
}},
|
}},
|
||||||
SETTOKEN: {Name: "settoken nodename* username*", Help: "令牌", Style: html.DANGER, Hand: func(m *ice.Message, arg ...string) {
|
SETTOKEN: {Name: "settoken nodename* username*", Help: "令牌", Style: html.DANGER, Hand: func(m *ice.Message, arg ...string) {
|
||||||
token := m.Cmdx(TOKEN, mdb.CREATE, mdb.TYPE, SERVER, mdb.NAME, m.Option(aaa.USERNAME), mdb.TEXT, m.Option(tcp.NODENAME))
|
token := m.Cmdx(TOKEN, mdb.CREATE, mdb.TYPE, SERVER, mdb.NAME, m.Option(aaa.USERNAME), mdb.TEXT, m.Option(tcp.NODENAME))
|
||||||
m.Cmd(SPACE, m.Option(mdb.NAME), SPIDE, DEV_CREATE_TOKEN, ice.Maps{TOKEN: token})
|
m.Cmd(SPACE, m.Option(mdb.NAME), SPIDE, DEV_CREATE_TOKEN, ice.Maps{CLIENT_NAME: ice.DEV, TOKEN: token})
|
||||||
}},
|
}},
|
||||||
GETTOKEN: {Help: "令牌", Style: html.DANGER, Hand: func(m *ice.Message, arg ...string) {
|
GETTOKEN: {Help: "令牌", Style: html.DANGER, Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Options(m.Cmd(SPIDE, m.Option(mdb.NAME)).AppendSimple()).Cmdy(SPIDE, mdb.DEV_REQUEST)
|
m.Options(m.Cmd(SPIDE, m.Option(mdb.NAME)).AppendSimple()).Cmdy(SPIDE, mdb.DEV_REQUEST)
|
||||||
}},
|
}},
|
||||||
GRANT: {Name: "grant username", Role: aaa.VOID, Hand: func(m *ice.Message, arg ...string) {
|
GRANT: {Name: "grant username", Hand: func(m *ice.Message, arg ...string) {
|
||||||
if aaa.IsTechOrRoot(m) && m.Option(aaa.USERNAME) != "" {
|
if aaa.IsTechOrRoot(m) && m.Option(aaa.USERNAME) != "" {
|
||||||
m.Option(ice.MSG_USERNAME, m.Option(aaa.USERNAME))
|
m.Option(ice.MSG_USERNAME, m.Option(aaa.USERNAME))
|
||||||
}
|
}
|
||||||
@ -486,7 +482,7 @@ func init() {
|
|||||||
m.Cmdy(nfs.CAT, "go.work")
|
m.Cmdy(nfs.CAT, "go.work")
|
||||||
}},
|
}},
|
||||||
}, StatsAction(), DreamAction(), DreamTablesAction(), mdb.ImportantHashAction(
|
}, StatsAction(), DreamAction(), DreamTablesAction(), mdb.ImportantHashAction(
|
||||||
mdb.SHORT, mdb.NAME, mdb.FIELD, "time,name,help,main,icons,repos,binary,template,restart,access",
|
mdb.SHORT, mdb.NAME, mdb.FIELD, "time,name,main,icons,repos,binary,template,restart,access",
|
||||||
html.BUTTON, kit.JoinWord(PORTAL, DESKTOP, ADMIN, WORD, VIMER, STATUS, COMPILE, XTERM, DREAM),
|
html.BUTTON, kit.JoinWord(PORTAL, DESKTOP, ADMIN, WORD, VIMER, STATUS, COMPILE, XTERM, DREAM),
|
||||||
)), Hand: func(m *ice.Message, arg ...string) {
|
)), Hand: func(m *ice.Message, arg ...string) {
|
||||||
if len(arg) == 0 {
|
if len(arg) == 0 {
|
||||||
@ -510,8 +506,7 @@ func init() {
|
|||||||
m.Sort("type,status,name", []string{aaa.LOGIN, WORKER, SERVER, ORIGIN}, []string{cli.START, cli.STOP, cli.BEGIN}, ice.STR_R)
|
m.Sort("type,status,name", []string{aaa.LOGIN, WORKER, SERVER, ORIGIN}, []string{cli.START, cli.STOP, cli.BEGIN}, ice.STR_R)
|
||||||
m.StatusTimeCountStats(mdb.TYPE, mdb.STATUS)
|
m.StatusTimeCountStats(mdb.TYPE, mdb.STATUS)
|
||||||
} else if arg[0] == ctx.ACTION {
|
} else if arg[0] == ctx.ACTION {
|
||||||
m.Cmdy(arg[1], DREAM_ACTION, arg)
|
gdb.Event(m, DREAM_ACTION, arg)
|
||||||
// gdb.Event(m, DREAM_ACTION, arg)
|
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
})
|
})
|
||||||
|
@ -85,12 +85,10 @@ const (
|
|||||||
CONTENT = "content"
|
CONTENT = "content"
|
||||||
PROFILE = "profile"
|
PROFILE = "profile"
|
||||||
DISPLAY = "display"
|
DISPLAY = "display"
|
||||||
PORTAL = "portal"
|
|
||||||
|
|
||||||
VIEW = "view"
|
VIEW = "view"
|
||||||
VALUE = "value"
|
VALUE = "value"
|
||||||
INPUT = "input"
|
INPUT = "input"
|
||||||
TITLE = "title"
|
|
||||||
ICON = "icon"
|
ICON = "icon"
|
||||||
ICONS = "icons"
|
ICONS = "icons"
|
||||||
OUTPUT = "output"
|
OUTPUT = "output"
|
||||||
|
@ -84,10 +84,8 @@ func Render(m *ice.Message, cmd string, args ...ice.Any) bool {
|
|||||||
"$output", fieldset+">div.output",
|
"$output", fieldset+">div.output",
|
||||||
"$status", fieldset+">div.status",
|
"$status", fieldset+">div.status",
|
||||||
"$fieldset", fieldset,
|
"$fieldset", fieldset,
|
||||||
"$field", fieldset,
|
|
||||||
"$input", "div.input.float."+m.Option(ctx.INDEX),
|
|
||||||
"$body", "body.cmd."+m.Option(ctx.INDEX),
|
|
||||||
"$index", m.Option(ctx.INDEX),
|
"$index", m.Option(ctx.INDEX),
|
||||||
|
"$input", "body>div.input.float."+m.Option(ctx.INDEX),
|
||||||
)))
|
)))
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -173,7 +171,7 @@ func RenderPodCmd(m *ice.Message, pod, cmd string, arg ...ice.Any) {
|
|||||||
m.Option(mdb.ICONS, msg.Option(ice.MSG_NODEICON))
|
m.Option(mdb.ICONS, msg.Option(ice.MSG_NODEICON))
|
||||||
}
|
}
|
||||||
m.OptionDefault(mdb.ICONS, m.Resource(kit.Select(ice.Info.NodeIcon, msg.Option(ice.MSG_NODEICON), msg.Append(mdb.ICONS))))
|
m.OptionDefault(mdb.ICONS, m.Resource(kit.Select(ice.Info.NodeIcon, msg.Option(ice.MSG_NODEICON), msg.Append(mdb.ICONS))))
|
||||||
serve := strings.Split(UserHost(m), "://")[1]
|
serve := kit.Select("localhost:9020", UserWeb(m).Host)
|
||||||
pod = kit.Select(pod, msg.Option(ice.MSG_NODENAME), m.Option(ice.MSG_USERPOD) != "")
|
pod = kit.Select(pod, msg.Option(ice.MSG_NODENAME), m.Option(ice.MSG_USERPOD) != "")
|
||||||
m.OptionDefault(TITLE, kit.Select(cmd, msg.Append(mdb.HELP), !m.IsEnglish())+" "+kit.Select(serve, pod))
|
m.OptionDefault(TITLE, kit.Select(cmd, msg.Append(mdb.HELP), !m.IsEnglish())+" "+kit.Select(serve, pod))
|
||||||
RenderCmds(m, kit.Dict(msg.AppendSimple(), ctx.ARGS, kit.Simple(arg), ctx.DISPLAY, m.Option(ice.MSG_DISPLAY)))
|
RenderCmds(m, kit.Dict(msg.AppendSimple(), ctx.ARGS, kit.Simple(arg), ctx.DISPLAY, m.Option(ice.MSG_DISPLAY)))
|
||||||
|
@ -190,7 +190,6 @@ func _serve_handle(key string, cmd *ice.Command, m *ice.Message, w http.Response
|
|||||||
kit.For(r.Cookies(), func(k, v string) { m.Optionv(k, v) })
|
kit.For(r.Cookies(), func(k, v string) { m.Optionv(k, v) })
|
||||||
m.Options(ice.MSG_METHOD, r.Method, ice.MSG_COUNT, "0")
|
m.Options(ice.MSG_METHOD, r.Method, ice.MSG_COUNT, "0")
|
||||||
m.Options(ice.MSG_REFERER, r.Header.Get(html.Referer))
|
m.Options(ice.MSG_REFERER, r.Header.Get(html.Referer))
|
||||||
m.Options(ice.MSG_USERURL, r.URL.String())
|
|
||||||
m.Options(ice.MSG_USERWEB, _serve_domain(m), ice.MSG_USERPOD, m.Option(ice.POD))
|
m.Options(ice.MSG_USERWEB, _serve_domain(m), ice.MSG_USERPOD, m.Option(ice.POD))
|
||||||
m.Options(ice.MSG_USERUA, r.Header.Get(html.UserAgent), ice.MSG_USERIP, r.Header.Get(ice.MSG_USERIP))
|
m.Options(ice.MSG_USERUA, r.Header.Get(html.UserAgent), ice.MSG_USERIP, r.Header.Get(ice.MSG_USERIP))
|
||||||
m.Options(ice.MSG_SESSID, kit.Select(m.Option(ice.MSG_SESSID), m.Option(CookieName(m.Option(ice.MSG_USERWEB)))))
|
m.Options(ice.MSG_SESSID, kit.Select(m.Option(ice.MSG_SESSID), m.Option(CookieName(m.Option(ice.MSG_USERWEB)))))
|
||||||
@ -199,6 +198,7 @@ func _serve_handle(key string, cmd *ice.Command, m *ice.Message, w http.Response
|
|||||||
})
|
})
|
||||||
UserHost(m)
|
UserHost(m)
|
||||||
for k, v := range m.R.Header {
|
for k, v := range m.R.Header {
|
||||||
|
// m.Info("what %v %v", k, v)
|
||||||
kit.If(strings.HasPrefix(k, "Wechatpay"), func() { m.Option(k, v) })
|
kit.If(strings.HasPrefix(k, "Wechatpay"), func() { m.Option(k, v) })
|
||||||
}
|
}
|
||||||
m.W.Header().Add(strings.ReplaceAll(ice.LOG_TRACEID, ".", "-"), m.Option(ice.LOG_TRACEID))
|
m.W.Header().Add(strings.ReplaceAll(ice.LOG_TRACEID, ".", "-"), m.Option(ice.LOG_TRACEID))
|
||||||
@ -232,8 +232,6 @@ func _serve_handle(key string, cmd *ice.Command, m *ice.Message, w http.Response
|
|||||||
Info.ServeDeleteCount++
|
Info.ServeDeleteCount++
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
} else {
|
|
||||||
m.RenderResult()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func _serve_domain(m *ice.Message) string {
|
func _serve_domain(m *ice.Message) string {
|
||||||
@ -251,7 +249,7 @@ func _serve_domain(m *ice.Message) string {
|
|||||||
}
|
}
|
||||||
func _serve_auth(m *ice.Message, key string, cmds []string, w http.ResponseWriter, r *http.Request) ([]string, bool) {
|
func _serve_auth(m *ice.Message, key string, cmds []string, w http.ResponseWriter, r *http.Request) ([]string, bool) {
|
||||||
kit.If(len(cmds) > 0, func() { cmds = append(kit.Split(cmds[0], ","), cmds[1:]...) })
|
kit.If(len(cmds) > 0, func() { cmds = append(kit.Split(cmds[0], ","), cmds[1:]...) })
|
||||||
// kit.If(!aaa.IsTechOrRoot(m), func() { m.Option("user_uid", "") })
|
kit.If(!aaa.IsTechOrRoot(m), func() { m.Option("user_uid", "") })
|
||||||
if r.URL.Path == PP(SPACE) {
|
if r.URL.Path == PP(SPACE) {
|
||||||
aaa.SessCheck(m, m.Option(ice.MSG_SESSID))
|
aaa.SessCheck(m, m.Option(ice.MSG_SESSID))
|
||||||
return cmds, true
|
return cmds, true
|
||||||
@ -259,9 +257,6 @@ func _serve_auth(m *ice.Message, key string, cmds []string, w http.ResponseWrite
|
|||||||
defer func() { m.Options(ice.MSG_CMDS, "") }()
|
defer func() { m.Options(ice.MSG_CMDS, "") }()
|
||||||
if strings.Contains(m.Option(ice.MSG_SESSID), " ") {
|
if strings.Contains(m.Option(ice.MSG_SESSID), " ") {
|
||||||
m.Cmdy(kit.Split(m.Option(ice.MSG_SESSID)))
|
m.Cmdy(kit.Split(m.Option(ice.MSG_SESSID)))
|
||||||
if m.Warn(m.Option("user.status") == "1", "此用户已封号") {
|
|
||||||
return cmds, false
|
|
||||||
}
|
|
||||||
} else if aaa.SessCheck(m, m.Option(ice.MSG_SESSID)); m.Option(ice.MSG_USERNAME) == "" {
|
} else if aaa.SessCheck(m, m.Option(ice.MSG_SESSID)); m.Option(ice.MSG_USERNAME) == "" {
|
||||||
if ls := kit.Simple(mdb.Cache(m, m.Option(ice.MSG_USERIP), func() ice.Any {
|
if ls := kit.Simple(mdb.Cache(m, m.Option(ice.MSG_USERIP), func() ice.Any {
|
||||||
if !IsLocalHost(m) {
|
if !IsLocalHost(m) {
|
||||||
|
@ -125,7 +125,7 @@ func init() {
|
|||||||
RenderPodCmd(m, msg.Append(SPACE), msg.Append(mdb.NAME), kit.UnMarshal(msg.Append(mdb.TEXT)))
|
RenderPodCmd(m, msg.Append(SPACE), msg.Append(mdb.NAME), kit.UnMarshal(msg.Append(mdb.TEXT)))
|
||||||
}
|
}
|
||||||
case DOWNLOAD:
|
case DOWNLOAD:
|
||||||
m.RenderDownload(msg.Append(mdb.TEXT), msg.Append(mdb.TYPE), msg.Append(mdb.NAME))
|
m.RenderDownload(msg.Append(mdb.TEXT))
|
||||||
default:
|
default:
|
||||||
RenderMain(m)
|
RenderMain(m)
|
||||||
}
|
}
|
||||||
|
@ -49,9 +49,7 @@ func _space_qrcode(m *ice.Message, dev string) {
|
|||||||
func _space_dial(m *ice.Message, dev, name string, arg ...string) {
|
func _space_dial(m *ice.Message, dev, name string, arg ...string) {
|
||||||
msg := m.Cmd(SPIDE, dev)
|
msg := m.Cmd(SPIDE, dev)
|
||||||
origin := msg.Append(CLIENT_ORIGIN)
|
origin := msg.Append(CLIENT_ORIGIN)
|
||||||
u := kit.ParseURL(kit.MergeURL2(strings.Replace(origin, HTTP, "ws", 1), PP(SPACE), mdb.TYPE, ice.Info.NodeType, mdb.NAME, name,
|
u := kit.ParseURL(kit.MergeURL2(strings.Replace(origin, HTTP, "ws", 1), PP(SPACE), mdb.TYPE, ice.Info.NodeType, mdb.NAME, name, TOKEN, msg.Append(TOKEN), mdb.ICONS, ice.Info.NodeIcon,
|
||||||
mdb.HELP, ice.Info.Titles,
|
|
||||||
TOKEN, msg.Append(TOKEN), mdb.ICONS, ice.Info.NodeIcon,
|
|
||||||
ice.MAIN, ice.Info.NodeMain, mdb.TIME, ice.Info.Make.Time, nfs.MODULE, ice.Info.Make.Module, nfs.VERSION, ice.Info.Make.Versions(), cli.GOOS, runtime.GOOS, cli.GOARCH, runtime.GOARCH, arg))
|
ice.MAIN, ice.Info.NodeMain, mdb.TIME, ice.Info.Make.Time, nfs.MODULE, ice.Info.Make.Module, nfs.VERSION, ice.Info.Make.Versions(), cli.GOOS, runtime.GOOS, cli.GOARCH, runtime.GOARCH, arg))
|
||||||
args := kit.SimpleKV("type,name,host,port", u.Scheme, dev, u.Hostname(), kit.Select(kit.Select(tcp.PORT_443, tcp.PORT_80, u.Scheme == "ws"), u.Port()))
|
args := kit.SimpleKV("type,name,host,port", u.Scheme, dev, u.Hostname(), kit.Select(kit.Select(tcp.PORT_443, tcp.PORT_80, u.Scheme == "ws"), u.Port()))
|
||||||
gdb.Go(m, func() {
|
gdb.Go(m, func() {
|
||||||
@ -105,7 +103,7 @@ func _space_fork(m *ice.Message) {
|
|||||||
safe = aaa.IsTechOrRoot(m)
|
safe = aaa.IsTechOrRoot(m)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
args := kit.Simple(mdb.TYPE, m.Option(mdb.TYPE), mdb.NAME, name, mdb.TEXT, text, m.OptionSimple(mdb.HELP, mdb.ICONS, mdb.TIME, nfs.MODULE, nfs.VERSION, cli.DAEMON, "main"))
|
args := kit.Simple(mdb.TYPE, m.Option(mdb.TYPE), mdb.NAME, name, mdb.TEXT, text, m.OptionSimple(mdb.ICONS, mdb.TIME, nfs.MODULE, nfs.VERSION, cli.DAEMON, "main"))
|
||||||
args = append(args, aaa.USERNICK, m.Option(ice.MSG_USERNICK), aaa.USERNAME, m.Option(ice.MSG_USERNAME), aaa.USERROLE, m.Option(ice.MSG_USERROLE))
|
args = append(args, aaa.USERNICK, m.Option(ice.MSG_USERNICK), aaa.USERNAME, m.Option(ice.MSG_USERNAME), aaa.USERROLE, m.Option(ice.MSG_USERROLE))
|
||||||
args = append(args, cli.SYSTEM, m.Option(cli.GOOS))
|
args = append(args, cli.SYSTEM, m.Option(cli.GOOS))
|
||||||
args = append(args, ParseUA(m)...)
|
args = append(args, ParseUA(m)...)
|
||||||
@ -155,7 +153,7 @@ func _space_handle(m *ice.Message, safe bool, name string, c *websocket.Conn) {
|
|||||||
}()
|
}()
|
||||||
msg := m.Spawn(b)
|
msg := m.Spawn(b)
|
||||||
if safe && msg.Option(ice.MSG_UNSAFE) != ice.TRUE { // 下行权限
|
if safe && msg.Option(ice.MSG_UNSAFE) != ice.TRUE { // 下行权限
|
||||||
if !aaa.IsTechOrRoot(msg) && msg.Option(ice.MSG_HANDLE) != ice.TRUE && msg.Option(ice.MSG_USERUID) == "" {
|
if !aaa.IsTechOrRoot(msg) && msg.Option(ice.MSG_HANDLE) != ice.TRUE {
|
||||||
msg.Option(ice.MSG_USERROLE, kit.Select(msg.Option(ice.MSG_USERROLE), aaa.UserRole(msg, msg.Option(ice.MSG_USERNAME))))
|
msg.Option(ice.MSG_USERROLE, kit.Select(msg.Option(ice.MSG_USERROLE), aaa.UserRole(msg, msg.Option(ice.MSG_USERNAME))))
|
||||||
}
|
}
|
||||||
// kit.If(kit.IsIn(msg.Option(ice.MSG_USERROLE), "", aaa.VOID), func() { msg.Option(ice.MSG_USERROLE, aaa.UserRole(msg, msg.Option(ice.MSG_USERNAME))) })
|
// kit.If(kit.IsIn(msg.Option(ice.MSG_USERROLE), "", aaa.VOID), func() { msg.Option(ice.MSG_USERROLE, aaa.UserRole(msg, msg.Option(ice.MSG_USERNAME))) })
|
||||||
@ -447,7 +445,7 @@ func init() {
|
|||||||
}},
|
}},
|
||||||
nfs.PS: {Hand: func(m *ice.Message, arg ...string) { _space_fork(m) }},
|
nfs.PS: {Hand: func(m *ice.Message, arg ...string) { _space_fork(m) }},
|
||||||
}, gdb.EventsAction(SPACE_LOGIN), mdb.HashAction(mdb.LIMIT, 1000, mdb.LEAST, 500,
|
}, gdb.EventsAction(SPACE_LOGIN), mdb.HashAction(mdb.LIMIT, 1000, mdb.LEAST, 500,
|
||||||
mdb.SHORT, mdb.NAME, mdb.FIELD, "time,type,name,help,text,main,icons,module,version,agent,system,ip,usernick,username,userrole",
|
mdb.SHORT, mdb.NAME, mdb.FIELD, "time,type,name,text,main,icons,module,version,agent,system,ip,usernick,username,userrole",
|
||||||
ctx.ACTION, OPEN, REDIAL, kit.Dict("a", 1000, "b", 100, "c", 1000),
|
ctx.ACTION, OPEN, REDIAL, kit.Dict("a", 1000, "b", 100, "c", 1000),
|
||||||
), mdb.ClearOnExitHashAction()), Hand: func(m *ice.Message, arg ...string) {
|
), mdb.ClearOnExitHashAction()), Hand: func(m *ice.Message, arg ...string) {
|
||||||
if len(arg) < 2 {
|
if len(arg) < 2 {
|
||||||
@ -494,9 +492,6 @@ func init() {
|
|||||||
})
|
})
|
||||||
m.Sort("", kit.Simple(aaa.LOGIN, WEIXIN, PORTAL, WORKER, SERVER, ORIGIN))
|
m.Sort("", kit.Simple(aaa.LOGIN, WEIXIN, PORTAL, WORKER, SERVER, ORIGIN))
|
||||||
} else {
|
} else {
|
||||||
if arg[0] == "web.team.gonganxitong.sess" {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if ice.Info.NodeType != WORKER && arg[0] == ice.OPS {
|
if ice.Info.NodeType != WORKER && arg[0] == ice.OPS {
|
||||||
m.Cmdy(arg[1:])
|
m.Cmdy(arg[1:])
|
||||||
return
|
return
|
||||||
@ -530,10 +525,7 @@ func init() {
|
|||||||
})
|
})
|
||||||
case SPACE:
|
case SPACE:
|
||||||
AdminCmd(m, SPACE).Table(func(value ice.Maps) {
|
AdminCmd(m, SPACE).Table(func(value ice.Maps) {
|
||||||
kit.If(kit.IsIn(value[mdb.TYPE], WORKER, SERVER), func() {
|
kit.If(kit.IsIn(value[mdb.TYPE], WORKER, SERVER), func() { m.Push(arg[0], value[mdb.NAME]) })
|
||||||
m.Push(arg[0], value[mdb.NAME])
|
|
||||||
m.Push(mdb.HELP, value[mdb.HELP])
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
case SERVER:
|
case SERVER:
|
||||||
AdminCmd(m, SPACE).Table(func(value ice.Maps) {
|
AdminCmd(m, SPACE).Table(func(value ice.Maps) {
|
||||||
@ -562,8 +554,7 @@ func init() {
|
|||||||
} else {
|
} else {
|
||||||
m.Cmdy(ctx.COMMAND)
|
m.Cmdy(ctx.COMMAND)
|
||||||
}
|
}
|
||||||
m.Cut(ctx.INDEX, mdb.HELP)
|
m.CutTo(ctx.INDEX, arg[0])
|
||||||
m.RenameAppend(ctx.INDEX, arg[0])
|
|
||||||
case ctx.ARGS:
|
case ctx.ARGS:
|
||||||
m.OptionDefault(ctx.INDEX, m.Option("extra.index"))
|
m.OptionDefault(ctx.INDEX, m.Option("extra.index"))
|
||||||
if space := m.Option(SPACE); space != "" {
|
if space := m.Option(SPACE); space != "" {
|
||||||
|
@ -115,6 +115,7 @@ func _spide_body(m *ice.Message, method string, arg ...string) (io.Reader, ice.M
|
|||||||
case SPIDE_FORM:
|
case SPIDE_FORM:
|
||||||
// arg = kit.Simple(arg, func(v string) string { return url.QueryEscape(v) })
|
// arg = kit.Simple(arg, func(v string) string { return url.QueryEscape(v) })
|
||||||
head[html.ContentType], body = html.ApplicationForm, bytes.NewBufferString(kit.JoinQuery(arg[1:]...))
|
head[html.ContentType], body = html.ApplicationForm, bytes.NewBufferString(kit.JoinQuery(arg[1:]...))
|
||||||
|
m.Info("debug what %v", kit.JoinQuery(arg[1:]...))
|
||||||
case SPIDE_PART:
|
case SPIDE_PART:
|
||||||
head[html.ContentType], body = _spide_part(m, arg...)
|
head[html.ContentType], body = _spide_part(m, arg...)
|
||||||
case SPIDE_FILE:
|
case SPIDE_FILE:
|
||||||
@ -310,6 +311,7 @@ func init() {
|
|||||||
m.Cmd("", mdb.CREATE, kit.Select(dev, os.Getenv("ctx_dev_ip")), ice.DEV_IP, ice.SRC_MAIN_ICO, "dev_ip")
|
m.Cmd("", mdb.CREATE, kit.Select(dev, os.Getenv("ctx_dev_ip")), ice.DEV_IP, ice.SRC_MAIN_ICO, "dev_ip")
|
||||||
m.Cmd("", mdb.CREATE, kit.Select("http://localhost:9020", conf[cli.CTX_OPS]), ice.OPS, ice.SRC_MAIN_ICO, nfs.REPOS)
|
m.Cmd("", mdb.CREATE, kit.Select("http://localhost:9020", conf[cli.CTX_OPS]), ice.OPS, ice.SRC_MAIN_ICO, nfs.REPOS)
|
||||||
m.Cmd("", mdb.CREATE, kit.Select("https://shylinux.com", conf[cli.CTX_SHY]), ice.SHY, ice.SRC_MAIN_ICO, nfs.REPOS)
|
m.Cmd("", mdb.CREATE, kit.Select("https://shylinux.com", conf[cli.CTX_SHY]), ice.SHY, ice.SRC_MAIN_ICO, nfs.REPOS)
|
||||||
|
m.Cmd("", mdb.CREATE, kit.Select("https://web.shylinux.com", conf[cli.CTX_WEB]), ice.WEB, ice.SRC_MAIN_ICO, nfs.REPOS)
|
||||||
m.Cmd("", mdb.CREATE, kit.Select("https://mail.shylinux.com", conf[cli.CTX_MAIL]), ice.MAIL, "usr/icons/Mail.png", "mail")
|
m.Cmd("", mdb.CREATE, kit.Select("https://mail.shylinux.com", conf[cli.CTX_MAIL]), ice.MAIL, "usr/icons/Mail.png", "mail")
|
||||||
m.Cmd("", mdb.CREATE, kit.Select("https://demo.shylinux.com", conf[cli.CTX_DEMO]), ice.DEMO, ice.SRC_MAIN_ICO, "demo")
|
m.Cmd("", mdb.CREATE, kit.Select("https://demo.shylinux.com", conf[cli.CTX_DEMO]), ice.DEMO, ice.SRC_MAIN_ICO, "demo")
|
||||||
m.Cmd("", mdb.CREATE, "https://2023.shylinux.com", "2023-ContextOS", ice.SRC_MAIN_ICO, nfs.REPOS)
|
m.Cmd("", mdb.CREATE, "https://2023.shylinux.com", "2023-ContextOS", ice.SRC_MAIN_ICO, nfs.REPOS)
|
||||||
@ -387,7 +389,7 @@ func init() {
|
|||||||
mdb.HashModify(m, mdb.NAME, m.Option(CLIENT_NAME), TOKEN, "")
|
mdb.HashModify(m, mdb.NAME, m.Option(CLIENT_NAME), TOKEN, "")
|
||||||
}},
|
}},
|
||||||
DEV_CREATE_TOKEN: {Hand: func(m *ice.Message, arg ...string) {
|
DEV_CREATE_TOKEN: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.OptionDefault(CLIENT_NAME, m.Option(ice.FROM_SPACE))
|
m.Option(CLIENT_NAME, m.Option(ice.FROM_SPACE))
|
||||||
mdb.HashModify(m, m.OptionSimple(CLIENT_NAME, TOKEN))
|
mdb.HashModify(m, m.OptionSimple(CLIENT_NAME, TOKEN))
|
||||||
m.Cmd(SPACE, tcp.DIAL, m.Option(CLIENT_NAME)).Sleep300ms()
|
m.Cmd(SPACE, tcp.DIAL, m.Option(CLIENT_NAME)).Sleep300ms()
|
||||||
}},
|
}},
|
||||||
@ -430,17 +432,8 @@ func init() {
|
|||||||
return kit.Format(mdb.Cache(ice.Pulse, p, func() ice.Any { return m.Cmdx(SPIDE, ice.OPS, SPIDE_RAW, http.MethodGet, p) }))
|
return kit.Format(mdb.Cache(ice.Pulse, p, func() ice.Any { return m.Cmdx(SPIDE, ice.OPS, SPIDE_RAW, http.MethodGet, p) }))
|
||||||
} else if p == "" {
|
} else if p == "" {
|
||||||
return ""
|
return ""
|
||||||
} else if nfs.Exists(m, p) {
|
|
||||||
return m.Cmdx(nfs.CAT, p)
|
|
||||||
} else if strings.Contains(p, "/pkg/mod/") {
|
|
||||||
ls := strings.Split(p, "/pkg/mod/")
|
|
||||||
return kit.Format(mdb.Cache(ice.Pulse, p, func() ice.Any { return m.Cmdx(SPIDE, ice.OPS, SPIDE_RAW, http.MethodGet, nfs.REQUIRE+ls[1]) }))
|
|
||||||
} else if strings.Contains(p, "/usr/local/work/") {
|
|
||||||
ls := strings.Split(strings.Split(p, "/usr/local/work/")[1], "/src/")
|
|
||||||
pp := kit.MergeURL2(ice.Info.Make.Domain, "/p/src/"+ls[1]+"?pod="+ls[0])
|
|
||||||
return kit.Format(mdb.Cache(ice.Pulse, p, func() ice.Any { return m.Cmdx(SPIDE, ice.OPS, SPIDE_RAW, http.MethodGet, pp) }))
|
|
||||||
} else {
|
} else {
|
||||||
return ""
|
return m.Cmdx(nfs.CAT, p)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nfs.TemplatePath = func(m *ice.Message, arg ...string) string {
|
nfs.TemplatePath = func(m *ice.Message, arg ...string) string {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
$project div.list { margin-left:25px; }
|
$project div.list { margin-left:25px; }
|
||||||
$project div.item span.exists { color:var(--notice-bg-color); padding:0 var(--input-padding); }
|
$project div.item span.exists { color:var(--notice-bg-color); padding:0 var(--input-padding); }
|
||||||
$content>div.item { border:var(--plugin-border); border-radius:var(--plugin-radius); }
|
$content>div.item { box-shadow:var(--th-box-shadow); border:var(--plugin-border); border-radius:var(--plugin-radius); }
|
||||||
$content>div.item:hover { box-shadow:var(--notice-box-shadow); }
|
$content>div.item:hover { box-shadow:var(--notice-box-shadow); }
|
||||||
$content>div.item div.title div.label { font-size:var(--status-font-size); font-weight:normal; margin-top:var(--input-margin); }
|
$content>div.item div.title div.label { font-size:var(--status-font-size); font-weight:normal; margin-top:var(--input-margin); }
|
||||||
$content>div.item div.title div.label span { padding:var(--input-padding); padding-right:var(--input-margin); }
|
$content>div.item div.title div.label span { padding:var(--input-padding); padding-right:var(--input-margin); }
|
||||||
|
34
conf.go
34
conf.go
@ -171,7 +171,6 @@ const ( // DIR
|
|||||||
SRC_MAIN_CSS = "src/main.css"
|
SRC_MAIN_CSS = "src/main.css"
|
||||||
SRC_MAIN_JS = "src/main.js"
|
SRC_MAIN_JS = "src/main.js"
|
||||||
SRC_MAIN_GO = "src/main.go"
|
SRC_MAIN_GO = "src/main.go"
|
||||||
SRC_OPTION_GO = "src/option.go"
|
|
||||||
SRC_WEBVIEW_GO = "src/webview.go"
|
SRC_WEBVIEW_GO = "src/webview.go"
|
||||||
SRC_VERSION_GO = "src/version.go"
|
SRC_VERSION_GO = "src/version.go"
|
||||||
SRC_BINPACK_GO = "src/binpack.go"
|
SRC_BINPACK_GO = "src/binpack.go"
|
||||||
@ -221,24 +220,21 @@ const ( // MSG
|
|||||||
MSG_DISPLAY_CSS = "_display_css"
|
MSG_DISPLAY_CSS = "_display_css"
|
||||||
MSG_TOOLKIT = "_toolkit"
|
MSG_TOOLKIT = "_toolkit"
|
||||||
|
|
||||||
MSG_USERIP = "user.ip"
|
MSG_USERIP = "user.ip"
|
||||||
MSG_USERUA = "user.ua"
|
MSG_USERUA = "user.ua"
|
||||||
MSG_USERURL = "user.url"
|
MSG_USERWEB = "user.web"
|
||||||
MSG_USERWEB = "user.web"
|
MSG_USERPOD = "user.pod"
|
||||||
MSG_USERPOD = "user.pod"
|
MSG_USERPOD0 = "user.pod0"
|
||||||
MSG_USERPOD0 = "user.pod0"
|
MSG_USERWEB0 = "user.web0"
|
||||||
MSG_USERWEB0 = "user.web0"
|
MSG_USERHOST = "user.host"
|
||||||
MSG_USERHOST = "user.host"
|
MSG_USERADDR = "user.addr"
|
||||||
MSG_USERADDR = "user.addr"
|
MSG_USERDATA = "user.data"
|
||||||
MSG_USERDATA = "user.data"
|
MSG_USERNICK = "user.nick"
|
||||||
MSG_USERNICK = "user.nick"
|
MSG_USERNAME = "user.name"
|
||||||
MSG_USERNAME = "user.name"
|
MSG_USERROLE = "user.role"
|
||||||
MSG_USERROLE = "user.role"
|
MSG_USERZONE = "user.zone"
|
||||||
MSG_USERZONE = "user.zone"
|
MSG_LANGUAGE = "user.lang"
|
||||||
MSG_LANGUAGE = "user.lang"
|
MSG_AVATAR = "user.avatar"
|
||||||
MSG_AVATAR = "user.avatar"
|
|
||||||
MSG_USERSTATUS = "user.status"
|
|
||||||
MSG_USERUID = "user.uid"
|
|
||||||
|
|
||||||
MSG_BG = "sess.bg"
|
MSG_BG = "sess.bg"
|
||||||
MSG_FG = "sess.fg"
|
MSG_FG = "sess.fg"
|
||||||
|
@ -141,7 +141,7 @@ func init() {
|
|||||||
m.Echo(m.Option(ice.MSG_SESSID))
|
m.Echo(m.Option(ice.MSG_SESSID))
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
}, web.ApiAction(), mdb.ImportantHashAction(mdb.SHORT, mdb.NAME, mdb.FIELD, "time,type,name,help,prompt,icons,order,link,space,index,args")), Hand: func(m *ice.Message, arg ...string) {
|
}, web.ApiAction(), mdb.ImportantHashAction(mdb.SHORT, mdb.NAME, mdb.FIELD, "time,type,name,help,icons,order,link,space,index,args")), Hand: func(m *ice.Message, arg ...string) {
|
||||||
if kit.Contains(m.Option(ice.MSG_USERUA), "MicroMessenger") {
|
if kit.Contains(m.Option(ice.MSG_USERUA), "MicroMessenger") {
|
||||||
if m.Option(ice.MSG_USERNAME) == "" && m.Option("code") == "" && mdb.Config(m, "oauth") != "" {
|
if m.Option(ice.MSG_USERNAME) == "" && m.Option("code") == "" && mdb.Config(m, "oauth") != "" {
|
||||||
m.ProcessOpen(mdb.Config(m, "oauth"))
|
m.ProcessOpen(mdb.Config(m, "oauth"))
|
||||||
@ -163,14 +163,8 @@ func init() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
m.Option(aaa.LANGUAGE, strings.ReplaceAll(strings.ToLower(kit.Select("", kit.Split(kit.GetValid(
|
m.Option(aaa.LANGUAGE, strings.ReplaceAll(strings.ToLower(kit.Select("", kit.Split(kit.GetValid(
|
||||||
func() string { return m.Option(ice.MSG_LANGUAGE) },
|
|
||||||
func() string { return kit.Select("", "zh-cn", strings.Contains(m.Option(ice.MSG_USERUA), "zh_CN")) },
|
func() string { return kit.Select("", "zh-cn", strings.Contains(m.Option(ice.MSG_USERUA), "zh_CN")) },
|
||||||
func() string {
|
func() string { return kit.Select("", kit.Split(m.R.Header.Get(html.AcceptLanguage), ",;"), 0) },
|
||||||
if m.R != nil {
|
|
||||||
return kit.Select("", kit.Split(m.R.Header.Get(html.AcceptLanguage), ",;"), 0)
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
},
|
|
||||||
func() string { return ice.Info.Lang },
|
func() string { return ice.Info.Lang },
|
||||||
), " ."), 0)), "_", "-"))
|
), " ."), 0)), "_", "-"))
|
||||||
m.Option("language.list", m.Cmd(nfs.DIR, nfs.TemplatePath(m, aaa.LANGUAGE)+nfs.PS, nfs.FILE).Appendv(nfs.FILE))
|
m.Option("language.list", m.Cmd(nfs.DIR, nfs.TemplatePath(m, aaa.LANGUAGE)+nfs.PS, nfs.FILE).Appendv(nfs.FILE))
|
||||||
|
@ -1,10 +1,17 @@
|
|||||||
package macos
|
package macos
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"path"
|
||||||
|
"strings"
|
||||||
|
|
||||||
ice "shylinux.com/x/icebergs"
|
ice "shylinux.com/x/icebergs"
|
||||||
"shylinux.com/x/icebergs/base/aaa"
|
"shylinux.com/x/icebergs/base/aaa"
|
||||||
|
"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/core/code"
|
"shylinux.com/x/icebergs/core/code"
|
||||||
|
kit "shylinux.com/x/toolkits"
|
||||||
)
|
)
|
||||||
|
|
||||||
const APPLICATIONS = "applications"
|
const APPLICATIONS = "applications"
|
||||||
@ -18,6 +25,23 @@ func init() {
|
|||||||
}, PodCmdAction(), CmdHashAction("space,index,args"), mdb.ClearOnExitHashAction())},
|
}, PodCmdAction(), CmdHashAction("space,index,args"), mdb.ClearOnExitHashAction())},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
func install(m *ice.Message, cmd, icon, index string, arg ...string) string {
|
||||||
|
if icon == "" {
|
||||||
|
return ""
|
||||||
|
} else if !kit.HasPrefix(icon, nfs.PS, web.HTTP) && !nfs.Exists(m, icon) && !nfs.Exists(m, ice.USR_ICONS+icon, func(p string) { icon = p }) {
|
||||||
|
if strings.Contains(kit.Path(""), nfs.USR_LOCAL_WORK) && nfs.Exists(m, path.Join(strings.Split(kit.Path(""), nfs.USR_LOCAL_WORK)[0], ice.USR_ICONS+icon)) {
|
||||||
|
icon = ice.USR_ICONS + icon
|
||||||
|
} else {
|
||||||
|
icon = path.Join(path.Dir(ctx.GetCmdFile(m, m.PrefixKey())), icon)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
name := kit.TrimExt(path.Base(icon), nfs.PNG, nfs.JPG, nfs.JPEG)
|
||||||
|
if !strings.HasPrefix(icon, nfs.USR_ICONS) {
|
||||||
|
name = kit.Select("", kit.Split(index, "."), -1)
|
||||||
|
}
|
||||||
|
m.Cmd(Prefix(cmd), mdb.CREATE, mdb.NAME, name, mdb.ICON, icon, ctx.INDEX, index, arg)
|
||||||
|
return icon
|
||||||
|
}
|
||||||
func AppInstall(m *ice.Message, icon, index string, arg ...string) string {
|
func AppInstall(m *ice.Message, icon, index string, arg ...string) string {
|
||||||
return install(m, APPLICATIONS, icon, index, arg...)
|
return install(m, APPLICATIONS, icon, index, arg...)
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,6 @@ fieldset.desktop>div.output>div.desktop { display:flex; flex-direction:column; f
|
|||||||
fieldset.desktop>div.output>div.desktop:not(.select) { display:none; }
|
fieldset.desktop>div.output>div.desktop:not(.select) { display:none; }
|
||||||
fieldset.desktop>div.output>div.desktop>div.item { text-align:center; }
|
fieldset.desktop>div.output>div.desktop>div.item { text-align:center; }
|
||||||
fieldset.desktop>div.output>div.desktop>div.item img { object-fit:contain; height:var(--desktop-icon-size); width:var(--desktop-icon-size); }
|
fieldset.desktop>div.output>div.desktop>div.item img { object-fit:contain; height:var(--desktop-icon-size); width:var(--desktop-icon-size); }
|
||||||
fieldset.desktop>div.output>div.desktop>div.item.portal img { padding:8px; border-radius:20px; }
|
|
||||||
fieldset.desktop>div.output>div.desktop>div.item>div.name { color:white; white-space:pre; font-size:var(--code-font-size); width:var(--desktop-icon-size); overflow:hidden; }
|
fieldset.desktop>div.output>div.desktop>div.item>div.name { color:white; white-space:pre; font-size:var(--code-font-size); width:var(--desktop-icon-size); overflow:hidden; }
|
||||||
fieldset.desktop>div.output>div.desktop>fieldset { border:0; position:absolute; }
|
fieldset.desktop>div.output>div.desktop>fieldset { border:0; position:absolute; }
|
||||||
fieldset.desktop>div.output>div.desktop>fieldset>legend { box-shadow:none; padding:0 var(--input-padding); margin:var(--button-margin); }
|
fieldset.desktop>div.output>div.desktop>fieldset>legend { box-shadow:none; padding:0 var(--input-padding); margin:var(--button-margin); }
|
||||||
@ -64,15 +63,8 @@ fieldset.desktop>div.output>div.desktop>fieldset.web.chat.location>div.action>di
|
|||||||
fieldset.desktop>div.output>div.desktop>fieldset.web.chat.location>div.action>div.item.style select { width:80px; }
|
fieldset.desktop>div.output>div.desktop>fieldset.web.chat.location>div.action>div.item.style select { width:80px; }
|
||||||
fieldset.desktop>div.output>div.desktop>fieldset.web.chat.location>div.action>div.item.feature select { width:60px; }
|
fieldset.desktop>div.output>div.desktop>fieldset.web.chat.location>div.action>div.item.feature select { width:60px; }
|
||||||
fieldset.desktop>div.output>div.desktop>fieldset.web.chat.macos.finder>div.action { display:none; }
|
fieldset.desktop>div.output>div.desktop>fieldset.web.chat.macos.finder>div.action { display:none; }
|
||||||
fieldset.desktop>div.output>div.desktop>fieldset.web.chat.iframe.portal>div.action { display:none; }
|
|
||||||
fieldset.desktop>div.output>div.desktop>fieldset.web.chat.macos.finder>div.status { display:none; }
|
fieldset.desktop>div.output>div.desktop>fieldset.web.chat.macos.finder>div.status { display:none; }
|
||||||
fieldset.desktop>div.output>div.desktop>fieldset.web.chat.macos.finder>div.output div.item.disable { display:none; }
|
fieldset.desktop>div.output>div.desktop>fieldset.web.chat.macos.finder>div.output div.item.disable { display:none; }
|
||||||
fieldset.desktop>div.output>div.desktop>fieldset.web.team.gonganxitong.service>form.option input { display:none; }
|
|
||||||
fieldset.desktop>div.output>div.desktop>fieldset.web.team.gonganxitong.recent>form.option input { display:none; }
|
|
||||||
fieldset.desktop>div.output>div.desktop>fieldset.web.team.portal>div.action { top:48px; }
|
|
||||||
fieldset.desktop>div.output>div.desktop>fieldset.web.team.portal>div.output div.item.card>div.action { display:none; }
|
|
||||||
fieldset.desktop>div.output>div.desktop>fieldset.web.chat.iframe>div.output { background-color:var(--output-bg-color); color:var(--output-fg-color); }
|
|
||||||
|
|
||||||
fieldset.desktop>div.output>fieldset.web.chat.macos.dock>div.output div.item.disable { display:none; }
|
fieldset.desktop>div.output>fieldset.web.chat.macos.dock>div.output div.item.disable { display:none; }
|
||||||
fieldset.desktop>div.output>div.desktop>div.item.disable { display:none; }
|
fieldset.desktop>div.output>div.desktop>div.item.disable { display:none; }
|
||||||
fieldset.macos.menu>div.output>div.item { padding:0 var(--button-padding); height:var(--desktop-menu-height); float:right; }
|
fieldset.macos.menu>div.output>div.item { padding:0 var(--button-padding); height:var(--desktop-menu-height); float:right; }
|
||||||
@ -81,9 +73,7 @@ body.mobile fieldset.macos.menu>div.output>div.tabs { display:none; }
|
|||||||
body.mobile fieldset.macos.menu>div.output>div.icon.create { display:none; }
|
body.mobile fieldset.macos.menu>div.output>div.icon.create { display:none; }
|
||||||
body.mobile fieldset.macos.menu>div.output>div.item.search { display:none; }
|
body.mobile fieldset.macos.menu>div.output>div.item.search { display:none; }
|
||||||
body.mobile fieldset.macos.menu>div.output>div.item.notify { display:none; }
|
body.mobile fieldset.macos.menu>div.output>div.item.notify { display:none; }
|
||||||
body.mobile fieldset.macos.menu>div.output>div.item.usernick { display:none; }
|
fieldset.macos.menu>div.output>div.item.avatar>img { padding:0; height:var(--desktop-menu-height); }
|
||||||
body.mobile fieldset.macos.menu>div.output>div.item.qrcode { display:none; }
|
|
||||||
fieldset.macos.menu>div.output>div.item.avatar>img { border-radius:20px; padding:0; height:var(--desktop-menu-height); }
|
|
||||||
fieldset.macos.menu>div.output>div.menu { padding:0 var(--button-padding); float:left; }
|
fieldset.macos.menu>div.output>div.menu { padding:0 var(--button-padding); float:left; }
|
||||||
body.mobile fieldset.macos.menu>div.output>div.menu { padding:0 var(--input-padding); }
|
body.mobile fieldset.macos.menu>div.output>div.menu { padding:0 var(--input-padding); }
|
||||||
fieldset.macos.menu>div.output>div.tabs { font-style:italic; padding:0 var(--input-padding); float:left; }
|
fieldset.macos.menu>div.output>div.tabs { font-style:italic; padding:0 var(--input-padding); float:left; }
|
||||||
@ -96,8 +86,8 @@ fieldset.macos.dock>div.output>div.item { text-align:center; align-self:baseline
|
|||||||
fieldset.macos.dock>div.output>div.item img { object-fit:contain; min-height:var(--desktop-icon-size); width:var(--desktop-icon-size); transition:width 0.3s; }
|
fieldset.macos.dock>div.output>div.item img { object-fit:contain; min-height:var(--desktop-icon-size); width:var(--desktop-icon-size); transition:width 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.finder>div.output div.content>div.item { text-align:center; float:left; width:var(--desktop-icon-size); }
|
fieldset.macos.finder>div.output div.content>div.item { text-align:center; float:left; width:var(--desktop-icon-size); }
|
||||||
|
fieldset.macos.finder>div.output div.content>div.item img { object-fit:contain; width:var(--desktop-icon-size); }
|
||||||
fieldset.macos.finder>div.output div.content>div.item img { object-fit:contain; width:var(--desktop-icon-size); height:var(--desktop-icon-size); }
|
fieldset.macos.finder>div.output div.content>div.item img { object-fit:contain; width:var(--desktop-icon-size); height:var(--desktop-icon-size); }
|
||||||
fieldset.macos.finder>div.output div.content>div.item.portal img { padding:8px; border-radius:20px; }
|
|
||||||
fieldset.macos.finder>div.output div.content>div.item div.name { font-size:var(--code-font-size); white-space:pre; text-align:center; overflow:hidden; }
|
fieldset.macos.finder>div.output div.content>div.item div.name { font-size:var(--code-font-size); white-space:pre; text-align:center; overflow:hidden; }
|
||||||
fieldset.desktop>div.output>div.desktop fieldset table.content tbody tr:nth-child(odd):not(:hover) { background-color:var(--output-bg-color); }
|
fieldset.desktop>div.output>div.desktop fieldset table.content tbody tr:nth-child(odd):not(:hover) { background-color:var(--output-bg-color); }
|
||||||
fieldset.desktop>div.output>div.desktop fieldset table.content tbody tr:nth-child(even):not(:hover) { background-color:var(--plugin-bg-color); }
|
fieldset.desktop>div.output>div.desktop fieldset table.content tbody tr:nth-child(even):not(:hover) { background-color:var(--plugin-bg-color); }
|
||||||
@ -106,7 +96,6 @@ body:not(.mobile) fieldset.macos.dock>div.output>div.item:hover { background-col
|
|||||||
body:not(.mobile) fieldset.macos.dock>div.output>div.item img:hover { width:160px; transition:width 0.3s; }
|
body:not(.mobile) fieldset.macos.dock>div.output>div.item img:hover { width:160px; transition:width 0.3s; }
|
||||||
body:not(.mobile) fieldset.desktop>div.output>fieldset.macos.dock:hover { margin-left:-40px; transition:margin-left 0.3s; }
|
body:not(.mobile) fieldset.desktop>div.output>fieldset.macos.dock:hover { margin-left:-40px; transition:margin-left 0.3s; }
|
||||||
body:not(.mobile) fieldset.desktop>div.output>div.desktop>div.item { margin:var(--desktop-icon-margin); }
|
body:not(.mobile) fieldset.desktop>div.output>div.desktop>div.item { margin:var(--desktop-icon-margin); }
|
||||||
body:not(.mobile) fieldset.desktop>div.output>div.desktop>div.item:hover { background-color:var(--hover-bg-color); }
|
|
||||||
body:not(.mobile) fieldset.desktop>div.output>fieldset.macos.searchs>form.option>div.item.keyword input { background-color:transparent; width:var(--river-width); }
|
body:not(.mobile) fieldset.desktop>div.output>fieldset.macos.searchs>form.option>div.item.keyword input { background-color:transparent; width:var(--river-width); }
|
||||||
body:not(.mobile) fieldset.desktop>div.output>fieldset.macos.searchs>div.action input { background-color:transparent; }
|
body:not(.mobile) fieldset.desktop>div.output>fieldset.macos.searchs>div.action input { background-color:transparent; }
|
||||||
body:not(.mobile) fieldset.desktop>div.output>div.desktop>fieldset>legend:not(:hover) { background-color:transparent; }
|
body:not(.mobile) fieldset.desktop>div.output>div.desktop>fieldset>legend:not(:hover) { background-color:transparent; }
|
||||||
|
@ -20,22 +20,22 @@ func init() {
|
|||||||
}},
|
}},
|
||||||
ice.CTX_OPEN: {Hand: func(m *ice.Message, arg ...string) {
|
ice.CTX_OPEN: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
if m.Cmd(DESKTOP).Length() == 0 {
|
if m.Cmd(DESKTOP).Length() == 0 {
|
||||||
DeskAppend(m, "Messages.png", web.CHAT_MESSAGE, mdb.TEXT, "消息", mdb.SCORE, "1")
|
DeskAppend(m, "Books.png", web.WIKI_WORD)
|
||||||
DeskAppend(m, "Calendar.png", web.TEAM_PLAN, mdb.TEXT, "日历", mdb.SCORE, "2")
|
DeskAppend(m, "Photos.png", web.WIKI_FEEL)
|
||||||
DeskAppend(m, "Photos.png", web.WIKI_FEEL, mdb.TEXT, "相册", mdb.SCORE, "3")
|
DeskAppend(m, "Calendar.png", web.TEAM_PLAN)
|
||||||
DeskAppend(m, "Books.png", web.WIKI_WORD, mdb.TEXT, "文档", mdb.SCORE, "4")
|
DeskAppend(m, "Messages.png", web.CHAT_MESSAGE)
|
||||||
}
|
}
|
||||||
if m.Cmd(DOCK).Length() == 0 {
|
if m.Cmd(DOCK).Length() == 0 {
|
||||||
DockAppend(m, "Finder.png", Prefix(FINDER), mdb.SCORE, "1")
|
DockAppend(m, "Finder.png", Prefix(FINDER))
|
||||||
DockAppend(m, "Safari.png", web.CHAT_IFRAME, mdb.SCORE, "2")
|
DockAppend(m, "Safari.png", web.CHAT_IFRAME)
|
||||||
DockAppend(m, "vimer.png", web.CODE_VIMER, mdb.SCORE, "3")
|
DockAppend(m, "Terminal.png", web.CODE_XTERM)
|
||||||
DockAppend(m, "git.png", web.CODE_GIT_STATUS, mdb.SCORE, "4")
|
DockAppend(m, "git.png", web.CODE_GIT_STATUS)
|
||||||
DockAppend(m, "Terminal.png", web.CODE_XTERM, mdb.SCORE, "5")
|
DockAppend(m, "vimer.png", web.CODE_VIMER)
|
||||||
}
|
}
|
||||||
m.Travel(func(p *ice.Context, c *ice.Context, key string, cmd *ice.Command) {
|
m.Travel(func(p *ice.Context, c *ice.Context, key string, cmd *ice.Command) {
|
||||||
kit.If(cmd.Icon, func() {
|
kit.If(cmd.Icon, func() {
|
||||||
if kit.Contains(cmd.Icon, ".ico", ".png", ".jpg") {
|
if kit.Contains(cmd.Icon, ".ico", ".png", ".jpg") {
|
||||||
cmd.Icon = AppInstall(m, cmd.Icon, m.PrefixKey(), mdb.TEXT, cmd.Help)
|
cmd.Icon = AppInstall(m, cmd.Icon, m.PrefixKey())
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -50,7 +50,7 @@ func init() {
|
|||||||
}},
|
}},
|
||||||
// web.DREAM_ACTION: {Hand: func(m *ice.Message, arg ...string) { web.DreamProcessIframe(m, arg...) }},
|
// web.DREAM_ACTION: {Hand: func(m *ice.Message, arg ...string) { web.DreamProcessIframe(m, arg...) }},
|
||||||
// web.DREAM_ACTION: {Hand: func(m *ice.Message, arg ...string) { web.DreamProcess(m, "", arg, arg...) }},
|
// web.DREAM_ACTION: {Hand: func(m *ice.Message, arg ...string) { web.DreamProcess(m, "", arg, arg...) }},
|
||||||
}, web.DreamTablesAction(), PodCmdAction(), CmdHashAction("space,index,args"), mdb.ExportHashAction())},
|
}, web.DreamTablesAction(), PodCmdAction(), CmdHashAction(ctx.INDEX), mdb.ExportHashAction())},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
can.sup.onexport.link = function() { return can.misc.MergeURL(can, {pod: can.ConfSpace()||can.misc.Search(can, ice.POD), cmd: web.DESKTOP}) }
|
can.sup.onexport.link = function() { return can.misc.MergeURL(can, {pod: can.ConfSpace()||can.misc.Search(can, ice.POD), cmd: web.DESKTOP}) }
|
||||||
can.onexport.title(can, can.ConfHelp(), can.user.titles)
|
can.onexport.title(can, can.ConfHelp(), can.user.titles)
|
||||||
},
|
},
|
||||||
_menu: function(can) { can.onappend.plugin(can, {index: "web.chat.macos.menu", style: html.OUTPUT, title: can.Conf("title")}, function(sub) { can.ui.menu = sub, sub._desktop = can
|
_menu: function(can) { can.onappend.plugin(can, {index: "web.chat.macos.menu", style: html.OUTPUT}, function(sub) { can.ui.menu = sub, sub._desktop = can
|
||||||
var tabs = can.misc.sessionStorage(can, [can.ConfIndex(), html.TABS])
|
var tabs = can.misc.sessionStorage(can, [can.ConfIndex(), html.TABS])
|
||||||
sub.onexport.output = function() { can.onimport._desktop(can, can._msg)
|
sub.onexport.output = function() { can.onimport._desktop(can, can._msg)
|
||||||
var sess = can.misc.SearchHash(can)[0]||can.Conf("session")
|
var sess = can.misc.SearchHash(can)[0]||can.Conf("session")
|
||||||
@ -71,28 +71,15 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
}) }) },
|
}) }) },
|
||||||
__item: function(can, msg, target) { var index = 0; can.onimport.icon(can, msg = msg||can._msg, target, function(target, item) { can.page.Modify(can, target, {
|
__item: function(can, msg, target) { var index = 0; can.onimport.icon(can, msg = msg||can._msg, target, function(target, item) { can.page.Modify(can, target, {
|
||||||
onclick: function(event) { can.onimport._window(can, item) },
|
onclick: function(event) { can.onimport._window(can, item) },
|
||||||
oncontextmenu: function(event) { if (!can.user.isTechOrRoot(can)) { return } var carte = can.user.carteRight(event, can, {
|
oncontextmenu: function(event) { var carte = can.user.carteRight(event, can, {
|
||||||
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) },
|
||||||
}) }) },
|
}) }) },
|
||||||
_window: function(can, item, cb) { if (!item.index) { return }
|
_window: function(can, item, cb) { if (!item.index) { return }
|
||||||
item.height = can.base.Max(html.DESKTOP_HEIGHT, can.ConfHeight()-125), item.width = can.base.Max(html.DESKTOP_WIDTH, can.ConfWidth())
|
item.height = can.base.Max(html.DESKTOP_HEIGHT, can.ConfHeight()-125), item.width = can.base.Max(html.DESKTOP_WIDTH, can.ConfWidth())
|
||||||
item.left = (can.ConfWidth()-item.width)/2, item.top = can.base.Min((can.ConfHeight()-item.height-125)/4+25, 25)
|
item.left = (can.ConfWidth()-item.width)/2, item.top = (can.ConfHeight()-item.height-125)/4+25
|
||||||
var style = item.style
|
|
||||||
if (item.index == web.CHAT_IFRAME && (item.style == "portal" || item._style == "portal") || can.base.beginWith(item.index, "web.team.") && can.base.endWith(item.index, ".portal")) {
|
|
||||||
// item.title = "ContextOS",
|
|
||||||
item.width = 390, item.height = can.base.Max(844, can.ConfHeight()-25)
|
|
||||||
item.left = can.ConfWidth()-item.width, item.top = 25
|
|
||||||
}
|
|
||||||
item.type = html.PLUGIN, item.style = {left: item.left, top: item.top, height: item.height, width: item.width}
|
item.type = html.PLUGIN, item.style = {left: item.left, top: item.top, height: item.height, width: item.width}
|
||||||
can.onappend.plugin(can, item, function(sub) {
|
can.onappend.plugin(can, item, function(sub) {
|
||||||
can.page.Select(can, sub._legend, html.SPAN, function(target) {
|
|
||||||
target.innerText = can.user.trans(can, sub.ConfIndex(), sub.ConfHelp())
|
|
||||||
})
|
|
||||||
if (can.page.tagis(sub._target, "fieldset.web.team.portal")) {
|
|
||||||
sub.onimport.size(sub, item.height = can.base.Max(844, can.ConfHeight()-25), item.width = 390, false)
|
|
||||||
}
|
|
||||||
can.onappend.style(sub, style)
|
|
||||||
var index = 0; can.core.Item({
|
var index = 0; can.core.Item({
|
||||||
close: {color: "#f95f57", inner: "x", onclick: function(event) { sub.onaction._close(event, sub) }},
|
close: {color: "#f95f57", inner: "x", onclick: function(event) { sub.onaction._close(event, sub) }},
|
||||||
small: {color: "#fcbc2f", inner: "-", onclick: function(event) { var dock = can.page.Append(can, can.ui.dock._output, [{view: html.ITEM, list: [{view: html.ICON, list: [{img: can.misc.PathJoin(item.icon)}]}], onclick: function() {
|
small: {color: "#fcbc2f", inner: "-", onclick: function(event) { var dock = can.page.Append(can, can.ui.dock._output, [{view: html.ITEM, list: [{view: html.ICON, list: [{img: can.misc.PathJoin(item.icon)}]}], onclick: function() {
|
||||||
@ -102,10 +89,7 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
}, function(name, item) {
|
}, function(name, item) {
|
||||||
can.page.insertBefore(can, [{view: [[html.ITEM, html.BUTTON, "window", name], ""], title: name, list: [{text: item.inner}], style: {"background-color": item.color, right: 10+25*index++}, onclick: item.onclick}], sub._output)
|
can.page.insertBefore(can, [{view: [[html.ITEM, html.BUTTON, "window", name], ""], title: name, list: [{text: item.inner}], style: {"background-color": item.color, right: 10+25*index++}, onclick: item.onclick}], sub._output)
|
||||||
})
|
})
|
||||||
|
sub.onimport._open = function(sub, msg, arg) { can.onimport._window(can, {title: msg.Option(html.TITLE), index: web.CHAT_IFRAME, args: [arg]}) }
|
||||||
sub.onimport._open = function(sub, msg, arg) {
|
|
||||||
can.onimport._window(can, {title: msg.Option(html.TITLE), style: msg.Option("style"), index: web.CHAT_IFRAME, args: [arg]})
|
|
||||||
}
|
|
||||||
sub.onimport._field = function(sub, msg) { msg.Table(function(item) { can.onimport._window(can, item) }) }
|
sub.onimport._field = function(sub, msg) { msg.Table(function(item) { can.onimport._window(can, item) }) }
|
||||||
sub.onaction._close = function() { can.page.Remove(can, sub._target), can.onexport.tabs(can) }
|
sub.onaction._close = function() { can.page.Remove(can, sub._target), can.onexport.tabs(can) }
|
||||||
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() }) }
|
||||||
@ -113,12 +97,7 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
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) }
|
||||||
sub.onexport.marginTop = function() { return 25 }, sub.onexport.marginBottom = function() { return 100 }
|
sub.onexport.marginTop = function() { return 25 }, sub.onexport.marginBottom = function() { return 100 }
|
||||||
sub.onexport.actionHeight = function(sub) { return can.page.ClassList.has(can, sub._target, html.OUTPUT)? 0: html.ACTION_HEIGHT+20 }
|
sub.onexport.actionHeight = function(sub) { return can.page.ClassList.has(can, sub._target, html.OUTPUT)? 0: html.ACTION_HEIGHT+20 }
|
||||||
sub.onexport.output = function(_sub, msg) {
|
sub.onexport.output = function() { sub.onimport.size(sub, item.height, can.base.Min(sub._target.offsetWidth, item.width), false)
|
||||||
if (msg.Option("display.style") == "portal") {
|
|
||||||
sub.onimport.size(sub, item.height, can.base.Max(can.base.Min(sub._target.offsetWidth, item.width), 390), false)
|
|
||||||
} else {
|
|
||||||
sub.onimport.size(sub, item.height, can.base.Min(sub._target.offsetWidth, item.width), false)
|
|
||||||
}
|
|
||||||
sub._target._meta.args = can.base.trim(can.page.SelectArgs(can, sub._option, "", function(target) { return target.value })), can.onexport.tabs(can)
|
sub._target._meta.args = can.base.trim(can.page.SelectArgs(can, sub._option, "", function(target) { return target.value })), can.onexport.tabs(can)
|
||||||
}
|
}
|
||||||
can.onappend.style(can, html.FLOAT, sub._target), can.ondetail.select(can, sub._target, sub)
|
can.onappend.style(can, html.FLOAT, sub._target), can.ondetail.select(can, sub._target, sub)
|
||||||
|
@ -14,6 +14,4 @@ func init() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func DockAppend(m *ice.Message, icon, index string, arg ...string) {
|
func DockAppend(m *ice.Message, icon, index string) { install(m, DOCK, icon, index) }
|
||||||
install(m, DOCK, icon, index, arg...)
|
|
||||||
}
|
|
||||||
|
@ -10,7 +10,7 @@ const FINDER = "finder"
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
Index.MergeCommands(ice.Commands{
|
Index.MergeCommands(ice.Commands{
|
||||||
FINDER: {Name: "finder list", Help: "系统资源", Role: aaa.VOID, Actions: ice.MergeActions(ice.Actions{
|
FINDER: {Name: "finder list", Help: "应用", Role: aaa.VOID, Actions: ice.MergeActions(ice.Actions{
|
||||||
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) { m.Cmdy(APPLICATIONS, mdb.INPUTS, arg) }},
|
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) { m.Cmdy(APPLICATIONS, mdb.INPUTS, arg) }},
|
||||||
mdb.INSERT: {Name: "insert space index* args name* icon*@icon", Hand: func(m *ice.Message, arg ...string) { m.Cmdy(APPLICATIONS, mdb.CREATE, arg) }},
|
mdb.INSERT: {Name: "insert space index* args name* icon*@icon", Hand: func(m *ice.Message, arg ...string) { m.Cmdy(APPLICATIONS, mdb.CREATE, arg) }},
|
||||||
}, CmdHashAction(mdb.NAME))},
|
}, CmdHashAction(mdb.NAME))},
|
||||||
|
@ -1,20 +1,18 @@
|
|||||||
Volcanos(chat.ONIMPORT, {
|
Volcanos(chat.ONIMPORT, {
|
||||||
_init: function(can, msg) {
|
_init: function(can, msg) { can.ui = can.onappend.layout(can), msg.Table(function(value, index) { value._select = index == 0
|
||||||
can.ui = can.onappend.layout(can), msg.Table(function(value, index) { value._select = index == 0
|
can.onimport.item(can, value, function(event, item) { if (can.onmotion.cache(can, function() { return value.name }, can.ui.content)) { return }
|
||||||
can.onimport.item(can, value, function(event, item) { if (can.onmotion.cache(can, function() { return value.name }, can.ui.content)) { return }
|
can.runActionCommand(event, value.index, [], function(msg) {
|
||||||
can.runActionCommand(event, value.index, [], function(msg) {
|
switch (value.name) {
|
||||||
switch (value.name) {
|
case ".":
|
||||||
case ".":
|
case "applications": can.onimport.icons(can, msg, can.ui.content); break
|
||||||
case "applications": can.onimport.icons(can, msg, can.ui.content); break
|
default: can.onappend.table(can, msg, null, can.ui.content)
|
||||||
default: can.onappend.table(can, msg, null, can.ui.content)
|
} can.onimport.layout(can)
|
||||||
} can.onimport.layout(can)
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
}), can.onmotion.hidden(can, can.ui.project)
|
})
|
||||||
},
|
}), can.onmotion.hidden(can, can.ui.project) },
|
||||||
icons: function(can, msg, target) { can.onimport.icon(can, msg = msg||can._msg, target, function(target, item) { can.page.Modify(can, target, {
|
icons: function(can, msg, target) { can.onimport.icon(can, msg = msg||can._msg, target, function(target, item) { can.page.Modify(can, target, {
|
||||||
onclick: function(event) { can.sup.onexport.record(can.sup, item.name, mdb.NAME, item) },
|
onclick: function(event) { can.sup.onexport.record(can.sup, item.name, mdb.NAME, item) },
|
||||||
oncontextmenu: function(event) { can.user.isTechOrRoot(can) && can.user.carteRight(event, can, {
|
oncontextmenu: function(event) { can.user.carteRight(event, can, {
|
||||||
"add to desktop": function() { can.sup.onappend.desktop(item) },
|
"add to desktop": function() { can.sup.onappend.desktop(item) },
|
||||||
"add to dock": function() { can.sup.onappend.dock(item) },
|
"add to dock": function() { can.sup.onappend.dock(item) },
|
||||||
}, []) }, draggable: true, ondragstart: function(event) { window._drag_item = item },
|
}, []) }, draggable: true, ondragstart: function(event) { window._drag_item = item },
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
package macos
|
package macos
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"path"
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
ice "shylinux.com/x/icebergs"
|
ice "shylinux.com/x/icebergs"
|
||||||
"shylinux.com/x/icebergs/base/aaa"
|
"shylinux.com/x/icebergs/base/aaa"
|
||||||
"shylinux.com/x/icebergs/base/cli"
|
"shylinux.com/x/icebergs/base/cli"
|
||||||
@ -53,35 +50,17 @@ func disableApp(m *ice.Message) *ice.Message {
|
|||||||
})
|
})
|
||||||
return m
|
return m
|
||||||
}
|
}
|
||||||
func install(m *ice.Message, cmd, icon, index string, arg ...string) string {
|
|
||||||
if icon == "" {
|
|
||||||
return ""
|
|
||||||
} else if !kit.HasPrefix(icon, nfs.PS, web.HTTP) && !nfs.Exists(m, icon) && !nfs.Exists(m, ice.USR_ICONS+icon, func(p string) { icon = p }) {
|
|
||||||
if strings.Contains(kit.Path(""), nfs.USR_LOCAL_WORK) && nfs.Exists(m, path.Join(strings.Split(kit.Path(""), nfs.USR_LOCAL_WORK)[0], ice.USR_ICONS+icon)) {
|
|
||||||
icon = ice.USR_ICONS + icon
|
|
||||||
} else {
|
|
||||||
icon = path.Join(path.Dir(ctx.GetCmdFile(m, m.PrefixKey())), icon)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
name := kit.TrimExt(path.Base(icon), nfs.PNG, nfs.JPG, nfs.JPEG)
|
|
||||||
if !strings.HasPrefix(icon, nfs.USR_ICONS) {
|
|
||||||
name = kit.Select("", kit.Split(index, "."), -1)
|
|
||||||
}
|
|
||||||
m.Cmd(Prefix(cmd), mdb.CREATE, mdb.NAME, name, mdb.ICON, icon, ctx.INDEX, index, mdb.SCORE, "1000", arg)
|
|
||||||
return icon
|
|
||||||
}
|
|
||||||
func PodCmdAction(arg ...string) ice.Actions {
|
func PodCmdAction(arg ...string) ice.Actions {
|
||||||
file := kit.FileLine(-1, 100)
|
file := kit.FileLine(-1, 100)
|
||||||
return ice.Actions{
|
return ice.Actions{
|
||||||
mdb.SELECT: {Name: "list hash auto create", Hand: func(m *ice.Message, arg ...string) {
|
mdb.SELECT: {Name: "list hash auto create", Hand: func(m *ice.Message, arg ...string) {
|
||||||
defer m.Display(m.FileURI(file))
|
defer m.Display(m.FileURI(file))
|
||||||
msg := disableApp(mdb.HashSelect(m.Spawn(), arg...))
|
msg := disableApp(mdb.HashSelect(m.Spawn(), arg...).Sort(mdb.NAME))
|
||||||
web.PushPodCmd(msg, m.PrefixKey(), arg...)
|
web.PushPodCmd(msg, m.PrefixKey(), arg...)
|
||||||
has := map[string]bool{}
|
has := map[string]bool{}
|
||||||
msg.Table(func(value ice.Maps, index int, head []string) {
|
msg.Table(func(value ice.Maps, index int, head []string) {
|
||||||
kit.If(!has[value[ctx.INDEX]+value[ctx.ARGS]], func() { has[value[ctx.INDEX]+value[ctx.ARGS]] = true; m.Push("", value, head) })
|
kit.If(!has[value[ctx.INDEX]], func() { has[value[ctx.INDEX]] = true; m.Push("", value, head) })
|
||||||
})
|
})
|
||||||
m.Sort("score,space,index,args", ice.INT)
|
|
||||||
}},
|
}},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -98,7 +77,7 @@ func CmdHashAction(arg ...string) ice.Actions {
|
|||||||
}},
|
}},
|
||||||
mdb.SELECT: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.SELECT: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Option(html.FAVICON, m.Cmd(web.SPACE, ice.INFO).Append(mdb.ICONS))
|
m.Option(html.FAVICON, m.Cmd(web.SPACE, ice.INFO).Append(mdb.ICONS))
|
||||||
disableApp(mdb.HashSelect(m, arg...).Sort("score,space,index,args").Display(m.FileURI(file)))
|
disableApp(mdb.HashSelect(m, arg...).Sort(mdb.NAME).Display(m.FileURI(file)))
|
||||||
}},
|
}},
|
||||||
}, mdb.HashAction(mdb.SHORT, kit.Select("", arg, 0), mdb.FIELD, kit.Select("time,hash,icon,name,text,score,space,index,args", arg, 1), kit.Slice(arg, 2)))
|
}, mdb.HashAction(mdb.SHORT, kit.Select("", arg, 0), mdb.FIELD, kit.Select("time,hash,icon,name,text,space,index,args", arg, 1), kit.Slice(arg, 2)))
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,6 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg) { can.page.style(can, can._ou
|
|||||||
{view: [[html.MENU, html.TITLE]], list: [
|
{view: [[html.MENU, html.TITLE]], list: [
|
||||||
{img: can.misc.ResourceFavicon(can, msg.Option(html.FAVICON), can.ConfSpace())},
|
{img: can.misc.ResourceFavicon(can, msg.Option(html.FAVICON), can.ConfSpace())},
|
||||||
{text: decodeURIComponent(
|
{text: decodeURIComponent(
|
||||||
can.Conf("title")||
|
|
||||||
(window == top? can.user.info.titles: "")||can.ConfSpace()||can.misc.Search(can, ice.POD)||location.host
|
(window == top? can.user.info.titles: "")||can.ConfSpace()||can.misc.Search(can, ice.POD)||location.host
|
||||||
)},
|
)},
|
||||||
], onclick: function(event) { can.sup.onexport.record(can, html.DESKTOP) }},
|
], onclick: function(event) { can.sup.onexport.record(can, html.DESKTOP) }},
|
||||||
|
@ -18,7 +18,7 @@ const MESSAGE = "message"
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
Index.MergeCommands(ice.Commands{
|
Index.MergeCommands(ice.Commands{
|
||||||
MESSAGE: {Name: "message refresh", Help: "聊天消息", Icon: "Messages.png", Actions: ice.MergeActions(ice.Actions{
|
MESSAGE: {Name: "message refresh", Help: "聊天", Icon: "Messages.png", 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) {
|
||||||
MessageCreate(m, aaa.APPLY, html.ICONS_MAIL)
|
MessageCreate(m, aaa.APPLY, html.ICONS_MAIL)
|
||||||
MessageCreate(m, web.DREAM, html.ICONS_DREAM)
|
MessageCreate(m, web.DREAM, html.ICONS_DREAM)
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
package oauth
|
|
||||||
|
|
||||||
import "shylinux.com/x/ice"
|
|
||||||
|
|
||||||
type cache struct {
|
|
||||||
ice.Hash
|
|
||||||
short string `data:"uniq"`
|
|
||||||
field string `data:"hash,state,goback"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() { ice.Cmd("web.chat.oauth.cache", cache{}) }
|
|
@ -158,9 +158,6 @@ func (s Client) Login(m *ice.Message, arg ...string) {
|
|||||||
func (s Client) Login2(m *ice.Message, arg ...string) {
|
func (s Client) Login2(m *ice.Message, arg ...string) {
|
||||||
if state, code := m.Option(STATE), m.Option(CODE); !m.WarnNotValid(state == "" || code == "") {
|
if state, code := m.Option(STATE), m.Option(CODE); !m.WarnNotValid(state == "" || code == "") {
|
||||||
msg := m.Spawn()
|
msg := m.Spawn()
|
||||||
_msg := m.Cmd("web.chat.oauth.cache", state)
|
|
||||||
state = kit.Select(state, _msg.Append("state"))
|
|
||||||
m.Option("goback", _msg.Append("goback"))
|
|
||||||
s.Hash.List(msg, m.Option(mdb.HASH, state)).Table(func(value ice.Maps) { msg.Options(value) })
|
s.Hash.List(msg, m.Option(mdb.HASH, state)).Table(func(value ice.Maps) { msg.Options(value) })
|
||||||
msg.Options(GRANT_TYPE, AUTHORIZATION_CODE, REDIRECT_URI, s.RedirectURI(msg)).Option(ACCESS_TOKEN, "")
|
msg.Options(GRANT_TYPE, AUTHORIZATION_CODE, REDIRECT_URI, s.RedirectURI(msg)).Option(ACCESS_TOKEN, "")
|
||||||
if res := s.Get(msg, msg.Option(mdb.HASH), msg.Option(GRANT_URL), kit.Simple(msg.OptionSimple(GRANT_TYPE, CODE), "appid", msg.Option(CLIENT_ID), "secret", msg.Option(CLIENT_SECRET))...); !m.WarnNotValid(res == nil) {
|
if res := s.Get(msg, msg.Option(mdb.HASH), msg.Option(GRANT_URL), kit.Simple(msg.OptionSimple(GRANT_TYPE, CODE), "appid", msg.Option(CLIENT_ID), "secret", msg.Option(CLIENT_SECRET))...); !m.WarnNotValid(res == nil) {
|
||||||
@ -173,8 +170,7 @@ func (s Client) Login2(m *ice.Message, arg ...string) {
|
|||||||
if msg.Option(SESS_CMD) != "" {
|
if msg.Option(SESS_CMD) != "" {
|
||||||
m.Cmdy(kit.Split(msg.Option(SESS_CMD)), kit.Dict("user_uid", msg.Option("user_uid")))
|
m.Cmdy(kit.Split(msg.Option(SESS_CMD)), kit.Dict("user_uid", msg.Option("user_uid")))
|
||||||
} else {
|
} else {
|
||||||
// m.ProcessCookie(ice.MSG_SESSID, aaa.SessCreate(m.Message, msg.Option(aaa.USERNAME)), "-2")
|
m.ProcessCookie(ice.MSG_SESSID, aaa.SessCreate(m.Message, msg.Option(aaa.USERNAME)), "-2")
|
||||||
m.ProcessCookie(ice.MSG_SESSID, aaa.SessCreate(m.Message, msg.Option(aaa.USERNAME)), "-3")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,22 +18,6 @@ const POD = "pod"
|
|||||||
func init() {
|
func init() {
|
||||||
Index.MergeCommands(ice.Commands{
|
Index.MergeCommands(ice.Commands{
|
||||||
POD: {Help: "空间", Actions: web.ApiWhiteAction(), Hand: func(m *ice.Message, arg ...string) {
|
POD: {Help: "空间", Actions: web.ApiWhiteAction(), Hand: func(m *ice.Message, arg ...string) {
|
||||||
if m.IsWeixinUA() && m.Option(ice.MSG_USERNAME) == "" {
|
|
||||||
template := func(script string) string { return kit.Format(`<html><body><script>%s</script></body></html>`, script) }
|
|
||||||
if m.Option("code") == "" && m.Option("state") == "" {
|
|
||||||
if msg := m.Cmd(web.SPACE, "20240724-community", "web.chat.wx.agent"); msg.Option("oauth") != "" {
|
|
||||||
m.RenderResult(kit.Format(template(`document.cookie = "goback="+location.href+";path=/"; location.href = "%s"`),
|
|
||||||
msg.Option("oauth")))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if msg := m.Cmd(web.SPACE, "20240724-community", "web.chat.oauth.client", "action", "login2"); msg.Option("_arg") != "" {
|
|
||||||
m.RenderResult(kit.Format(template(`document.cookie = "sessid=%s;path=/"; location.href = "%s"; document.cookie = "goback=;path=/;expires=Mon, 19 May 2025 00:52:51 GMT"`),
|
|
||||||
kit.Simple(msg.Optionv("_arg"))[1], kit.Select("/s/20240724-enterprise/c/web.team.yingxiaotuiguang.portal", msg.Option("goback"), m.Option("goback"))))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if m.IsCliUA() {
|
if m.IsCliUA() {
|
||||||
if len(arg) == 0 || arg[0] == "" {
|
if len(arg) == 0 || arg[0] == "" {
|
||||||
m.Option(ice.MSG_USERROLE, aaa.TECH)
|
m.Option(ice.MSG_USERROLE, aaa.TECH)
|
||||||
|
@ -111,16 +111,15 @@ func init() {
|
|||||||
kit.If(cli.SystemFindGo(m), func() { m.PushButton(kit.Dict(m.CommandKey(), m.Commands("").Help)) })
|
kit.If(cli.SystemFindGo(m), func() { m.PushButton(kit.Dict(m.CommandKey(), m.Commands("").Help)) })
|
||||||
})
|
})
|
||||||
}},
|
}},
|
||||||
}, web.DreamTablesAction(), ctx.ConfAction(cli.ENV, kit.Dict(GOPRIVATE, "shylinux.com", GOPROXY, "https://goproxy.cn,direct", CGO_ENABLED, "0"))), Hand: func(m *ice.Message, arg ...string) {
|
}, web.DreamTablesAction(), ctx.ConfAction(cli.ENV, kit.Dict(GOPRIVATE, "shylinux.com,github.com", GOPROXY, "https://goproxy.cn,direct", CGO_ENABLED, "0"))), Hand: func(m *ice.Message, arg ...string) {
|
||||||
main, file, goos, arch := _compile_target(m, arg...)
|
main, file, goos, arch := _compile_target(m, arg...)
|
||||||
env := kit.Simple(cli.PATH, cli.BinPath(), cli.HOME, kit.Select(kit.Path(""), kit.Env(cli.HOME)), mdb.Configv(m, cli.ENV), m.Optionv(cli.ENV), cli.GOOS, goos, cli.GOARCH, arch)
|
env := kit.Simple(cli.PATH, cli.BinPath(), cli.HOME, kit.Select(kit.Path(""), kit.Env(cli.HOME)), mdb.Configv(m, cli.ENV), m.Optionv(cli.ENV), cli.GOOS, goos, cli.GOARCH, arch)
|
||||||
kit.If(runtime.GOOS == cli.WINDOWS, func() { env = append(env, GOPATH, kit.HomePath(GO), GOCACHE, kit.HomePath("go/go-build")) })
|
kit.If(runtime.GOOS == cli.WINDOWS, func() { env = append(env, GOPATH, kit.HomePath(GO), GOCACHE, kit.HomePath("go/go-build")) })
|
||||||
m.Options(cli.CMD_ENV, env).Cmd(AUTOGEN, VERSION)
|
m.Options(cli.CMD_ENV, env).Cmd(AUTOGEN, VERSION)
|
||||||
_compile_get(m, main)
|
_compile_get(m, main)
|
||||||
defer m.StatusTime(VERSION, strings.TrimPrefix(GoVersion(m), "go version"))
|
defer m.StatusTime(VERSION, strings.TrimPrefix(GoVersion(m), "go version"))
|
||||||
args := []string{main}
|
args := []string{main, ice.SRC_VERSION_GO}
|
||||||
nfs.Exists(m, ice.SRC_OPTION_GO, func(p string) { args = append(args, p) })
|
nfs.Exists(m, "src/option.go", func(p string) { args = append(args, p) })
|
||||||
nfs.Exists(m, ice.SRC_VERSION_GO, func(p string) { args = append(args, p) })
|
|
||||||
kit.If(file != ice.BIN_ICE_BIN, func() { args = append(args, ice.SRC_BINPACK_GO, ice.SRC_BINPACK_USR_GO) })
|
kit.If(file != ice.BIN_ICE_BIN, func() { args = append(args, ice.SRC_BINPACK_GO, ice.SRC_BINPACK_USR_GO) })
|
||||||
if msg := GoBuild(m.Spawn(), file, args...); !cli.IsSuccess(msg) {
|
if msg := GoBuild(m.Spawn(), file, args...); !cli.IsSuccess(msg) {
|
||||||
m.Copy(msg)
|
m.Copy(msg)
|
||||||
|
@ -18,9 +18,6 @@ func _css_stat(m *ice.Message, zone string, stats map[string]int) {
|
|||||||
m.Copy(msg.SortIntR(mdb.VALUE))
|
m.Copy(msg.SortIntR(mdb.VALUE))
|
||||||
}
|
}
|
||||||
func _css_show(m *ice.Message, arg ...string) {
|
func _css_show(m *ice.Message, arg ...string) {
|
||||||
if _go_portal(m, arg...) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if arg[1] == "main.css" {
|
if arg[1] == "main.css" {
|
||||||
m.EchoIFrame(m.MergePodCmd("", web.ADMIN))
|
m.EchoIFrame(m.MergePodCmd("", web.ADMIN))
|
||||||
return
|
return
|
||||||
@ -65,9 +62,6 @@ func _css_show(m *ice.Message, arg ...string) {
|
|||||||
_css_stat(m, "stats.value", stats_value)
|
_css_stat(m, "stats.value", stats_value)
|
||||||
}
|
}
|
||||||
func _css_exec(m *ice.Message, arg ...string) {
|
func _css_exec(m *ice.Message, arg ...string) {
|
||||||
if _go_portal(m, arg...) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if arg[2] == ice.USR_VOLCANOS {
|
if arg[2] == ice.USR_VOLCANOS {
|
||||||
if strings.HasPrefix(arg[1], ice.PLUGIN_LOCAL) {
|
if strings.HasPrefix(arg[1], ice.PLUGIN_LOCAL) {
|
||||||
ctx.ProcessField(m, kit.Select(ice.CAN_PLUGIN, "web."+strings.Replace(kit.TrimExt(strings.TrimPrefix(arg[1], ice.PLUGIN_LOCAL), JS), nfs.PS, nfs.PT, -1)), kit.Simple())
|
ctx.ProcessField(m, kit.Select(ice.CAN_PLUGIN, "web."+strings.Replace(kit.TrimExt(strings.TrimPrefix(arg[1], ice.PLUGIN_LOCAL), JS), nfs.PS, nfs.PT, -1)), kit.Simple())
|
||||||
|
@ -5,7 +5,6 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
ice "shylinux.com/x/icebergs"
|
ice "shylinux.com/x/icebergs"
|
||||||
"shylinux.com/x/icebergs/base/aaa"
|
|
||||||
"shylinux.com/x/icebergs/base/cli"
|
"shylinux.com/x/icebergs/base/cli"
|
||||||
"shylinux.com/x/icebergs/base/ctx"
|
"shylinux.com/x/icebergs/base/ctx"
|
||||||
"shylinux.com/x/icebergs/base/gdb"
|
"shylinux.com/x/icebergs/base/gdb"
|
||||||
@ -62,33 +61,6 @@ func _go_navigate(m *ice.Message, arg ...string) {
|
|||||||
}
|
}
|
||||||
_c_tags(m, GOTAGS, "-f", nfs.TAGS, "-R", nfs.PWD)
|
_c_tags(m, GOTAGS, "-f", nfs.TAGS, "-R", nfs.PWD)
|
||||||
}
|
}
|
||||||
func _go_portal(m *ice.Message, arg ...string) bool {
|
|
||||||
if p := path.Join(arg[2], strings.Split(arg[1], "/")[0], "portal.go"); nfs.Exists(m, p) {
|
|
||||||
cmd := ctx.GetFileCmd(path.Join(arg[2], kit.ExtChange(arg[1], "go")))
|
|
||||||
if _cmd := ctx.GetFileCmd(p); _cmd != "" {
|
|
||||||
if m.ActionKey() == mdb.RENDER {
|
|
||||||
if path.Base(arg[1]) == "common.go" {
|
|
||||||
ctx.ProcessField(m, strings.ReplaceAll(_cmd, ".portal", ".clean"), kit.Simple())
|
|
||||||
} else if msg := m.Cmd(_cmd, "commandSelect", cmd); msg.Length() > 0 || cmd == "" {
|
|
||||||
ctx.ProcessField(m, _cmd, kit.Simple())
|
|
||||||
} else {
|
|
||||||
ctx.ProcessField(m, cmd, kit.Simple())
|
|
||||||
}
|
|
||||||
} else if aaa.IsTechOrRoot(m) {
|
|
||||||
ls := kit.Split(arg[1], "/")
|
|
||||||
if msg := m.Cmd(_cmd, "commandSelect", cmd); msg.Length() > 0 && !kit.IsIn(path.Base(arg[1]), "model.go", "common.go") {
|
|
||||||
ctx.ProcessField(m, "web.code.mysql.query", kit.Simple("mysql", ls[0], TableName(kit.TrimExt(kit.Select("", ls, -1), arg[0]))))
|
|
||||||
} else {
|
|
||||||
ctx.ProcessField(m, "web.code.mysql.query", kit.Simple("mysql", ls[0]))
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
m.Option(ice.MSG_DISPLAY, "")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
func _go_show(m *ice.Message, arg ...string) {
|
func _go_show(m *ice.Message, arg ...string) {
|
||||||
if arg[1] == MAIN_GO {
|
if arg[1] == MAIN_GO {
|
||||||
ProcessXterm(m, kit.JoinWord("ish", arg[1]), "", "")
|
ProcessXterm(m, kit.JoinWord("ish", arg[1]), "", "")
|
||||||
@ -96,8 +68,31 @@ func _go_show(m *ice.Message, arg ...string) {
|
|||||||
ctx.ProcessField(m, cli.RUNTIME, kit.Simple())
|
ctx.ProcessField(m, cli.RUNTIME, kit.Simple())
|
||||||
} else if arg[1] == "binpack.go" {
|
} else if arg[1] == "binpack.go" {
|
||||||
ctx.ProcessField(m, nfs.PACK, kit.Simple())
|
ctx.ProcessField(m, nfs.PACK, kit.Simple())
|
||||||
} else if _go_portal(m, arg...) {
|
} else if path.Base(arg[1]) == "model.go" {
|
||||||
|
ctx.ProcessField(m, "web.code.mysql.query", kit.Simple("mysql", kit.Split(arg[1], "/", "/")[0]))
|
||||||
|
} else if path.Base(arg[1]) == "common.go" {
|
||||||
|
// ctx.ProcessField(m, "web.code.xterm", kit.Simple())
|
||||||
|
ctx.ProcessField(m, "log.debug", kit.Simple("bench"))
|
||||||
} else if cmd := ctx.GetFileCmd(path.Join(arg[2], arg[1])); cmd != "" {
|
} else if cmd := ctx.GetFileCmd(path.Join(arg[2], arg[1])); cmd != "" {
|
||||||
|
if p := path.Join(arg[2], strings.Split(arg[1], "/")[0], "portal.go"); path.Base(arg[1]) != "portal.go" && nfs.Exists(m, p) &&
|
||||||
|
!kit.IsIn(arg[1],
|
||||||
|
"gonganxitong/user.go",
|
||||||
|
"gonganxitong/sess.go",
|
||||||
|
"gonganxitong/grant.go",
|
||||||
|
"gonganxitong/domain.go",
|
||||||
|
"gonganxitong/command.go",
|
||||||
|
"gonganxitong/quotalist.go",
|
||||||
|
) {
|
||||||
|
if cmd := ctx.GetFileCmd(p); cmd != "" {
|
||||||
|
if m.ActionKey() == mdb.RENDER {
|
||||||
|
ctx.ProcessField(m, cmd, kit.Simple())
|
||||||
|
} else {
|
||||||
|
ls := kit.Split(strings.TrimSuffix(arg[1], ".go"), "/")
|
||||||
|
ctx.ProcessField(m, "web.code.mysql.query", kit.Simple("mysql", ls[0], TableName(kit.Select("", ls, -1))))
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
ctx.ProcessField(m, cmd, kit.Simple())
|
ctx.ProcessField(m, cmd, kit.Simple())
|
||||||
} else if msg := m.Cmd(yac.STACK, path.Join(arg[2], arg[1])); msg.Option("__index") != "" {
|
} else if msg := m.Cmd(yac.STACK, path.Join(arg[2], arg[1])); msg.Option("__index") != "" {
|
||||||
ctx.ProcessField(m, msg.Option("__index"), kit.Simple())
|
ctx.ProcessField(m, msg.Option("__index"), kit.Simple())
|
||||||
@ -231,9 +226,9 @@ func TableName(model string) string {
|
|||||||
if strings.Contains("0123456789", model[len(model)-1:]) {
|
if strings.Contains("0123456789", model[len(model)-1:]) {
|
||||||
return model
|
return model
|
||||||
}
|
}
|
||||||
if kit.IsIn(model, "sms", "equipment", "bonus") {
|
if kit.IsIn(model, "sms", "equipment") {
|
||||||
|
|
||||||
} else if kit.HasSuffix(model, "y") && !kit.HasSuffix(model, "way") {
|
} else if kit.HasSuffix(model, "y") {
|
||||||
model = model[:len(model)-1] + "ies"
|
model = model[:len(model)-1] + "ies"
|
||||||
} else if kit.HasSuffix(model, "s") {
|
} else if kit.HasSuffix(model, "s") {
|
||||||
if !kit.HasSuffix(model, "os") {
|
if !kit.HasSuffix(model, "os") {
|
||||||
|
@ -86,7 +86,7 @@ func init() {
|
|||||||
m.Cmdy(mdb.PLUGIN, m.Option(lex.PARSE, strings.ToLower(kit.Split(path.Base(arg[1]), nfs.PT)[0])), arg[1:])
|
m.Cmdy(mdb.PLUGIN, m.Option(lex.PARSE, strings.ToLower(kit.Split(path.Base(arg[1]), nfs.PT)[0])), arg[1:])
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
mdb.RENDER: {Role: aaa.VOID, Hand: func(m *ice.Message, arg ...string) { _inner_show(m, arg[0], arg[1], arg[2]) }},
|
mdb.RENDER: {Hand: func(m *ice.Message, arg ...string) { _inner_show(m, arg[0], arg[1], arg[2]) }},
|
||||||
mdb.ENGINE: {Hand: func(m *ice.Message, arg ...string) { _inner_exec(m, arg[0], arg[1], arg[2]) }},
|
mdb.ENGINE: {Hand: func(m *ice.Message, arg ...string) { _inner_exec(m, arg[0], arg[1], arg[2]) }},
|
||||||
nfs.TAGS: {Hand: func(m *ice.Message, arg ...string) { _inner_tags(m, m.Option(nfs.PATH), arg[0]) }},
|
nfs.TAGS: {Hand: func(m *ice.Message, arg ...string) { _inner_tags(m, m.Option(nfs.PATH), arg[0]) }},
|
||||||
nfs.GREP: {Hand: func(m *ice.Message, arg ...string) { m.Cmdy(nfs.GREP, arg) }},
|
nfs.GREP: {Hand: func(m *ice.Message, arg ...string) { m.Cmdy(nfs.GREP, arg) }},
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package code
|
package code
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"path"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
ice "shylinux.com/x/icebergs"
|
ice "shylinux.com/x/icebergs"
|
||||||
@ -20,7 +21,15 @@ func _js_show(m *ice.Message, arg ...string) {
|
|||||||
} else if strings.HasPrefix(arg[1], "plugin/local/") {
|
} else if strings.HasPrefix(arg[1], "plugin/local/") {
|
||||||
ctx.ProcessField(m, kit.Select(ice.CAN_PLUGIN, "web."+strings.Replace(strings.TrimSuffix(strings.TrimPrefix(arg[1], "plugin/local/"), nfs.PT+JS), nfs.PS, nfs.PT, -1)), nil)
|
ctx.ProcessField(m, kit.Select(ice.CAN_PLUGIN, "web."+strings.Replace(strings.TrimSuffix(strings.TrimPrefix(arg[1], "plugin/local/"), nfs.PT+JS), nfs.PS, nfs.PT, -1)), nil)
|
||||||
}
|
}
|
||||||
} else if _go_portal(m, arg...) {
|
} else {
|
||||||
|
if p := path.Join(arg[2], strings.Split(arg[1], "/")[0], "portal.go"); nfs.Exists(m, p) {
|
||||||
|
if cmd := ctx.GetFileCmd(p); cmd != "" {
|
||||||
|
ctx.ProcessField(m, cmd, kit.Simple())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ctx.DisplayBase(m, require(arg[2], arg[1]))
|
||||||
|
ctx.ProcessField(m, kit.Select(ice.CAN_PLUGIN, ctx.GetFileCmd(kit.ExtChange(path.Join(arg[2], arg[1]), GO))), kit.Simple())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,12 +32,6 @@ func init() {
|
|||||||
})
|
})
|
||||||
}},
|
}},
|
||||||
mdb.ENGINE: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.ENGINE: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
if path.Base(arg[1]) == "portal.json" {
|
|
||||||
if cmd := ctx.GetFileCmd(path.Join(arg[2], arg[1])); cmd != "" {
|
|
||||||
ctx.ProcessField(m, cmd, kit.Simple("table"))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
m.Cmdy(nfs.CAT, path.Join(arg[2], arg[1]))
|
m.Cmdy(nfs.CAT, path.Join(arg[2], arg[1]))
|
||||||
ctx.DisplayStoryJSON(m)
|
ctx.DisplayStoryJSON(m)
|
||||||
}},
|
}},
|
||||||
|
@ -136,16 +136,11 @@ func init() {
|
|||||||
nfs.TRASH: {Hand: func(m *ice.Message, arg ...string) {
|
nfs.TRASH: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
nfs.Trash(m, arg[0])
|
nfs.Trash(m, arg[0])
|
||||||
}},
|
}},
|
||||||
web.UPLOAD: {Hand: func(m *ice.Message, arg ...string) {
|
|
||||||
web.UploadSave(m, path.Dir(path.Join(m.Option(nfs.PATH), m.Option(nfs.FILE)))+nfs.PS)
|
|
||||||
}},
|
|
||||||
nfs.SAVE: {Hand: func(m *ice.Message, arg ...string) {
|
nfs.SAVE: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
kit.If(m.Option(nfs.CONTENT) == "", func() { m.Option(nfs.CONTENT, m.Cmdx("", TEMPLATE)) })
|
kit.If(m.Option(nfs.CONTENT) == "", func() { m.Option(nfs.CONTENT, m.Cmdx("", TEMPLATE)) })
|
||||||
m.Cmd(nfs.SAVE, path.Join(m.Option(nfs.PATH), m.Option(nfs.FILE)))
|
m.Cmd(nfs.SAVE, path.Join(m.Option(nfs.PATH), m.Option(nfs.FILE)))
|
||||||
gdb.Event(m, VIMER_SAVE)
|
gdb.Event(m, VIMER_SAVE)
|
||||||
}},
|
}},
|
||||||
mdb.RENDER: {Role: aaa.VOID, Hand: func(m *ice.Message, arg ...string) { _inner_show(m, arg[0], arg[1], arg[2]) }},
|
|
||||||
mdb.ENGINE: {Role: aaa.VOID, Hand: func(m *ice.Message, arg ...string) { _inner_exec(m, arg[0], arg[1], arg[2]) }},
|
|
||||||
TEMPLATE: {Hand: func(m *ice.Message, arg ...string) {
|
TEMPLATE: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Cmdy(TEMPLATE, kit.Ext(m.Option(mdb.FILE)), m.Option(nfs.FILE), m.Option(nfs.PATH))
|
m.Cmdy(TEMPLATE, kit.Ext(m.Option(mdb.FILE)), m.Option(nfs.FILE), m.Option(nfs.PATH))
|
||||||
}},
|
}},
|
||||||
|
@ -37,7 +37,6 @@ func (s *Label) Draw(m *ice.Message, x, y int) wiki.Chart {
|
|||||||
wiki.AddGroupOption(m, TEXT, wiki.STROKE, m.Option(wiki.STROKE), wiki.FILL, m.Option(wiki.STROKE))
|
wiki.AddGroupOption(m, TEXT, wiki.STROKE, m.Option(wiki.STROKE), wiki.FILL, m.Option(wiki.STROKE))
|
||||||
defer gs.DumpAll(m, RECT, TEXT)
|
defer gs.DumpAll(m, RECT, TEXT)
|
||||||
top := y
|
top := y
|
||||||
mod := kit.Int(m.Option("order.mod"))
|
|
||||||
for _, line := range s.data {
|
for _, line := range s.data {
|
||||||
left, height := x, 0
|
left, height := x, 0
|
||||||
for i, text := range line {
|
for i, text := range line {
|
||||||
@ -58,17 +57,9 @@ func (s *Label) Draw(m *ice.Message, x, y int) wiki.Chart {
|
|||||||
item.Width = s.max[i]
|
item.Width = s.max[i]
|
||||||
}
|
}
|
||||||
if m.Option(HIDE_BLOCK) != ice.TRUE {
|
if m.Option(HIDE_BLOCK) != ice.TRUE {
|
||||||
args := []string{}
|
gs.EchoRect(RECT, item.GetHeight(), item.GetWidth(), left+item.MarginX/2, top+item.MarginY/2)
|
||||||
if mod > 0 && i%mod == 0 {
|
|
||||||
args = append(args, "", "", "style", `"`+kit.JoinCSS("stroke", m.Option("order.bg"), "fill", m.Option("order.bg"))+`"`)
|
|
||||||
}
|
|
||||||
gs.EchoRect(RECT, item.GetHeight(), item.GetWidth(), left+item.MarginX/2, top+item.MarginY/2, args...)
|
|
||||||
}
|
}
|
||||||
args := []string{}
|
gs.EchoText(TEXT, left+item.GetWidths()/2, top+item.GetHeights()/2, item.Text)
|
||||||
if mod > 0 && i%mod == 0 {
|
|
||||||
args = append(args, "style", kit.JoinCSS("stroke", m.Option("order.fg"), "fill", m.Option("order.fg")))
|
|
||||||
}
|
|
||||||
gs.EchoText(TEXT, left+item.GetWidths()/2, top+item.GetHeights()/2, item.Text, args...)
|
|
||||||
if left += item.GetWidths(); item.GetHeights() > height {
|
if left += item.GetWidths(); item.GetHeights() > height {
|
||||||
height = item.GetHeights()
|
height = item.GetHeights()
|
||||||
}
|
}
|
||||||
|
@ -1,81 +1,74 @@
|
|||||||
$fieldset { --portal-max-width:1200px; --portal-header-height:64px; --portal-main-padding:40px; --plugin-radius:10px; }
|
fieldset.web.wiki.portal { --portal-max-width:1200px; --portal-header-height:64px; --portal-main-padding:40px; --plugin-radius:10px; }
|
||||||
$fieldset.home { --portal-max-width:1500px; }
|
fieldset.web.wiki.portal.home { --portal-max-width:1500px; }
|
||||||
$fieldset>div.header { display:none; }
|
fieldset.web.wiki.portal>div.header { display:none; }
|
||||||
$output { padding:0; }
|
fieldset.web.wiki.portal>div.output { padding:0; }
|
||||||
$output>div.header { box-shadow:var(--box-shadow); background-color:var(--panel-bg-color); height:var(--portal-header-height); --hover-bg-color:var(--plugin-bg-color); }
|
fieldset.web.wiki.portal>div.output>div.header { background-color:var(--panel-bg-color); height:var(--portal-header-height); --hover-bg-color:var(--plugin-bg-color); }
|
||||||
$output>div.header div.list { display:flex; }
|
fieldset.web.wiki.portal>div.output>div.header div.list { display:flex; }
|
||||||
$output>div.header div.story div.item span { white-space:pre; overflow:hidden; }
|
fieldset.web.wiki.portal>div.output>div.header div.story[data-name=navmenu] { --hover-fg-color:white; }
|
||||||
$output>div.header div.story[data-name=navmenu] { --hover-fg-color:white; }
|
fieldset.web.wiki.portal>div.output>div.header div.story div.item span { white-space:pre; overflow:hidden; }
|
||||||
$output>div.header div.story[data-name=navmenu] { display:flex; justify-content:center; }
|
fieldset.web.wiki.portal>div.output>div.header div.story[data-name=navmenu] { display:flex; justify-content:center; }
|
||||||
$output>div.header div.story[data-name=navmenu] div.item { text-align:center; padding:var(--legend-padding); height:var(--portal-header-height); }
|
fieldset.web.wiki.portal>div.output>div.header div.story[data-name=navmenu] div.item { text-align:center; padding:var(--legend-padding); height:var(--portal-header-height); }
|
||||||
$output>div.header div.story[data-name=navmenu] div.item { display:flex; align-items:center; }
|
fieldset.web.wiki.portal>div.output>div.header div.story[data-name=navmenu] div.item { display:flex; align-items:center; }
|
||||||
$output>div.header div.story[data-name=navmenu] div.item:first-child { padding:var(--input-padding); }
|
fieldset.web.wiki.portal>div.output>div.header div.story[data-name=navmenu] div.item:first-child { padding:var(--input-padding); }
|
||||||
$output>div.header div.story[data-name=navmenu] div.item:first-child { line-height:calc(var(--portal-header-height) - 2 * var(--legend-padding)); font-size:24px; font-weight:bold; }
|
body.mobile fieldset.web.wiki.portal>div.output>div.header div.story[data-name=navmenu] div.item:first-child span { display:none; font-size:18px; max-width:160px; }
|
||||||
$output>div.header div.story[data-name=navmenu] div.item:first-child img { margin-right:var(--button-margin); }
|
fieldset.web.wiki.portal>div.output>div.header div.story[data-name=navmenu] div.item:first-child { line-height:calc(var(--portal-header-height) - 2 * var(--legend-padding)); font-size:24px; font-weight:bold; }
|
||||||
$output>div.header div.story[data-name=navmenu] div.item.select { background-color:var(--output-bg-color); }
|
fieldset.web.wiki.portal>div.output>div.header div.story[data-name=navmenu] div.item:first-child img { margin-right:var(--button-margin); }
|
||||||
$output>div.header div.story[data-name=navmenu] div.item:not(.space):hover { background-color:var(--output-bg-color); }
|
fieldset.web.wiki.portal>div.output>div.header div.story[data-name=navmenu] div.item.select { background-color:var(--output-bg-color); }
|
||||||
// $output>div.header div.story[data-name=navmenu] div.item.space { padding:0px; margin:0 var(--portal-main-padding); }
|
fieldset.web.wiki.portal>div.output>div.header div.story[data-name=navmenu] div.item:hover { background-color:var(--output-bg-color); }
|
||||||
$output>div.header div.story[data-name=navmenu] div.item.space { padding:0px; width:20px; }
|
fieldset.web.wiki.portal>div.output>div.header div.story[data-name=navmenu] div.item.space { padding:0px; margin:0 var(--portal-main-padding); }
|
||||||
$output>div.layout { display:flex; justify-content:center; }
|
fieldset.web.wiki.portal>div.output>div.layout { display:flex; justify-content:center; }
|
||||||
$output>div.layout table.story.content { background-color:var(--output-bg-color); }
|
fieldset.web.wiki.portal>div.output>div.layout table.story.content { background-color:var(--output-bg-color); }
|
||||||
$output>div.layout table.story.content th { text-align:left; padding:var(--table-padding); }
|
fieldset.web.wiki.portal>div.output>div.layout table.story.content th { text-align:left; padding:var(--table-padding); }
|
||||||
$output>div.layout>div.nav { border-right:var(--box-border); padding:var(--portal-main-padding); padding-right:var(--button-padding); min-width:var(--project-width); overflow:auto; }
|
fieldset.web.wiki.portal>div.output>div.layout>div.nav { border-right:var(--box-border); padding:var(--portal-main-padding); padding-right:var(--button-padding); min-width:var(--project-width); overflow:auto; }
|
||||||
$output>div.layout>div.nav div.story[data-name=navmenu] div.item { padding:var(--input-padding); }
|
fieldset.web.wiki.portal>div.output>div.layout>div.nav div.story[data-name=navmenu] div.item { padding:var(--input-padding); }
|
||||||
$output>div.layout>div.nav div.story[data-name=navmenu] div.item.select { border-right:var(--box-notice); }
|
fieldset.web.wiki.portal>div.output>div.layout>div.nav div.story[data-name=navmenu] div.item.select { border-right:var(--box-notice); }
|
||||||
$output>div.layout>div.nav div.story[data-name=navmenu]>div.item { border-bottom:var(--box-border); margin-top:var(--button-margin); }
|
fieldset.web.wiki.portal>div.output>div.layout>div.nav div.story[data-name=navmenu]>div.item { border-bottom:var(--box-border); margin-top:var(--button-margin); }
|
||||||
$output>div.layout>div.nav div.story[data-name=navmenu] div.list { padding-left:var(--legend-padding); }
|
fieldset.web.wiki.portal>div.output>div.layout>div.nav div.story[data-name=navmenu] div.list { padding-left:var(--legend-padding); }
|
||||||
$output>div.layout>div.aside { padding:var(--portal-main-padding); padding-left:var(--button-padding); min-width:var(--project-width); overflow:auto; }
|
fieldset.web.wiki.portal>div.output>div.layout>div.aside { padding:var(--portal-main-padding); padding-left:var(--button-padding); min-width:var(--project-width); overflow:auto; }
|
||||||
$output>div.layout>div.aside div.item { padding:var(--input-padding); }
|
fieldset.web.wiki.portal>div.output>div.layout>div.aside div.item { padding:var(--input-padding); }
|
||||||
$output>div.layout>div.aside div.item.select { border-left:var(--box-notice); }
|
fieldset.web.wiki.portal>div.output>div.layout>div.aside div.item.select { border-left:var(--box-notice); }
|
||||||
$output>div.layout>div.aside div.item.section { padding-left:var(--legend-padding); }
|
fieldset.web.wiki.portal>div.output>div.layout>div.aside div.item.section { padding-left:var(--legend-padding); }
|
||||||
$output>div.layout>div.main { padding:var(--portal-main-padding); height:600px; min-width:390px; max-width:var(--portal-max-width); overflow:auto; overflow-x:hidden; }
|
fieldset.web.wiki.portal>div.output>div.layout>div.main { padding:var(--portal-main-padding); height:600px; min-width:390px; max-width:var(--portal-max-width); overflow:auto; overflow-x:hidden; }
|
||||||
$output>div.layout>div.main img[data-name="qrcode"] { margin-top:20px; width:240px !important; }
|
fieldset.web.wiki.portal>div.output>div.layout>div.main div.story.column { display:flex; flex-direction:column; justify-content:center; }
|
||||||
body.width1 $output>div.layout>div.main>div.story.flex { flex-direction:column; }
|
fieldset.web.wiki.portal>div.output>div.layout>div.main div.story.column fieldset.inner>div.output>div.layout>div.layout div.content div.tips { top:5px; right:10px; }
|
||||||
// body.width1 $output>div.layout>div.main div.story.column fieldset.inner { width:100%; }
|
fieldset.web.wiki.portal>div.output>div.layout>div.main div.story.column h1 { font-size:24px; font-style:italic; margin-top:0; }
|
||||||
body.width1 $output>div.layout>div.main div.story.column { flex:unset !important; }
|
body.mobile fieldset.web.wiki.portal>div.output>div.layout>div.main div.story.column h2 { font-size:18px; }
|
||||||
$output>div.layout>div.main div.story.column { display:flex; flex-direction:column; justify-content:center; }
|
body:not(.mobile) fieldset.web.wiki.portal>div.output>div.layout>div.main div.story.column h1 { font-size:32px; }
|
||||||
$output>div.layout>div.main div.story.column fieldset.inner>div.output>div.layout>div.layout div.content div.tips { top:5px; right:10px; }
|
fieldset.web.wiki.portal>div.output>div.layout>div.main div.story.column h2 { margin:0 !important; }
|
||||||
$output>div.layout>div.main div.story.column fieldset.inner { box-shadow:none; border:var(--box-border); border-radius:0; }
|
fieldset.web.wiki.portal>div.output>div.layout>div.main img[data-name="qrcode"] { margin-top:20px; width:240px !important; }
|
||||||
$output>div.layout>div.main div.story.column fieldset.inner>div.output { width:100%; }
|
fieldset.web.wiki.portal>div.output>div.layout>div.main div.story.column li { margin:10px 0; }
|
||||||
$output>div.layout>div.main div.story.column h1 { font-size:24px; font-style:italic; margin-top:0; }
|
fieldset.web.wiki.portal>div.output>div.layout>div.main div.story.column ul { margin:10px; }
|
||||||
$output>div.layout>div.main div.story.column h2 { margin:0 !important; }
|
fieldset.web.wiki.portal>div.output>div.layout>div.main div.story.column b { font-size:22px; }
|
||||||
$output>div.layout>div.main div.story.column p[data-type=brief] { font-size:1.5em; font-weight:bold; text-align:center; }
|
fieldset.web.wiki.portal>div.output>div.layout>div.main div.story.column input[type=button] { box-shadow:var(--th-box-shadow); border:0; background-color:var(--notice-bg-color); color:var(--notice-fg-color); }
|
||||||
$output>div.layout>div.main div.story.column li { margin:10px 0; }
|
fieldset.web.wiki.portal>div.output>div.layout>div.main div.story.column input[type=button]:hover { box-shadow:var(--notice-box-shadow); }
|
||||||
$output>div.layout>div.main div.story.column ul { margin:10px; }
|
fieldset.web.wiki.portal>div.output>div.layout>div.main fieldset.desktop>legend { display:none; }
|
||||||
$output>div.layout>div.main div.story.column b { font-size:22px; }
|
fieldset.web.wiki.portal>div.output>div.layout>div.main fieldset.inner.output div.content { padding:var(--input-padding) 0; }
|
||||||
$output>div.layout>div.main div.story.column input[type=button] { box-shadow:var(--th-box-shadow); border:0; background-color:var(--notice-bg-color); color:var(--notice-fg-color); }
|
fieldset.web.wiki.portal>div.output>div.layout>div.main div.story[data-type=spark][data-name=shell] { border:var(--box-border); border-left:var(--box-notice3); }
|
||||||
$output>div.layout>div.main div.story.column input[type=button]:hover { box-shadow:var(--notice-box-shadow); }
|
fieldset.web.wiki.portal>div.output>div.layout>div.main div.story[data-type=spark][data-name=shell]:hover { box-shadow:var(--notice-box-shadow); }
|
||||||
$output>div.layout>div.main div.story[data-type=spark][data-name=shell] { border:var(--box-border); border-left:var(--box-notice3); }
|
fieldset.web.wiki.portal>div.output>div.layout>div.main div.story[data-type=spark][data-name=shell] { padding:var(--button-padding); margin-top:var(--button-margin); }
|
||||||
$output>div.layout>div.main div.story[data-type=spark][data-name=shell]:hover { box-shadow:var(--notice-box-shadow); }
|
fieldset.web.wiki.portal>div.output>div.layout>div.main table.content div.story[data-type=spark][data-name=shell] { margin-top:unset; }
|
||||||
$output>div.layout>div.main div.story[data-type=spark][data-name=shell] { padding:var(--button-padding); margin-top:var(--button-margin); }
|
fieldset.web.wiki.portal.home>div.output>div.layout>div.main p { white-space:pre-wrap; }
|
||||||
$output>div.layout>div.main table.content div.story[data-type=spark][data-name=shell] { margin-top:unset; }
|
|
||||||
$output>div.layout>div.main fieldset.inner.output div.content { padding:var(--input-padding) 0; }
|
|
||||||
$output>div.layout>div.main fieldset.desktop>legend { display:none; }
|
|
||||||
$fieldset.home>div.output>div.layout>div.main p { white-space:pre-wrap; }
|
|
||||||
$fieldset.home>div.output>div.layout>div.main p:hover { background-color:var(--hover-bg-color); color:var(--hover-fg-color); }
|
|
||||||
div.story[data-type=qrcode] { text-align:center; }
|
div.story[data-type=qrcode] { text-align:center; }
|
||||||
body:not(.mobile) $output>div.layout>div.main div.story.column h1 { font-size:32px; }
|
fieldset.web.wiki.portal.home>div.output>div.layout>div.main p:hover { background-color:var(--hover-bg-color); color:var(--hover-fg-color); }
|
||||||
body.dark $output>div.header div.story[data-name=navmenu] div.item:hover { background-color:var(--output-bg-color); }
|
body.dark fieldset.web.wiki.portal>div.output>div.header div.story[data-name=navmenu] div.item:hover { background-color:var(--output-bg-color); }
|
||||||
body.dark $output>div.header div.story[data-name=navmenu] div.item.select { background-color:var(--output-bg-color); }
|
body.dark fieldset.web.wiki.portal>div.output>div.header div.story[data-name=navmenu] div.item.select { background-color:var(--output-bg-color); }
|
||||||
body.dark $output>div.layout { background-color:var(--plugin-bg-color); --code-bg-color:var(--output-bg-color); }
|
body.dark fieldset.web.wiki.portal>div.output>div.layout { background-color:var(--plugin-bg-color); --code-bg-color:var(--output-bg-color); }
|
||||||
body.dark $output>div.layout>div.main fieldset:not(.macos) { border:var(--plugin-border); }
|
body.dark fieldset.web.wiki.portal>div.output>div.layout>div.main fieldset:not(.macos) { border:var(--plugin-border); }
|
||||||
body.dark $output>div.layout>div.main fieldset { border-radius:0; }
|
body.dark fieldset.web.wiki.portal>div.output>div.layout>div.main fieldset { border-radius:0; }
|
||||||
body.dark $output>div.layout>div.main div.story[data-type=spark][data-name=shell] { border-left:var(--box-notice3); }
|
body.dark fieldset.web.wiki.portal>div.output>div.layout>div.main div.story[data-type=spark][data-name=shell] { border-left:var(--box-notice3); }
|
||||||
body.white $output>div.header { color:silver; }
|
body.white fieldset.web.wiki.portal>div.output>div.header { color:silver; }
|
||||||
body.light $output>div.header { color:white; }
|
body.light fieldset.web.wiki.portal>div.output>div.header { color:white; }
|
||||||
body.light $output>div.header div.story[data-name=navmenu] { --hover-fg-color:black; }
|
body.light fieldset.web.wiki.portal>div.output>div.header div.story[data-name=navmenu] { --hover-fg-color:black; }
|
||||||
body.width1 $output>div.header div.story[data-name=navmenu] div.item:first-child span { display:none; font-size:18px; max-width:160px; }
|
body.mobile fieldset.web.wiki.portal { --portal-main-padding:5px; --legend-padding:10px; }
|
||||||
body.width1 $output>div.layout { display:block; }
|
body.mobile fieldset.web.wiki.portal>div.output>div.layout { display:block; }
|
||||||
body.width1 $output>div.layout>div.nav { height:400px; }
|
body.mobile fieldset.web.wiki.portal>div.output>div.layout>div.nav { height:400px; }
|
||||||
body.width1 $output>div.layout>div.main { height:unset; }
|
body.mobile fieldset.web.wiki.portal>div.output>div.layout>div.main { height:unset; }
|
||||||
body.width1 $output>div.layout>div.main div.story.column { padding:10px 0 !important; }
|
body.mobile fieldset.web.wiki.portal>div.output>div.layout>div.main div.story.column { padding:10px 0 !important; }
|
||||||
body.width1 $output>div.layout>div.main fieldset { width:fit-content; }
|
body.mobile fieldset.web.wiki.portal>div.output>div.layout>div.main fieldset { width:fit-content; }
|
||||||
body.width1 $output>div.layout>div.main fieldset>div.action { display:none; }
|
body.mobile fieldset.web.wiki.portal>div.output>div.layout>div.main fieldset>div.action { display:none; }
|
||||||
body.width1 $output>div.layout>div.main div.story.column h2 { font-size:18px; }
|
body.mobile fieldset.web.wiki.portal.cmd>div.output>div.header div.story[data-name=navmenu] div.item { line-height:calc(var(--portal-header-height) - 2 * var(--legend-padding)); }
|
||||||
body.width1 $fieldset { --portal-main-padding:5px; --legend-padding:10px; }
|
body.mobile fieldset.web.wiki.portal.home>div.output>div.layout>div.main p { white-space:normal; text-align:center; padding:var(--button-padding); }
|
||||||
body.width1 $fieldset.cmd>div.output>div.header div.story[data-name=navmenu] div.item { line-height:calc(var(--portal-header-height) - 2 * var(--legend-padding)); }
|
body.mobile fieldset.web.wiki.portal.home>div.output>div.layout>div.main h2 { margin-top:40px; margin-bottom:0; }
|
||||||
body.width1 $fieldset.home>div.output>div.layout>div.main p { white-space:normal; text-align:center; padding:var(--button-padding); }
|
body.mobile fieldset.web.wiki.portal>div.output>div.layout>div.main p { padding:var(--input-padding); margin:0; }
|
||||||
body.width1 $fieldset.home>div.output>div.layout>div.main h2 { margin-top:40px; margin-bottom:0; }
|
body.width2 fieldset.web.wiki.portal>div.output>div.layout>div.main>div.flex { flex-direction:column; }
|
||||||
body.width1 $fieldset>div.output>div.layout>div.main p { padding:var(--input-padding); margin:0; }
|
body.web.wiki.portal fieldset.Action.home>div.toast { display:none; }
|
||||||
body.width2 $fieldset>div.output>div.layout>div.main>div.flex { flex-direction:column; }
|
|
||||||
$body fieldset.Action.home>div.toast { display:none; }
|
|
||||||
|
@ -38,7 +38,7 @@ func init() {
|
|||||||
if m.Push(HEADER, m.Cmdx(WORD, _portal_path(m, INDEX_SHY))); len(arg) > 0 {
|
if m.Push(HEADER, m.Cmdx(WORD, _portal_path(m, INDEX_SHY))); len(arg) > 0 {
|
||||||
m.Push(NAV, m.Cmdx(WORD, _portal_path(m, path.Join(arg...), INDEX_SHY)))
|
m.Push(NAV, m.Cmdx(WORD, _portal_path(m, path.Join(arg...), INDEX_SHY)))
|
||||||
}
|
}
|
||||||
m.Display("").DisplayCSS("")
|
m.Display("")
|
||||||
}},
|
}},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,6 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
title: function(can, meta, target) { can.isCmdMode() && can.page.tagis(target, html.H1) && can.onexport && can.onexport.title(can, meta.text) },
|
title: function(can, meta, target) { can.isCmdMode() && can.page.tagis(target, html.H1) && can.onexport && can.onexport.title(can, meta.text) },
|
||||||
brief: function(can, meta, target) { can.isCmdMode() && can.user.agent.init(can, meta.text) },
|
|
||||||
button: function(can, meta, target) { var item = can.base.Obj(meta.meta); target.onclick = function(event) { can.onaction.route(event, can, item.route) } },
|
button: function(can, meta, target) { var item = can.base.Obj(meta.meta); target.onclick = function(event) { can.onaction.route(event, can, item.route) } },
|
||||||
layout: function(can, height, width) { if (!can.ui.layout || !can.ui.main) { return }
|
layout: function(can, height, width) { if (!can.ui.layout || !can.ui.main) { return }
|
||||||
can.ui.layout(height, width), can.ConfWidth(can.ui.main.offsetWidth), padding = can.Conf(html.PADDING)
|
can.ui.layout(height, width), can.ConfWidth(can.ui.main.offsetWidth), padding = can.Conf(html.PADDING)
|
||||||
@ -70,7 +69,7 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
sub.onimport.size(sub, can.base.Min(html.FLOAT_HEIGHT, can.ConfHeight()/2, can.ConfHeight()), (can.ConfWidth()-2*padding), true)
|
sub.onimport.size(sub, can.base.Min(html.FLOAT_HEIGHT, can.ConfHeight()/2, can.ConfHeight()), (can.ConfWidth()-2*padding), true)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
})
|
}, [""])
|
||||||
Volcanos(chat.ONACTION, {
|
Volcanos(chat.ONACTION, {
|
||||||
route: function(event, can, route, internal) {
|
route: function(event, can, route, internal) {
|
||||||
var link = can.base.trimPrefix(route||"", nfs.USR_LEARNING_PORTAL, nfs.SRC_DOCUMENT); if (!link || link == can.db.current) { return }
|
var link = can.base.trimPrefix(route||"", nfs.USR_LEARNING_PORTAL, nfs.SRC_DOCUMENT); if (!link || link == can.db.current) { return }
|
||||||
|
@ -99,7 +99,6 @@ func init() {
|
|||||||
}},
|
}},
|
||||||
PROJECT: {Hand: func(m *ice.Message, arg ...string) { _spark_project(m, arg...) }},
|
PROJECT: {Hand: func(m *ice.Message, arg ...string) { _spark_project(m, arg...) }},
|
||||||
PRODUCT: {Hand: func(m *ice.Message, arg ...string) { _spark_product(m, arg...) }},
|
PRODUCT: {Hand: func(m *ice.Message, arg ...string) { _spark_product(m, arg...) }},
|
||||||
"html": {Hand: func(m *ice.Message, arg ...string) { m.Echo(arg[0], kit.TransArgs(arg[1:])...) }},
|
|
||||||
}), Hand: func(m *ice.Message, arg ...string) {
|
}), Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Option(mdb.META, "")
|
m.Option(mdb.META, "")
|
||||||
if kit.Ext(arg[0]) == "md" {
|
if kit.Ext(arg[0]) == "md" {
|
||||||
@ -121,7 +120,7 @@ func _spark_project(m *ice.Message, arg ...string) {
|
|||||||
func() {
|
func() {
|
||||||
defer m.Cmdy(STYLE, COLUMN).Cmdy(STYLE, END)
|
defer m.Cmdy(STYLE, COLUMN).Cmdy(STYLE, END)
|
||||||
m.Cmdy(TITLE, ice.Info.Title())
|
m.Cmdy(TITLE, ice.Info.Title())
|
||||||
m.Cmdy(BRIEF, arg[0]).Cmdy(ORDER, arg[1])
|
m.Cmdy(SPARK, TITLE, arg[0]).Cmdy(ORDER, arg[1])
|
||||||
func() {
|
func() {
|
||||||
defer m.Cmdy(STYLE, FLEX).Cmdy(STYLE, END)
|
defer m.Cmdy(STYLE, FLEX).Cmdy(STYLE, END)
|
||||||
m.Cmdy(SPARK, html.BUTTON, "体 验", ROUTE, web.SpideOrigin(m, ice.DEMO))
|
m.Cmdy(SPARK, html.BUTTON, "体 验", ROUTE, web.SpideOrigin(m, ice.DEMO))
|
||||||
@ -130,7 +129,7 @@ func _spark_project(m *ice.Message, arg ...string) {
|
|||||||
}()
|
}()
|
||||||
}()
|
}()
|
||||||
func() {
|
func() {
|
||||||
defer m.Cmdy(STYLE, COLUMN, FLEX, "0 0 480px").Cmdy(STYLE, END)
|
defer m.Cmdy(STYLE, COLUMN, FLEX, "0 0 500px", "padding", "10px").Cmdy(STYLE, END)
|
||||||
m.Cmdy(SPARK, INNER, ice.SRC_MAIN_GO, html.WIDTH, "480px")
|
m.Cmdy(SPARK, INNER, ice.SRC_MAIN_GO, html.WIDTH, "480px")
|
||||||
m.Cmdy(SPARK, SHELL, kit.Renders(`
|
m.Cmdy(SPARK, SHELL, kit.Renders(`
|
||||||
git clone {{ .Make.Remote }}
|
git clone {{ .Make.Remote }}
|
||||||
|
2
exec.go
2
exec.go
@ -164,7 +164,7 @@ func (m *Message) _command(arg ...Any) *Message {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if count := kit.Int(m.Option(MSG_COUNT, kit.Format(kit.Int(m.Option(MSG_COUNT))+1))); m.Warn(count > 50000, ErrTooDeepCount) {
|
if count := kit.Int(m.Option(MSG_COUNT, kit.Format(kit.Int(m.Option(MSG_COUNT))+1))); m.Warn(count > 3000, ErrTooDeepCount) {
|
||||||
panic(count)
|
panic(count)
|
||||||
}
|
}
|
||||||
list := kit.Simple(args...)
|
list := kit.Simple(args...)
|
||||||
|
2
go.mod
2
go.mod
@ -5,6 +5,6 @@ go 1.13
|
|||||||
require (
|
require (
|
||||||
shylinux.com/x/go-git/v5 v5.6.7
|
shylinux.com/x/go-git/v5 v5.6.7
|
||||||
shylinux.com/x/go-qrcode v0.0.3
|
shylinux.com/x/go-qrcode v0.0.3
|
||||||
shylinux.com/x/toolkits v1.0.20
|
shylinux.com/x/toolkits v1.0.19
|
||||||
shylinux.com/x/websocket v0.0.4
|
shylinux.com/x/websocket v0.0.4
|
||||||
)
|
)
|
||||||
|
4
go.sum
4
go.sum
@ -4,7 +4,7 @@ shylinux.com/x/go-qrcode v0.0.3 h1:RMo+Vidbgq3HatLBj7DDXcTbTLFUwzis5K7TqBkD38U=
|
|||||||
shylinux.com/x/go-qrcode v0.0.3/go.mod h1:KAbtU+KwiiABMZ/CJ0zh9PI2AX82Uf9rRYcQ4ODm4po=
|
shylinux.com/x/go-qrcode v0.0.3/go.mod h1:KAbtU+KwiiABMZ/CJ0zh9PI2AX82Uf9rRYcQ4ODm4po=
|
||||||
shylinux.com/x/toolkits v0.7.10 h1:65d5rkQXQ71MD8FzYnZ9DFxb1XcOYSYfmRc4j8qQsUw=
|
shylinux.com/x/toolkits v0.7.10 h1:65d5rkQXQ71MD8FzYnZ9DFxb1XcOYSYfmRc4j8qQsUw=
|
||||||
shylinux.com/x/toolkits v0.7.10/go.mod h1:CHDJarGlDkg60kVsvMLYL/a5hAnRLEOShiEsMOuEp0Q=
|
shylinux.com/x/toolkits v0.7.10/go.mod h1:CHDJarGlDkg60kVsvMLYL/a5hAnRLEOShiEsMOuEp0Q=
|
||||||
shylinux.com/x/toolkits v1.0.20 h1:uBnfyyqDsbSWYsXfXmBugZ8ZWp5QQ8sthrzRdJ6ET90=
|
shylinux.com/x/toolkits v1.0.19 h1:Nrx0xYRc5ph1WS66EZ1hJUCe+2FdSWQ4QP6tBlguikQ=
|
||||||
shylinux.com/x/toolkits v1.0.20/go.mod h1:CHDJarGlDkg60kVsvMLYL/a5hAnRLEOShiEsMOuEp0Q=
|
shylinux.com/x/toolkits v1.0.19/go.mod h1:CHDJarGlDkg60kVsvMLYL/a5hAnRLEOShiEsMOuEp0Q=
|
||||||
shylinux.com/x/websocket v0.0.4 h1:AJpwblePoOpiE6C8NrvgNYpKTotXMLrDDX2chTvx44Q=
|
shylinux.com/x/websocket v0.0.4 h1:AJpwblePoOpiE6C8NrvgNYpKTotXMLrDDX2chTvx44Q=
|
||||||
shylinux.com/x/websocket v0.0.4/go.mod h1:3UGWkjTu3ie5NAZen7J+uLPBrO7DFeKloj6Jxo13Oiw=
|
shylinux.com/x/websocket v0.0.4/go.mod h1:3UGWkjTu3ie5NAZen7J+uLPBrO7DFeKloj6Jxo13Oiw=
|
||||||
|
7
info.go
7
info.go
@ -308,9 +308,6 @@ func Module(prefix string, arg ...Any) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
func (m *Message) FileURI(dir string) string {
|
func (m *Message) FileURI(dir string) string {
|
||||||
if strings.Contains(dir, "bi ") {
|
|
||||||
return dir
|
|
||||||
}
|
|
||||||
if dir == "" || kit.HasPrefix(dir, HTTP) {
|
if dir == "" || kit.HasPrefix(dir, HTTP) {
|
||||||
return dir
|
return dir
|
||||||
}
|
}
|
||||||
@ -332,9 +329,7 @@ func (m *Message) FileURI(dir string) string {
|
|||||||
dir = strings.TrimPrefix(dir, ISH_PLUGED)
|
dir = strings.TrimPrefix(dir, ISH_PLUGED)
|
||||||
}
|
}
|
||||||
if strings.HasPrefix(dir, PS) {
|
if strings.HasPrefix(dir, PS) {
|
||||||
if !strings.Contains(dir, "pod=") {
|
|
||||||
dir = kit.MergeURL(dir, POD, m.Option(MSG_USERPOD))
|
|
||||||
}
|
|
||||||
} else if strings.HasPrefix(dir, USR_VOLCANOS) {
|
} else if strings.HasPrefix(dir, USR_VOLCANOS) {
|
||||||
dir = strings.TrimPrefix(dir, USR)
|
dir = strings.TrimPrefix(dir, USR)
|
||||||
} else {
|
} else {
|
||||||
|
4
logs.go
4
logs.go
@ -7,7 +7,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"path"
|
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
@ -124,8 +123,7 @@ func (m *Message) Warn(err Any, arg ...Any) bool {
|
|||||||
}
|
}
|
||||||
str, meta := m.join(arg...)
|
str, meta := m.join(arg...)
|
||||||
if m.log(LOG_WARN, str, meta...); len(arg) > 0 {
|
if m.log(LOG_WARN, str, meta...); len(arg) > 0 {
|
||||||
p := path.Join(kit.Slice(strings.Split(logs.FileLines(-2), "/"), -2)...)
|
m.Option(MSG_TITLE, kit.JoinWord(kit.Keys(m.Option(MSG_USERPOD), m.CommandKey(), m.ActionKey()), logs.FileLines(-2)))
|
||||||
m.Option(MSG_TITLE, kit.JoinWord(kit.Keys(m.Option(MSG_USERPOD), m.CommandKey(), m.ActionKey()), p))
|
|
||||||
m.error(arg...)
|
m.error(arg...)
|
||||||
kit.If(map[string]int{
|
kit.If(map[string]int{
|
||||||
ErrNotLogin: http.StatusUnauthorized,
|
ErrNotLogin: http.StatusUnauthorized,
|
||||||
|
@ -16,7 +16,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
return
|
|
||||||
const TAGS = "tags"
|
const TAGS = "tags"
|
||||||
Index.MergeCommands(ice.Commands{
|
Index.MergeCommands(ice.Commands{
|
||||||
TAGS: {Name: "tags path name auto", Actions: ice.MergeActions(ice.Actions{
|
TAGS: {Name: "tags path name auto", Actions: ice.MergeActions(ice.Actions{
|
||||||
|
@ -136,10 +136,10 @@ func init() {
|
|||||||
m.Cmd(mdb.PRUNES, m.Prefix(SCAN), "", mdb.HASH, m.OptionSimple(mdb.NAME))
|
m.Cmd(mdb.PRUNES, m.Prefix(SCAN), "", mdb.HASH, m.OptionSimple(mdb.NAME))
|
||||||
m.Cmd(mdb.PRUNES, m.Prefix(IDE), "", mdb.HASH, m.OptionSimple(mdb.NAME))
|
m.Cmd(mdb.PRUNES, m.Prefix(IDE), "", mdb.HASH, m.OptionSimple(mdb.NAME))
|
||||||
}},
|
}},
|
||||||
}, gdb.EventsAction(web.SPACE_GRANT, web.SPACE_LOGIN_CLOSE), mdb.HashAction(
|
}, gdb.EventsAction(web.SPACE_GRANT, web.SPACE_LOGIN_CLOSE), mdb.ExportHashAction(
|
||||||
mdb.SHORT, ACCESS, mdb.FIELD, "time,type,access,icons,usernick,appid,secret,token", tcp.SERVER, CGI_BIN,
|
mdb.SHORT, ACCESS, mdb.FIELD, "time,type,access,icons,usernick,appid,secret,token", tcp.SERVER, CGI_BIN,
|
||||||
)), Hand: func(m *ice.Message, arg ...string) {
|
)), Hand: func(m *ice.Message, arg ...string) {
|
||||||
mdb.HashSelect(m, arg...).PushAction(OAUTH, web.SSO, TOKENS, TICKET, mdb.REMOVE).StatusTimeCount(mdb.ConfigSimple(m, ACCESS, APPID), web.SERVE, m.MergeLink("/chat/wx/login/"))
|
mdb.HashSelect(m, arg...).PushAction(OAUTH, web.SSO, mdb.REMOVE).StatusTimeCount(mdb.ConfigSimple(m, ACCESS, APPID), web.SERVE, m.MergeLink("/chat/wx/login/"))
|
||||||
m.RewriteAppend(func(value, key string, index int) string {
|
m.RewriteAppend(func(value, key string, index int) string {
|
||||||
kit.If(key == cli.QRCODE, func() { value = ice.Render(m, ice.RENDER_QRCODE, value) })
|
kit.If(key == cli.QRCODE, func() { value = ice.Render(m, ice.RENDER_QRCODE, value) })
|
||||||
return value
|
return value
|
||||||
@ -159,7 +159,7 @@ func spideToken(m *ice.Message, api string, token, expire string, arg ...string)
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
m.Info("res: %v", res.FormatMeta())
|
m.Info("res: %v", res.FormatMeta())
|
||||||
mdb.HashModify(m, m.OptionSimple(ACCESS), expire, m.Time(kit.Format("%vs", kit.Int(res.Append(oauth.EXPIRES_IN))-3600)), token, res.Append(kit.Select(oauth.ACCESS_TOKEN, TICKET, api == TICKET_GETTICKET)))
|
mdb.HashModify(m, m.OptionSimple(ACCESS), expire, m.Time(kit.Format("%vs", res.Append(oauth.EXPIRES_IN))), token, res.Append(kit.Select(oauth.ACCESS_TOKEN, TICKET, api == TICKET_GETTICKET)))
|
||||||
msg = mdb.HashSelect(m.Spawn(), m.Option(ACCESS))
|
msg = mdb.HashSelect(m.Spawn(), m.Option(ACCESS))
|
||||||
}
|
}
|
||||||
m.Echo(msg.Append(token)).Status(msg.AppendSimple(expire))
|
m.Echo(msg.Append(token)).Status(msg.AppendSimple(expire))
|
||||||
|
@ -52,15 +52,7 @@ func init() {
|
|||||||
"oauth", "", web.SPACE, "", nfs.SCRIPT, "https://res.wx.qq.com/open/js/jweixin-1.6.0.js",
|
"oauth", "", web.SPACE, "", nfs.SCRIPT, "https://res.wx.qq.com/open/js/jweixin-1.6.0.js",
|
||||||
)), Hand: func(m *ice.Message, arg ...string) {
|
)), Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Cmdy(ACCESS, AGENT).Options(SIGNATURE, _wx_sign(m, m.Option(NONCESTR, ice.Info.Pathname), m.Option(TIMESTAMP, kit.Format(time.Now().Unix())))).Display("")
|
m.Cmdy(ACCESS, AGENT).Options(SIGNATURE, _wx_sign(m, m.Option(NONCESTR, ice.Info.Pathname), m.Option(TIMESTAMP, kit.Format(time.Now().Unix())))).Display("")
|
||||||
m.Info("what %v", m.FormatsMeta(nil))
|
|
||||||
ctx.OptionFromConfig(m, "oauth", nfs.SCRIPT)
|
ctx.OptionFromConfig(m, "oauth", nfs.SCRIPT)
|
||||||
if m.Option(ice.MSG_USERNAME) == "" {
|
|
||||||
msg := m.Spawn()
|
|
||||||
web.ParseURL(msg, m.Option("oauth"))
|
|
||||||
state := m.Cmdx("web.chat.oauth.cache", mdb.CREATE, "state", msg.Option("state"), "goback", kit.Select(m.Option(ice.MSG_USERURL), m.Option(ice.MSG_REFERER)))
|
|
||||||
oauth := kit.MergeURL(m.Option("oauth"), "state", state)
|
|
||||||
m.Option("oauth", oauth)
|
|
||||||
}
|
|
||||||
m.Option("oauth", strings.ReplaceAll(m.Option("oauth"), "https%3A%2F%2Fyunxuanlinghang.com", strings.ReplaceAll(m.Option(ice.MSG_USERHOST), "://", "%3A%2F%2F")))
|
m.Option("oauth", strings.ReplaceAll(m.Option("oauth"), "https%3A%2F%2Fyunxuanlinghang.com", strings.ReplaceAll(m.Option(ice.MSG_USERHOST), "://", "%3A%2F%2F")))
|
||||||
}},
|
}},
|
||||||
})
|
})
|
||||||
|
@ -8,6 +8,13 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
debug = false, can.onmotion.hidden(can, can._fields)
|
debug = false, can.onmotion.hidden(can, can._fields)
|
||||||
wx.config({debug: debug, signature: msg.Option("signature"), timestamp: msg.Option("timestamp"), nonceStr: msg.Option("noncestr"), appId: msg.Option("appid"),
|
wx.config({debug: debug, signature: msg.Option("signature"), timestamp: msg.Option("timestamp"), nonceStr: msg.Option("noncestr"), appId: msg.Option("appid"),
|
||||||
jsApiList: can.core.Item({
|
jsApiList: can.core.Item({
|
||||||
|
getLocation: function(can, cb) { wx.getLocation({type: "gcj02", success: function (res) {
|
||||||
|
can.base.isFunc(cb) && cb({type: "gcj02", name: "当前位置", text: "当前位置", latitude: parseInt(res.latitude*100000), longitude: parseInt(res.longitude*100000) })
|
||||||
|
} }) },
|
||||||
|
openLocation: function(can, msg) { wx.openLocation({
|
||||||
|
name: msg.Option(mdb.NAME), address: msg.Option(mdb.TEXT), infoUrl: msg.Option(web.LINK),
|
||||||
|
longitude: parseFloat(msg.Option(aaa.LONGITUDE)), latitude: parseFloat(msg.Option(aaa.LATITUDE)), scale: msg.Option("scale")||14,
|
||||||
|
}) },
|
||||||
chooseImage: function(can, cb, count) { wx.chooseImage({count: count||9, sourceType: ["camera", "album"], sizeType: ["original", "compressed"], success: function (res) {
|
chooseImage: function(can, cb, count) { wx.chooseImage({count: count||9, sourceType: ["camera", "album"], sizeType: ["original", "compressed"], success: function (res) {
|
||||||
can.base.isFunc(cb) && cb(res.localIds)
|
can.base.isFunc(cb) && cb(res.localIds)
|
||||||
} }) },
|
} }) },
|
||||||
@ -17,47 +24,23 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
previewImage: function(can, url, list) {
|
previewImage: function(can, url, list) {
|
||||||
wx.previewImage({current: url, urls: list||[url]})
|
wx.previewImage({current: url, urls: list||[url]})
|
||||||
},
|
},
|
||||||
scanQRCode: function(can, cb) {
|
scanQRCode: function(can, cb) { wx.scanQRCode({needResult: cb? 1: 0, scanType: ["qrCode", "barCode"], success: function (res) {
|
||||||
wx.scanQRCode({needResult: cb? 1: 0, scanType: ["qrCode", "barCode"], success: function (res) {
|
can.base.isFunc(cb) && cb(can.base.ParseJSON(res.resultStr))
|
||||||
can.base.isFunc(cb) && cb(can.base.ParseJSON(res.resultStr))
|
|
||||||
}, fail: function(res) {
|
|
||||||
can.user.toastFailure(can, res)
|
|
||||||
} })
|
|
||||||
},
|
|
||||||
getLocation: function(can, cb) { wx.getLocation({type: "gcj02", success: function (res) {
|
|
||||||
can.base.isFunc(cb) && cb({type: "gcj02", name: can.user.info.usernick, text: can.base.Time(),
|
|
||||||
latitude: parseInt(res.latitude*100000), longitude: parseInt(res.longitude*100000),
|
|
||||||
})
|
|
||||||
} }) },
|
} }) },
|
||||||
openLocation: function(can, msg) { wx.openLocation({
|
|
||||||
name: msg.Option(mdb.NAME)||can.user.info.usernick, address: msg.Option(mdb.TEXT)||can.base.Time(), infoUrl: msg.Option(web.LINK)||location.href,
|
|
||||||
longitude: parseFloat(msg.Option(aaa.LONGITUDE)/100000), latitude: parseFloat(msg.Option(aaa.LATITUDE)/100000), scale: msg.Option("scale")||14,
|
|
||||||
}) },
|
|
||||||
openAddress: function(can, cb) {
|
|
||||||
wx.openAddress({success: function(res) { cb(res) }})
|
|
||||||
},
|
|
||||||
}, function(key, value) { return can.user.agent[key] = value, key }).concat([
|
}, function(key, value) { return can.user.agent[key] = value, key }).concat([
|
||||||
"updateAppMessageShareData",
|
"updateAppMessageShareData", "updateTimelineShareData",
|
||||||
], can.user.isMobile? ["updateTimelineShareData"]: []), openTagList: ["wx-open-subscribe"],
|
]), openTagList: ["wx-open-subscribe"],
|
||||||
})
|
|
||||||
wx.error(function (res) {
|
|
||||||
can.user.toastFailure(can, JSON.stringify(res))
|
|
||||||
})
|
})
|
||||||
wx.ready(function () {
|
wx.ready(function () {
|
||||||
function share(title, icons, content, link) {
|
function share(title, icons, content) {
|
||||||
wx.updateAppMessageShareData({title: title, desc: content||can.user.info.titles, link: link||location.href, imgUrl: icons, fail: function(res) {
|
wx.updateAppMessageShareData({title: title, desc: content||can.user.info.titles, link: location.href, imgUrl: icons})
|
||||||
// can.user.toastFailure(can, JSON.stringify(res))
|
wx.updateTimelineShareData({title: title, link: location.href, imgUrl: icons})
|
||||||
}})
|
|
||||||
can.user.isMobile && wx.updateTimelineShareData({title: title, link: link||location.href, imgUrl: icons, fail: function(res) {
|
|
||||||
// can.user.toastFailure(can, JSON.stringify(res))
|
|
||||||
}})
|
|
||||||
}
|
}
|
||||||
var p = can.misc.Resource(can, can.user.info.favicon); can.base.beginWith(p, "/") && (p = location.origin + p)
|
var p = can.misc.Resource(can, can.user.info.favicon); can.base.beginWith(p, "/") && (p = location.origin + p)
|
||||||
can.user.agent.init = function(can, content, icons, link) { if (!can) { return }
|
can.user.agent.init = function(can, content, icons) { if (!can) { return }
|
||||||
p = can.misc.Resource(can, icons||can.Conf(mdb.ICONS))||p; can.base.beginWith(p, "/") && (p = location.origin + p)
|
p = can.misc.Resource(can, icons||can.Conf(mdb.ICONS))||p; can.base.beginWith(p, "/") && (p = location.origin + p)
|
||||||
share(document.title, p, content, link)
|
share(document.title, p, content)
|
||||||
}, can.user.agent.init(can.user.agent.cmd, can.user.agent._init_content, can.user.agent._init_icons)
|
}, can.user.agent.init(can.user.agent.cmd, can.user.agent._init_content, can.user.agent._init_icons)
|
||||||
// location.pathname == "/" && can.onmotion.delay(can, function() { share(document.title, can.misc.Resource(can, can.user.info.favicon)) }, 300)
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
package wx
|
package wx
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"strings"
|
|
||||||
|
|
||||||
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"
|
||||||
@ -41,23 +39,22 @@ func init() {
|
|||||||
value[mdb.TEXT] = web.C(value[ctx.INDEX])
|
value[mdb.TEXT] = web.C(value[ctx.INDEX])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
value[mdb.TEXT] = m.MergeLink(value[mdb.TEXT] + value[ctx.ARGS])
|
value[mdb.TEXT] = m.MergeLink(value[mdb.TEXT])
|
||||||
})
|
})
|
||||||
kit.Value(list, key, kit.Dict(mdb.TYPE, value[mdb.TYPE], mdb.NAME, value[mdb.NAME], mdb.KEY, value[mdb.HASH], web.URL, value[mdb.TEXT]))
|
kit.Value(list, key, kit.Dict(mdb.TYPE, value[mdb.TYPE], mdb.NAME, value[mdb.NAME], mdb.KEY, value[mdb.HASH], web.URL, value[mdb.TEXT]))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
m.Echo(kit.Formats(SpidePost(m, MENU_CREATE, web.SPIDE_DATA, strings.ReplaceAll(kit.Format(list), "\\u0026", "&"))))
|
m.Echo(kit.Formats(SpidePost(m, MENU_CREATE, web.SPIDE_DATA, kit.Formats(list))))
|
||||||
m.ProcessHold()
|
m.ProcessHold()
|
||||||
}},
|
}},
|
||||||
web.PREVIEW: {Hand: func(m *ice.Message, arg ...string) {
|
|
||||||
m.ProcessOpen(m.MergeLink(kit.Select(web.S(m.Option(web.SPACE))+web.C(m.Option(ctx.INDEX)), m.Option(mdb.TEXT)) + m.Option(ctx.ARGS)))
|
|
||||||
}},
|
|
||||||
}, mdb.ExportHashAction(mdb.SHORT, "scene,river,storm", mdb.FIELD, "time,hash,scene,river,storm,type,name,text,icons,space,index,args")), Hand: func(m *ice.Message, arg ...string) {
|
}, mdb.ExportHashAction(mdb.SHORT, "scene,river,storm", mdb.FIELD, "time,hash,scene,river,storm,type,name,text,icons,space,index,args")), Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
m.Option("cache.limit", "-1")
|
||||||
if len(arg) == 0 {
|
if len(arg) == 0 {
|
||||||
m.Cmdy(ACCESS).PushAction("").Action()
|
m.Cmdy(ACCESS).PushAction("").Option(ice.MSG_ACTION, "")
|
||||||
kit.If(m.Length() == 0, func() { m.SetResult() })
|
if m.Length() == 0 {
|
||||||
} else if mdb.HashSelect(m.Options("cache.limit", "-1"), arg[1:]...).Sort(mdb.Config(m, mdb.SHORT), ice.STR, ice.INT, ice.INT); len(arg) == 1 {
|
m.SetResult()
|
||||||
m.PushAction(web.PREVIEW, mdb.REMOVE)
|
}
|
||||||
|
} else if mdb.HashSelect(m, arg[1:]...).Sort(mdb.Config(m, mdb.SHORT), ice.STR, ice.INT, ice.INT); len(arg) == 1 {
|
||||||
m.Action(mdb.CREATE, mdb.UPDATE)
|
m.Action(mdb.CREATE, mdb.UPDATE)
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
|
@ -14,7 +14,9 @@ func init() {
|
|||||||
m.Cmdy(ACCESS)
|
m.Cmdy(ACCESS)
|
||||||
} else if m.Option(ACCESS, arg[0]); len(arg) == 1 {
|
} else if m.Option(ACCESS, arg[0]); len(arg) == 1 {
|
||||||
res := SpideGet(m, "template/get_all_private_template")
|
res := SpideGet(m, "template/get_all_private_template")
|
||||||
kit.For(kit.Value(res, "template_list"), func(value ice.Map) { m.Push("", value) })
|
kit.For(kit.Value(res, "template_list"), func(value ice.Map) {
|
||||||
|
m.Push("", value)
|
||||||
|
})
|
||||||
m.Cut("template_id,title,content,example")
|
m.Cut("template_id,title,content,example")
|
||||||
} else if len(arg) > 4 {
|
} else if len(arg) > 4 {
|
||||||
args := []ice.Any{"template_id", arg[1], "touser", arg[2], "url", arg[3]}
|
args := []ice.Any{"template_id", arg[1], "touser", arg[2], "url", arg[3]}
|
||||||
|
@ -47,7 +47,6 @@ func _user_list(m *ice.Message, res ice.Any) *ice.Message {
|
|||||||
list := map[string]string{}
|
list := map[string]string{}
|
||||||
m.Cmd(TAGS, m.Option(ACCESS), func(value ice.Maps) { list[value[mdb.ID]] = value[mdb.NAME] })
|
m.Cmd(TAGS, m.Option(ACCESS), func(value ice.Maps) { list[value[mdb.ID]] = value[mdb.NAME] })
|
||||||
kit.For(kit.Value(res, kit.Keys(mdb.DATA, OPENID)), func(value string) {
|
kit.For(kit.Value(res, kit.Keys(mdb.DATA, OPENID)), func(value string) {
|
||||||
return
|
|
||||||
res := SpideGet(m, USER_INFO, OPENID, value)
|
res := SpideGet(m, USER_INFO, OPENID, value)
|
||||||
m.Push(mdb.TIME, kit.TimeUnix(kit.Value(res, SUBSCRIBE_TIME)))
|
m.Push(mdb.TIME, kit.TimeUnix(kit.Value(res, SUBSCRIBE_TIME)))
|
||||||
m.Push("", res, []string{OPENID, SEX, aaa.USERNICK, aaa.LANGUAGE, aaa.PROVINCE, aaa.CITY})
|
m.Push("", res, []string{OPENID, SEX, aaa.USERNICK, aaa.LANGUAGE, aaa.PROVINCE, aaa.CITY})
|
||||||
|
@ -12,4 +12,3 @@ field web.chat.wx.menu
|
|||||||
field web.chat.wx.scan
|
field web.chat.wx.scan
|
||||||
field web.chat.wx.tags
|
field web.chat.wx.tags
|
||||||
field web.chat.wx.users
|
field web.chat.wx.users
|
||||||
field web.chat.wx.template
|
|
||||||
|
14
render.go
14
render.go
@ -55,9 +55,6 @@ func Render(m *Message, cmd string, args ...Any) string {
|
|||||||
case RENDER_SCRIPT:
|
case RENDER_SCRIPT:
|
||||||
return kit.Format(`<code>%s</code>`, arg[0])
|
return kit.Format(`<code>%s</code>`, arg[0])
|
||||||
case RENDER_IMAGES:
|
case RENDER_IMAGES:
|
||||||
if len(arg) > 2 {
|
|
||||||
return kit.Format(`<img src="%s" height="%s" class="%s">`, arg[0], arg[1], arg[2])
|
|
||||||
}
|
|
||||||
if len(arg) > 1 {
|
if len(arg) > 1 {
|
||||||
return kit.Format(`<img src="%s" height="%s">`, arg[0], arg[1])
|
return kit.Format(`<img src="%s" height="%s">`, arg[0], arg[1])
|
||||||
}
|
}
|
||||||
@ -234,11 +231,9 @@ func (m *Message) EchoButton(arg ...Any) *Message {
|
|||||||
func (m *Message) EchoAnchor(arg ...string) *Message { return m.Echo(Render(m, RENDER_ANCHOR, arg)) }
|
func (m *Message) EchoAnchor(arg ...string) *Message { return m.Echo(Render(m, RENDER_ANCHOR, arg)) }
|
||||||
func (m *Message) EchoQRCode(src string) *Message { return m.Echo(Render(m, RENDER_QRCODE, src)) }
|
func (m *Message) EchoQRCode(src string) *Message { return m.Echo(Render(m, RENDER_QRCODE, src)) }
|
||||||
func (m *Message) EchoScript(arg ...string) *Message { return m.Echo(Render(m, RENDER_SCRIPT, arg)) }
|
func (m *Message) EchoScript(arg ...string) *Message { return m.Echo(Render(m, RENDER_SCRIPT, arg)) }
|
||||||
func (m *Message) EchoImages(arg ...string) *Message {
|
func (m *Message) EchoImages(src string) *Message { return m.Echo(Render(m, RENDER_IMAGES, src)) }
|
||||||
return m.Echo(Render(m, RENDER_IMAGES, arg))
|
func (m *Message) EchoVideos(src string) *Message { return m.Echo(Render(m, RENDER_VIDEOS, src)) }
|
||||||
}
|
func (m *Message) EchoAudios(src string) *Message { return m.Echo(Render(m, RENDER_AUDIOS, src)) }
|
||||||
func (m *Message) EchoVideos(src string) *Message { return m.Echo(Render(m, RENDER_VIDEOS, src)) }
|
|
||||||
func (m *Message) EchoAudios(src string) *Message { return m.Echo(Render(m, RENDER_AUDIOS, src)) }
|
|
||||||
func (m *Message) EchoIFrame(src string) *Message {
|
func (m *Message) EchoIFrame(src string) *Message {
|
||||||
kit.If(!m.IsCliUA(), func() {
|
kit.If(!m.IsCliUA(), func() {
|
||||||
kit.If(src, func() { m.Echo(Render(m, RENDER_IFRAME, src)) })
|
kit.If(src, func() { m.Echo(Render(m, RENDER_IFRAME, src)) })
|
||||||
@ -268,9 +263,6 @@ func (m *Message) DisplayCSS(file string, arg ...Any) *Message {
|
|||||||
return m
|
return m
|
||||||
}
|
}
|
||||||
func (m *Message) Resource(file string, arg ...string) string {
|
func (m *Message) Resource(file string, arg ...string) string {
|
||||||
if strings.Contains(file, "bi ") {
|
|
||||||
return file
|
|
||||||
}
|
|
||||||
if len(arg) > 0 && arg[0] != "" {
|
if len(arg) > 0 && arg[0] != "" {
|
||||||
if strings.HasPrefix(file, HTTP) {
|
if strings.HasPrefix(file, HTTP) {
|
||||||
return file
|
return file
|
||||||
|
Loading…
x
Reference in New Issue
Block a user