bfg-common 1.4.502 → 1.4.504

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,8 @@
1
1
  <template>
2
2
  <common-pages-home-widgets-hosts-new
3
3
  v-if="isNewView"
4
+ :items="defaultHosts"
5
+ :total-hosts="totalHosts"
4
6
  :loading="false"
5
7
  ></common-pages-home-widgets-hosts-new>
6
8
 
@@ -28,6 +30,26 @@ const totalHosts = computed<number>(
28
30
  props.hosts.maintenance +
29
31
  props.hosts.disconnected || 0
30
32
  )
33
+
34
+ const defaultHosts = ref([
35
+ // временно
36
+ {
37
+ value: 0,
38
+ text: 'connected',
39
+ icon: 'vsphere-icon-Host_Connect',
40
+ },
41
+ {
42
+ value: 0,
43
+ text: 'disconnected',
44
+ icon: 'vsphere-icon-Host_Disconnect',
45
+ },
46
+
47
+ {
48
+ value: 0,
49
+ text: 'maintenance',
50
+ icon: 'vsphere-icon-host-maintenance',
51
+ },
52
+ ])
31
53
  </script>
32
54
 
33
55
  <style lang="scss" scoped></style>
@@ -3,14 +3,89 @@
3
3
  <template v-if="props.loading">
4
4
  <!-- skeleton -->
5
5
  </template>
6
- <div v-else></div>
6
+ <div v-else class="card-content">
7
+ <div class="card-content__title">
8
+ <h1>{{ localization.common.hosts }}</h1>
9
+ <span>({{ props.totalVms }})</span>
10
+ </div>
11
+
12
+ <div class="card-content__container">
13
+ <div
14
+ v-for="({ text, value, icon }, key) in props.items"
15
+ :key="key"
16
+ class="card-content-item"
17
+ >
18
+ <span :class="['icon', icon]"></span>
19
+ <div class="label">{{ localization.common[text] }}</div>
20
+ <div class="count">{{ value }}</div>
21
+ </div>
22
+ </div>
23
+ </div>
7
24
  </ui-widget>
8
25
  </template>
9
26
 
10
27
  <script lang="ts" setup>
28
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
29
+ import type { UI_I_Card } from '~/components/common/pages/home/lib/models/interfaces'
30
+
11
31
  const props = defineProps<{
32
+ items: UI_I_Card[]
33
+ totalVms: number
12
34
  loading: boolean
13
35
  }>()
36
+
37
+ const localization = computed<UI_I_Localization>(() => useLocal())
14
38
  </script>
15
39
 
16
- <style lang="scss" scoped></style>
40
+ <style lang="scss" scoped>
41
+ @import 'assets/scss/common/mixins.scss';
42
+ .card-content {
43
+ &__title {
44
+ @include flex($align: center);
45
+ color: var(--widget-text-first);
46
+ margin-bottom: 16px;
47
+ & > h1 {
48
+ font-size: 16px;
49
+ font-weight: 500;
50
+ line-height: 19.36px;
51
+ }
52
+ & > span {
53
+ font-size: 16px;
54
+ font-weight: 500;
55
+ margin-left: 5px;
56
+ }
57
+ }
58
+ &__container {
59
+ display: flex;
60
+ justify-content: space-between;
61
+ text-align: center;
62
+ }
63
+
64
+ .card-content-item {
65
+ display: flex;
66
+ flex-direction: column;
67
+ align-items: center;
68
+
69
+ .icon {
70
+ width: 20px;
71
+ height: 20px;
72
+ margin-bottom: 8px;
73
+ }
74
+
75
+ .label {
76
+ color: #9da6ad;
77
+ font-size: 14px;
78
+ font-weight: 500;
79
+ line-height: 16.94px;
80
+ margin-bottom: 12px;
81
+ }
82
+
83
+ .count {
84
+ color: var(--widget-text-first);
85
+ font-size: 16px;
86
+ font-weight: 500;
87
+ line-height: 19.36px;
88
+ }
89
+ }
90
+ }
91
+ </style>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.4.502",
4
+ "version": "1.4.504",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",