From c6a9235274dce35341d1931edfc4444e295d46e5 Mon Sep 17 00:00:00 2001 From: harveyshao Date: Thu, 7 Oct 2021 21:19:41 +0800 Subject: [PATCH] opt some --- lib/user.js | 2 +- page/index.css | 6 +++++- page/index.js | 11 ++++++----- plugin/input/key.js | 25 +++++++++++++++++-------- plugin/state.js | 6 ++++++ 5 files changed, 35 insertions(+), 15 deletions(-) diff --git a/lib/user.js b/lib/user.js index 17d18769..bb1db262 100644 --- a/lib/user.js +++ b/lib/user.js @@ -63,7 +63,7 @@ Volcanos("user", {help: "用户操作", agent: { "begin": "启动", "end": "结束", "list": "查看", "back": "返回", "run": "执行", "refresh": "刷新", - "share": "共享", + "share": "共享", "clear": "清空", }[text] || text }, toast: function(can, content, title, duration, progress) { diff --git a/page/index.css b/page/index.css index 144bbd2e..27657965 100644 --- a/page/index.css +++ b/page/index.css @@ -237,7 +237,7 @@ fieldset>div.status>div.item { height:18px; } fieldset>div.status>div.item>label { - font-size:10px; color:#504242e0; + font-size:10px; color:#bdb8b8e0; } fieldset>div.output { @@ -488,6 +488,10 @@ body.white table input[type=button][value=启动] { background:#52ce78; } +body.white fieldset>div.status>div.item>label { + font-size:10px; color:#504242e0; +} + body.white fieldset.Action { color:black; } diff --git a/page/index.js b/page/index.js index e72d0434..f0ca6d3f 100644 --- a/page/index.js +++ b/page/index.js @@ -82,6 +82,7 @@ Volcanos({name: "chat", iceberg: "/chat/", volcano: "/frame.js", {name: "idc", help: "平台", index: "web.wiki.word", args: ["usr/linux-story/idc/idc.shy"]}, {name: "iso", help: "系统", index: "web.wiki.word", args: ["usr/linux-story/iso/iso.shy"]}, {name: "iot", help: "设备", index: "web.wiki.word", args: ["usr/linux-story/iot/iot.shy"]}, + {name: "cli", help: "命令", index: "web.wiki.word", args: ["usr/linux-story/cli/cli.shy"]}, {name: "linux", help: "系统", index: "web.wiki.word", args: ["usr/linux-story/src/main.shy"]}, ]}, nginx: {name: "代理 nginx", action: [ @@ -94,7 +95,7 @@ Volcanos({name: "chat", iceberg: "/chat/", volcano: "/frame.js", {name: "redis", help: "缓存", index: "web.wiki.word", args: ["usr/redis-story/src/main.shy"]}, {name: "kafka", help: "队列", index: "web.wiki.word", args: ["usr/redis-story/src/kafka/kafka.shy"]}, ]}, - mysql: {name: "数据 mysql", action: [ + mysql: {name: "存储 mysql", action: [ {name: "mysql", help: "数据存储", index: "web.wiki.word", args: ["usr/mysql-story/src/main.shy"]}, {name: "clickhouse", help: "数据存储", index: "web.wiki.word", args: ["usr/mysql-story/src/clickhouse/clickhouse.shy"]}, ]}, @@ -109,14 +110,14 @@ Volcanos({name: "chat", iceberg: "/chat/", volcano: "/frame.js", ]}, }}, operate: {name: "运维群", storm: { - cli: {name: "系统 cli", index: [ - "qrcode", "daemon", "system", "runtime", + aaa: {name: "权限 aaa", index: [ + "user", "sess", "role", "totp", ]}, web: {name: "应用 web", index: [ "spide", "route", "share", "dream", ]}, - aaa: {name: "权限 aaa", index: [ - "user", "sess", "role", "totp", + cli: {name: "系统 cli", index: [ + "qrcode", "daemon", "system", "runtime", ]}, nfs: {name: "文件 nfs", index: [ "cat", "dir", "tail", "trash", diff --git a/plugin/input/key.js b/plugin/input/key.js index a0514ce3..768d3f5e 100644 --- a/plugin/input/key.js +++ b/plugin/input/key.js @@ -2,16 +2,25 @@ Volcanos("onfigure", {help: "控件详情", list: [], key: {onclick: function(ev can.run(event, [ctx.ACTION, "inputs", meta.name, target.value], function(msg) { if (msg.Length() == 0) { return can.page.Remove(can, can._target) } - can.onappend._action(can, ["关闭", "清空"], can._action, { - "关闭": function(event) { can.page.Remove(can, can._target) }, - "清空": function(event) { target.value = "" }, + can.onappend._action(can, ["close", "clear"], can._action, { + "close": function(event) { can.page.Remove(can, can._target) }, + "clear": function(event) { target.value = "" }, }) - can.onappend.table(can, msg, function(value, key, index, line) { - return {text: [value, "td"], onclick: function() { - target.value = line[key], can.page.Remove(can, can._target) - }} - }), can.Status("count", msg.Length()) + function show(msg) { + can.onmotion.clear(can) + can.onappend.table(can, msg, function(value, key, index, line) { + return {text: [value, "td"], onclick: function() { + target.value = line[key] + msg.Option("_process") == "_again"? can.run({}, [ctx.ACTION, "inputs", meta.name, target.value], function(msg) { + show(msg) + }): can.page.Remove(can, can._target) + + }} + }), can.Status("count", msg.Length()) + } + show(msg) + can.onlayout.figure(event, can) }) }}}) diff --git a/plugin/state.js b/plugin/state.js index 9188aed0..80ffdc2f 100644 --- a/plugin/state.js +++ b/plugin/state.js @@ -173,6 +173,12 @@ Volcanos("onaction", {help: "交互操作", list: [ }) }, + next: function(event, can) { + can.Update(event, [ctx.ACTION, "next", can.Status("total")||0, can.Option("limit"), can.Option("offend")]) + }, + prev: function(event, can) { + can.Update(event, [ctx.ACTION, "prev", can.Status("total")||0, can.Option("limit"), can.Option("offend")]) + }, change: function(event, can, name, value, cb) { return can.page.Select(can, can._option, "input.args", function(input) { if (input.name == name && value != input.value) { input.value = value