1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-25 17:18:05 +08:00
This commit is contained in:
harveyshao 2022-08-06 02:01:34 +08:00
parent a6e422a0bb
commit 8e4751719e
14 changed files with 16 additions and 24 deletions

View File

@ -29,7 +29,6 @@ func _user_login(m *ice.Message, name, word string) {
_user_create(m.Spawn(), name, word) _user_create(m.Spawn(), name, word)
} }
m.Debug("what %v", m.FormatMeta())
_source := logs.FileLineMeta(logs.FileLine(-1, 3)) _source := logs.FileLineMeta(logs.FileLine(-1, 3))
mdb.HashSelectDetail(m.Spawn(), name, func(value ice.Map) { 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) { 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, _source,
) )
}) })
m.Debug("what %v", m.FormatMeta())
} }
const ( const (

View File

@ -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)) 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, "node", "nodejs")
IsAlpine(m, "java", "openjdk8") IsAlpine(m, "java", "openjdk8")
IsAlpine(m, "javac", "openjdk8") IsAlpine(m, "javac", "openjdk8")

View File

@ -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) { 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)) // 会话认证 aaa.SessCheck(msg, msg.Option(ice.MSG_SESSID)) // 会话认证
msg.Debug("what %v", msg.Append("extra.password"))
if msg.Config("staffname") != "" { if msg.Config("staffname") != "" {
aaa.UserLogin(msg, r.Header.Get("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)) { if msg.Option(ice.MSG_USERNAME) == "" && msg.Config(tcp.LOCALHOST) == ice.TRUE && tcp.IsLocalHost(msg, msg.Option(ice.MSG_USERIP)) {
aaa.UserRoot(msg) // 本机认证 aaa.UserRoot(msg) // 本机认证

View File

@ -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))) res, e := _spide_send(m, msg.Append(CLIENT_NAME), req, kit.Format(msg.Append(CLIENT_TIMEOUT)))
if m.Warn(e, ice.ErrNotFound, uri) { if m.Warn(e, ice.ErrNotFound, uri) {
return return

View File

@ -60,6 +60,7 @@ const HEADER = "header"
func init() { func init() {
Index.MergeCommands(ice.Commands{ Index.MergeCommands(ice.Commands{
web.WEB_LOGIN: {Hand: func(m *ice.Message, arg ...string) { web.WEB_LOGIN: {Hand: func(m *ice.Message, arg ...string) {
m.Debug("what %v", m.FormatStack(1, 100))
switch kit.Select("", arg, 0) { switch kit.Select("", arg, 0) {
case web.P(HEADER): case web.P(HEADER):
switch kit.Select("", arg, 1) { switch kit.Select("", arg, 1) {

View File

@ -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(), "", 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.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}, value) m.Push("", value, []string{mdb.HASH, mdb.NAME}, val)
}) })
}) })
} }

View File

@ -7,7 +7,7 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, tar
Volcanos(chat.ONACTION, {help: "控件交互", Volcanos(chat.ONACTION, {help: "控件交互",
scanQRCode0: function(event, can) { can.user.agent.scanQRCode() }, scanQRCode0: function(event, can) { can.user.agent.scanQRCode() },
scanQRCode: function(event, can, button) { can.user.agent.scanQRCode(function(text, data) { 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() can.user.toastSuccess(can, text), can.Update()
}, true) }, true)
}, can) }, }, can) },

View File

@ -27,9 +27,7 @@ func init() {
} }
}}, }},
RIVER_CREATE: {Name: "river.create river template", Help: "建群", Hand: func(m *ice.Message, arg ...string) { 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.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, "") 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("", m.Option(TEMPLATE), value[STORM]).Tables(func(value ice.Maps) {
m.Cmd(STORM, mdb.INSERT, mdb.HASH, h, kit.SimpleKV("space,index", value)) m.Cmd(STORM, mdb.INSERT, mdb.HASH, h, kit.SimpleKV("space,index", value))
@ -76,10 +74,9 @@ func init() {
var _river_template = kit.Dict( var _river_template = kit.Dict(
"base", kit.Dict( "base", kit.Dict(
"info", kit.List( "info", kit.List(
"web.chat.info",
"web.chat.ocean",
"web.chat.storm", "web.chat.storm",
"web.chat.node", "web.chat.ocean",
"web.chat.nodes",
), ),
"scan", kit.List( "scan", kit.List(
"web.chat.scan", "web.chat.scan",
@ -101,5 +98,9 @@ var _river_template = kit.Dict(
"web.wiki.data", "web.wiki.data",
"web.wiki.word", "web.wiki.word",
), ),
"term", kit.List(
"web.code.xterm",
"web.code.vimer",
),
), ),
) )

View File

@ -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 { func _website_render(m *ice.Message, w http.ResponseWriter, r *http.Request, kind, text, name string) bool {
msg := m.Spawn(w, r) msg := m.Spawn(w, r)
m.Debug("what %v", kind)
switch kind { switch kind {
case nfs.ZML: case nfs.ZML:
web.RenderCmd(msg, "can.parse", text, name) web.RenderCmd(msg, "can.parse", text, name)

View File

@ -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]))} args := []string{"./bin/ice.bin", ctx.GetFileCmd(path.Join(arg[2], arg[1]))}
m.Cmdy(cli.SYSTEM, args) m.Cmdy(cli.SYSTEM, args)
m.StatusTime("args", kit.Join(args, " ")) m.StatusTime("args", kit.Join(args, " "))
m.Debug(m.FormatsMeta())
return return
} }
if m.Option(mdb.TEXT) == "" { if m.Option(mdb.TEXT) == "" {

View File

@ -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)) args := kit.Simple("node", "-e", kit.Join(_js_main_script(m, arg...), ice.NL))
m.Cmdy(cli.SYSTEM, args) 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.StatusTime("args", kit.Join([]string{"./bin/ice.bin", "web.code.js.js", "exec", path.Join(arg[2], arg[1])}, " "))
m.Debug(m.FormatsMeta())
return return
} }

View File

@ -38,7 +38,6 @@ func _publish_list(m *ice.Message, arg ...string) {
m.Option(nfs.DIR_ROOT, ice.USR_PUBLISH) m.Option(nfs.DIR_ROOT, ice.USR_PUBLISH)
m.Option(nfs.DIR_REG, kit.Select("", arg, 0)) m.Option(nfs.DIR_REG, kit.Select("", arg, 0))
m.Cmdy(nfs.DIR, nfs.PWD, kit.Select(nfs.DIR_WEB_FIELDS, arg, 1)) 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) { func _publish_bin_list(m *ice.Message, dir string) {
p := m.Option(cli.CMD_DIR, dir) p := m.Option(cli.CMD_DIR, dir)

View File

@ -87,13 +87,13 @@ func _webpack_cache(m *ice.Message, dir string, write bool) {
p := value[nfs.PATH] p := value[nfs.PATH]
switch kit.Ext(p) { switch kit.Ext(p) {
case nfs.CSS: 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 return
case nfs.JS: case nfs.JS:
default: default:
p = p + "/lib/" + p + ".js" 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) { func _webpack_build(m *ice.Message, file string) {

View File

@ -24,17 +24,17 @@ func _title_show(m *ice.Message, kind, text string, arg ...string) {
case NAVMENU: // 导航目录 case NAVMENU: // 导航目录
_option(m, kind, "", text, arg...) _option(m, kind, "", text, arg...)
data := _title_parse(m, path.Dir(m.Option(ice.MSG_SCRIPT)), text) 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 return
case PREMENU: // 前置目录 case PREMENU: // 前置目录
_option(m, kind, "", "", arg...) _option(m, kind, "", "", arg...)
m.RenderTemplate(m.Config(kind)) m.RenderTemplate(m.Config(kind), &Message{m})
return return
case ENDMENU: // 后置目录 case ENDMENU: // 后置目录
_option(m, kind, "", "", arg...) _option(m, kind, "", "", arg...)
m.RenderTemplate(m.Config(kind)) m.RenderTemplate(m.Config(kind), &Message{m})
return return
case SECTION: // 分节标题 case SECTION: // 分节标题