-
Notifications
You must be signed in to change notification settings - Fork 276
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 sidebar to host networks view #8287
base: master
Are you sure you want to change the base?
Conversation
1190751
to
24b8506
Compare
8fecac8
to
fbdcffc
Compare
7a43728
to
d3d0b57
Compare
d3d0b57
to
28df170
Compare
28df170
to
6ebe5fb
Compare
host: XoHost | ||
}>() | ||
const { records } = usePifStore().subscribe() | ||
const route = useRoute() |
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.
To fix type-check
error l.30:
const route = useRoute() | |
const route = useRoute<'/host/[id]'>() |
- xo-server minor | ||
- xo-web minor |
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.
I don't think it is necessary:
- xo-server minor | |
- xo-web minor |
.map(slaveId => baseContext.records.value.find(pif => pif.id === slaveId)) | ||
.map(pif => pif!.device) |
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.
Can’t it be simplified?
</UiComplexIcon> | ||
<a href="">{{ networkNameLabel }}</a> | ||
--> | ||
<span v-tooltip class="text-ellipsis">{{ network?.name_label }}</span> |
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.
Shouldn't we display at least a -
if network
is undefined and we have no name_label
?
{{ $t('network') }} | ||
</template> | ||
<template #value> | ||
<div class="network"> |
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.
The <div>
will always be rendered, even if network
is undefined
{{ pif.dns }} | ||
</span> | ||
</template> | ||
<template v-if="pif.dns" #addons> |
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.
<template v-if="pif.dns" #addons> | |
<template #addons> |
:icon="faCopy" | ||
size="medium" | ||
accent="brand" | ||
@click="copy(String(pif.dns))" |
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.
Same here for the conversion
<template v-if="pif.gateway" #addons> | ||
<UiButtonIcon | ||
v-tooltip="copied && $t('core.copied')" | ||
:icon="faCopy" | ||
size="medium" | ||
accent="brand" | ||
@click="copy(String(pif.gateway))" |
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.
I will not add comments on each section, but please refer to my previous comments about the v-if
and String()
parts
|
||
const networkNbd = computed(() => (network.value?.nbd ? t('on') : t('off'))) | ||
|
||
const status = computed(() => (pif?.attached ? 'connected' : 'disconnected')) |
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.
const status = computed(() => (pif?.attached ? 'connected' : 'disconnected')) | |
const status = computed(() => (pif.attached ? 'connected' : 'disconnected')) |
|
||
const status = computed(() => (pif?.attached ? 'connected' : 'disconnected')) | ||
|
||
const physicalInterfaceStatus = computed(() => (pif && pif.carrier ? 'connected' : 'physically-disconnected')) |
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.
I think this can be enough:
const physicalInterfaceStatus = computed(() => (pif && pif.carrier ? 'connected' : 'physically-disconnected')) | |
const physicalInterfaceStatus = computed(() => (pif.carrier ? 'connected' : 'physically-disconnected')) |
Description
Add sidebar to host networks view
Screenshot
Checklist
Fixes #007
,See xoa-support#42
,See https://...
)Introduced by
CHANGELOG.unreleased.md
Review process
Notes: