添加服务器ui调整
This commit is contained in:
@@ -272,20 +272,20 @@ func RemoteCommandJobByTelnetPassword(id int, name string, command string, serve
|
||||
|
||||
commandArr := strings.Split(command, "\n")
|
||||
|
||||
out := ""
|
||||
out, n := "", 0
|
||||
for _, c := range commandArr {
|
||||
_, err = conn.Write([]byte(c + "\r\n"))
|
||||
if err != nil {
|
||||
return "", "", err, false
|
||||
}
|
||||
|
||||
_, err = conn.Read(buf)
|
||||
n, err = conn.Read(buf)
|
||||
|
||||
out = out + gbkAsUtf8(string(buf[:]))
|
||||
out = out + gbkAsUtf8(string(buf[0:n]))
|
||||
if err != nil ||
|
||||
strings.Contains(out, "'"+c+"' is not recognized as an internal or external command") ||
|
||||
strings.Contains(out, "'"+c+"' 不是内部或外部命令,也不是可运行的程序") {
|
||||
return "", "", fmt.Errorf(gbkAsUtf8(string(buf[:]))), false
|
||||
return out, "", fmt.Errorf(gbkAsUtf8(string(buf[0:n]))), false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -71,8 +71,8 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label mw200">验证登录类型</label>
|
||||
<div class="layui-input-inline mw400">
|
||||
<input type="radio" name="type" lay-verify="type" value="0" title="密码" checked>
|
||||
<input type="radio" name="type" lay-verify="type" value="1" title="密钥" >
|
||||
<input type="radio" name="type" lay-verify="type" lay-filter="type" value="0" title="密码" checked>
|
||||
<input type="radio" name="type" lay-verify="type" lay-filter="type" value="1" title="密钥" >
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux"></div>
|
||||
</div>
|
||||
@@ -133,7 +133,7 @@
|
||||
})
|
||||
return;
|
||||
}
|
||||
form.on('radio', function(data){
|
||||
form.on('radio(type)', function(data){
|
||||
if(data.value==1){
|
||||
$(".key").show();
|
||||
$(".password").hide();
|
||||
|
||||
@@ -71,8 +71,8 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label mw200">验证登录类型</label>
|
||||
<div class="layui-input-inline mw400">
|
||||
<input type="radio" name="type" lay-verify="type" value="0" title="密码" {{if eq .server.type 0}}checked{{end}}>
|
||||
<input type="radio" name="type" lay-verify="type" value="1" title="密钥" {{if eq .server.type 1}}checked{{end}}>
|
||||
<input type="radio" name="type" lay-verify="type" lay-filter="type" value="0" title="密码" {{if eq .server.type 0}}checked{{end}}>
|
||||
<input type="radio" name="type" lay-verify="type" lay-filter="type" value="1" title="密钥" {{if eq .server.type 1}}checked{{end}}>
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux"></div>
|
||||
</div>
|
||||
@@ -131,7 +131,7 @@
|
||||
})
|
||||
return;
|
||||
}
|
||||
form.on('radio', function(data){
|
||||
form.on('radio(type)', function(data){
|
||||
if(data.value==1){
|
||||
$(".key").show();
|
||||
$(".password").hide();
|
||||
|
||||
@@ -71,8 +71,8 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label mw200">验证登录类型</label>
|
||||
<div class="layui-input-inline mw400">
|
||||
<input type="radio" name="type" lay-verify="type" value="0" title="密码" {{if eq .server.type 0}}checked{{end}}>
|
||||
<input type="radio" name="type" lay-verify="type" value="1" title="密钥" {{if eq .server.type 1}}checked{{end}}>
|
||||
<input type="radio" name="type" lay-verify="type" lay-filter="type" value="0" title="密码" {{if eq .server.type 0}}checked{{end}}>
|
||||
<input type="radio" name="type" lay-verify="type" lay-filter="type" value="1" title="密钥" {{if eq .server.type 1}}checked{{end}}>
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux"></div>
|
||||
</div>
|
||||
@@ -132,7 +132,7 @@
|
||||
})
|
||||
return;
|
||||
}
|
||||
form.on('radio', function(data){
|
||||
form.on('radio(type)', function(data){
|
||||
if(data.value==1){
|
||||
$(".key").show();
|
||||
$(".password").hide();
|
||||
|
||||
Reference in New Issue
Block a user