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

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