bfg-common 1.5.731 → 1.5.732

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.
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="main-content-snapshots h-full overflow-hidden">
3
- <templates-inventory-vm-snapshots-tools
3
+ <common-vm-snapshots-tools
4
4
  :snapshots-count="props.snapshotsTree.length"
5
5
  :snapshots-loading="props.snapshotsLoading"
6
6
  @select="emits('show-modal', $event)"
@@ -24,9 +24,7 @@
24
24
  @select-node="emits('select-node', $event)"
25
25
  @show-nodes="emits('show-nodes', $event)"
26
26
  />
27
- <templates-inventory-vm-snapshots-detail-view
28
- :detail="props.detailData"
29
- />
27
+ <common-vm-snapshots-detail-view :detail="props.detailData" />
30
28
  </div>
31
29
  <div v-else class="empty-block flex items-center justify-center w-full">
32
30
  {{ localization.common.noSnapshotAvailable }}
@@ -0,0 +1,82 @@
1
+ <template>
2
+ <component
3
+ :is="currentComponent"
4
+ :snapshots-tree="props.snapshotsTree"
5
+ :snapshots-loading="props.snapshotsLoading"
6
+ :detail-data="detailData"
7
+ @show-modal="onShowModal"
8
+ @select-node="onSelectNode"
9
+ @show-nodes="onShowNodes"
10
+ />
11
+ </template>
12
+
13
+ <script setup lang="ts">
14
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
15
+ import type { UI_T_SnapshotActionType } from '~/components/common/vm/snapshots/lib/models/types'
16
+ import type {
17
+ UI_I_SnapshotsDetails,
18
+ UI_I_SnapshotsTreeNode,
19
+ } from '~/store/inventory/modules/snapshots/lib/models/interfaces'
20
+
21
+ const props = defineProps<{
22
+ snapshotsTree: UI_I_SnapshotsTreeNode
23
+ snapshotsLoading: boolean
24
+ }>()
25
+
26
+ const emits = defineEmits<{
27
+ (event: 'select-node', value: UI_I_SnapshotsTreeNode): void
28
+ (event: 'show-nodes', value: string): void
29
+ (event: 'show-modal', value: UI_T_SnapshotActionType): void
30
+ }>()
31
+
32
+ const { $recursion, $store }: any = useNuxtApp()
33
+
34
+ const localization = computed<UI_I_Localization>(() => useLocal())
35
+
36
+ const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
37
+ const currentComponent = computed(() =>
38
+ isNewView.value
39
+ ? defineAsyncComponent(() => import('./new/New.vue'))
40
+ : defineAsyncComponent(() => import('./Old.vue'))
41
+ )
42
+
43
+ const detailData = computed<UI_I_SnapshotsDetails | null>(() => {
44
+ const node: UI_I_SnapshotsTreeNode =
45
+ $recursion.find(props.snapshotsTree, true, 'isActive', 'nodes') || null
46
+
47
+ if (!node) return null
48
+
49
+ let snapshot_the_virtual_machines_memory = ''
50
+ let quiesce_guest_file_system = ''
51
+
52
+ if (isNewView.value) {
53
+ snapshot_the_virtual_machines_memory = node.memory?.enabled ? 'yes' : 'no'
54
+ quiesce_guest_file_system = node.quiesce_fs ? 'yes' : 'no'
55
+ } else {
56
+ snapshot_the_virtual_machines_memory = node.memory?.enabled
57
+ ? localization.value.common.yes
58
+ : localization.value.common.no
59
+ quiesce_guest_file_system = node.quiesce_fs
60
+ ? localization.value.common.yes
61
+ : localization.value.common.no
62
+ }
63
+
64
+ return {
65
+ ...node,
66
+ snapshot_the_virtual_machines_memory,
67
+ quiesce_guest_file_system,
68
+ }
69
+ })
70
+ const onSelectNode = (item: UI_I_SnapshotsTreeNode): void => {
71
+ emits('select-node', item.type === 'location' ? item.parent_id : item.id)
72
+ }
73
+ const onShowNodes = (id: string): void => {
74
+ emits('show-nodes', id)
75
+ }
76
+
77
+ const onShowModal = (action: UI_T_SnapshotActionType): void => {
78
+ emits('show-modal', action)
79
+ }
80
+ </script>
81
+
82
+ <style scoped lang="scss"></style>
@@ -6,4 +6,3 @@ export type UI_T_SnapshotActionType =
6
6
  | 'delete_all'
7
7
  | 'group_take'
8
8
  | 'group_delete_all'
9
- export type UI_T_TakeOrEdit = 'take' | 'edit' | 'groupTake'
@@ -206,7 +206,7 @@
206
206
  </div>
207
207
  </div>
208
208
 
209
- <templates-common-vm-snapshots-new-context-menu-view
209
+ <common-vm-snapshots-new-context-menu-view
210
210
  :show="contextMenuShow"
211
211
  :context-data="contextMenu"
212
212
  @select-action="onSelectContextMenuItem"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.5.731",
4
+ "version": "1.5.732",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",