webssh 50%
This commit is contained in:
parent
9134dfb1a9
commit
719ad042c7
Binary file not shown.
|
After Width: | Height: | Size: 297 B |
|
|
@ -11,10 +11,103 @@ sys.path.append(os.getcwd() + "/class/core")
|
|||
import mw
|
||||
|
||||
|
||||
def status():
|
||||
return 'start'
|
||||
class App():
|
||||
|
||||
__cmd_file = 'cmd.json'
|
||||
__cmd_path = ''
|
||||
|
||||
def __init__(self):
|
||||
self.__cmd_path = self.getServerDir() + '/' + self.__cmd_file
|
||||
|
||||
if not os.path.exists(self.__cmd_path):
|
||||
mw.writeFile(self.__cmd_path, '[]')
|
||||
|
||||
def getPluginName(self):
|
||||
return 'webssh'
|
||||
|
||||
def getPluginDir(self):
|
||||
return mw.getPluginDir() + '/' + self.getPluginName()
|
||||
|
||||
def getServerDir(self):
|
||||
return mw.getServerDir() + '/' + self.getPluginName()
|
||||
|
||||
def getArgs(self):
|
||||
args = sys.argv[2:]
|
||||
tmp = {}
|
||||
args_len = len(args)
|
||||
|
||||
if args_len == 1:
|
||||
t = args[0].strip('{').strip('}')
|
||||
t = t.split(':')
|
||||
tmp[t[0]] = t[1]
|
||||
elif args_len > 1:
|
||||
for i in range(len(args)):
|
||||
t = args[i].split(':')
|
||||
tmp[t[0]] = t[1]
|
||||
|
||||
return tmp
|
||||
|
||||
def checkArgs(self, data, ck=[]):
|
||||
for i in range(len(ck)):
|
||||
if not ck[i] in data:
|
||||
return (False, mw.returnJson(False, '参数:(' + ck[i] + ')没有!'))
|
||||
return (True, mw.returnJson(True, 'ok'))
|
||||
|
||||
def status(self):
|
||||
return 'start'
|
||||
|
||||
def saveCmd(self, t):
|
||||
data_tmp = json.loads(mw.readFile(self.__cmd_path))
|
||||
is_has = False
|
||||
for x in range(0, len(data_tmp) - 1):
|
||||
if data_tmp[x]['title'] == t['title']:
|
||||
is_has = True
|
||||
data_tmp[x]['cmd'] = t['cmd']
|
||||
if not is_has:
|
||||
data_tmp.append(t)
|
||||
mw.writeFile(self.__cmd_path, json.dumps(data_tmp))
|
||||
|
||||
def add_cmd(self):
|
||||
args = self.getArgs()
|
||||
check = self.checkArgs(args, ['title', 'cmd'])
|
||||
if not check[0]:
|
||||
return check[1]
|
||||
|
||||
title = args['title']
|
||||
cmd = args['cmd']
|
||||
|
||||
t = {
|
||||
'title': title,
|
||||
'cmd': cmd
|
||||
}
|
||||
self.saveCmd(t)
|
||||
|
||||
return mw.returnJson(True, '添加成功!')
|
||||
|
||||
def del_cmd(self):
|
||||
args = self.getArgs()
|
||||
check = self.checkArgs(args, ['title'])
|
||||
if not check[0]:
|
||||
return check[1]
|
||||
|
||||
title = args['title']
|
||||
data_tmp = json.loads(mw.readFile(self.__cmd_path))
|
||||
for x in range(0, len(data_tmp)):
|
||||
if data_tmp[x]['title'] == title:
|
||||
del(data_tmp[x])
|
||||
mw.writeFile(self.__cmd_path, json.dumps(data_tmp))
|
||||
return mw.returnJson(True, '删除成功')
|
||||
return mw.returnJson(False, '删除无效')
|
||||
|
||||
def get_cmd_list(self):
|
||||
alist = json.loads(mw.readFile(self.__cmd_path))
|
||||
return mw.returnJson(True, 'ok', alist)
|
||||
|
||||
if __name__ == "__main__":
|
||||
func = sys.argv[1]
|
||||
if func == 'status':
|
||||
print(status())
|
||||
classApp = App()
|
||||
try:
|
||||
data = eval("classApp." + func + "()")
|
||||
print(data)
|
||||
except Exception as e:
|
||||
print(mw.getTracebackInfo())
|
||||
|
|
|
|||
|
|
@ -1,5 +1,62 @@
|
|||
|
||||
changeDivH();
|
||||
function appPost(method,args,callback){
|
||||
var _args = null;
|
||||
if (typeof(args) == 'string'){
|
||||
_args = JSON.stringify(toArrayObject(args));
|
||||
} else {
|
||||
_args = JSON.stringify(args);
|
||||
}
|
||||
|
||||
var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 });
|
||||
$.post('/plugins/run', {name:'webssh', func:method, args:_args}, function(data) {
|
||||
layer.close(loadT);
|
||||
if (!data.status){
|
||||
layer.msg(data.msg,{icon:0,time:2000,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
|
||||
if(typeof(callback) == 'function'){
|
||||
callback(data);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
function appAsyncPost(method,args){
|
||||
var _args = null;
|
||||
if (typeof(args) == 'string'){
|
||||
_args = JSON.stringify(toArrayObject(args));
|
||||
} else {
|
||||
_args = JSON.stringify(args);
|
||||
}
|
||||
return syncPost('/plugins/run', {name:'webssh', func:method, args:_args});
|
||||
}
|
||||
|
||||
function appPostCallbak(method, args, callback){
|
||||
var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 });
|
||||
|
||||
var req_data = {};
|
||||
req_data['name'] = 'webssh';
|
||||
req_data['func'] = method;
|
||||
args['version'] = '1.0';
|
||||
|
||||
if (typeof(args) == 'string'){
|
||||
req_data['args'] = JSON.stringify(toArrayObject(args));
|
||||
} else {
|
||||
req_data['args'] = JSON.stringify(args);
|
||||
}
|
||||
|
||||
$.post('/plugins/callback', req_data, function(data) {
|
||||
layer.close(loadT);
|
||||
if (!data.status){
|
||||
layer.msg(data.msg,{icon:0,time:2000,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
|
||||
if(typeof(callback) == 'function'){
|
||||
callback(data);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
changeDivH();
|
||||
|
|
@ -21,10 +78,46 @@ $(document).ready(function(){
|
|||
}
|
||||
});
|
||||
|
||||
$('.glyphicon-resize-full').click(function(ele){
|
||||
const func = ele.requestFullscreen || ele.mozRequestFullScreen || ele.webkitRequestFullscreen || ele.msRequestFullscreen;
|
||||
var e = $('#term_box_view').parent();
|
||||
func.call(e);
|
||||
$('.full_exit_screen').click(function(ele){
|
||||
if($(this).hasClass('glyphicon-resize-full')){
|
||||
requestFullScreen($('#term_box_view')[0]);
|
||||
$(this).removeClass('glyphicon-resize-full').addClass('glyphicon-resize-small');
|
||||
} else{
|
||||
exitFull();
|
||||
$(this).removeClass('glyphicon-resize-small').addClass('glyphicon-resize-full');
|
||||
}
|
||||
});
|
||||
|
||||
$('.addServer').click(function(){
|
||||
webShell_addServer();
|
||||
});
|
||||
|
||||
$('.tootls_host_btn').click(function(){
|
||||
webShell_addServer();
|
||||
});
|
||||
|
||||
$('.tootls_commonly_btn').click(function(){
|
||||
webShell_cmd();
|
||||
});
|
||||
|
||||
//服务器列表和常用命令
|
||||
$('.term_tootls .tab-nav span').click(function(){
|
||||
var list_type = $(this).attr('data-type');
|
||||
if (!$(this).hasClass('on')){
|
||||
|
||||
$('.term_tootls .tab-nav span').removeClass('on');
|
||||
$(this).addClass('on');
|
||||
|
||||
$('.term_tootls .tab-con .tab-block').removeClass('on')
|
||||
if (list_type == 'host'){
|
||||
$('.term_tootls .tab-con .tab-block').eq(0).addClass('on');
|
||||
}
|
||||
|
||||
if (list_type == 'shell'){
|
||||
$('.term_tootls .tab-con .tab-block').eq(1).addClass('on');
|
||||
webShell_getCmdList();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
webShell_Menu();
|
||||
|
|
@ -34,12 +127,114 @@ $(document).ready(function(){
|
|||
function changeDivH(){
|
||||
var l = $(window).height();
|
||||
$('#term_box_view').parent().css('height',l-80);
|
||||
|
||||
$('#xterm-viewport').css('height',l-80);
|
||||
|
||||
|
||||
$('.tootls_host_list').css('display','block').css('height',l-192);
|
||||
$('.tootls_commonly_list').css('display','block').css('height',l-192);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 窗口状态改变
|
||||
function fullScreenChange(el, callback) {
|
||||
el.addEventListener("fullscreenchange", function () {
|
||||
callback && callback(document.fullscreen);
|
||||
});
|
||||
|
||||
el.addEventListener("webkitfullscreenchange", function () {
|
||||
callback && callback(document.webkitIsFullScreen);
|
||||
});
|
||||
|
||||
el.addEventListener("mozfullscreenchange", function () {
|
||||
callback && callback(document.mozFullScreen);
|
||||
});
|
||||
|
||||
el.addEventListener("msfullscreenchange", function () {
|
||||
callback && callback(document.msFullscreenElement);
|
||||
});
|
||||
}
|
||||
|
||||
// 全屏
|
||||
function requestFullScreen(element) {
|
||||
var requestMethod = element.requestFullScreen || //W3C
|
||||
element.webkitRequestFullScreen || //Chrome等
|
||||
element.mozRequestFullScreen || //FireFox
|
||||
element.msRequestFullScreen; //IE11
|
||||
if (requestMethod) {
|
||||
requestMethod.call(element);
|
||||
}else if (typeof window.ActiveXObject !== "undefined") {//for Internet Explorer
|
||||
var wscript = new ActiveXObject("WScript.Shell");
|
||||
if (wscript !== null) {
|
||||
wscript.SendKeys("{F11}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//退出全屏
|
||||
function exitFull() {
|
||||
var exitMethod = document.exitFullscreen || //W3C
|
||||
document.mozCancelFullScreen || //Chrome等
|
||||
document.webkitExitFullscreen || //FireFox
|
||||
document.webkitExitFullscreen; //IE11
|
||||
if (exitMethod) {
|
||||
exitMethod.call(document);
|
||||
}else if (typeof window.ActiveXObject !== "undefined") {//for Internet Explorer
|
||||
var wscript = new ActiveXObject("WScript.Shell");
|
||||
if (wscript !== null) {
|
||||
wscript.SendKeys("{F11}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function webShell_getCmdList(){
|
||||
appPost('get_cmd_list', {}, function(rdata){
|
||||
var rdata = $.parseJSON(rdata.data);
|
||||
var alist = rdata.data;
|
||||
|
||||
var tli = '';
|
||||
for (var i = 0; i < alist.length; i++) {
|
||||
tli+='<li class="data-cmd-list" data-index="'+i+'" data-clipboard-text="'+alist[i]['cmd']+'">\
|
||||
<i></i>\
|
||||
<span>'+alist[i]['title']+'</span>\
|
||||
<span class="tootls">\
|
||||
<span class="glyphicon glyphicon-edit" aria-hidden="true" title="编辑常用命令信息"></span>\
|
||||
<span class="glyphicon glyphicon-trash" aria-hidden="true" title="删除常用命令信息"></span>\
|
||||
</span>\
|
||||
</li>';
|
||||
}
|
||||
|
||||
$('.tootls_commonly_list').html(tli);
|
||||
|
||||
$('.glyphicon-edit').click(function(){
|
||||
var index = $(this).parent().parent().attr('data-index');
|
||||
var t = alist[index];
|
||||
webShell_cmd(t['title'],t['cmd']);
|
||||
});
|
||||
|
||||
$('.glyphicon-trash').click(function(){
|
||||
var index = $(this).parent().parent().attr('data-index');
|
||||
var t = alist[index];
|
||||
appPost('del_cmd', {title:t['title']}, function(rdata){
|
||||
var rdata = $.parseJSON(rdata.data);
|
||||
showMsg(rdata.msg, function(){
|
||||
webShell_getCmdList();
|
||||
},{ icon: rdata.status ? 1 : 2 });
|
||||
});
|
||||
});
|
||||
|
||||
$('.data-cmd-list').click(function(){
|
||||
copyText($(this).attr('data-clipboard-text'));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function webShell_Menu() {
|
||||
var termCols = 83;
|
||||
var termRows = 21;
|
||||
var termRows = 20;
|
||||
var sendTotal = 0;
|
||||
if(!socket)socket = io.connect();
|
||||
var term = new Terminal({ cols: termCols, rows: termRows, screenKeys: true, useStyle: true});
|
||||
|
|
@ -79,8 +274,6 @@ function webShell_Menu() {
|
|||
socket.emit('webssh', data);
|
||||
});
|
||||
|
||||
// term.destroy();
|
||||
// clearInterval(interval);
|
||||
$(".shell_btn_close").click(function(){
|
||||
layer.close(term_box);
|
||||
term.destroy();
|
||||
|
|
@ -187,19 +380,101 @@ function webShell_Menu() {
|
|||
}, 100);
|
||||
}
|
||||
|
||||
function shell_to_baidu() {
|
||||
var selectText = getCookie('ssh_selection');
|
||||
remove_ssh_menu();
|
||||
window.open('https://www.baidu.com/s?wd=' + selectText)
|
||||
gterm.focus();
|
||||
function webShell_addServer(){
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: '添加主机信息',
|
||||
area: '500px',
|
||||
btn:["确定","取消"],
|
||||
content:'<div class="bt-form pd20 c6">\
|
||||
<div class="line input_group">\
|
||||
<span class="tname">服务器IP</span>\
|
||||
<div class="info-r">\
|
||||
<input type="text" name="host" class="bt-input-text mr5" style="width:240px" value="127.0.0.1" placeholder="输入服务器IP" val="" autocomplete="off" />\
|
||||
<input type="text" name="port" class="bt-input-text mr5" style="width:60px" placeholder="端口" value="22" autocomplete="off"/>\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="line">\
|
||||
<span class="tname">SSH账号</span>\
|
||||
<div class="info-r">\
|
||||
<input type="text" name="username" class="bt-input-text mr5" style="width:305px" placeholder="输入SSH账号" value="root" autocomplete="off"/>\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="line">\
|
||||
<span class="tname">验证方式</span>\
|
||||
<div class="info-r ">\
|
||||
<div class="btn-group">\
|
||||
<button type="button" tabindex="-1" class="btn btn-sm auth_type_checkbox btn-success" data-ctype="0">密码验证</button>\
|
||||
<button type="button" tabindex="-1" class="btn btn-sm auth_type_checkbox btn-default" data-ctype="1">私钥验证\
|
||||
</button>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="line c_password_view show">\
|
||||
<span class="tname">密码</span>\
|
||||
<div class="info-r">\
|
||||
<input type="text" name="password" class="bt-input-text mr5" placeholder="请输入SSH密码" style="width:305px;" value="" autocomplete="off"/>\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="line c_pkey_view hide">\
|
||||
<span class="tname">私钥</span>\
|
||||
<div class="info-r">\
|
||||
<textarea rows="4" name="pkey" class="bt-input-text mr5" placeholder="请输入SSH私钥" style="width:305px;height: 80px;line-height: 18px;padding-top:10px;"></textarea>\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="line key_pwd_line hide">\
|
||||
<span class="tname">私钥密码</span>\
|
||||
<div class="info-r">\
|
||||
<input type="text" name="pkey_passwd" class="bt-input-text mr5" placeholder="请输入私钥密码" style="width:305px;" value="" autocomplete="off"/>\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="line ssh_ps_tips">\
|
||||
<span class="tname">备注</span>\
|
||||
<div class="info-r">\
|
||||
<input type="text" name="ps" class="bt-input-text mr5" placeholder="请输入备注,可为空" style="width:305px;" value="" autocomplete="off"/>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>',
|
||||
success:function(){
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function shell_paste_text(){
|
||||
socket.emit('webssh', getCookie('ssh_selection'));
|
||||
remove_ssh_menu();
|
||||
gterm.focus();
|
||||
function webShell_cmd(title='', cmd=''){
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: '添加常用命令信息',
|
||||
area: '500px',
|
||||
btn:["确定","取消"],
|
||||
content:'<div class="bt-form pd20 c6">\
|
||||
<div class="line">\
|
||||
<span class="tname">命令名称</span>\
|
||||
<div class="info-r">\
|
||||
<input type="text" name="title" class="bt-input-text mr5" style="width:305px" placeholder="请输入常用命令描述,必填项" value="'+title+'" autocomplete="off"/>\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="line">\
|
||||
<span class="tname">命令内容</span>\
|
||||
<div class="info-r">\
|
||||
<textarea rows="4" name="cmd" class="bt-input-text mr5" placeholder="请输入常用命令信息,必填项" style="width:305px;height: 150px;line-height: 18px;padding-top:10px;">'+cmd+'</textarea>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>',
|
||||
success:function(){
|
||||
},
|
||||
yes:function(l,layer_id){
|
||||
var title = $('input[name="title"]').val();
|
||||
var cmd = $('textarea[name="cmd"]').val();
|
||||
|
||||
appPost('add_cmd', {title:title,cmd:cmd}, function(rdata){
|
||||
layer.close(l);
|
||||
var rdata = $.parseJSON(rdata.data);
|
||||
showMsg(rdata.msg, function(){
|
||||
webShell_getCmdList();
|
||||
},{ icon: rdata.status ? 1 : 2 });
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function remove_ssh_menu() {
|
||||
$(".contextmenu").remove();
|
||||
}
|
||||
|
|
@ -459,3 +459,131 @@ color: #bbb;
|
|||
.term_content_tab .xterm .xterm-viewport:hover::-webkit-scrollbar-track {
|
||||
background-color: #444;
|
||||
}
|
||||
|
||||
.tootls_host_list,
|
||||
.tootls_commonly_list {
|
||||
list-style: none;
|
||||
border-top: none;
|
||||
border: 1px solid #ececec;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.tootls_host_list,
|
||||
.tootls_commonly_list {
|
||||
/* min-height: 300px; */
|
||||
overflow: auto;
|
||||
/* margin-bottom: 10px; */
|
||||
overflow-x: hidden;
|
||||
font-size: 12px;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.tootls_commonly_list li,
|
||||
.tootls_host_list li {
|
||||
display: inline-block;
|
||||
height: 38px;
|
||||
line-height: 38px;
|
||||
color: #444;
|
||||
border-bottom: 1px solid #ececec;
|
||||
font-size: 13px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.tootls_commonly_list li {
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
.tootls_commonly_list li:hover,
|
||||
.tootls_host_list li:hover {
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
.tootls_commonly_list li:hover .tootls,
|
||||
.tootls_host_list li:hover .tootls {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.tootls_host_list li i {
|
||||
display: inline-block;
|
||||
height: 100%;
|
||||
width: 38px;
|
||||
background-size: 16px;
|
||||
background: url('/plugins/file?name=webssh&f=img/ico-cmd.png') no-repeat center center;
|
||||
}
|
||||
|
||||
.tootls_commonly_list li>span,
|
||||
.tootls_host_list li>span {
|
||||
vertical-align: top;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.tootls_commonly_list li:hover>span:nth-child(2),
|
||||
.tootls_host_list li:hover>span:nth-child(2) {
|
||||
width: 120px;
|
||||
}
|
||||
|
||||
.tootls_commonly_list li>span:nth-child(2),
|
||||
.tootls_host_list li>span:nth-child(2) {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-size: 12px;
|
||||
max-width: 190px;
|
||||
}
|
||||
|
||||
|
||||
/* .tootls_host_list li>span:nth-child(2){
|
||||
margin-left: 35px;
|
||||
} */
|
||||
|
||||
.tootls_commonly_list li>span:nth-child(2) {
|
||||
max-width: 190px;
|
||||
}
|
||||
|
||||
.tootls_commonly_list li span:nth-child(3),
|
||||
.tootls_host_list li span:nth-child(3) {
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.tootls_commonly_list li .tootls,
|
||||
.tootls_host_list li .tootls {
|
||||
width: 70px;
|
||||
text-align: right;
|
||||
padding-right: 10px;
|
||||
display: none;
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
}
|
||||
|
||||
.tootls_commonly_list li .tootls {
|
||||
width: 90px;
|
||||
}
|
||||
|
||||
.tootls_commonly_list li .tootls span,
|
||||
.tootls_host_list li .tootls span {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
line-height: 22px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.tootls_commonly_list li .tootls span:nth-child(1),
|
||||
.tootls_host_list li .tootls span:nth-child(1) {
|
||||
color: #888;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.tootls_commonly_list li .tootls span:nth-child(2),
|
||||
.tootls_host_list li .tootls span:nth-child(2) {
|
||||
color: #ea7575;
|
||||
}
|
||||
|
||||
.tootls_commonly_list li .tootls span:nth-child(2):hover,
|
||||
.tootls_host_list li .tootls span:nth-child(2):hover {
|
||||
color: red;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
|
||||
|
||||
<div class="main-content">
|
||||
<div class="container-fluid">
|
||||
<div class="safe bgw mtb15 pd15 radius4" style="height: 300px;">
|
||||
|
|
@ -13,16 +15,19 @@
|
|||
<span class="glyphicon glyphicon-plus" aria-hidden="true" ></span>
|
||||
</span>
|
||||
<span class="tab_tootls">
|
||||
<span class="glyphicon glyphicon-resize-full" aria-hidden="true"></span>
|
||||
<span class="glyphicon full_exit_screen glyphicon-resize-full" aria-hidden="true"></span>
|
||||
<!-- <span>全屏显示</span> -->
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<!-- 控制台 -->
|
||||
<div class="term_content_tab">
|
||||
<div class="term-tool-button tool-hide"><span class="glyphicon glyphicon-menu-right"></span></div>
|
||||
<div class="term_item" id="ECFEfRWM8" data-host="38.6.224.67"><div dir="ltr" class="terminal xterm" tabindex="0"><div class="xterm-viewport" style="background-color: rgb(0, 0, 0);"><div class="xterm-scroll-area" style="height: 51px;"></div></div><div class="xterm-screen" style="width: 792px; height: 17px;"><div class="xterm-helpers"><textarea class="xterm-helper-textarea" aria-label="Terminal input" aria-multiline="false" autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="left: 234.406px; top: 34px; width: 9.01562px; height: 17px; line-height: 17px; z-index: -5;"></textarea><span class="xterm-char-measure-element" aria-hidden="true" style="font-family: courier-new, courier, monospace; font-size: 15px;">W</span><div class="composition-view"></div></div><canvas class="xterm-text-layer" width="792" height="17" style="z-index: 0; width: 792px; height: 17px;"></canvas><canvas class="xterm-selection-layer" width="792" height="17" style="z-index: 1; width: 792px; height: 17px;"></canvas><canvas class="xterm-link-layer" width="792" height="17" style="z-index: 2; width: 792px; height: 17px;"></canvas><canvas class="xterm-cursor-layer" width="792" height="17" style="z-index: 3; width: 792px; height: 17px;"></canvas></div></div></div>
|
||||
<div class="term_item" id="ECFEfRWM8" data-host="38.6.224.67"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="term_tootls">
|
||||
|
||||
<div class="tab-nav">
|
||||
<span class="on" data-type="host">服务器列表</span>
|
||||
<span data-type="shell">常用命令</span>
|
||||
|
|
@ -30,90 +35,19 @@
|
|||
<div class="tab-con">
|
||||
<div class="tab-block on">
|
||||
<div>
|
||||
<button class="btn btn-success btn-sm" type="button" data-type="host">添加服务器</button>
|
||||
<button class="btn btn-success btn-sm tootls_host_btn" type="button" data-type="host">添加服务器</button>
|
||||
</div>
|
||||
<ul class="tootls_host_list"></ul>
|
||||
</div>
|
||||
<div class="tab-block">
|
||||
<div>
|
||||
<button class="btn btn-success btn-sm" type="button" data-type="shell">添加命令</button>
|
||||
<button class="btn btn-success tootls_commonly_btn btn-sm" type="button" data-type="shell">添加命令</button>
|
||||
</div>
|
||||
<ul class="tootls_commonly_list"></ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="tootls_tab"><span class="active">服务器列表</span><a href="javascript:;" data-type="host" title="添加服务器SSH信息"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></a></div>
|
||||
<ul class="tootls_host_list"></ul> -->
|
||||
<!-- <div class="tootls_tab"><div class="term-move-border"></div><span class="active">常用命令<i>(点击复制命令)</i></span><a href="javascript:;" data-type="shell" title="添加常用命令"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></a></div>
|
||||
<ul class="tootls_commonly_list"></ul> -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <script type="text/html" id="host_form_view">
|
||||
<div class="bt-form bt-form-2x pd20" id="host_form">
|
||||
<input type="text" name="sort" class="hidden" value="<% this.form.sort %>" />
|
||||
<div class="line input_group">
|
||||
<span class="tname">服务器IP</span>
|
||||
<div class="info-r">
|
||||
<input type="text" name="host" class="bt-input-text mr5" style="width:240px" value="<% this.form.host %>" placeholder="输入服务器IP" val="" autocomplete="off" />
|
||||
<input type="text" name="port" class="bt-input-text mr5" style="width:60px" placeholder="端口" value="<% this.form.port %>" autocomplete="off"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
<span class="tname">SSH账号</span>
|
||||
<div class="info-r">
|
||||
<input type="text" name="username" class="bt-input-text mr5" style="width:305px" placeholder="输入SSH账号" value="<% this.form.username %>" autocomplete="off"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
<span class="tname">验证方式</span>
|
||||
<div class="info-r ">
|
||||
<div class="btn-group">
|
||||
<button type="button" tabindex="-1" class="btn btn-sm auth_type_checkbox <% !(this.form.password != '' || this.form.pkey == '' && this.form.password == '')?'btn-default':'btn-success' %>" data-ctype="0">密码验证</button>
|
||||
<button type="button" tabindex="-1" class="btn btn-sm auth_type_checkbox <% this.form.pkey == ''?'btn-default':'btn-success' %>" data-ctype="1">私钥验证
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line c_password_view <% (this.form.password != '' || this.form.pkey == '' && this.form.password == '')?'show':'hidden'%>">
|
||||
<span class="tname">密码</span>
|
||||
<div class="info-r">
|
||||
<input type="text" name="password" class="bt-input-text mr5" placeholder="请输入SSH密码" style="width:305px;" value="<% this.form.password %>" autocomplete="off"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line c_pkey_view <% this.form.pkey != ''?'show':'hidden'%>">
|
||||
<span class="tname">私钥</span>
|
||||
<div class="info-r">
|
||||
<textarea rows="4" name="pkey" class="bt-input-text mr5" placeholder="请输入SSH私钥" style="width:305px;height: 80px;line-height: 18px;padding-top:10px;"><% this.form.pkey %></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line key_pwd_line <% this.form.pkey != '' ? 'show' : 'hidden' %>">
|
||||
<span class="tname">私钥密码</span>
|
||||
<div class="info-r">
|
||||
<input type="text" name="pkey_passwd" class="bt-input-text mr5" placeholder="请输入私钥密码" style="width:305px;" value="<% this.form.pkey_passwd %>" autocomplete="off"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line ssh_ps_tips">
|
||||
<span class="tname">备注</span>
|
||||
<div class="info-r">
|
||||
<input type="text" name="ps" class="bt-input-text mr5" placeholder="请输入备注,可为空" style="width:305px;" value="<% this.form.ps %>" autocomplete="off"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/html" id="shell_form_view">
|
||||
<div class="bt-form bt-form-2x pd20" id="host_form">
|
||||
<div class="line">
|
||||
<span class="tname">命令名称</span>
|
||||
<div class="info-r">
|
||||
<input type="text" name="title" class="bt-input-text mr5" style="width:305px" placeholder="请输入常用命令描述,必填项" value="<% this.form.title %>" autocomplete="off"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
<span class="tname">命令内容</span>
|
||||
<div class="info-r">
|
||||
<textarea rows="4" name="shell" class="bt-input-text mr5" placeholder="请输入常用命令信息,必填项" style="width:305px;height: 150px;line-height: 18px;padding-top:10px;"><% this.form.shell %></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script> -->
|
||||
</div>
|
||||
Loading…
Reference in New Issue