Skip to content

Commit

Permalink
review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
J0ris-K committed Feb 26, 2025
1 parent ae09692 commit 6366596
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
31 changes: 18 additions & 13 deletions @xen-orchestra/lite/src/components/host/network/HostPifsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
/>
</div>
<div v-else-if="column.id === 'IP'" class="ip-addresses">
<span class="value text-ellipsis">{{ column.value[0] }}</span>
<span v-tooltip class="value text-ellipsis">{{ column.value[0] }}</span>
<span v-if="column.value.length > 1" class="typo-body-regular-small more-ips">
{{ `+${column.value.length - 1}` }}
</span>
Expand Down Expand Up @@ -174,19 +174,8 @@ const { getByOpaqueRef } = useNetworkStore().subscribe()
const { getPifStatus } = usePifStore().subscribe()
const { t } = useI18n()
const selectedPifId = useRouteQuery('id')
const searchQuery = ref('')
// TODO change to match with network name
const filteredPifs = computed(() => {
const searchTerm = searchQuery.value.trim().toLocaleLowerCase()
if (!searchTerm) {
return pifs
}
return pifs.filter(pif => Object.values(pif).some(value => String(value).toLocaleLowerCase().includes(searchTerm)))
})
const selectedPifId = useRouteQuery('id')
const pifsUuids = computed(() => pifs.map(pif => pif.uuid))
Expand All @@ -209,6 +198,22 @@ const getIpConfigurationMode = (ipMode: string) => {
}
}
const searchQuery = ref('')
const filteredPifs = computed(() => {
const searchTerm = searchQuery.value.trim().toLocaleLowerCase()
if (!searchTerm) {
return pifs
}
return pifs.filter(pif =>
[...Object.values(pif), getNetworkName(pif.network)].some(value =>
String(value).toLocaleLowerCase().includes(searchTerm)
)
)
})
const { visibleColumns, rows } = useTable('pifs', filteredPifs, {
rowId: record => record.uuid,
columns: define => [
Expand Down
1 change: 1 addition & 0 deletions @xen-orchestra/lite/src/libs/xen-api/xen-api.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export type RawTypeToType<RawType extends RawObjectType> = Lowercase<RawType>
export type TypeToRawType<Type extends ObjectType> = TypeMapping[Type]

type ObjectTypeToRecordMapping = {
bond: XenApiBond
console: XenApiConsole
host: XenApiHost
host_metrics: XenApiHostMetrics
Expand Down

0 comments on commit 6366596

Please sign in to comment.