mirror of
https://shylinux.com/x/ContextOS
synced 2025-04-26 09:14:06 +08:00
add plugin mind
This commit is contained in:
parent
8826185bc6
commit
6b6d1f3b8c
@ -4,5 +4,5 @@ var version = struct {
|
|||||||
host string
|
host string
|
||||||
self int
|
self int
|
||||||
}{
|
}{
|
||||||
"2019-09-10 21:10:24", "centos", 509,
|
"2019-09-10 22:40:18", "com.mac", 491,
|
||||||
}
|
}
|
||||||
|
@ -16,8 +16,8 @@ kit macro "脚本宏" "macro.js" public \
|
|||||||
|
|
||||||
kit sys "命令行" public "ssh._route" _ "nfs.source" \
|
kit sys "命令行" public "ssh._route" _ "nfs.source" \
|
||||||
text "" name pod imports plugin_pod \
|
text "" name pod imports plugin_pod \
|
||||||
textarea "" view long \
|
|
||||||
button "运行" \
|
button "运行" \
|
||||||
|
textarea "" view long \
|
||||||
exports mac name
|
exports mac name
|
||||||
|
|
||||||
fun salary "工资单" public \
|
fun salary "工资单" public \
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
|
|
||||||
{init: function(run, field, option, output) {
|
{init: function(run, field, option, output) {
|
||||||
var stop = false
|
|
||||||
return {
|
return {
|
||||||
ondaemon: {
|
ondaemon: {
|
||||||
table: function(msg, cb) {
|
table: function(msg, cb) {
|
||||||
if (stop) {return}
|
if (msg.event.type == "blur") {return}
|
||||||
var plugin = field.Plugin
|
var plugin = field.Plugin
|
||||||
output.innerHTML = "", msg.append && kit.OrderTable(kit.AppendTable(kit.AppendChild(output, "table"), ctx.Table(msg), msg.append), "", function(event, value, name, line, index) {
|
output.innerHTML = "", msg.append && kit.OrderTable(kit.AppendTable(kit.AppendChild(output, "table"), ctx.Table(msg), msg.append), "", function(event, value, name, line, index) {
|
||||||
if (name == "id") {
|
if (name == "id") {
|
||||||
@ -14,10 +12,8 @@
|
|||||||
function submit(event) {
|
function submit(event) {
|
||||||
td.innerText = event.target.value
|
td.innerText = event.target.value
|
||||||
if (event.target.value != value) {
|
if (event.target.value != value) {
|
||||||
stop = true
|
|
||||||
plugin.Run(event, [option.title.value, name, index-1, event.target.value], function() {
|
plugin.Run(event, [option.title.value, name, index-1, event.target.value], function() {
|
||||||
plugin.Check()
|
plugin.Check()
|
||||||
stop = false
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ ctx = context = {
|
|||||||
for (var k in dataset) {
|
for (var k in dataset) {
|
||||||
option[k] = dataset[k].split(",")
|
option[k] = dataset[k].split(",")
|
||||||
}
|
}
|
||||||
|
var event = window.event
|
||||||
kit.History.add("cmd", option)
|
kit.History.add("cmd", option)
|
||||||
this.GET("", option, function(msg) {
|
this.GET("", option, function(msg) {
|
||||||
msg[0] && (msg = msg[0])
|
msg[0] && (msg = msg[0])
|
||||||
@ -16,6 +17,7 @@ ctx = context = {
|
|||||||
s = kit.Color(s)
|
s = kit.Color(s)
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
msg.event = event
|
||||||
typeof cb == "function" && cb(msg || {})
|
typeof cb == "function" && cb(msg || {})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -703,7 +703,7 @@ function Plugin(page, pane, field, runs) {
|
|||||||
var exports = JSON.parse(meta.exports||'["",""]')
|
var exports = JSON.parse(meta.exports||'["",""]')
|
||||||
var deal = (feature && feature.display) || "table"
|
var deal = (feature && feature.display) || "table"
|
||||||
var history = []
|
var history = []
|
||||||
output.className = feature.style || "item"
|
output.className = (feature.style || "") + " output"
|
||||||
|
|
||||||
var plugin = Meta(field, (field.Script && field.Script.init || function() {
|
var plugin = Meta(field, (field.Script && field.Script.init || function() {
|
||||||
})(run, field, option, output)||{}, {
|
})(run, field, option, output)||{}, {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user