@xen-orchestra/web-core 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/assets/css/_colors.pcss +56 -24
- package/lib/assets/css/_context.pcss +9 -9
- package/lib/assets/css/base.pcss +6 -6
- package/lib/components/backup-item/VtsBackupItem.vue +47 -0
- package/lib/components/backup-state/{BackupState.vue → VtsBackupState.vue} +4 -4
- package/lib/components/{button/ButtonGroup.vue → button-group/VtsButtonGroup.vue} +7 -6
- package/lib/components/cell-object/{CellObject.vue → VtsCellObject.vue} +14 -14
- package/lib/components/cell-text/{CellText.vue → VtsCellText.vue} +11 -11
- package/lib/components/console/{RemoteConsole.vue → VtsRemoteConsole.vue} +12 -18
- package/lib/components/donut-chart-with-legend/{DonutChartWithLegend.vue → VtsDonutChartWithLegend.vue} +6 -6
- package/lib/components/dropdown/DropdownItem.vue +8 -14
- package/lib/components/dropdown/DropdownTitle.vue +3 -3
- package/lib/components/icon/VtsIcon.vue +38 -42
- package/lib/components/layout/{LayoutSidebar.vue → VtsLayoutSidebar.vue} +31 -30
- package/lib/components/legend-group/VtsLegendGroup.vue +44 -0
- package/lib/components/{legend/LegendList.vue → legend-list/VtsLegendList.vue} +2 -2
- package/lib/components/menu/MenuTrigger.vue +2 -2
- package/lib/components/stacked-bar-with-legend/{StackedBarWithLegend.vue → VtsStackedBarWithLegend.vue} +14 -14
- package/lib/components/state-hero/VtsComingSoonHero.vue +13 -0
- package/lib/components/state-hero/VtsLoadingHero.vue +15 -0
- package/lib/components/state-hero/VtsNoDataHero.vue +11 -0
- package/lib/components/state-hero/VtsObjectNotFoundHero.vue +13 -0
- package/lib/components/state-hero/{StateHero.vue → VtsStateHero.vue} +42 -35
- package/lib/components/tab/TabItem.vue +6 -6
- package/lib/components/table/ColumnTitle.vue +7 -7
- package/lib/components/table/{UiTable.vue → VtsTable.vue} +7 -3
- package/lib/components/task/{QuickTaskButton.vue → VtsQuickTaskButton.vue} +8 -7
- package/lib/components/task/{QuickTaskList.vue → VtsQuickTaskList.vue} +10 -11
- package/lib/components/task/{QuickTaskTabBar.vue → VtsQuickTaskTabBar.vue} +9 -13
- package/lib/components/{tooltip/TooltipList.vue → tooltip-list/VtsTooltipList.vue} +2 -3
- package/lib/components/tree/{TreeItem.vue → VtsTreeItem.vue} +3 -4
- package/lib/components/tree/VtsTreeItemError.vue +18 -0
- package/lib/components/tree/{TreeLine.vue → VtsTreeLine.vue} +9 -11
- package/lib/components/tree/{TreeList.vue → VtsTreeList.vue} +5 -2
- package/lib/components/tree/VtsTreeLoadingItem.vue +61 -0
- package/lib/components/ui/account-menu-button/UiAccountMenuButton.vue +64 -0
- package/lib/components/ui/actions-title/UiActionsTitle.vue +18 -0
- package/lib/components/ui/button/UiButton.vue +532 -0
- package/lib/components/ui/button-icon/UiButtonIcon.vue +248 -0
- package/lib/components/{UiCard.vue → ui/card/UiCard.vue} +8 -6
- package/lib/components/ui/card-numbers/UiCardNumbers.vue +103 -0
- package/lib/components/ui/card-subtitle/UiCardSubtitle.vue +24 -0
- package/lib/components/ui/card-title/UiCardTitle.vue +56 -0
- package/lib/components/ui/checkbox/UiCheckbox.vue +410 -0
- package/lib/components/ui/checkbox-group/UiCheckboxGroup.vue +57 -0
- package/lib/components/ui/chip/ChipIcon.vue +21 -0
- package/lib/components/ui/chip/ChipRemoveIcon.vue +13 -0
- package/lib/components/ui/chip/UiChip.vue +135 -0
- package/lib/components/{icon/ComplexIcon.vue → ui/complex-icon/UiComplexIcon.vue} +21 -27
- package/lib/components/ui/counter/UiCounter.vue +134 -0
- package/lib/components/{donut-chart/DonutChart.vue → ui/donut-chart/UiDonutChart.vue} +28 -30
- package/lib/components/{head-bar/HeadBar.vue → ui/head-bar/UiHeadBar.vue} +31 -31
- package/lib/components/{info/VtsInfo.vue → ui/info/UiInfo.vue} +13 -11
- package/lib/components/{input → ui/input}/UiInput.vue +9 -7
- package/lib/components/ui/input/UiTextarea.vue +120 -0
- package/lib/components/ui/label/UiLabel.vue +76 -0
- package/lib/components/ui/legend/UiLegend.vue +98 -0
- package/lib/components/{LegendTitle.vue → ui/legend-title/UiLegendTitle.vue} +4 -4
- package/lib/components/{UiSpinner.vue → ui/loader/UiLoader.vue} +3 -3
- package/lib/components/{icon/ObjectIcon.vue → ui/object-icon/UiObjectIcon.vue} +44 -36
- package/lib/components/ui/object-link/UiObjectLink.vue +83 -0
- package/lib/components/ui/panel/UiPanel.vue +57 -0
- package/lib/components/{query-search-bar/QuerySearchBar.vue → ui/query-search-bar/UiQuerySearchBar.vue} +16 -16
- package/lib/components/{task/QuickTaskItem.vue → ui/quick-task-item/UiQuickTaskItem.vue} +46 -34
- package/lib/components/{task/QuickTaskPanel.vue → ui/quick-task-panel/UiQuickTaskPanel.vue} +8 -7
- package/lib/components/ui/radio-button/UiRadioButton.vue +196 -0
- package/lib/components/ui/radio-button-group/UiRadioButtonGroup.vue +56 -0
- package/lib/components/{stacked-bar → ui/stacked-bar}/StackedBarSegment.vue +23 -26
- package/lib/components/{stacked-bar/StackedBar.vue → ui/stacked-bar/UiStackedBar.vue} +6 -6
- package/lib/components/ui/table-actions/UiTableActions.vue +46 -0
- package/lib/components/ui/tag/UiTag.vue +118 -0
- package/lib/components/ui/title/UiTitle.vue +39 -0
- package/lib/components/ui/toaster/UiToaster.vue +100 -0
- package/lib/components/ui/toggle/UiToggle.vue +117 -0
- package/lib/components/{tooltip/TooltipItem.vue → ui/tooltip/UiTooltip.vue} +15 -15
- package/lib/components/ui/top-bottom-table/UiTopBottomTable.vue +64 -0
- package/lib/components/{tree/TreeItemLabel.vue → ui/tree-item-label/UiTreeItemLabel.vue} +60 -59
- package/lib/components/ui/user-link/UiUserLink.vue +76 -0
- package/lib/components/ui/user-logo/UiUserLogo.vue +50 -0
- package/lib/composables/route-query.composable.md +136 -0
- package/lib/composables/table.composable.md +159 -0
- package/lib/composables/tree/define-tree.ts +1 -1
- package/lib/composables/tree/tree-node-base.ts +6 -6
- package/lib/composables/tree.composable.md +536 -0
- package/lib/layouts/CoreLayout.vue +8 -6
- package/lib/locales/de.json +3 -2
- package/lib/locales/en.json +7 -3
- package/lib/locales/fa.json +3 -2
- package/lib/locales/fr.json +7 -3
- package/lib/types/color.type.ts +0 -2
- package/lib/types/subscribable-store.type.ts +2 -2
- package/lib/utils/create-subscribable-store-context.util.ts +1 -1
- package/lib/utils/if-else.utils.md +23 -0
- package/lib/utils/if-else.utils.ts +2 -2
- package/lib/utils/to-variants.util.md +62 -0
- package/package.json +7 -7
- package/lib/components/CardNumbers.vue +0 -101
- package/lib/components/PowerStateIcon.vue +0 -46
- package/lib/components/UiTag.vue +0 -101
- package/lib/components/backup-item/BackupItem.vue +0 -40
- package/lib/components/button/ButtonIcon.vue +0 -220
- package/lib/components/button/UiButton.vue +0 -470
- package/lib/components/card/CardSubtitle.vue +0 -24
- package/lib/components/card/CardTitle.vue +0 -57
- package/lib/components/chip/ChipIcon.vue +0 -30
- package/lib/components/chip/ChipRemoveIcon.vue +0 -13
- package/lib/components/chip/UiChip.vue +0 -137
- package/lib/components/counter/VtsCounter.vue +0 -147
- package/lib/components/legend/LegendGroup.vue +0 -44
- package/lib/components/legend/LegendItem.vue +0 -86
- package/lib/components/object-link/ObjectLink.vue +0 -87
- package/lib/components/state-hero/ComingSoonHero.vue +0 -13
- package/lib/components/state-hero/LoadingHero.vue +0 -15
- package/lib/components/state-hero/NoDataHero.vue +0 -11
- package/lib/components/state-hero/ObjectNotFoundHero.vue +0 -13
- package/lib/components/tree/TreeItemError.vue +0 -13
- package/lib/components/tree/TreeLoadingItem.vue +0 -60
- package/lib/components/user/UserLink.vue +0 -72
- package/lib/components/user/UserLogo.vue +0 -57
- package/lib/types/backup.type.ts +0 -11
- package/lib/types/size.type.ts +0 -1
- package/lib/types/task.type.ts +0 -13
- /package/lib/components/backdrop/{Backdrop.vue → VtsBackdrop.vue} +0 -0
- /package/lib/components/divider/{Divider.vue → VtsDivider.vue} +0 -0
package/lib/locales/fr.json
CHANGED
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
|
|
27
27
|
"core.select.all": "Tout sélectionner",
|
|
28
28
|
"core.select.none": "Tout désélectionner",
|
|
29
|
-
|
|
29
|
+
"core.select.unselect": "Tout désélectionner",
|
|
30
|
+
"core.select.n-selected-of": "{count} objet sélectionné sur {total} | {count} objet sélectionné sur {total} | {count} objets sélectionnés sur {total}",
|
|
30
31
|
"core.sidebar.close": "Fermer la barre latérale",
|
|
31
32
|
"core.sidebar.lock": "Verrouiller la barre latérale",
|
|
32
33
|
"core.sidebar.open": "Ouvrir la barre latérale",
|
|
@@ -39,9 +40,11 @@
|
|
|
39
40
|
"dark-mode.disable": "Désactiver le mode sombre",
|
|
40
41
|
"dark-mode.auto": "Mode sombre automatique",
|
|
41
42
|
|
|
43
|
+
"access-forum": "Accès au forum",
|
|
42
44
|
"dashboard": "Tableau de bord",
|
|
43
45
|
"documentation-name": "Documentation {name}",
|
|
44
46
|
"hosts": "Hôtes",
|
|
47
|
+
"learn-more": "En savoir plus",
|
|
45
48
|
"loading-in-progress": "Chargement en cours…",
|
|
46
49
|
"log-out": "Se déconnecter",
|
|
47
50
|
"master": "Hôte primaire",
|
|
@@ -51,12 +54,13 @@
|
|
|
51
54
|
"object-not-found": "L'objet {id} est introuvable…",
|
|
52
55
|
"other": "Autre",
|
|
53
56
|
"patches": "Patches",
|
|
54
|
-
"power-on-for-console": "Allumez votre VM pour accéder à sa console",
|
|
57
|
+
"power-on-vm-for-console": "Allumez votre VM pour accéder à sa console",
|
|
58
|
+
"power-on-host-for-console": "Allumez votre hôte pour accéder à sa console",
|
|
59
|
+
"professional-support": "Support professionel",
|
|
55
60
|
"running-vm": "VM en cours d'exécution | VMs en cours d'exécution",
|
|
56
61
|
"see-all": "Voir tout",
|
|
57
62
|
"stats": "Stats",
|
|
58
63
|
"storage": "Stockage",
|
|
59
|
-
"support-name": "Support pro {name}",
|
|
60
64
|
"system": "Système",
|
|
61
65
|
|
|
62
66
|
"tasks": "Tâches",
|
package/lib/types/color.type.ts
CHANGED
|
@@ -15,7 +15,7 @@ export type Subscribe<TDefer extends boolean = false> = (options?: {
|
|
|
15
15
|
|
|
16
16
|
export type SubscribableStoreConfig<TContext> = {
|
|
17
17
|
context: TContext
|
|
18
|
-
onSubscribe
|
|
19
|
-
onUnsubscribe
|
|
18
|
+
onSubscribe?: () => void
|
|
19
|
+
onUnsubscribe?: () => void
|
|
20
20
|
isEnabled?: MaybeRefOrGetter<boolean>
|
|
21
21
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# `ifElse`
|
|
2
|
+
|
|
3
|
+
`ifElse` utility is a wrapper around `watch`.
|
|
4
|
+
|
|
5
|
+
It allows watching a `boolean` source and execute the first callback if the source is `true`, or the second one if the
|
|
6
|
+
source is `false`.
|
|
7
|
+
|
|
8
|
+
```ts
|
|
9
|
+
ifElse(mySource, doSomething, doSomethingElse)
|
|
10
|
+
ifElse(mySource, doSomething, doSomethingElse, { immediate: true })
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
const myValue = ref(5)
|
|
17
|
+
|
|
18
|
+
ifElse(
|
|
19
|
+
() => myValue.value > 10,
|
|
20
|
+
() => console.log('myValue is greater than 10'),
|
|
21
|
+
() => console.log('myValue is less than or equal to 10')
|
|
22
|
+
)
|
|
23
|
+
```
|
|
@@ -6,8 +6,8 @@ export interface IfElseOptions extends Pick<WatchOptions, 'immediate'> {}
|
|
|
6
6
|
|
|
7
7
|
export function ifElse(
|
|
8
8
|
source: WatchSource<boolean>,
|
|
9
|
-
onTrue: MaybeArray<VoidFunction
|
|
10
|
-
onFalse: MaybeArray<VoidFunction
|
|
9
|
+
onTrue: MaybeArray<VoidFunction> | undefined,
|
|
10
|
+
onFalse: MaybeArray<VoidFunction> | undefined,
|
|
11
11
|
options?: IfElseOptions
|
|
12
12
|
) {
|
|
13
13
|
const onTrueFunctions = toArray(onTrue)
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# toVariants utility
|
|
2
|
+
|
|
3
|
+
This utility is used to convert a set of props into a list of CSS variants classes.
|
|
4
|
+
|
|
5
|
+
- No class will be added for _falsy_ values
|
|
6
|
+
- `<key>` class will be added for `true` values
|
|
7
|
+
- `<key>--<value>` class will be added for other values
|
|
8
|
+
|
|
9
|
+
## Basic usage
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
const props = defineProps<{
|
|
13
|
+
label: string
|
|
14
|
+
color: 'blue' | 'red'
|
|
15
|
+
size: 'small' | 'large'
|
|
16
|
+
disabled?: boolean
|
|
17
|
+
}>()
|
|
18
|
+
|
|
19
|
+
const variants = computed(() =>
|
|
20
|
+
toVariants({
|
|
21
|
+
color: props.color,
|
|
22
|
+
size: props.size,
|
|
23
|
+
disabled: props.disabled,
|
|
24
|
+
})
|
|
25
|
+
)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
If `color` is `'blue'`, `size` is `'small'`, and `disabled` is `false`,
|
|
29
|
+
then `variants` will be `['color--blue', 'size--small']`.
|
|
30
|
+
|
|
31
|
+
## Advanced usage
|
|
32
|
+
|
|
33
|
+
Variants don't have to be based on props, you can define them the way you want.
|
|
34
|
+
|
|
35
|
+
Thanks to the way Vue works, they can also be mixed with other classes.
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
const props = defineProps<{
|
|
39
|
+
label: string
|
|
40
|
+
color: 'blue' | 'red'
|
|
41
|
+
size: 'small' | 'large'
|
|
42
|
+
}>()
|
|
43
|
+
|
|
44
|
+
const isDisabled = inject('isParentDisabled', ref(false))
|
|
45
|
+
|
|
46
|
+
const typoClasses = {
|
|
47
|
+
small: 'typo p3-regular',
|
|
48
|
+
large: 'typo p2-medium',
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const classes = computed(() => [
|
|
52
|
+
typoClasses[props.size],
|
|
53
|
+
{ disabled: isDisabled.value },
|
|
54
|
+
toVariants({
|
|
55
|
+
color: props.color,
|
|
56
|
+
size: props.size.slice(0, 1),
|
|
57
|
+
state: isDisabled.value ? 'off' : 'on',
|
|
58
|
+
}),
|
|
59
|
+
])
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
`classes` applied to the component will then look like `typo p3-regular disabled color-blue size-s state-off`
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xen-orchestra/web-core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.5.0",
|
|
5
5
|
"private": false,
|
|
6
6
|
"exports": {
|
|
7
7
|
"./*": {
|
|
@@ -23,19 +23,19 @@
|
|
|
23
23
|
"placement.js": "^1.0.0-beta.5"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"pinia": "^2.
|
|
27
|
-
"vue": "~3.
|
|
26
|
+
"pinia": "^2.2.6",
|
|
27
|
+
"vue": "~3.5.12",
|
|
28
28
|
"vue-i18n": "^9.9.0",
|
|
29
|
-
"vue-router": "^4.4.
|
|
29
|
+
"vue-router": "^4.4.5"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/lodash-es": "^4.17.12",
|
|
33
33
|
"@types/novnc__novnc": "^1.5.0",
|
|
34
34
|
"@vue/tsconfig": "^0.5.1",
|
|
35
|
-
"pinia": "^2.
|
|
36
|
-
"vue": "~3.
|
|
35
|
+
"pinia": "^2.2.6",
|
|
36
|
+
"vue": "~3.5.12",
|
|
37
37
|
"vue-i18n": "^9.9.0",
|
|
38
|
-
"vue-router": "^4.4.
|
|
38
|
+
"vue-router": "^4.4.5"
|
|
39
39
|
},
|
|
40
40
|
"homepage": "https://github.com/vatesfr/xen-orchestra/tree/master/@xen-orchestra/web-core",
|
|
41
41
|
"bugs": "https://github.com/vatesfr/xen-orchestra/issues",
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
<!-- v1.0 -->
|
|
2
|
-
<template>
|
|
3
|
-
<div class="card-numbers" :class="size">
|
|
4
|
-
<span class="label typo" :class="labelFontClass">{{ label }}</span>
|
|
5
|
-
<div class="values" :class="size">
|
|
6
|
-
<span v-if="percentValue" class="value typo c2-semi-bold">
|
|
7
|
-
{{ percentValue }}
|
|
8
|
-
</span>
|
|
9
|
-
|
|
10
|
-
<div class="value typo" :class="valueFontClass">
|
|
11
|
-
{{ value ?? '-' }}<span class="unit typo" :class="unitFontClass">{{ unit }}</span>
|
|
12
|
-
</div>
|
|
13
|
-
</div>
|
|
14
|
-
</div>
|
|
15
|
-
</template>
|
|
16
|
-
|
|
17
|
-
<script setup lang="ts" generic="TSize extends 'small' | 'medium'">
|
|
18
|
-
import { computed } from 'vue'
|
|
19
|
-
import { useI18n } from 'vue-i18n'
|
|
20
|
-
|
|
21
|
-
interface CardNumbersProps {
|
|
22
|
-
label: string
|
|
23
|
-
size: TSize
|
|
24
|
-
value?: number
|
|
25
|
-
unit?: string
|
|
26
|
-
max?: TSize extends 'small' ? number : never
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const props = defineProps<CardNumbersProps>()
|
|
30
|
-
|
|
31
|
-
const { n } = useI18n()
|
|
32
|
-
|
|
33
|
-
const labelFontClass = computed(() => (props.size === 'medium' ? 'c3-semi-bold' : 'c2-semi-bold'))
|
|
34
|
-
|
|
35
|
-
const valueFontClass = computed(() => (props.size === 'medium' ? 'h3-semi-bold' : 'c2-semi-bold'))
|
|
36
|
-
|
|
37
|
-
const unitFontClass = computed(() => (props.size === 'medium' ? 'p2-medium' : 'c2-semi-bold'))
|
|
38
|
-
|
|
39
|
-
const percentValue = computed(() => {
|
|
40
|
-
if (props.size !== 'small' || props.max === undefined || props.max === 0) {
|
|
41
|
-
return undefined
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (props.value === undefined) {
|
|
45
|
-
return n(0, 'percent').replace('0', '-')
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return n(props.value / props.max, 'percent')
|
|
49
|
-
})
|
|
50
|
-
</script>
|
|
51
|
-
|
|
52
|
-
<style lang="postcss" scoped>
|
|
53
|
-
/* COLOR VARIANTS */
|
|
54
|
-
.card-numbers {
|
|
55
|
-
&.small {
|
|
56
|
-
--label-color: var(--color-neutral-txt-primary);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
&.medium {
|
|
60
|
-
--label-color: var(--color-neutral-txt-secondary);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/* IMPLEMENTATION */
|
|
65
|
-
.card-numbers {
|
|
66
|
-
display: flex;
|
|
67
|
-
gap: 0.8rem;
|
|
68
|
-
width: fit-content;
|
|
69
|
-
|
|
70
|
-
&.medium {
|
|
71
|
-
flex-direction: column;
|
|
72
|
-
gap: 0.4rem;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.label {
|
|
77
|
-
color: var(--label-color);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.values {
|
|
81
|
-
display: flex;
|
|
82
|
-
flex-direction: column;
|
|
83
|
-
gap: 0.8rem;
|
|
84
|
-
align-items: flex-end;
|
|
85
|
-
|
|
86
|
-
&.medium {
|
|
87
|
-
align-items: flex-start;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.value {
|
|
92
|
-
color: var(--color-neutral-txt-primary);
|
|
93
|
-
display: flex;
|
|
94
|
-
gap: 0.2rem;
|
|
95
|
-
align-items: center;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.unit {
|
|
99
|
-
color: var(--color-neutral-txt-primary);
|
|
100
|
-
}
|
|
101
|
-
</style>
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
<!-- v1.0 -->
|
|
2
|
-
<template>
|
|
3
|
-
<VtsIcon :class="className" accent="current" :icon class="power-state-icon" />
|
|
4
|
-
</template>
|
|
5
|
-
|
|
6
|
-
<script lang="ts" setup>
|
|
7
|
-
import VtsIcon from '@core/components/icon/VtsIcon.vue'
|
|
8
|
-
import type { POWER_STATE } from '@core/types/power-state.type'
|
|
9
|
-
import { faMoon, faPause, faPlay, faStop } from '@fortawesome/free-solid-svg-icons'
|
|
10
|
-
import { computed } from 'vue'
|
|
11
|
-
|
|
12
|
-
const props = defineProps<{
|
|
13
|
-
state: POWER_STATE
|
|
14
|
-
}>()
|
|
15
|
-
|
|
16
|
-
const icons = {
|
|
17
|
-
running: faPlay,
|
|
18
|
-
paused: faPause,
|
|
19
|
-
suspended: faMoon,
|
|
20
|
-
halted: faStop,
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const icon = computed(() => icons[props.state])
|
|
24
|
-
|
|
25
|
-
const className = computed(() => `state-${props.state}`)
|
|
26
|
-
</script>
|
|
27
|
-
|
|
28
|
-
<style lang="postcss" scoped>
|
|
29
|
-
.power-state-icon {
|
|
30
|
-
&.state-suspended {
|
|
31
|
-
color: var(--color-normal-txt-item);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
&.state-running {
|
|
35
|
-
color: var(--color-success-item-base);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
&.state-paused {
|
|
39
|
-
color: var(--color-normal-item-active);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
&.state-halted {
|
|
43
|
-
color: var(--color-danger-item-base);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
</style>
|
package/lib/components/UiTag.vue
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
<!-- v1.2 -->
|
|
2
|
-
<template>
|
|
3
|
-
<span :class="[color, { light }]" class="ui-tag typo p3-regular">
|
|
4
|
-
<slot name="icon">
|
|
5
|
-
<VtsIcon :icon accent="current" fixed-width />
|
|
6
|
-
</slot>
|
|
7
|
-
<span class="text-ellipsis"><slot /></span>
|
|
8
|
-
</span>
|
|
9
|
-
</template>
|
|
10
|
-
|
|
11
|
-
<script lang="ts" setup>
|
|
12
|
-
import VtsIcon from '@core/components/icon/VtsIcon.vue'
|
|
13
|
-
import type { TagColor } from '@core/types/color.type'
|
|
14
|
-
import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
|
|
15
|
-
|
|
16
|
-
defineProps<{
|
|
17
|
-
color: TagColor
|
|
18
|
-
light?: boolean
|
|
19
|
-
icon?: IconDefinition
|
|
20
|
-
}>()
|
|
21
|
-
</script>
|
|
22
|
-
|
|
23
|
-
<style lang="postcss" scoped>
|
|
24
|
-
/* COLOR VARIANTS */
|
|
25
|
-
.ui-tag {
|
|
26
|
-
&.primary {
|
|
27
|
-
--background-color: var(--color-normal-item-base);
|
|
28
|
-
--color: var(--color-normal-txt-item);
|
|
29
|
-
|
|
30
|
-
&.light {
|
|
31
|
-
--background-color: var(--color-normal-background-selected);
|
|
32
|
-
--color: var(--color-normal-txt-base);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
&.secondary {
|
|
37
|
-
--background-color: var(--color-neutral-txt-primary);
|
|
38
|
-
--color: var(--color-neutral-background-primary);
|
|
39
|
-
|
|
40
|
-
&.light {
|
|
41
|
-
--background-color: var(--color-neutral-background-secondary);
|
|
42
|
-
--color: var(--color-neutral-txt-primary);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
&.success {
|
|
47
|
-
--background-color: var(--color-success-item-base);
|
|
48
|
-
--color: var(--color-success-txt-item);
|
|
49
|
-
|
|
50
|
-
&.light {
|
|
51
|
-
--background-color: var(--color-success-background-selected);
|
|
52
|
-
--color: var(--color-success-txt-base);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
&.warning {
|
|
57
|
-
--background-color: var(--color-warning-item-base);
|
|
58
|
-
--color: var(--color-warning-txt-item);
|
|
59
|
-
|
|
60
|
-
&.light {
|
|
61
|
-
--background-color: var(--color-warning-background-selected);
|
|
62
|
-
--color: var(--color-warning-txt-base);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
&.danger {
|
|
67
|
-
--background-color: var(--color-danger-item-base);
|
|
68
|
-
--color: var(--color-danger-txt-item);
|
|
69
|
-
|
|
70
|
-
&.light {
|
|
71
|
-
--background-color: var(--color-danger-background-selected);
|
|
72
|
-
--color: var(--color-danger-txt-base);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
&.disabled {
|
|
77
|
-
--background-color: var(--color-neutral-background-disabled);
|
|
78
|
-
--color: var(--color-neutral-txt-secondary);
|
|
79
|
-
|
|
80
|
-
&.light {
|
|
81
|
-
--background-color: var(--color-neutral-background-secondary);
|
|
82
|
-
--color: var(--color-neutral-txt-secondary);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/* IMPLEMENTATION */
|
|
88
|
-
.ui-tag {
|
|
89
|
-
display: flex;
|
|
90
|
-
justify-content: center;
|
|
91
|
-
align-items: center;
|
|
92
|
-
gap: 0.8rem;
|
|
93
|
-
white-space: nowrap;
|
|
94
|
-
color: var(--color);
|
|
95
|
-
background-color: var(--background-color);
|
|
96
|
-
padding: 0.2rem 0.8rem;
|
|
97
|
-
border-radius: 0.4rem;
|
|
98
|
-
vertical-align: middle;
|
|
99
|
-
min-width: 0;
|
|
100
|
-
}
|
|
101
|
-
</style>
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
<!-- v1.0 -->
|
|
2
|
-
<template>
|
|
3
|
-
<div class="backup-item">
|
|
4
|
-
<RouterLink v-if="backup.route !== undefined" :to="backup.route">
|
|
5
|
-
{{ backup.label }}
|
|
6
|
-
</RouterLink>
|
|
7
|
-
<p v-else class="typo p3-medium">
|
|
8
|
-
{{ backup.label }}
|
|
9
|
-
</p>
|
|
10
|
-
<div class="states">
|
|
11
|
-
<BackupState v-for="(state, index) in backup.states" :key="index" :state />
|
|
12
|
-
</div>
|
|
13
|
-
</div>
|
|
14
|
-
</template>
|
|
15
|
-
|
|
16
|
-
<script lang="ts" setup>
|
|
17
|
-
import BackupState from '@core/components/backup-state/BackupState.vue'
|
|
18
|
-
import type { Backup } from '@core/types/backup.type'
|
|
19
|
-
|
|
20
|
-
defineProps<{
|
|
21
|
-
backup: Backup
|
|
22
|
-
}>()
|
|
23
|
-
</script>
|
|
24
|
-
|
|
25
|
-
<style lang="postcss" scoped>
|
|
26
|
-
.backup-item {
|
|
27
|
-
padding: 0.8rem 0.4rem;
|
|
28
|
-
border-top: 0.1rem solid var(--color-neutral-border);
|
|
29
|
-
display: flex;
|
|
30
|
-
align-items: center;
|
|
31
|
-
gap: 0.2rem;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.states {
|
|
35
|
-
margin-inline-start: auto;
|
|
36
|
-
display: flex;
|
|
37
|
-
align-items: center;
|
|
38
|
-
gap: 0.2rem;
|
|
39
|
-
}
|
|
40
|
-
</style>
|