forked from x/icebergs
opt some
This commit is contained in:
parent
a6e422a0bb
commit
8e4751719e
@ -29,7 +29,6 @@ func _user_login(m *ice.Message, name, word string) {
|
||||
_user_create(m.Spawn(), name, word)
|
||||
}
|
||||
|
||||
m.Debug("what %v", m.FormatMeta())
|
||||
_source := logs.FileLineMeta(logs.FileLine(-1, 3))
|
||||
mdb.HashSelectDetail(m.Spawn(), name, func(value ice.Map) {
|
||||
if m.Warn(word != "" && word != kit.Format(kit.Value(value, kit.Keys(mdb.EXTRA, PASSWORD))), ice.ErrNotRight) {
|
||||
@ -42,7 +41,6 @@ func _user_login(m *ice.Message, name, word string) {
|
||||
_source,
|
||||
)
|
||||
})
|
||||
m.Debug("what %v", m.FormatMeta())
|
||||
}
|
||||
|
||||
const (
|
||||
|
@ -36,6 +36,7 @@ func init() {
|
||||
mdb.ZoneInsert(m, CLI, "go", CMD, kit.Format("install download https://golang.google.cn/dl/go1.15.5.%s-%s.tar.gz usr/local", runtime.GOOS, runtime.GOARCH))
|
||||
}
|
||||
|
||||
IsAlpine(m, "npm")
|
||||
IsAlpine(m, "node", "nodejs")
|
||||
IsAlpine(m, "java", "openjdk8")
|
||||
IsAlpine(m, "javac", "openjdk8")
|
||||
|
@ -279,14 +279,11 @@ func _serve_handle(key string, cmd *ice.Command, msg *ice.Message, w http.Respon
|
||||
}
|
||||
}
|
||||
func _serve_login(msg *ice.Message, key string, cmds []string, w http.ResponseWriter, r *http.Request) ([]string, bool) {
|
||||
msg.Debug("what %v", msg.Append("extra.password"))
|
||||
aaa.SessCheck(msg, msg.Option(ice.MSG_SESSID)) // 会话认证
|
||||
|
||||
msg.Debug("what %v", msg.Append("extra.password"))
|
||||
if msg.Config("staffname") != "" {
|
||||
aaa.UserLogin(msg, r.Header.Get("Staffname"), "")
|
||||
}
|
||||
msg.Debug("what %v", msg.Append("extra.password"))
|
||||
|
||||
if msg.Option(ice.MSG_USERNAME) == "" && msg.Config(tcp.LOCALHOST) == ice.TRUE && tcp.IsLocalHost(msg, msg.Option(ice.MSG_USERIP)) {
|
||||
aaa.UserRoot(msg) // 本机认证
|
||||
|
@ -77,8 +77,6 @@ func _spide_list(m *ice.Message, arg ...string) {
|
||||
})
|
||||
|
||||
// 发送请求
|
||||
m.Debug("what %v", msg.Append(CLIENT_NAME))
|
||||
m.Debug("what %v", msg.FormatsMeta())
|
||||
res, e := _spide_send(m, msg.Append(CLIENT_NAME), req, kit.Format(msg.Append(CLIENT_TIMEOUT)))
|
||||
if m.Warn(e, ice.ErrNotFound, uri) {
|
||||
return
|
||||
|
@ -60,6 +60,7 @@ const HEADER = "header"
|
||||
func init() {
|
||||
Index.MergeCommands(ice.Commands{
|
||||
web.WEB_LOGIN: {Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Debug("what %v", m.FormatStack(1, 100))
|
||||
switch kit.Select("", arg, 0) {
|
||||
case web.P(HEADER):
|
||||
switch kit.Select("", arg, 1) {
|
||||
|
@ -44,8 +44,8 @@ func _river_list(m *ice.Message) {
|
||||
}
|
||||
|
||||
m.Cmd(mdb.SELECT, m.PrefixKey(), "", mdb.HASH, ice.OptionFields(mdb.HASH, mdb.NAME)).Tables(func(value ice.Maps) {
|
||||
m.Cmd(mdb.SELECT, m.PrefixKey(), kit.Keys(mdb.HASH, value[mdb.HASH], OCEAN), mdb.HASH, m.Option(ice.MSG_USERNAME)).Tables(func(value ice.Maps) {
|
||||
m.Push("", value, []string{mdb.HASH, mdb.NAME}, value)
|
||||
m.Cmd(mdb.SELECT, m.PrefixKey(), kit.Keys(mdb.HASH, value[mdb.HASH], OCEAN), mdb.HASH, m.Option(ice.MSG_USERNAME)).Tables(func(val ice.Maps) {
|
||||
m.Push("", value, []string{mdb.HASH, mdb.NAME}, val)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, tar
|
||||
Volcanos(chat.ONACTION, {help: "控件交互",
|
||||
scanQRCode0: function(event, can) { can.user.agent.scanQRCode() },
|
||||
scanQRCode: function(event, can, button) { can.user.agent.scanQRCode(function(text, data) {
|
||||
can.runAction(can.request(event, data), data.action||button [], function(msg) {
|
||||
can.runAction(can.request(event, data), data.action||button, [], function(msg) {
|
||||
can.user.toastSuccess(can, text), can.Update()
|
||||
}, true)
|
||||
}, can) },
|
||||
|
@ -27,9 +27,7 @@ func init() {
|
||||
}
|
||||
}},
|
||||
RIVER_CREATE: {Name: "river.create river template", Help: "建群", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Debug("fuck %v", 123)
|
||||
m.Cmd("", m.Option(TEMPLATE)).Tables(func(value ice.Maps) {
|
||||
m.Debug("fuck %v", value)
|
||||
h := m.Cmdx(STORM, mdb.CREATE, mdb.TYPE, "", mdb.NAME, value[STORM], mdb.TEXT, "")
|
||||
m.Cmd("", m.Option(TEMPLATE), value[STORM]).Tables(func(value ice.Maps) {
|
||||
m.Cmd(STORM, mdb.INSERT, mdb.HASH, h, kit.SimpleKV("space,index", value))
|
||||
@ -76,10 +74,9 @@ func init() {
|
||||
var _river_template = kit.Dict(
|
||||
"base", kit.Dict(
|
||||
"info", kit.List(
|
||||
"web.chat.info",
|
||||
"web.chat.ocean",
|
||||
"web.chat.storm",
|
||||
"web.chat.node",
|
||||
"web.chat.ocean",
|
||||
"web.chat.nodes",
|
||||
),
|
||||
"scan", kit.List(
|
||||
"web.chat.scan",
|
||||
@ -101,5 +98,9 @@ var _river_template = kit.Dict(
|
||||
"web.wiki.data",
|
||||
"web.wiki.word",
|
||||
),
|
||||
"term", kit.List(
|
||||
"web.code.xterm",
|
||||
"web.code.vimer",
|
||||
),
|
||||
),
|
||||
)
|
||||
|
@ -121,7 +121,6 @@ func _website_parse(m *ice.Message, text string, args ...string) (ice.Map, bool)
|
||||
}
|
||||
func _website_render(m *ice.Message, w http.ResponseWriter, r *http.Request, kind, text, name string) bool {
|
||||
msg := m.Spawn(w, r)
|
||||
m.Debug("what %v", kind)
|
||||
switch kind {
|
||||
case nfs.ZML:
|
||||
web.RenderCmd(msg, "can.parse", text, name)
|
||||
|
@ -87,7 +87,6 @@ func _go_exec(m *ice.Message, arg ...string) {
|
||||
args := []string{"./bin/ice.bin", ctx.GetFileCmd(path.Join(arg[2], arg[1]))}
|
||||
m.Cmdy(cli.SYSTEM, args)
|
||||
m.StatusTime("args", kit.Join(args, " "))
|
||||
m.Debug(m.FormatsMeta())
|
||||
return
|
||||
}
|
||||
if m.Option(mdb.TEXT) == "" {
|
||||
|
@ -41,7 +41,6 @@ func _js_exec(m *ice.Message, arg ...string) {
|
||||
args := kit.Simple("node", "-e", kit.Join(_js_main_script(m, arg...), ice.NL))
|
||||
m.Cmdy(cli.SYSTEM, args)
|
||||
m.StatusTime("args", kit.Join([]string{"./bin/ice.bin", "web.code.js.js", "exec", path.Join(arg[2], arg[1])}, " "))
|
||||
m.Debug(m.FormatsMeta())
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,6 @@ func _publish_list(m *ice.Message, arg ...string) {
|
||||
m.Option(nfs.DIR_ROOT, ice.USR_PUBLISH)
|
||||
m.Option(nfs.DIR_REG, kit.Select("", arg, 0))
|
||||
m.Cmdy(nfs.DIR, nfs.PWD, kit.Select(nfs.DIR_WEB_FIELDS, arg, 1))
|
||||
m.Debug("what %v", m.FormatsMeta())
|
||||
}
|
||||
func _publish_bin_list(m *ice.Message, dir string) {
|
||||
p := m.Option(cli.CMD_DIR, dir)
|
||||
|
@ -87,13 +87,13 @@ func _webpack_cache(m *ice.Message, dir string, write bool) {
|
||||
p := value[nfs.PATH]
|
||||
switch kit.Ext(p) {
|
||||
case nfs.CSS:
|
||||
_webpack_css(m, css, js, path.Join(ice.REQUIRE, ice.NODE_MODULES, ice.LIB, p))
|
||||
_webpack_css(m, css, js, path.Join(ice.REQUIRE, ice.LIB, ice.NODE_MODULES, p))
|
||||
return
|
||||
case nfs.JS:
|
||||
default:
|
||||
p = p + "/lib/" + p + ".js"
|
||||
}
|
||||
_webpack_node(m, js, path.Join(ice.REQUIRE, ice.NODE_MODULES, ice.LIB, p))
|
||||
_webpack_node(m, js, path.Join(ice.REQUIRE, ice.LIB, ice.NODE_MODULES, p))
|
||||
})
|
||||
}
|
||||
func _webpack_build(m *ice.Message, file string) {
|
||||
|
@ -24,17 +24,17 @@ func _title_show(m *ice.Message, kind, text string, arg ...string) {
|
||||
case NAVMENU: // 导航目录
|
||||
_option(m, kind, "", text, arg...)
|
||||
data := _title_parse(m, path.Dir(m.Option(ice.MSG_SCRIPT)), text)
|
||||
m.RenderTemplate(kit.Format("<div {{.OptionTemplate}} data-data='%s'></div>", data))
|
||||
m.RenderTemplate(kit.Format("<div {{.OptionTemplate}} data-data='%s'></div>", data), &Message{m})
|
||||
return
|
||||
|
||||
case PREMENU: // 前置目录
|
||||
_option(m, kind, "", "", arg...)
|
||||
m.RenderTemplate(m.Config(kind))
|
||||
m.RenderTemplate(m.Config(kind), &Message{m})
|
||||
return
|
||||
|
||||
case ENDMENU: // 后置目录
|
||||
_option(m, kind, "", "", arg...)
|
||||
m.RenderTemplate(m.Config(kind))
|
||||
m.RenderTemplate(m.Config(kind), &Message{m})
|
||||
return
|
||||
|
||||
case SECTION: // 分节标题
|
||||
|
Loading…
x
Reference in New Issue
Block a user