Commit bcfe82f1 authored by ibuler's avatar ibuler

[Update] 优化错误颜色

parent 82af5f8f
......@@ -171,7 +171,7 @@ function initResultTerminal() {
cursorBlink: false,
screenKeys: false,
fontFamily: '"Monaco", "Consolas", "monospace"',
fontSize: 12,
fontSize: 13,
rightClickSelectsWord: true,
disableStdin: true,
theme: {
......@@ -182,6 +182,10 @@ function initResultTerminal() {
term.write("选择左侧资产, 选择运行的系统用户,批量执行命令\r\n")
}
function wrapperError(msg) {
return '\033[31m' + msg + '\033[0m' + '\r\n';
}
function execute() {
if (!term) {
initResultTerminal()
......@@ -192,6 +196,18 @@ function execute() {
var hosts = getSelectedAssetsNode().map(function (node) {
return node.id;
});
if (hosts.length === 0) {
term.write(wrapperError('没有选中资产'));
return
}
if (!command) {
term.write(wrapperError('没有输入命令'));
return
}
if (!run_as) {
term.write(wrapperError('没有选择运行用户'));
return
}
var data = {
hosts: hosts,
run_as: run_as,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment