Skip to content

Commit

Permalink
review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
J0ris-K committed Dec 12, 2024
1 parent 0138398 commit e382bc1
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
<template>
<UiInfo class="text-ellipsis" :accent="statusProps.accent">
<span class="text-ellipsis">{{ statusProps.text }}</span>
<UiInfo :accent="statusProps.accent">
<span>{{ statusProps.text }}</span>
</UiInfo>
</template>

<script setup lang="ts">
import UiInfo from '@core/components/ui/info/UiInfo.vue'
import { computed } from 'vue'
import { useI18n } from 'vue-i18n'
const { pif } = defineProps<{
pif: { status: 'connected' | 'disconnected' | 'partially_connected' }
const { status } = defineProps<{
status: 'connected' | 'disconnected' | 'partial'
}>()
const { t } = useI18n()
type NetworkAccent = 'success' | 'warning' | 'danger'
const statusMap: Record<string, { text: string; accent: NetworkAccent }> = {
connected: { text: 'Connected', accent: 'success' },
disconnected: { text: 'Disconnected', accent: 'danger' },
partially_connected: { text: 'Partially Connected', accent: 'warning' },
connected: { text: t('connected'), accent: 'success' },
disconnected: { text: t('disconnected'), accent: 'danger' },
partial: { text: t('partially-connected'), accent: 'warning' },
}
const statusProps = computed(() => statusMap[pif.status])
const statusProps = computed(() => statusMap[status])
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
{{ (row.value as any).network.name_description }}
</div>
<div v-if="column.id === 'status'" class="status">
<PoolNetworksPifStatus :pif="row.value" />
<PoolNetworksPifStatus :status="(row.value as any).status" />
</div>
<div v-if="column.id === 'vlan'" v-tooltip="{ placement: 'bottom-end' }" class="text-ellipsis">
{{ (row.value as any).vlan }}
Expand Down
3 changes: 3 additions & 0 deletions @xen-orchestra/lite/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"close": "Close",
"community": "Community",
"community-name": "{name} community",
"connected": "Connected",
"configuration": "Configuration",
"confirm-cancel": "Are you sure you want to cancel?",
"confirm-delete": "You're about to delete {0}",
Expand All @@ -58,6 +59,7 @@
"description": "Description",
"dhcp": "DHCP",
"disabled": "Disabled",
"disconnected": "Disconnected",
"display": "Display",
"dns": "DNS",
"do-you-have-needs": "You have needs and/or expectations? Let us know",
Expand Down Expand Up @@ -197,6 +199,7 @@
"ok": "OK",
"on-object": "on {object}",
"or": "Or",
"partially-connected": "Partially connected",
"password": "Password",
"password-invalid": "Password invalid",
"pause": "Pause",
Expand Down
5 changes: 4 additions & 1 deletion @xen-orchestra/lite/src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"close": "Fermer",
"community": "Communauté",
"community-name": "Communauté {name}",
"connected": "Connecté",
"configuration": "Configuration",
"confirm-cancel": "Êtes-vous sûr de vouloir annuler ?",
"confirm-delete": "Vous êtes sur le point de supprimer {0}",
Expand All @@ -59,6 +60,7 @@
"dhcp": "DHCP",
"dns": "DNS",
"disabled": "Désactivé",
"disconnected": "Déconnecté",
"display": "Affichage",
"do-you-have-needs": "Vous avez des besoins et/ou des attentes ? Faites le nous savoir",
"documentation": "Documentation",
Expand Down Expand Up @@ -99,7 +101,7 @@
"here": "Ici",
"host.active": "Actif | Actif | Actifs",
"host.inactive": "Inactif | Inactif | Inactifs",
"host-internal-networks": "Réseaux interne de l'hôte",
"host-internal-networks": "Réseaux internes de l'hôte",
"invalid-field": "Champ invalide",

"job.vm-copy.bad-power-state": "La VM doit être arrêtée",
Expand Down Expand Up @@ -197,6 +199,7 @@
"ok": "OK",
"on-object": "sur {object}",
"or": "Ou",
"partially-connected": "Partiellement connecté",
"password": "Mot de passe",
"password-invalid": "Mot de passe incorrect",
"pause": "Pause",
Expand Down
4 changes: 1 addition & 3 deletions @xen-orchestra/lite/src/stores/xen-api/network.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ export const useNetworkStore = defineStore('xen-api-network', () => {
})

const hostInternalNetworks = computed(() => {
return baseContext.records.value
.filter(network => network.PIFs.length === 0) // Only networks without PIFs
.map(network => network)
return baseContext.records.value.filter(network => network.PIFs.length === 0) // Only networks without PIFs
})

const context = {
Expand Down

0 comments on commit e382bc1

Please sign in to comment.