fix: 修复多用户弹窗选择后无法登陆

parent abe51e44
...@@ -117,6 +117,14 @@ def asset_groups_assets(): ...@@ -117,6 +117,14 @@ def asset_groups_assets():
"protocol": "ssh", "protocol": "ssh",
"auth_method": "P", "auth_method": "P",
"auto_push": True "auto_push": True
},
{
"id": 2,
"name": "liuzheng",
"username": "liuzheng",
"protocol": "ssh",
"auth_method": "P",
"auto_push": True
} }
] ]
}, },
......
...@@ -98,6 +98,7 @@ export class CleftbarComponent implements OnInit { ...@@ -98,6 +98,7 @@ export class CleftbarComponent implements OnInit {
Connect(host) { Connect(host) {
// console.log(host); // console.log(host);
let userid: string; let userid: string;
const that = this;
if (host.system_users_granted.length > 1) { if (host.system_users_granted.length > 1) {
let options = ''; let options = '';
for (let u of host.system_users_granted) { for (let u of host.system_users_granted) {
...@@ -112,6 +113,19 @@ export class CleftbarComponent implements OnInit { ...@@ -112,6 +113,19 @@ export class CleftbarComponent implements OnInit {
content: '<select id="selectuser">' + options + '</select>', content: '<select id="selectuser">' + options + '</select>',
yes: function (index, layero) { yes: function (index, layero) {
userid = jQuery('#selectuser').val(); userid = jQuery('#selectuser').val();
if (host.plantform === 'Linux') {
jQuery('app-ssh').show();
jQuery('app-rdp').hide();
that._term.TerminalConnect(host, userid);
} else if (host.plantform === 'Windows') {
jQuery('app-ssh').hide();
jQuery('app-rdp').show();
that._rdp.Connect(host, userid);
} else {
jQuery('app-ssh').show();
jQuery('app-rdp').hide();
that._term.TerminalConnect(host, userid);
}
layer.close(index); layer.close(index);
}, },
btn2: function (index, layero) { btn2: function (index, layero) {
...@@ -123,22 +137,22 @@ export class CleftbarComponent implements OnInit { ...@@ -123,22 +137,22 @@ export class CleftbarComponent implements OnInit {
}); });
} else if (host.system_users_granted.length === 1) { } else if (host.system_users_granted.length === 1) {
userid = host.system_users_granted[0].id; userid = host.system_users_granted[0].id;
} if (userid === '') {
if (userid === '') { return;
return; }
} if (host.plantform === 'Linux') {
if (host.plantform === 'Linux') { jQuery('app-ssh').show();
jQuery('app-ssh').show(); jQuery('app-rdp').hide();
jQuery('app-rdp').hide(); this._term.TerminalConnect(host, userid);
this._term.TerminalConnect(host, userid); } else if (host.plantform === 'Windows') {
} else if (host.plantform === 'Windows') { jQuery('app-ssh').hide();
jQuery('app-ssh').hide(); jQuery('app-rdp').show();
jQuery('app-rdp').show(); this._rdp.Connect(host, userid);
this._rdp.Connect(host, userid); } else {
} else { jQuery('app-ssh').show();
jQuery('app-ssh').show(); jQuery('app-rdp').hide();
jQuery('app-rdp').hide(); this._term.TerminalConnect(host, userid);
this._term.TerminalConnect(host, userid); }
} }
} }
......
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