From 60f81b5d51c8916aee76b34769d803dbe08151eb Mon Sep 17 00:00:00 2001 From: shy Date: Tue, 7 Nov 2023 09:30:14 +0800 Subject: [PATCH] add some --- const.js | 12 +++++------- panel/footer.js | 4 ++-- plugin/local/code/inner.js | 3 ++- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/const.js b/const.js index b39a3bab..b8d4b9c5 100644 --- a/const.js +++ b/const.js @@ -44,7 +44,7 @@ var ice = { MSG_DAEMON: "sess.daemon", LOG_DISABLE: "log.disable", LOG_TRACEID: "log.id", ErrWarn: "warn: ", ErrNotLogin: "not login: ", ErrNotRight: "not right: ", ErrNotValid: "not valid: ", ErrNotFound: "not found: ", - NFS: "nfs", USR: "usr", USR_VOLCANOS: "usr/volcanos/", CAN_PLUGIN: "can._plugin", + NFS: "nfs", USR: "usr", CAN_PLUGIN: "can._plugin", } var ctx = { @@ -128,13 +128,10 @@ var nfs = { DIR: "dir", CAT: "cat", DEFS: "defs", PACK: "pack", TRASH: "trash", DIR_ROOT: "dir_root", COPY: "copy", EDIT: "edit", SAVE: "save", LOAD: "load", FIND: "find", GREP: "grep", TAGS: "tags", SUBJECT: "subject", CONTENT: "content", RECENT: "recent", SCRIPT: "script", SOURCE: "source", TARGET: "target", - REPOS: "repos", - IMAGE: "image", + REPOS: "repos", IMAGE: "image", MODULE: "module", SCRIPT: "script", - BINARY: "binary", - VERSION: "version", - TEMPLATE: "template", - BRANCH: "branch", MASTER: "master", + BRANCH: "branch", VERSION: "version", + TEMPLATE: "template", BINARY: "binary", PUSH: "push", PULL: "pull", PATH: "path", FILE: "file", LINE: "line", SIZE: "size", REPLACE: "replace", FROM: "from", TO: "to", @@ -142,6 +139,7 @@ var nfs = { TXT: "txt", PNG: "png", WEBM: "webm", _CSS: ".css", _JS: ".js", PWD: "./", SRC: "src/", USR: "usr/", USR_LOCAL_WORK: "usr/local/work/", SRC_DOCUMENT: "src/document/", SRC_TEMPLATE: "src/template/", + USR_ICONS: "usr/icons/", USR_GEOAREA: "usr/geoarea/", USR_VOLCANOS: "usr/volcanos/", DF: ice.DF, PS: ice.PS, PT: ice.PT, } var cli = { diff --git a/panel/footer.js b/panel/footer.js index af98c803..7520ee30 100644 --- a/panel/footer.js +++ b/panel/footer.js @@ -94,9 +94,9 @@ Volcanos(chat.ONPLUGIN, { {type: html.TD, list: can.core.List(list, function(item, index) { var vimer if (index == 1) { var _ls = /(https*:\/\/[^/]+)\/*([^:]+):([0-9]+):([0-9]+)/.exec(list[1]); _ls[2] = _ls[2].split(ice.QS)[0] return {view: [html.ITEM, html.SPAN], list: [{text: lex.SP+can.page.unicode.close+lex.SP}, {text: [(_ls[1] == location.origin? "": _ls[1])+_ls[2]+nfs.DF+_ls[3], "", nfs.PATH], onclick: function(event) { - if (can.onexport.record(can, list[1], mdb.LINK, {time: list[0], link: list[1], type: list[2], path: ice.USR_VOLCANOS, file: _ls[2], line: _ls[3]})) { return } + if (can.onexport.record(can, list[1], mdb.LINK, {time: list[0], link: list[1], type: list[2], path: nfs.USR_VOLCANOS, file: _ls[2], line: _ls[3]})) { return } if (vimer) { return can.page.Remove(can, vimer._target), vimer = null } - vimer = can.onappend.plugin(_can, {index: web.CODE_INNER, args: [ice.USR_VOLCANOS, _ls[2], _ls[3]]}, function(sub) {}, event.target.parentNode) + vimer = can.onappend.plugin(_can, {index: web.CODE_INNER, args: [nfs.USR_VOLCANOS, _ls[2], _ls[3]]}, function(sub) {}, event.target.parentNode) }}]} } if (!can.base.isObject(item)) { return item && {text: (index > 0? lex.SP: "")+item} } return {view: [mdb.DATA, html.SPAN], _init: function(target) { diff --git a/plugin/local/code/inner.js b/plugin/local/code/inner.js index c0721bcc..2c1e4f32 100644 --- a/plugin/local/code/inner.js +++ b/plugin/local/code/inner.js @@ -8,7 +8,8 @@ const VIEW_CREATE = "tabview.view.create", VIEW_REMOVE = "tabview.view.remove", Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { var paths = can.core.Split(can.Option(nfs.PATH), mdb.FS); can.Option(nfs.PATH, paths[0]) can.Mode(msg.Option("mode")||can.Mode()), can.Option(nfs.FILE) == " " && can.Option(nfs.FILE, "") if (can.Mode() == ice.MSG_RESULT) { msg.result = msg.result||[can._output.innerHTML], can.Mode(chat.SIMPLE), can.sup.Mode(chat.SIMPLE) } - can.core.List(paths.concat(can.core.Split(msg.Option(nfs.REPOS))), function(p) { if (can.base.beginWith(p, nfs.USR_LOCAL_WORK) || can.base.endWith(p, "-dict/")) { return } + can.core.List(paths.concat(can.core.Split(msg.Option(nfs.REPOS))), function(p) { + if (can.base.beginWith(p, nfs.USR_LOCAL_WORK) || can.base.endWith(p, "-dict/") || can.base.isIn(p, nfs.USR_ICONS, nfs.USR_GEOAREA)) { return } if (p && paths.indexOf(p) == -1 && p[0] != nfs.PS) { paths.push(p) } }), can.onmotion.clear(can), can.onappend.style(can, code.INNER), can.sup.onimport._process = function(_can, msg) { if (msg.OptionProcess() == ice.PROCESS_REWRITE) {