-
Notifications
You must be signed in to change notification settings - Fork 270
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-6): add pool network view #8182
base: master
Are you sure you want to change the base?
Conversation
dce89a5
to
4c38fd5
Compare
825d888
to
dd74a4b
Compare
0d2d1a0
to
a17af42
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are other big changes to do on this PR, but to avoid making a lot of complicated comments, I will make another PR with the refactored code. I will link it when ready.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you restore the blank lines in the locales’ files?
@xen-orchestra/web/src/components/pool/PoolHostInternalNetworkTable.vue
Outdated
Show resolved
Hide resolved
define('checkbox', () => '', { label: '', isHideable: false }), | ||
define('name_label', { label: 'Name', isHideable: true }), | ||
define('name_description', { label: 'Description', isHideable: true }), | ||
define('MTU', { label: 'MTU', isHideable: true }), | ||
define('defaultIsLocked', { label: 'Default Locking mode', isHideable: true }), | ||
define('more', () => '', { label: '', isHideable: false }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since isHideable
is true
by default, there is no need to set it explicitly.
Also, remember to translate all strings for the labels.
define('checkbox', () => '', { label: '', isHideable: false }), | |
define('name_label', { label: 'Name', isHideable: true }), | |
define('name_description', { label: 'Description', isHideable: true }), | |
define('MTU', { label: 'MTU', isHideable: true }), | |
define('defaultIsLocked', { label: 'Default Locking mode', isHideable: true }), | |
define('more', () => '', { label: '', isHideable: false }), | |
define('checkbox', () => '', { label: '', isHideable: false }), | |
define('name_label', { label: t('name') }), | |
define('name_description', { label: t('description') }), | |
define('MTU', { label: t('mtu') }), | |
define('defaultIsLocked', { label: t('default-locking-mode') }), | |
define('more', () => '', { label: '', isHideable: false }), |
It's just an example, be sure to add the correct keys in the locales.
@xen-orchestra/web/src/components/pool/PoolHostInternalNetworkTable.vue
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be sure to translate all strings in this file (see my comments on @xen-orchestra/web/src/components/pool/PoolHostInternalNetworkTable.vue
)
const getHost = (id: XoPif['$host']) => { | ||
return records.value.find(host => host.id === id) | ||
} | ||
|
||
const getNetworkVlan = (vlan: XoPif['vlan']) => { | ||
return vlan !== -1 ? vlan.toString() : t('none') | ||
} | ||
|
||
const getLockingMode = (network: XoNetwork) => { | ||
return network.defaultIsLocked ? t('disabled') : t('unlocked') | ||
} | ||
|
||
const getNbd = (network: XoNetwork) => { | ||
return network.nbd ? t('on') : t('off') | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not a good practice to use functions called from the template. Here, computed would be more appropriate.
@xen-orchestra/web/src/components/pool/PoolNetworksSidePanel.vue
Outdated
Show resolved
Hide resolved
e02c67f
to
bf042a2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are other changes that need to be made, here is the link to my PR: https://github.com/vatesfr/xen-orchestra/pull/8252/files
@xen-orchestra/web/src/components/pool/PoolHostInternalNetworkTable.vue
Outdated
Show resolved
Hide resolved
87b50f1
to
8ce3eba
Compare
8ce3eba
to
bcfb604
Compare
Description
Add Pool network view with side panel
SCREENSHOT
Checklist
Fixes #007
,See xoa-support#42
,See https://...
)Introduced by
CHANGELOG.unreleased.md
Review process
Notes: