Commit 6414c78a authored by ibuler's avatar ibuler

[Update] 修复rdp右击问题

parent 0d87dbcd
...@@ -160,14 +160,25 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges { ...@@ -160,14 +160,25 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges {
} }
onRightClick(event, treeId, treeNode) { onRightClick(event, treeId, treeNode) {
if (!treeNode || treeNode.isParent ) { if (!treeNode || treeNode.isParent ) {
return null; return null;
} }
const host = treeNode.meta.asset; const host = treeNode.meta.asset;
if (host.protocol.toLowerCase() === 'rdp') { let findSSHProtocol = false;
const protocols = host.protocols || [];
if (host.protocol) {
protocols.push(host.protocol);
}
for (let i = 0; i <= protocols.length; i++) {
const protocol = protocols[i];
if (protocol.startsWith('ssh')) {
findSSHProtocol = true;
}
}
if (!findSSHProtocol) {
alert('Windows 请使用Ctrl+Shift+Alt呼出侧边栏上传下载'); alert('Windows 请使用Ctrl+Shift+Alt呼出侧边栏上传下载');
} }
if (!treeNode && event.target.tagName.toLowerCase() !== 'button' && $(event.target).parents('a').length === 0) { if (!treeNode && event.target.tagName.toLowerCase() !== 'button' && $(event.target).parents('a').length === 0) {
this.zTree.cancelSelectedNode(); this.zTree.cancelSelectedNode();
this.showRMenu(event.clientX, event.clientY); this.showRMenu(event.clientX, event.clientY);
......
...@@ -41,6 +41,7 @@ export class ElementGuacamoleComponent implements OnInit { ...@@ -41,6 +41,7 @@ export class ElementGuacamoleComponent implements OnInit {
}, },
error => { error => {
if (!this.registered) { if (!this.registered) {
console.log('Register host error, register token then connect');
this.registerToken(); this.registerToken();
} }
} }
......
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