mirror of
https://shylinux.com/x/volcanos
synced 2025-04-28 18:02:02 +08:00
opt xterm
This commit is contained in:
parent
d7e011d898
commit
825dcefeb2
@ -1,15 +1,13 @@
|
|||||||
Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, target) {
|
Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, target) {
|
||||||
can.require(["/node_modules/xterm/lib/xterm.js", "/node_modules/xterm/css/xterm.css"], function() {
|
can.onmotion.clear(can), can.base.isFunc(cb) && cb(msg)
|
||||||
can.term = new Terminal();
|
can.page.style(can, html.HEIGHT, can.ConfHeight(), html.WIDTH, can.ConfWidth())
|
||||||
can.term.open(can._output)
|
can.require(["/node_modules/xterm/lib/xterm.js", "/node_modules/xterm/css/xterm.css"], function() {
|
||||||
can.term.write('Hello from \x1B[1;3;31mxterm.js\x1B[0m $ ')
|
can.term = new Terminal(), can.term.open(can._output), can.term.onData(function(val) {
|
||||||
can.term.onData(function(val) {
|
can.runAction(can.request({}, {"channel": can.Conf("channel")}), "input", [val], function() {})
|
||||||
can.runAction(can.request({}, {"channel": can.Conf("channel")}), "input", [val], function(msg) {
|
|
||||||
can.term.write(msg.Result())
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
},
|
||||||
}, grow: function(can, str) {
|
grow: function(can, str) {
|
||||||
can.term.write(str.replaceAll("\n", "\r\n"))
|
can.term.write(atob(str))
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user