1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-26 01:04:06 +08:00

add xterm.js

This commit is contained in:
IT 老营长 @云轩领航-创始人 2022-07-23 00:03:33 +08:00
parent 28a1a7604a
commit d7e011d898

View File

@ -0,0 +1,15 @@
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.term = new Terminal();
can.term.open(can._output)
can.term.write('Hello from \x1B[1;3;31mxterm.js\x1B[0m $ ')
can.term.onData(function(val) {
can.runAction(can.request({}, {"channel": can.Conf("channel")}), "input", [val], function(msg) {
can.term.write(msg.Result())
})
})
})
}, grow: function(can, str) {
can.term.write(str.replaceAll("\n", "\r\n"))
}
})