Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(xo-web/proxy): make proxy address editable #6816

Merged
merged 5 commits into from
May 16, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

> Users must be able to say: “Nice enhancement, I'm eager to test it”

- [Proxy] Make proxy address editable (PR [#6816](https://github.com/vatesfr/xen-orchestra/pull/6816))

### Bug fixes

> Users must be able to say: “I had this issue, happy to know it's fixed”
Expand All @@ -27,4 +29,6 @@

<!--packages-start-->

- xo-web minor

<!--packages-end-->
14 changes: 13 additions & 1 deletion packages/xo-web/src/xo-app/proxies/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@ 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 })
const _editProxy = (value, { name, proxy }) => {
if (typeof value === 'string') {
value = value.trim()
value = value === '' ? null : value
}
return editProxyAppliance(proxy, { [name]: value })
}

const HEADER = (
<h2>
Expand Down Expand Up @@ -143,6 +149,12 @@ const COLUMNS = [
itemRenderer: proxy => <Vm id={proxy.vmUuid} link />,
name: _('vm'),
},
{
itemRenderer: proxy => (
<Text data-name='address' data-proxy={proxy} value={proxy.address ?? ''} onChange={_editProxy} />
),
name: _('address'),
},
{
name: _('license'),
itemRenderer: (proxy, { isAdmin, licensesByVmUuid }) => {
Expand Down