1
0
mirror of https://shylinux.com/x/icebergs synced 2025-06-26 18:37:29 +08:00

Compare commits

..

No commits in common. "master" and "v1.9.77" have entirely different histories.

18 changed files with 73 additions and 106 deletions

View File

@ -47,7 +47,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 +124,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) })

View File

@ -90,7 +90,6 @@ const (
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"

View File

@ -85,7 +85,7 @@ func Render(m *ice.Message, cmd string, args ...ice.Any) bool {
"$status", fieldset+">div.status", "$status", fieldset+">div.status",
"$fieldset", fieldset, "$fieldset", fieldset,
"$field", fieldset, "$field", fieldset,
"$input", "div.input.float."+m.Option(ctx.INDEX), "$input", "body>div.input.float."+m.Option(ctx.INDEX),
"$body", "body.cmd."+m.Option(ctx.INDEX), "$body", "body.cmd."+m.Option(ctx.INDEX),
"$index", m.Option(ctx.INDEX), "$index", m.Option(ctx.INDEX),
))) )))

View File

@ -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)))))
@ -249,7 +248,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

View File

@ -155,7 +155,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))) })
@ -530,10 +530,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 +559,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 != "" {

View File

@ -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"
@ -223,7 +222,6 @@ const ( // MSG
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"
@ -237,7 +235,6 @@ const ( // MSG
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_USERUID = "user.uid"
MSG_BG = "sess.bg" MSG_BG = "sess.bg"

View File

@ -66,8 +66,6 @@ fieldset.desktop>div.output>div.desktop>fieldset.web.chat.macos.finder>div.actio
fieldset.desktop>div.output>div.desktop>fieldset.web.chat.iframe.portal>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>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; }

View File

@ -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{}) }

View File

@ -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) {

View File

@ -29,7 +29,7 @@ func init() {
} else { } else {
if msg := m.Cmd(web.SPACE, "20240724-community", "web.chat.oauth.client", "action", "login2"); msg.Option("_arg") != "" { 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"`), 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")))) kit.Simple(msg.Optionv("_arg"))[1], m.Option("goback")))
return return
} }
} }

View File

@ -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)

View File

@ -18,13 +18,20 @@ 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
} }
if cmd := ctx.GetFileCmd(path.Join(arg[2], arg[1])); cmd != "" {
if p := path.Join(arg[2], strings.Split(arg[1], "/")[0], "portal.go"); nfs.Exists(m, p) {
if _cmd := ctx.GetFileCmd(p); _cmd != "" {
if msg := m.Cmd(_cmd, "commandSelect", cmd); msg.Length() > 0 {
ctx.ProcessField(m, _cmd, kit.Simple())
return
}
}
}
}
cmd := kit.Select(ice.CAN_PLUGIN, ctx.GetFileCmd(kit.ExtChange(path.Join(arg[2], arg[1]), GO))) cmd := kit.Select(ice.CAN_PLUGIN, ctx.GetFileCmd(kit.ExtChange(path.Join(arg[2], arg[1]), GO)))
ctx.DisplayBaseCSS(m, require(arg[2], arg[1]), "render", "replace", ctx.INDEX, cmd, ice.POD, m.Option(ice.MSG_USERPOD)) ctx.DisplayBaseCSS(m, require(arg[2], arg[1]), "render", "replace", ctx.INDEX, cmd, ice.POD, m.Option(ice.MSG_USERPOD))
ctx.DisplayBase(m, require(arg[2], arg[1])) ctx.DisplayBase(m, require(arg[2], arg[1]))
@ -65,9 +72,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())

View File

@ -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 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) {
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())
return
}
if msg := m.Cmd(_cmd, "commandSelect", cmd); msg.Length() > 0 {
ctx.ProcessField(m, _cmd, kit.Simple())
return
}
} else {
ls := kit.Split(strings.TrimSuffix(arg[1], ".go"), "/")
if path.Base(arg[1]) == "common.go" {
ctx.ProcessField(m, "web.code.mysql.query", kit.Simple("mysql", ls[0]))
} else {
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())

View File

@ -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,17 @@ 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 cmd := ctx.GetFileCmd(path.Join(arg[2], arg[1])); cmd != "" {
if p := path.Join(arg[2], strings.Split(arg[1], "/")[0], "portal.go"); nfs.Exists(m, p) {
if _cmd := ctx.GetFileCmd(p); _cmd != "" {
if msg := m.Cmd(_cmd, "commandSelect", cmd); msg.Length() > 0 {
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())
} }
} }

View File

@ -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)
}}, }},

View File

@ -145,7 +145,6 @@ func init() {
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.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))
}}, }},

View File

@ -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")))
}}, }},
}) })

View File

@ -8,7 +8,6 @@ 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) { 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) }) can.base.isFunc(cb) && cb({type: "gcj02", name: "当前位置", text: "当前位置", latitude: parseInt(res.latitude*100000), longitude: parseInt(res.longitude*100000) })
} }) }, } }) },
@ -28,7 +27,6 @@ Volcanos(chat.ONIMPORT, {
scanQRCode: function(can, cb) { wx.scanQRCode({needResult: cb? 1: 0, scanType: ["qrCode", "barCode"], success: function (res) { scanQRCode: function(can, cb) { 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))
} }) }, } }) },
*/
}, function(key, value) { return can.user.agent[key] = value, key }).concat([ }, function(key, value) { return can.user.agent[key] = value, key }).concat([
"updateAppMessageShareData", "updateAppMessageShareData",
], can.user.isMobile? ["updateTimelineShareData"]: []), openTagList: ["wx-open-subscribe"], ], can.user.isMobile? ["updateTimelineShareData"]: []), openTagList: ["wx-open-subscribe"],