mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 16:58:06 +08:00
add some
This commit is contained in:
parent
81935e42a5
commit
347e43f2b4
3
const.js
3
const.js
@ -74,6 +74,7 @@ var mdb = {FOREACH: "*", RANDOMS: "%",
|
|||||||
ORDER: "order", WEIGHT: "weight",
|
ORDER: "order", WEIGHT: "weight",
|
||||||
ENABLE: "enable", DISABLE: "disable",
|
ENABLE: "enable", DISABLE: "disable",
|
||||||
RENAME: "rename",
|
RENAME: "rename",
|
||||||
|
NICK: "nick",
|
||||||
DATA: "data", VIEW: "view",
|
DATA: "data", VIEW: "view",
|
||||||
INPUTS: "inputs", CREATE: "create", REMOVE: "remove", UPDATE: "update",
|
INPUTS: "inputs", CREATE: "create", REMOVE: "remove", UPDATE: "update",
|
||||||
INSERT: "insert", DELETE: "delete", MODIFY: "modify", SELECT: "select",
|
INSERT: "insert", DELETE: "delete", MODIFY: "modify", SELECT: "select",
|
||||||
@ -141,6 +142,7 @@ var aaa = {
|
|||||||
PROVINCE: "province", COUNTRY: "country", CITY: "city",
|
PROVINCE: "province", COUNTRY: "country", CITY: "city",
|
||||||
LONGITUDE: "longitude", LATITUDE: "latitude",
|
LONGITUDE: "longitude", LATITUDE: "latitude",
|
||||||
IP: "ip", UA: "ua",
|
IP: "ip", UA: "ua",
|
||||||
|
LOCATION: "location",
|
||||||
|
|
||||||
USERNICK: "usernick", USERNAME: "username", PASSWORD: "password", USERROLE: "userrole", USERZONE: "userzone",
|
USERNICK: "usernick", USERNAME: "username", PASSWORD: "password", USERROLE: "userrole", USERZONE: "userzone",
|
||||||
VOID: "void", TECH: "tech", ROOT: "root",
|
VOID: "void", TECH: "tech", ROOT: "root",
|
||||||
@ -435,6 +437,7 @@ var icon = {
|
|||||||
more: "bi bi-three-dots-vertical", actions: "bi bi-three-dots",
|
more: "bi bi-three-dots-vertical", actions: "bi bi-three-dots",
|
||||||
search: "bi bi-search", favor: "bi bi-star",
|
search: "bi bi-search", favor: "bi bi-star",
|
||||||
plugs: "bi bi-tools",
|
plugs: "bi bi-tools",
|
||||||
|
tools: "bi bi-grid",
|
||||||
|
|
||||||
key: "bi bi-hash", hash: "bi bi-hash", zone: "bi bi-diagram-3", id: "bi bi-sort-numeric-down",
|
key: "bi bi-hash", hash: "bi bi-hash", zone: "bi bi-diagram-3", id: "bi bi-sort-numeric-down",
|
||||||
modify: "bi bi-pencil-square", rename: "bi bi-pencil-square", remove: "bi bi-trash",
|
modify: "bi bi-pencil-square", rename: "bi bi-pencil-square", remove: "bi bi-trash",
|
||||||
|
32
frame.js
32
frame.js
@ -332,11 +332,16 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
|||||||
can.onexport._output(sub, msg), sub.Mode() != ice.MSG_RESULT && can.onmotion.clear(can, output)
|
can.onexport._output(sub, msg), sub.Mode() != ice.MSG_RESULT && can.onmotion.clear(can, output)
|
||||||
can.core.CallFunc([sub, chat.ONIMPORT, chat._INIT], {can: sub, msg: msg, cb: function(msg) {
|
can.core.CallFunc([sub, chat.ONIMPORT, chat._INIT], {can: sub, msg: msg, cb: function(msg) {
|
||||||
if (action !== false) { can.onkeymap._build(sub)
|
if (action !== false) { can.onkeymap._build(sub)
|
||||||
can.onmotion.clear(can, can._action), sub.onappend._action(sub, can.Conf(ice.MSG_ACTION)||msg.Option(ice.MSG_ACTION), action||can._action)
|
var list = can.base.Obj(msg.Option(ice.MSG_ACTION)||can.Conf(ice.MSG_ACTION), [])||[]
|
||||||
|
can.onmotion.clear(can, can._action), sub.onappend._action(sub, list, action||can._action)
|
||||||
sub.onappend._status(sub, sub.onexport&&sub.onexport.list||msg.Option(ice.MSG_STATUS), null, msg), can.user.isMobile || sub.onappend.tools(sub, msg)
|
sub.onappend._status(sub, sub.onexport&&sub.onexport.list||msg.Option(ice.MSG_STATUS), null, msg), can.user.isMobile || sub.onappend.tools(sub, msg)
|
||||||
can.core.Item(can.Action(), function(key) {
|
can.core.Item(can.Action(), function(key) { var value = can.misc.sessionStorage(can, [can.ConfIndex(), ctx.ACTION, key]); value && can.Action(key, msg.Option(key)||value[0]) })
|
||||||
var value = can.misc.sessionStorage(can, [can.ConfIndex(), ctx.ACTION, key]); value && can.Action(key, msg.Option(key)||value[0]) })
|
|
||||||
if (msg.Option("sess.online") == ice.TRUE) { can.ondaemon._online(can) }
|
if (msg.Option("sess.online") == ice.TRUE) { can.ondaemon._online(can) }
|
||||||
|
if (msg.Length() > 9 && !sub.ui.project) { can.onmotion.delay(can, function() {
|
||||||
|
can.page.insertBefore(can, [
|
||||||
|
{view:[[html.ITEM, html.TEXT, html.FILTER, "state"]], _init: function(target) { can.onappend.filter(can, target, can._output) }}
|
||||||
|
], (can.page.SelectOne(can, can._action, "div.item._space")||{}).nextSibling, can._action)
|
||||||
|
}, 300) }
|
||||||
} can.onappend.style(sub, sub.Conf(ctx.STYLE)), can.onmotion.story.auto(can, can._output)
|
} can.onappend.style(sub, sub.Conf(ctx.STYLE)), can.onmotion.story.auto(can, can._output)
|
||||||
if (can.onimport.size) {
|
if (can.onimport.size) {
|
||||||
can.page.ClassList.has(can, can._target, html.FLOAT) && !can.page.ClassList.has(can, can._target, html.PLUG)?
|
can.page.ClassList.has(can, can._target, html.FLOAT) && !can.page.ClassList.has(can, can._target, html.PLUG)?
|
||||||
@ -476,14 +481,18 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
|||||||
},
|
},
|
||||||
filter: function(can, target, output) { output = output||target
|
filter: function(can, target, output) { output = output||target
|
||||||
return can.onappend.input(can, {type: html.TEXT, name: web.FILTER, icon: icon.SEARCH, placeholder: "search in n items", onkeydown: function() {}, onkeyup: function(event) {
|
return can.onappend.input(can, {type: html.TEXT, name: web.FILTER, icon: icon.SEARCH, placeholder: "search in n items", onkeydown: function() {}, onkeyup: function(event) {
|
||||||
|
var value = event.currentTarget? event.currentTarget.value: ""
|
||||||
if (event.key == code.ENTER) {
|
if (event.key == code.ENTER) {
|
||||||
can.page.Select(can, output, html.DIV_ITEM+":not(.hide)", function(target) { target.click() })
|
can.page.Select(can, output, html.DIV_ITEM+":not(.hide)", function(target) { target.click() })
|
||||||
} else if (event.key == code.ESCAPE) { event.currentTarget.value = "", event.currentTarget.blur()
|
} else if (event.key == code.ESCAPE) { event.currentTarget.value = "", event.currentTarget.blur()
|
||||||
can.page.Select(can, output, html.DIV_ITEM, function(target) { can.onmotion.toggle(can, target, true) })
|
can.page.Select(can, output, html.DIV_ITEM, function(target) { can.onmotion.toggle(can, target, true) })
|
||||||
} else { if (can.onkeymap.selectCtrlN(event, can, output, html.DIV_ITEM+":not(.filter):not(.hide)")) { return }
|
} else { if (can.onkeymap.selectCtrlN(event, can, output, html.DIV_ITEM+":not(.filter):not(.hide)")) { return }
|
||||||
can.page.Select(can, output, html.DIV_ITEM, function(target) {
|
can.page.Select(can, output, html.DIV_ITEM, function(target) {
|
||||||
can.onmotion.toggle(can, target, target.innerText.indexOf(event.currentTarget.value) > -1 || target == event.currentTarget.parentNode)
|
can.onmotion.toggle(can, target, target.innerText.indexOf(value) > -1 || target == event.currentTarget.parentNode)
|
||||||
})
|
})
|
||||||
|
can.page.Select(can, output, html.TR, function(tr, index) {
|
||||||
|
if (!can.page.ClassList.set(can, tr, html.HIDE, index > 0 && tr.innerText.indexOf(value) == -1)) { return tr }
|
||||||
|
}).length
|
||||||
}
|
}
|
||||||
}}, "", target)
|
}}, "", target)
|
||||||
},
|
},
|
||||||
@ -556,7 +565,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
|||||||
function run(event, cmd, arg) { can.misc.Event(event, can, function(msg) { can.run(request(event), [ctx.ACTION, cmd].concat(arg)) }) }
|
function run(event, cmd, arg) { can.misc.Event(event, can, function(msg) { can.run(request(event), [ctx.ACTION, cmd].concat(arg)) }) }
|
||||||
function img(p) { return !msg.IsDetail()? can.page.Format(html.IMG, p, 48, 48): can.user.isMobile? can.page.Format(html.IMG, p, null, 320): can.page.Format(html.IMG, p, 320, null) }
|
function img(p) { return !msg.IsDetail()? can.page.Format(html.IMG, p, 48, 48): can.user.isMobile? can.page.Format(html.IMG, p, null, 320): can.page.Format(html.IMG, p, 320, null) }
|
||||||
// if (key == mdb.NAME && value) { _value = can.user.trans(can, value, null, html.INPUT) }
|
// if (key == mdb.NAME && value) { _value = can.user.trans(can, value, null, html.INPUT) }
|
||||||
if (key == mdb.ICON && value) { _value = img(can.misc.Resource(can, data[key], data[ice.POD]||data[web.SPACE])) }
|
if (key == mdb.ICON && value) { _value = can.base.contains(value, ".ico", ".png", ".jpg")? img(can.misc.Resource(can, data[key], data[ice.POD]||data[web.SPACE])): `<i class="${value}"></i>` }
|
||||||
if (key == mdb.ICONS && value) { _value = img(can.misc.Resource(can, data[key])) }
|
if (key == mdb.ICONS && value) { _value = img(can.misc.Resource(can, data[key])) }
|
||||||
if (key == nfs.IMAGE && value) { _value = can.core.List(can.core.Split(data[key]), function(item) { return img(can.misc.ShareCache(can, item, data.space)) }).join("") }
|
if (key == nfs.IMAGE && value) { _value = can.core.List(can.core.Split(data[key]), function(item) { return img(can.misc.ShareCache(can, item, data.space)) }).join("") }
|
||||||
if (key == web.SPACE && value) { _value = can.page.Format(html.A, can.misc.MergePodCmd(can, {pod: value}), value) }
|
if (key == web.SPACE && value) { _value = can.page.Format(html.A, can.misc.MergePodCmd(can, {pod: value}), value) }
|
||||||
@ -565,6 +574,15 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
|||||||
if (key == "secretKey" && value) { _value = value.slice(0, 4)+"****" }
|
if (key == "secretKey" && value) { _value = value.slice(0, 4)+"****" }
|
||||||
if (key == aaa.PASSWORD && value) { _value = "********" }
|
if (key == aaa.PASSWORD && value) { _value = "********" }
|
||||||
function onclick() { return false }
|
function onclick() { return false }
|
||||||
|
if (key == "enable") {
|
||||||
|
if (value == ice.TRUE) {
|
||||||
|
_value = `<i class="${icon.disable}">`
|
||||||
|
function onclick() { run(event, mdb.MODIFY, [key, ice.FALSE]); return true }
|
||||||
|
} else {
|
||||||
|
_value = `<i class="${icon.enable}">`
|
||||||
|
function onclick() { run(event, mdb.MODIFY, [key, ice.TRUE]); return true }
|
||||||
|
}
|
||||||
|
}
|
||||||
if (key == mdb.STATUS && can.base.isIn(value, mdb.DISABLE, ice.FALSE)) { _value = `<i class="${icon.enable}">`
|
if (key == mdb.STATUS && can.base.isIn(value, mdb.DISABLE, ice.FALSE)) { _value = `<i class="${icon.enable}">`
|
||||||
function onclick() { run(event, mdb.MODIFY, [mdb.STATUS, mdb.ENABLE]); return true }
|
function onclick() { run(event, mdb.MODIFY, [mdb.STATUS, mdb.ENABLE]); return true }
|
||||||
}
|
}
|
||||||
@ -591,6 +609,8 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
|||||||
can.page.SelectChild(can, can._option, html.DIV_ITEM_TEXT, function(target) { can.page.ClassList.set(can, target, "will", can.page.ClassList.has(can, target, key)) })
|
can.page.SelectChild(can, can._option, html.DIV_ITEM_TEXT, function(target) { can.page.ClassList.set(can, target, "will", can.page.ClassList.has(can, target, key)) })
|
||||||
}, _init: function(target) {
|
}, _init: function(target) {
|
||||||
if (key == mdb.TYPE) { can.onappend.style(can, value, target.parentNode) }
|
if (key == mdb.TYPE) { can.onappend.style(can, value, target.parentNode) }
|
||||||
|
if (key == mdb.STATUS) { can.onappend.style(can, value, target.parentNode) }
|
||||||
|
if (key == mdb.ENABLE) { can.onappend.style(can, value == ice.TRUE? mdb.ENABLE: mdb.DISABLE, target.parentNode) }
|
||||||
if (key == ctx.ACTION && msg.IsDetail()) { can.onappend.style(can, ctx.ACTION, target.parentNode) }
|
if (key == ctx.ACTION && msg.IsDetail()) { can.onappend.style(can, ctx.ACTION, target.parentNode) }
|
||||||
key == ctx.ACTION && can.onappend.mores(can, target, data, msg.IsDetail()? 20: html.TABLE_BUTTON)
|
key == ctx.ACTION && can.onappend.mores(can, target, data, msg.IsDetail()? 20: html.TABLE_BUTTON)
|
||||||
var list = can.page.Select(can, target, html.INPUT, function(target) {
|
var list = can.page.Select(can, target, html.INPUT, function(target) {
|
||||||
@ -1054,7 +1074,7 @@ Volcanos(chat.ONMOTION, {_init: function(can, target) {
|
|||||||
}, target.click()
|
}, target.click()
|
||||||
},
|
},
|
||||||
clear: function(can, target) { return can.page.Modify(can, target||can._output, ""), target },
|
clear: function(can, target) { return can.page.Modify(can, target||can._output, ""), target },
|
||||||
filter: function(can, value) {
|
filter: function(can, value, target) { target = target||can._output
|
||||||
can.onmotion.delayOnce(can, function() {
|
can.onmotion.delayOnce(can, function() {
|
||||||
var count = can.page.Select(can, can._output, html.TR, function(tr, index) {
|
var count = can.page.Select(can, can._output, html.TR, function(tr, index) {
|
||||||
if (!can.page.ClassList.set(can, tr, html.HIDE, index > 0 && tr.innerText.indexOf(value) == -1)) { return tr }
|
if (!can.page.ClassList.set(can, tr, html.HIDE, index > 0 && tr.innerText.indexOf(value) == -1)) { return tr }
|
||||||
|
@ -193,6 +193,8 @@ body.en span[lang^=zh] { display:none; } body.zh span[lang^=en] { display:none;
|
|||||||
// fieldset.plugin.cmd { display:flex; flex-wrap:wrap; justify-content:space-between; }
|
// fieldset.plugin.cmd { display:flex; flex-wrap:wrap; justify-content:space-between; }
|
||||||
fieldset.plugin.cmd:not(.output)>form.option { float:left; display:flex !important; }
|
fieldset.plugin.cmd:not(.output)>form.option { float:left; display:flex !important; }
|
||||||
fieldset.plugin.cmd:not(.output)>div.action { float:left; display:flex !important; flex-grow:1; height:var(--action-height); overflow:auto; }
|
fieldset.plugin.cmd:not(.output)>div.action { float:left; display:flex !important; flex-grow:1; height:var(--action-height); overflow:auto; }
|
||||||
|
fieldset.plugin.cmd:not(.output)>div.action div.tabs:last-child { margin-right:var(--button-margin); }
|
||||||
|
fieldset.plugin.cmd:not(.output)>div.action div.tabs:first-child { margin-left:var(--button-margin); }
|
||||||
fieldset.plugin.cmd:not(.output)>div.action div.tabs.select { padding-top:2px; }
|
fieldset.plugin.cmd:not(.output)>div.action div.tabs.select { padding-top:2px; }
|
||||||
fieldset.plugin.cmd:not(.output)>div.action div.tabs>span.name { overflow:hidden; }
|
fieldset.plugin.cmd:not(.output)>div.action div.tabs>span.name { overflow:hidden; }
|
||||||
fieldset.plugin.cmd:not(.output)>div.header { float:right; display:flex !important; flex-direction:row-reverse; }
|
fieldset.plugin.cmd:not(.output)>div.header { float:right; display:flex !important; flex-direction:row-reverse; }
|
||||||
@ -219,7 +221,7 @@ div.project div.item:not(.hide) {
|
|||||||
div.project div.item img { height:var(--action-height); width:var(--action-height); }
|
div.project div.item img { height:var(--action-height); width:var(--action-height); }
|
||||||
div.project div.item img { margin:0; }
|
div.project div.item img { margin:0; }
|
||||||
div.project div.item:not(:hover) input:not([type=button]) { border-right:0; }
|
div.project div.item:not(:hover) input:not([type=button]) { border-right:0; }
|
||||||
div.project div.item.filter { padding:0; width:100%; position:sticky; top:0; }
|
div.project div.item.filter { background-color:var(--plugin-bg-color); padding:0; width:100%; position:sticky; top:0; z-index:1; }
|
||||||
div.project div.item.filter>input { padding:0 25px; width:100% !important; }
|
div.project div.item.filter>input { padding:0 25px; width:100% !important; }
|
||||||
div.project div.item.search { padding:0; width:100%; }
|
div.project div.item.search { padding:0; width:100%; }
|
||||||
div.project div.item.search>input { padding:0 25px; width:100%; }
|
div.project div.item.search>input { padding:0 25px; width:100%; }
|
||||||
@ -619,6 +621,8 @@ fieldset>form.option>div.item.text.cmd>input { width:100%; }
|
|||||||
fieldset>form.option>div.item.select>input { min-width:var(--button-width); }
|
fieldset>form.option>div.item.select>input { min-width:var(--button-width); }
|
||||||
fieldset>form.option>div.item.textarea { height:var(--textarea-height); width:100%; }
|
fieldset>form.option>div.item.textarea { height:var(--textarea-height); width:100%; }
|
||||||
fieldset>div.action div.item.filter input { padding-left:24px; }
|
fieldset>div.action div.item.filter input { padding-left:24px; }
|
||||||
|
fieldset>div.action div.item.state.filter input { width:120px; transition:all 0.8s; }
|
||||||
|
fieldset>div.action div.item.state.filter input:focus { width:240px; transition:all 0.5s; }
|
||||||
fieldset>div.action div.item { height:var(--action-height); }
|
fieldset>div.action div.item { height:var(--action-height); }
|
||||||
fieldset>div.action>div.tabs { font-style:italic; padding:var(--input-padding) var(--button-padding); height:var(--action-height); }
|
fieldset>div.action>div.tabs { font-style:italic; padding:var(--input-padding) var(--button-padding); height:var(--action-height); }
|
||||||
fieldset>div.action>div.cmds { font-style:italic; padding:var(--input-padding) var(--button-padding); height:var(--action-height);
|
fieldset>div.action>div.cmds { font-style:italic; padding:var(--input-padding) var(--button-padding); height:var(--action-height);
|
||||||
|
@ -111,8 +111,9 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target, cb) {
|
|||||||
_item: function(can, item, cb, cbs) {
|
_item: function(can, item, cb, cbs) {
|
||||||
return {view: [[html.ITEM, item.type, item.role, item.status]], title: item.title||item.nick, list: [
|
return {view: [[html.ITEM, item.type, item.role, item.status]], title: item.title||item.nick, list: [
|
||||||
can.onimport._icons(can, item), can.onimport._nick(can, item),
|
can.onimport._icons(can, item), can.onimport._nick(can, item),
|
||||||
|
].concat(item._label||[], [
|
||||||
item.action && {icon: "bi bi-three-dots", onclick: function(event) { can.onimport._menu(event, can, item, cbs) }},
|
item.action && {icon: "bi bi-three-dots", onclick: function(event) { can.onimport._menu(event, can, item, cbs) }},
|
||||||
], _init: function(target) {
|
]), _init: function(target) {
|
||||||
item._select && can.onmotion.delay(can, function() { target.click() })
|
item._select && can.onmotion.delay(can, function() { target.click() })
|
||||||
}, onclick: function(event) {
|
}, onclick: function(event) {
|
||||||
cb(event)
|
cb(event)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user