From b0e77165e10b88680596ec5feb092c6712767e7c Mon Sep 17 00:00:00 2001 From: shylinux Date: Wed, 18 Sep 2019 10:45:51 +0800 Subject: [PATCH] opt love --- src/contexts/cli/version.go | 2 +- src/contexts/ssh/ssh.go | 1 + src/contexts/web/web.go | 2 +- src/plugin/love/index.shy | 15 ++++++++++----- usr/librarys/chat.js | 5 ++++- usr/librarys/example.js | 2 +- 6 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/contexts/cli/version.go b/src/contexts/cli/version.go index b4bbdac6..dc83ef1a 100644 --- a/src/contexts/cli/version.go +++ b/src/contexts/cli/version.go @@ -4,5 +4,5 @@ var version = struct { host string self int }{ - "2019-09-17 20:58:54", "centos", 526, + "2019-09-18 07:48:00", "com", 527, } diff --git a/src/contexts/ssh/ssh.go b/src/contexts/ssh/ssh.go index 67487895..1ae93c00 100644 --- a/src/contexts/ssh/ssh.go +++ b/src/contexts/ssh/ssh.go @@ -369,6 +369,7 @@ var Index = &ctx.Context{Name: "ssh", Help: "集群中心", default: m.Confm("componet", arg[0:], func(value map[string]interface{}) { if kit.Format(value["type"]) == "private" && m.Option("userrole") != "root" { + m.Log("warn", "%v private", arg) return } diff --git a/src/contexts/web/web.go b/src/contexts/web/web.go index cac5afd5..24dfc8d7 100644 --- a/src/contexts/web/web.go +++ b/src/contexts/web/web.go @@ -112,7 +112,7 @@ func (web *WEB) Login(msg *ctx.Message, w http.ResponseWriter, r *http.Request) } else if msg.Options("relay") { relay := msg.Cmd("aaa.relay", "check", msg.Option("relay")) - if relay.Appendi("count") < 1 { + if relay.Appendi("count") == 0 { msg.Err("共享失效") return false } diff --git a/src/plugin/love/index.shy b/src/plugin/love/index.shy index e080ae22..aab5afb1 100644 --- a/src/plugin/love/index.shy +++ b/src/plugin/love/index.shy @@ -1,4 +1,9 @@ -fun meet "第一眼" public \ +kit imports "导入" "" "" private "ssh.data" "import" \ + text "love" name table \ + text "" name file \ + button "导入" + +fun meets "第一眼" private \ text "love" name table imports plugin_table \ text "date" name when \ text "" name where \ @@ -11,7 +16,7 @@ fun meet "第一眼" public \ copy ssh.data insert _ when _ where __ end -kit imports "导入" "" "" private "ssh.data" "import" \ - text "love" name table \ - text "" name file \ - button "导入" +fun meet "第一眼" protected "ssh.data" show \ + text "love" name table imports plugin_table \ + button "查看" action auto + diff --git a/usr/librarys/chat.js b/usr/librarys/chat.js index 8ed2b829..1af99b15 100644 --- a/usr/librarys/chat.js +++ b/usr/librarys/chat.js @@ -496,7 +496,10 @@ var page = Page({check: true, page.steam.Pane.Show() }, "共享": function(event) { - page.login.Pane.Run(["relay", "storm", "username", kit.prompt("分享给用户"), "url", ctx.Share({ + var user = kit.prompt("分享给用户") + if (user == null) {return} + + page.login.Pane.Run(["relay", "storm", "username", user, "url", ctx.Share({ "river": page.river.Pane.which.get(), "storm": page.storm.Pane.which.get(), "layout": page.action.Pane.Layout(), diff --git a/usr/librarys/example.js b/usr/librarys/example.js index 77fdc0aa..bcd7d315 100644 --- a/usr/librarys/example.js +++ b/usr/librarys/example.js @@ -564,7 +564,7 @@ function Pane(page, field) { list.push(ui.last), field.scrollBy(0, field.scrollHeight+100) key && key.length > 0 && (member[line[which]] = member[line[key[0]]] = {index:index, key:line[which]}); - (type == "plugin" || type == "field") && pane.Plugin(page, pane, ui.field, function(event, cmds, cbs) { + line.name && (type == "plugin" || type == "field") && pane.Plugin(page, pane, ui.field, function(event, cmds, cbs) { typeof cb == "function" && cb(line, index, event, cmds, cbs) }) return ui