diff --git a/plugins/webssh/index.py b/plugins/webssh/index.py
index 20e359f1d..c8377c34b 100755
--- a/plugins/webssh/index.py
+++ b/plugins/webssh/index.py
@@ -73,7 +73,7 @@ class App():
if not check[0]:
return check[1]
- title = args['title']
+ title = args['title'].strip()
cmd = args['cmd']
t = {
@@ -90,7 +90,7 @@ class App():
if not check[0]:
return check[1]
- title = args['title']
+ title = args['title'].strip()
data_tmp = json.loads(mw.readFile(self.__cmd_path))
for x in range(0, len(data_tmp)):
if data_tmp[x]['title'] == title:
@@ -103,6 +103,13 @@ class App():
alist = json.loads(mw.readFile(self.__cmd_path))
return mw.returnJson(True, 'ok', alist)
+ def add_server(self):
+ args = self.getArgs()
+ check = self.checkArgs(
+ args, ['host', 'port', 'username', 'password', 'pkey', 'pkey_passwd', 'ps'])
+ if not check[0]:
+ return check[1]
+
if __name__ == "__main__":
func = sys.argv[1]
classApp = App()
diff --git a/plugins/webssh/js/webssh.js b/plugins/webssh/js/webssh.js
index cd2b0ca29..6a9e9127b 100755
--- a/plugins/webssh/js/webssh.js
+++ b/plugins/webssh/js/webssh.js
@@ -402,10 +402,10 @@ function webShell_addServer(){
\
\
验证方式\
-
\
+
\
\
- \
-
\
\
@@ -436,7 +436,46 @@ function webShell_addServer(){
\
',
success:function(){
- }
+ $('.auth_type_checkbox').click(function(){
+ var ctype = $(this).attr('data-ctype');
+
+ $('.auth_type_checkbox').removeClass('btn-success');
+ $(this).addClass('btn-success');
+
+ if (ctype == 0){
+ $('.c_password_view').removeClass('show').addClass('show');
+ $('.c_pkey_view').removeClass('show').addClass('hide');
+ $('.key_pwd_line').removeClass('show').addClass('hide');
+
+ }else{
+ $('.c_password_view').removeClass('show').addClass('hide');
+ $('.c_pkey_view').removeClass('show').addClass('show');
+ $('.key_pwd_line').removeClass('show').addClass('show');
+
+ }
+ });
+ },
+ yes:function(l,layeror){
+ var host = $('input[name="host"]').val();
+ var port = $('input[name="port"]').val();
+ var username = $('input[name="username"]').val();
+ var password = $('input[name="password"]').val();
+ var pkey = $('input[name="pkey"]').val();
+ var pkey_passwd = $('input[name="pkey_passwd"]').val();
+ var ps = $('input[name="ps"]').val();
+
+ appPost('add_server',{
+ host:host,
+ port:port,
+ username:username,
+ password:password,
+ pkey:pkey,
+ pkey_passwd:pkey_passwd,
+ ps
+ },function(rdata){
+ console.log(rdata);
+ });
+ },
});
}
diff --git a/plugins/webssh/menu/index.css b/plugins/webssh/menu/index.css
index 8f2ad6a00..35f25dc81 100644
--- a/plugins/webssh/menu/index.css
+++ b/plugins/webssh/menu/index.css
@@ -470,9 +470,7 @@ color: #bbb;
.tootls_host_list,
.tootls_commonly_list {
- /* min-height: 300px; */
overflow: auto;
- /* margin-bottom: 10px; */
overflow-x: hidden;
font-size: 12px;
bottom: 0;