feat(xo-web/vm/console): ability to open RDP session (#5523)

Fixes #5495
See xoa-support#3254
This commit is contained in:
Rajaa.BARHTAOUI 2021-01-25 16:14:20 +01:00 committed by GitHub
parent 26f5ef5e31
commit e9f82558ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 7 deletions

View File

@ -15,6 +15,7 @@
- [Pool/advanced] Ability to define default migration network [#3788](https://github.com/vatesfr/xen-orchestra/issues/3788#issuecomment-743207834) (PR [#5465](https://github.com/vatesfr/xen-orchestra/pull/5465))
- [Metadata backups] Ability to link a backup to a proxy (PR [#4206](https://github.com/vatesfr/xen-orchestra/pull/4206))
- [Proxy] Support metadata backups (PRs [#5499](https://github.com/vatesfr/xen-orchestra/pull/5499) [#5517](https://github.com/vatesfr/xen-orchestra/pull/5517))
- [VM/console] Add button to connect to the VM via the local RDP client [#5495](https://github.com/vatesfr/xen-orchestra/issues/5495) (PR [#5523](https://github.com/vatesfr/xen-orchestra/pull/5523))
### Bug fixes

View File

@ -2681,7 +2681,7 @@ export default {
sshUsernameLabel: 'Nome utente SSH',
// Original text: 'No IP address reported by client tools'
sshNeedClientTools: 'Nessun indirizzo IP segnalato dagli strumenti client',
remoteNeedClientTools: 'Nessun indirizzo IP segnalato dagli strumenti client',
// Original text: 'Name'
containerName: 'Nome',

View File

@ -1066,7 +1066,9 @@ const messages = {
sshUserTooltip: 'Connect using external SSH tool as user…',
sshUserLabel: 'SSH as…',
sshUsernameLabel: 'SSH user name',
sshNeedClientTools: 'No IP address reported by client tools',
remoteNeedClientTools: 'No IP address reported by client tools',
rdp: 'RDP',
rdpRootTooltip: 'Connect using external RDP tool',
// ----- VM container tab -----
containerName: 'Name',

View File

@ -742,6 +742,10 @@
@extend .fa;
@extend .fa-times;
}
&-rdp {
@extend .fa;
@extend .fa-exchange;
}
&-minus {
@extend .fa;
@extend .fa-minus;

View File

@ -110,10 +110,14 @@ export default class TabConsole extends Component {
this._openSsh(username)
}
_openRdp = () => {
window.location = `rdp://${this.props.vm.mainIpAddress}`
}
render() {
const { statsOverview, vm } = this.props
const { minimalLayout, scale } = this.state
const canSsh = vm.mainIpAddress !== undefined
const canSshOrRdp = vm.mainIpAddress !== undefined
if (!isVmRunning(vm)) {
return (
@ -182,8 +186,8 @@ export default class TabConsole extends Component {
<span className='input-group-btn'>
<ActionButton
handler={this._openSsh}
tooltip={canSsh ? _('sshRootTooltip') : _('sshNeedClientTools')}
disabled={!canSsh}
tooltip={canSshOrRdp ? _('sshRootTooltip') : _('remoteNeedClientTools')}
disabled={!canSshOrRdp}
icon='remote'
>
{_('sshRootLabel')}
@ -192,13 +196,23 @@ export default class TabConsole extends Component {
<span className='input-group-btn'>
<ActionButton
handler={this._openSshMore}
tooltip={canSsh ? _('sshUserTooltip') : _('sshNeedClientTools')}
disabled={!canSsh}
tooltip={canSshOrRdp ? _('sshUserTooltip') : _('remoteNeedClientTools')}
disabled={!canSshOrRdp}
icon='remote'
>
{_('sshUserLabel')}
</ActionButton>
</span>
<span className='input-group-btn'>
<ActionButton
handler={this._openRdp}
tooltip={canSshOrRdp ? _('rdpRootTooltip') : _('remoteNeedClientTools')}
disabled={!canSshOrRdp}
icon='rdp'
>
{_('rdp')}
</ActionButton>
</span>
<span className='input-group-btn'>
<ActionButton handler={this._sendCtrlAltDel} tooltip={_('ctrlAltDelButtonLabel')} icon='vm-keyboard' />
</span>