@xen-orchestra/web-core 0.0.3 → 0.0.4

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.
Files changed (39) hide show
  1. package/lib/assets/css/_typography.pcss +1 -0
  2. package/lib/assets/css/typography/_utils.pcss +6 -0
  3. package/lib/components/UiTag.vue +3 -7
  4. package/lib/components/backdrop/Backdrop.vue +11 -0
  5. package/lib/components/cell-object/CellObject.vue +54 -0
  6. package/lib/components/cell-text/CellText.vue +40 -0
  7. package/lib/components/chip/UiChip.vue +3 -4
  8. package/lib/components/console/RemoteConsole.vue +1 -1
  9. package/lib/components/divider/Divider.vue +25 -0
  10. package/lib/components/dropdown/DropdownItem.vue +1 -4
  11. package/lib/components/head-bar/HeadBar.vue +78 -0
  12. package/lib/components/input/UiInput.vue +133 -0
  13. package/lib/components/object-link/ObjectLink.vue +87 -0
  14. package/lib/components/search-bar/SearchBar.vue +60 -0
  15. package/lib/components/stacked-bar/StackedBarSegment.vue +2 -8
  16. package/lib/components/tab/TabList.vue +1 -0
  17. package/lib/components/table/UiTable.vue +6 -0
  18. package/lib/components/task/QuickTaskButton.vue +62 -0
  19. package/lib/components/task/QuickTaskItem.vue +91 -0
  20. package/lib/components/task/QuickTaskList.vue +48 -0
  21. package/lib/components/task/QuickTaskPanel.vue +65 -0
  22. package/lib/components/task/QuickTaskTabBar.vue +46 -0
  23. package/lib/components/tree/TreeItem.vue +8 -8
  24. package/lib/components/tree/TreeItemLabel.vue +28 -16
  25. package/lib/composables/tab-list.composable.ts +33 -0
  26. package/lib/composables/tree/branch.ts +5 -5
  27. package/lib/i18n.ts +53 -0
  28. package/lib/layouts/CoreLayout.vue +2 -11
  29. package/lib/locales/de.json +7 -1
  30. package/lib/locales/en.json +22 -1
  31. package/lib/locales/fa.json +46 -0
  32. package/lib/locales/fr.json +22 -1
  33. package/lib/types/tab.type.ts +17 -0
  34. package/lib/types/task.type.ts +13 -0
  35. package/lib/types/utility.type.ts +1 -1
  36. package/lib/utils/if-else.utils.ts +3 -3
  37. package/lib/utils/open-url.utils.ts +3 -0
  38. package/package.json +3 -3
  39. package/lib/components/UiSeparator.vue +0 -11
@@ -0,0 +1,46 @@
1
+ {
2
+ "alarms": "هشدارها",
3
+
4
+ "bytes.ki": "KiB",
5
+ "bytes.mi": "MiB",
6
+ "bytes.gi": "GiB",
7
+
8
+ "coming-soon": "به زودی!",
9
+ "console": "کنسول",
10
+
11
+ "core.close": "بستن",
12
+ "core.current": "جاری",
13
+ "core.filter": "فیلتر",
14
+ "core.group": "گروه",
15
+ "core.hide": "مخفی کردن",
16
+ "core.open": "باز کردن",
17
+ "core.quick-actions": "اقدامات سریع",
18
+
19
+ "core.select.all": "انتخاب همه",
20
+ "core.select.none": "انتخاب هیچکدام",
21
+
22
+ "core.sidebar.close": "بستن نوار کناری",
23
+ "core.sidebar.lock": "قفل کردن نوار کناری باز شده",
24
+ "core.sidebar.open": "باز کردن نوار کناری",
25
+ "core.sidebar.unlock": "از حالت قفل خارج کردن نوار کناری",
26
+
27
+ "core.sort.ascending": "مرتب سازی صعودی",
28
+ "core.sort.descending": "مرتب سازی نزولی",
29
+
30
+ "dark-mode.enable": "فعال کردن حالت تاریک",
31
+ "dark-mode.disable": "غیر فعال کردن حالت تاریک",
32
+ "dark-mode.auto": "حالت خودکار تاریک",
33
+
34
+ "dashboard": "داشبورد",
35
+ "documentation-name": "اسناد {name}",
36
+ "loading-in-progress": "بارگیری در حال انجام است…",
37
+ "log-out": "خروج",
38
+ "master": "میزبان اصلی",
39
+ "network": "شبکه",
40
+ "power-on-for-console": "ماشین مجازی خود را روشن کنید تا به کنسول آن دسترسی داشته باشید",
41
+ "stats": "آمار",
42
+ "storage": "ذخیره سازی",
43
+ "support-name": "پشتیبانی حرفه ای {name}",
44
+ "system": "سیستم",
45
+ "tasks": "کارها"
46
+ }
@@ -8,6 +8,8 @@
8
8
  "coming-soon": "Bientôt disponible !",
9
9
  "console": "Console",
10
10
 
11
+ "core.copied": "Copié",
12
+ "core.copy-id": "Copier l'ID",
11
13
  "core.close": "Fermer",
12
14
  "core.current": "Actuel",
13
15
  "core.filter": "Filtrer",
@@ -16,6 +18,12 @@
16
18
  "core.open": "Ouvrir",
17
19
  "core.quick-actions": "Actions rapides",
18
20
 
21
+ "core.search": "Rechercher",
22
+
23
+ "core.search-bar.label": "Moteur de recherche",
24
+ "core.search-bar.placeholder": "Écrivez votre requête…",
25
+ "core.search-bar.use-query-builder": "Utiliser le constructeur de requête",
26
+
19
27
  "core.select.all": "Tout sélectionner",
20
28
  "core.select.none": "Tout désélectionner",
21
29
 
@@ -33,15 +41,28 @@
33
41
 
34
42
  "dashboard": "Tableau de bord",
35
43
  "documentation-name": "Documentation {name}",
44
+ "hosts": "Hôtes",
36
45
  "loading-in-progress": "Chargement en cours…",
37
46
  "log-out": "Se déconnecter",
38
47
  "master": "Hôte primaire",
48
+ "n-vms": "1 VM | {n} VMs",
39
49
  "network": "Réseau",
40
50
  "object-not-found": "L'objet {id} est introuvable…",
41
51
  "power-on-for-console": "Allumez votre VM pour accéder à sa console",
52
+ "see-all": "Voir tout",
42
53
  "stats": "Stats",
43
54
  "storage": "Stockage",
44
55
  "support-name": "Support pro {name}",
45
56
  "system": "Système",
46
- "tasks": "Tâches"
57
+
58
+ "tasks": "Tâches",
59
+ "tasks.n-subtasks": "{n} sous-tâche | {n} sous-tâches",
60
+ "tasks.no-tasks": "Aucune tâche",
61
+ "tasks.quick-view": "Vue rapide des tâches",
62
+ "tasks.quick-view.all": "Toutes",
63
+ "tasks.quick-view.done": "Terminées",
64
+ "tasks.quick-view.failed": "Échouées",
65
+ "tasks.quick-view.in-progress": "En cours",
66
+
67
+ "vms": "VMs"
47
68
  }
@@ -0,0 +1,17 @@
1
+ import type { Ref } from 'vue'
2
+
3
+ export type Tab = {
4
+ isActive: boolean
5
+ activate: () => void
6
+ bindings: {
7
+ onClick: (event: MouseEvent) => void
8
+ active: boolean
9
+ }
10
+ }
11
+
12
+ export type TabList<TName extends string> = {
13
+ currentTab: Ref<TName | undefined>
14
+ activate: (name: TName | undefined) => void
15
+ isActive: (name: TName) => boolean
16
+ tabs: Record<TName, Tab>
17
+ }
@@ -0,0 +1,13 @@
1
+ export type TaskStatus = 'pending' | 'success' | 'failure'
2
+
3
+ export type TaskTab = TaskStatus | 'all'
4
+
5
+ export type Task = {
6
+ id: string | number
7
+ name: string
8
+ status: TaskStatus
9
+ tag?: string
10
+ start?: number
11
+ end?: number
12
+ subtasks?: Task[]
13
+ }
@@ -1,3 +1,3 @@
1
1
  export type MaybeArray<T> = T | T[]
2
2
 
3
- export type Noop = () => void
3
+ export type VoidFunction = () => void
@@ -1,4 +1,4 @@
1
- import type { MaybeArray, Noop } from '@core/types/utility.type'
1
+ import type { MaybeArray, VoidFunction } from '@core/types/utility.type'
2
2
  import { toArray } from '@core/utils/to-array.utils'
3
3
  import { watch, type WatchOptions, type WatchSource } from 'vue'
4
4
 
@@ -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<Noop>,
10
- onFalse: MaybeArray<Noop>,
9
+ onTrue: MaybeArray<VoidFunction>,
10
+ onFalse: MaybeArray<VoidFunction>,
11
11
  options?: IfElseOptions
12
12
  ) {
13
13
  const onTrueFunctions = toArray(onTrue)
@@ -0,0 +1,3 @@
1
+ export function openUrl(url: string, targetBlank?: boolean) {
2
+ window.open(url, targetBlank ? '_blank' : '_self')
3
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xen-orchestra/web-core",
3
3
  "type": "module",
4
- "version": "0.0.3",
4
+ "version": "0.0.4",
5
5
  "private": false,
6
6
  "exports": {
7
7
  "./*": {
@@ -26,7 +26,7 @@
26
26
  "pinia": "^2.1.7",
27
27
  "vue": "^3.4.13",
28
28
  "vue-i18n": "^9.9.0",
29
- "vue-router": "^4.2.5"
29
+ "vue-router": "^4.4.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/lodash-es": "^4.17.12",
@@ -35,7 +35,7 @@
35
35
  "pinia": "^2.1.7",
36
36
  "vue": "^3.4.13",
37
37
  "vue-i18n": "^9.9.0",
38
- "vue-router": "^4.2.5"
38
+ "vue-router": "^4.4.0"
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,11 +0,0 @@
1
- <template>
2
- <hr class="ui-separator" />
3
- </template>
4
-
5
- <style lang="postcss" scoped>
6
- .ui-separator {
7
- border: none;
8
- border-top: 0.1rem solid var(--color-grey-500);
9
- border-right: 0.1rem solid var(--color-grey-500);
10
- }
11
- </style>