-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
20 additions
and
14 deletions.
There are no files selected for viewing
20 changes: 11 additions & 9 deletions
20
@xen-orchestra/lite/src/components/pool/network/PoolNetworksPifStatus.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters