Skip to content

Commit

Permalink
feat(xo-web/proxies): copy proxy URL (#6287)
Browse files Browse the repository at this point in the history
  • Loading branch information
MathieuRA committed Jun 27, 2022
1 parent 87df917 commit cfc53c9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
> Users must be able to say: “Nice enhancement, I'm eager to test it”
- [Backup] Merge delta backups without copying data when using VHD directories on NFS/SMB/local remote(https://github.com/vatesfr/xen-orchestra/pull/6271))
- [Proxies] Ability to copy the proxy access URL (PR [#6287](https://github.com/vatesfr/xen-orchestra/pull/6287))

### Bug fixes

Expand Down Expand Up @@ -42,5 +43,6 @@
- xo-remote-parser minor
- xo-server minor
- xo-vmdk-to-vhd patch
- xo-web minor

<!--packages-end-->
3 changes: 3 additions & 0 deletions packages/xo-web/src/common/intl/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ const messages = {
// ----- Copiable component -----
copyToClipboard: 'Copy to clipboard',
copyUuid: 'Copy {uuid}',
copyValue: 'Copy {value}',

// ----- Pills -----
pillMaster: 'Master',
Expand Down Expand Up @@ -2417,6 +2418,8 @@ const messages = {
noProxiesAvailable: 'No proxies available',
checkProxyHealth: 'Test your proxy',
updateProxyApplianceSettings: 'Update appliance settings',
urlNotFound: 'URL not found',
proxyCopyUrl: 'Copy proxy URL',
proxyTestSuccess: 'Test passed for {name}',
proxyTestSuccessMessage: 'The proxy appears to work correctly',
proxyTestFailed: 'Test failed for {name}',
Expand Down
13 changes: 13 additions & 0 deletions packages/xo-web/src/xo-app/proxies/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import _ from 'intl'
import ActionButton from 'action-button'
import addSubscriptions from 'add-subscriptions'
import copy from 'copy-to-clipboard'
import decorate from 'apply-decorators'
import Icon from 'icon'
import NoObjects from 'no-objects'
Expand Down Expand Up @@ -28,6 +29,7 @@ import Page from '../page'
import deployProxy from './deploy-proxy'
import { updateApplianceSettings } from './update-appliance-settings'

import Tooltip from '../../common/tooltip'
import { getXoaPlan, SOURCES } from '../../common/xoa-plans'

const _editProxy = (value, { name, proxy }) => editProxyAppliance(proxy, { [name]: value })
Expand Down Expand Up @@ -56,6 +58,17 @@ const ACTIONS = [
]

const INDIVIDUAL_ACTIONS = [
{
collapsed: true,
disabled: ({ url }) => url === undefined,
handler: ({ url }) => copy(url),
icon: 'clipboard',
label: ({ url }) => (
<Tooltip content={url !== undefined ? _('copyValue', { value: url }) : _('urlNotFound')}>
{_('proxyCopyUrl')}
</Tooltip>
),
},
{
collapsed: true,
handler: (proxy, { deployProxy }) =>
Expand Down

0 comments on commit cfc53c9

Please sign in to comment.