bfg-common 1.6.65 → 1.6.66

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 (141) hide show
  1. package/components/atoms/dropdown/dropdown/Dropdown.vue +10 -8
  2. package/components/atoms/dropdown/dropdown/lib/models/interfaces.ts +1 -0
  3. package/components/common/adapterManager/AdapterManager.vue +473 -473
  4. package/components/common/adapterManager/AdapterManagerOld.vue +498 -498
  5. package/components/common/adapterManager/addAdapterModal/AddAdapterModal.vue +70 -70
  6. package/components/common/adapterManager/addAdapterModal/AddAdapterModalNew.vue +110 -110
  7. package/components/common/adapterManager/addAdapterModal/AddAdapterModalOld.vue +531 -531
  8. package/components/common/adapterManager/addAdapterWarningModal/AddAdapterWarningModal.vue +32 -32
  9. package/components/common/adapterManager/addAdapterWarningModal/AddAdapterWarningModalNew.vue +37 -37
  10. package/components/common/adapterManager/addAdapterWarningModal/AddAdapterWarningModalOld.vue +73 -73
  11. package/components/common/adapterManager/lib/config/index.ts +19 -19
  12. package/components/common/adapterManager/noActiveAdaptersModal/NoActiveAdaptersModal.vue +31 -31
  13. package/components/common/adapterManager/noActiveAdaptersModal/NoActiveAdaptersModalNew.vue +34 -34
  14. package/components/common/adapterManager/noActiveAdaptersModal/NoActiveAdaptersModalOld.vue +57 -57
  15. package/components/common/adapterManager/noConnectedActiveAdaptersModal/NoConnectedActiveAdaptersModal.vue +31 -31
  16. package/components/common/adapterManager/noConnectedActiveAdaptersModal/NoConnectedActiveAdaptersModalNew.vue +34 -34
  17. package/components/common/adapterManager/noConnectedActiveAdaptersModal/NoConnectedActiveAdaptersModalOld.vue +57 -57
  18. package/components/common/adapterManager/ui/actions/AddAdapterButton.vue +34 -34
  19. package/components/common/adapterManager/ui/actions/RemoveAdapterButton.vue +41 -41
  20. package/components/common/adapterManager/ui/actions/VerticalSeparator.vue +10 -10
  21. package/components/common/adapterManager/ui/actions/bar/BarOld.vue +95 -95
  22. package/components/common/adapterManager/ui/actions/moveDownAdapterButton/MoveDownAdapterButton.vue +28 -28
  23. package/components/common/adapterManager/ui/actions/moveDownAdapterButton/MoveDownAdapterButtonNew.vue +76 -76
  24. package/components/common/adapterManager/ui/actions/moveDownAdapterButton/MoveDownAdapterButtonOld.vue +33 -33
  25. package/components/common/adapterManager/ui/actions/moveUpAdapterButton/MoveUpAdapterButton.vue +28 -28
  26. package/components/common/adapterManager/ui/actions/moveUpAdapterButton/MoveUpAdapterButtonNew.vue +77 -77
  27. package/components/common/adapterManager/ui/actions/moveUpAdapterButton/MoveUpAdapterButtonOld.vue +33 -33
  28. package/components/common/adapterManager/ui/noSelectedAdapter/NoSelectedAdapter.vue +24 -24
  29. package/components/common/adapterManager/ui/noSelectedAdapter/NoSelectedAdapterNew.vue +18 -18
  30. package/components/common/adapterManager/ui/noSelectedAdapter/NoSelectedAdapterOld.vue +38 -38
  31. package/components/common/adapterManager/ui/secondTitle/SecondTitle.vue +31 -31
  32. package/components/common/adapterManager/ui/secondTitle/SecondTitleNew.vue +51 -51
  33. package/components/common/adapterManager/ui/secondTitle/SecondTitleOld.vue +35 -35
  34. package/components/common/adapterManager/ui/table/Table.vue +88 -88
  35. package/components/common/adapterManager/ui/table/TableNew.vue +137 -137
  36. package/components/common/adapterManager/ui/table/TableOld.vue +141 -141
  37. package/components/common/adapterManager/ui/table/adapters/Adapters.vue +44 -44
  38. package/components/common/adapterManager/ui/table/adapters/AdaptersNew.vue +187 -187
  39. package/components/common/adapterManager/ui/table/adapters/AdaptersOld.vue +87 -87
  40. package/components/common/adapterManager/ui/table/header/Header.vue +57 -57
  41. package/components/common/adapterManager/ui/table/header/HeaderNew.vue +81 -81
  42. package/components/common/adapterManager/ui/table/header/HeaderOld.vue +79 -79
  43. package/components/common/adapterManager/ui/table/lib/models/types.ts +1 -1
  44. package/components/common/diagramMain/Diagram.vue +459 -459
  45. package/components/common/diagramMain/DiagramMain.vue +929 -929
  46. package/components/common/diagramMain/adapter/Adapter.vue +123 -123
  47. package/components/common/diagramMain/adapter/AdapterItem.vue +438 -438
  48. package/components/common/diagramMain/adapter/AdapterItems.vue +61 -61
  49. package/components/common/diagramMain/adapter/Contents.vue +212 -212
  50. package/components/common/diagramMain/adapter/Lines.vue +81 -81
  51. package/components/common/diagramMain/adapter/block/Block.vue +27 -27
  52. package/components/common/diagramMain/adapter/block/BlockNew.vue +58 -58
  53. package/components/common/diagramMain/adapter/block/BlockOld.vue +50 -50
  54. package/components/common/diagramMain/adapter/secondBlock/SecondBlock.vue +27 -27
  55. package/components/common/diagramMain/adapter/secondBlock/SecondBlockNew.vue +60 -60
  56. package/components/common/diagramMain/adapter/secondBlock/SecondBlockOld.vue +51 -51
  57. package/components/common/diagramMain/header/Header.vue +49 -49
  58. package/components/common/diagramMain/header/HeaderNew.vue +155 -155
  59. package/components/common/diagramMain/header/HeaderOld.vue +234 -234
  60. package/components/common/diagramMain/highlights/Highlights.vue +151 -151
  61. package/components/common/diagramMain/highlights/HighlightsNew.vue +124 -124
  62. package/components/common/diagramMain/highlights/HighlightsOld.vue +107 -107
  63. package/components/common/diagramMain/lib/config/index.ts +81 -81
  64. package/components/common/diagramMain/lib/config/initial.ts +50 -50
  65. package/components/common/diagramMain/lib/config/positions.ts +194 -194
  66. package/components/common/diagramMain/lib/models/enums.ts +44 -44
  67. package/components/common/diagramMain/lib/models/interfaces.ts +760 -760
  68. package/components/common/diagramMain/lib/models/types.ts +21 -21
  69. package/components/common/diagramMain/lib/utils/utils.ts +331 -331
  70. package/components/common/diagramMain/modals/ManagePhysicalAdaptersModal.vue +331 -331
  71. package/components/common/diagramMain/modals/Modals.vue +483 -483
  72. package/components/common/diagramMain/modals/lib/config/adapterModal.ts +147 -147
  73. package/components/common/diagramMain/modals/lib/config/diagramConfig.ts +66 -66
  74. package/components/common/diagramMain/modals/lib/config/index.ts +56 -56
  75. package/components/common/diagramMain/modals/lib/config/initial.ts +180 -180
  76. package/components/common/diagramMain/modals/lib/config/networkModal.ts +405 -405
  77. package/components/common/diagramMain/modals/lib/config/portModal.ts +253 -253
  78. package/components/common/diagramMain/modals/lib/config/switchModal.ts +245 -245
  79. package/components/common/diagramMain/modals/lib/config/vCenterModal.ts +48 -48
  80. package/components/common/diagramMain/modals/lib/config/vmKernelAdapter.ts +90 -90
  81. package/components/common/diagramMain/modals/lib/mappers/mappers.ts +88 -88
  82. package/components/common/diagramMain/modals/migrateVmkernelAdapter/MigrateVmkernelAdapter.vue +541 -541
  83. package/components/common/diagramMain/modals/migrateVmkernelAdapter/lib/config/steps.ts +114 -114
  84. package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/ConnectionSettings.vue +170 -170
  85. package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/SelectVmkernelAdapter.vue +159 -159
  86. package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/VmkernelAdapterReadyComplete.vue +49 -49
  87. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/common.ts +19 -19
  88. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/connectionSettings.ts +137 -137
  89. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/selectVmkernelAdapter.ts +52 -52
  90. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/validations.ts +19 -19
  91. package/components/common/diagramMain/modals/remove/RemoveModal.vue +82 -82
  92. package/components/common/diagramMain/modals/remove/RemoveModalNew.vue +106 -106
  93. package/components/common/diagramMain/modals/remove/RemoveModalOld.vue +241 -241
  94. package/components/common/diagramMain/modals/viewSettings/info/Info.vue +57 -57
  95. package/components/common/diagramMain/modals/viewSettings/info/InfoNew.vue +174 -174
  96. package/components/common/diagramMain/modals/viewSettings/info/InfoOld.vue +141 -141
  97. package/components/common/diagramMain/modals/viewSettings/viewSettings/ViewSettings.vue +45 -45
  98. package/components/common/diagramMain/modals/viewSettings/viewSettings/ViewSettingsNew.vue +323 -323
  99. package/components/common/diagramMain/modals/viewSettings/viewSettings/ViewSettingsOld.vue +203 -203
  100. package/components/common/diagramMain/modals/viewSettings/viewSettingsModal/ViewSettingsModal.vue +60 -60
  101. package/components/common/diagramMain/modals/viewSettings/viewSettingsModal/ViewSettingsModalNew.vue +50 -50
  102. package/components/common/diagramMain/modals/viewSettings/viewSettingsModal/ViewSettingsModalOld.vue +70 -70
  103. package/components/common/diagramMain/modals/viewSettings/viewSettingsModal/lib/models/interfaces.ts +48 -48
  104. package/components/common/diagramMain/network/Contents.vue +497 -497
  105. package/components/common/diagramMain/network/Lines.vue +107 -107
  106. package/components/common/diagramMain/network/Network.vue +141 -141
  107. package/components/common/diagramMain/network/block/Block.vue +37 -37
  108. package/components/common/diagramMain/network/block/BlockNew.vue +68 -68
  109. package/components/common/diagramMain/network/block/BlockOld.vue +64 -64
  110. package/components/common/diagramMain/network/noNetwork/NoNetwork.vue +12 -12
  111. package/components/common/diagramMain/network/noNetwork/NoNetworkNew.vue +89 -89
  112. package/components/common/diagramMain/network/noNetwork/NoNetworkOld.vue +61 -61
  113. package/components/common/diagramMain/network/secondBlock/SecondBlock.vue +41 -41
  114. package/components/common/diagramMain/network/secondBlock/SecondBlockNew.vue +64 -64
  115. package/components/common/diagramMain/network/secondBlock/SecondBlockOld.vue +60 -60
  116. package/components/common/diagramMain/port/Port.vue +580 -580
  117. package/components/common/diagramMain/port/Ports.vue +47 -47
  118. package/components/common/diagramMain/skeleton/Header.vue +31 -31
  119. package/components/common/diagramMain/skeleton/Switch.vue +75 -75
  120. package/components/common/diagramMain/switch/Switch.vue +180 -180
  121. package/components/common/diagramMain/switch/SwitchSelected.vue +111 -111
  122. package/components/common/monitor/advanced/table/tableOld/TableOld.vue +93 -93
  123. package/components/common/monitor/utilization/Old.vue +65 -24
  124. package/components/common/monitor/utilization/Utilization.vue +22 -14
  125. package/components/common/monitor/utilization/infoBlock/InfoBlock.vue +125 -2
  126. package/components/common/monitor/utilization/infoBlock/New.vue +183 -3
  127. package/components/common/monitor/utilization/infoBlock/Old.vue +71 -66
  128. package/components/common/monitor/utilization/infoBlock/progressBar/New.vue +64 -0
  129. package/components/common/monitor/utilization/infoBlock/progressBar/Old.vue +65 -0
  130. package/components/common/monitor/utilization/infoBlock/progressBar/ProgressBar.vue +84 -0
  131. package/components/common/monitor/utilization/infoBlock/progressBar/lib/models/interfaces.ts +10 -0
  132. package/components/common/monitor/utilization/lib/models/enums.ts +4 -4
  133. package/components/common/monitor/utilization/lib/models/interfaces.ts +14 -12
  134. package/components/common/monitor/utilization/lib/models/types.ts +1 -0
  135. package/components/common/monitor/utilization/lib/utils/index.ts +64 -6
  136. package/components/common/monitor/utilization/new/New.vue +195 -0
  137. package/components/common/monitor/utilization/new/Portlet.vue +42 -0
  138. package/components/common/monitor/utilization/new/Skeleton.vue +120 -0
  139. package/components/common/monitor/utilization/new/lib/utils/newPortlet.ts +7 -0
  140. package/package.json +1 -1
  141. package/components/common/monitor/utilization/New.vue +0 -5
@@ -1,5 +1,20 @@
1
1
  <template>
2
- <component :is="currentComponent" :info-data="props.infoData" />
2
+ <component
3
+ :is="currentComponent"
4
+ :info-data="props.infoData"
5
+ :max-item="maxItem"
6
+ :consumed-item="consumedItem"
7
+ :demand-item="demandItem"
8
+ :overhead-item="overheadItem"
9
+ :usage-item="usageItem"
10
+ :bar-percent="barPercent"
11
+ :current-title="currentTitle"
12
+ :limit-item="limitItem"
13
+ :limit-percent="limitPercent"
14
+ :entitlement-item="entitlementItem"
15
+ :entitlement-percent="entitlementPercent"
16
+ :min-value="minValue"
17
+ />
3
18
  </template>
4
19
 
5
20
  <script setup lang="ts">
@@ -18,6 +33,114 @@ const currentComponent = computed(() =>
18
33
  ? defineAsyncComponent(() => import('./New.vue'))
19
34
  : defineAsyncComponent(() => import('./Old.vue'))
20
35
  )
36
+
37
+ const maxItem = ref<UI_I_UtilizationDataItem['data'][0] | null>(null)
38
+ const consumedItem = ref<UI_I_UtilizationDataItem['data'][0] | null>(null)
39
+ const demandItem = ref<UI_I_UtilizationDataItem['data'][0] | null>(null)
40
+ const overheadItem = ref<UI_I_UtilizationDataItem['data'][0] | null>(null)
41
+ const minValue = ref<string>('')
42
+ const usageItem = ref<UI_I_UtilizationDataItem['data'][0] | null>(null)
43
+ const limitItem = ref<UI_I_UtilizationDataItem['data'][0] | null>(null)
44
+ const entitlementItem = ref<UI_I_UtilizationDataItem['data'][0] | null>(null)
45
+
46
+ const parse = (value: string): number =>
47
+ parseFloat(value.replace(/[^\d.]/g, '')) || 0
48
+
49
+ const barPercent = computed<string>(() => {
50
+ if (!parse(maxItem.value?.value) || !parse(consumedItem.value?.value))
51
+ return '0'
52
+
53
+ return String(
54
+ Math.min(
55
+ (parse(consumedItem.value.value) / parse(maxItem.value.value)) * 100,
56
+ 100
57
+ )
58
+ )
59
+ })
60
+
61
+ const limitPercent = computed<string>(() => {
62
+ if (
63
+ !limitItem.value ||
64
+ !parse(limitItem.value?.value) ||
65
+ !parse(maxItem.value?.value)
66
+ )
67
+ return '0'
68
+
69
+ return String(
70
+ Math.min(
71
+ (parse(limitItem.value.value) / parse(maxItem.value.value)) * 100,
72
+ 100
73
+ )
74
+ )
75
+ })
76
+
77
+ const entitlementPercent = computed<string>(() => {
78
+ if (
79
+ !entitlementItem.value ||
80
+ !parse(entitlementItem.value?.value) ||
81
+ !parse(maxItem.value?.value)
82
+ )
83
+ return '0'
84
+
85
+ return String(
86
+ Math.min(
87
+ (parse(entitlementItem.value.value) / parse(maxItem.value.value)) * 100,
88
+ 100
89
+ )
90
+ )
91
+ })
92
+
93
+ const currentTitle = computed<string>(
94
+ () =>
95
+ `${consumedItem.value?.value} / ${maxItem.value?.value} - ${usageItem.value?.value}`
96
+ )
97
+
98
+ watch(
99
+ () => props.infoData,
100
+ (newValue) => {
101
+ newValue.data.forEach((item) => {
102
+ const currentLabelKey = item.labelKey.toLowerCase()
103
+
104
+ if (currentLabelKey.includes('capacity')) maxItem.value = item
105
+ if (currentLabelKey.includes('consumed')) {
106
+ consumedItem.value = item
107
+ minValue.value = '0 ' + item.value.split(' ')[1]
108
+ }
109
+ if (currentLabelKey.includes('demand')) demandItem.value = item
110
+ if (currentLabelKey.includes('overhead')) overheadItem.value = item
111
+
112
+ if (currentLabelKey.includes('usagepercent')) usageItem.value = item
113
+ if (
114
+ currentLabelKey.includes('limit') &&
115
+ item.value.toLowerCase() !== 'unlimited'
116
+ )
117
+ limitItem.value = item
118
+ if (currentLabelKey.includes('entitlement')) entitlementItem.value = item
119
+ })
120
+ },
121
+ { immediate: true, deep: true }
122
+ )
21
123
  </script>
22
124
 
23
- <style scoped lang="scss"></style>
125
+ <style>
126
+ :root {
127
+ --utilization-settings-consumed-info-color: #008fd6;
128
+ --utilization-settings-demand-info-color: #0776b3;
129
+ --utilization-settings-overhead-info-color: #239332;
130
+ --utilization-settings-active-info-color: #239332;
131
+ --utilization-settings-granted-info-color: #6fb842;
132
+ --utilization-settings-swapped-info-color: #ea3223;
133
+ --utilization-settings-ballooned-info-color: #fbce28;
134
+ --utilization-settings-unaccessed-info-color: #bdc3c7;
135
+ }
136
+ :root.dark-theme {
137
+ --utilization-settings-consumed-info-color: #2ba2de;
138
+ --utilization-settings-demand-info-color: #0776b3;
139
+ --utilization-settings-overhead-info-color: #3cae4c;
140
+ --utilization-settings-active-info-color: #3cae4c;
141
+ --utilization-settings-granted-info-color: #84bb42;
142
+ --utilization-settings-swapped-info-color: #ec4235;
143
+ --utilization-settings-ballooned-info-color: #fbce28;
144
+ --utilization-settings-unaccessed-info-color: #bdc3c770;
145
+ }
146
+ </style>
@@ -1,5 +1,185 @@
1
- <template>New</template>
1
+ <template>
2
+ <div class="info-block-new">
3
+ <div class="header-block mb-4">
4
+ <div
5
+ :class="[
6
+ 'progress-bar-container flex-col gap-2',
7
+ { 'has-icon': props.limitItem || props.entitlementItem },
8
+ ]"
9
+ >
10
+ <common-monitor-utilization-info-block-progress-bar
11
+ :percent="props.barPercent"
12
+ :color="`var(${props.consumedItem.colorKey})`"
13
+ :info-data="null"
14
+ :max-item="props.maxItem"
15
+ />
16
+ <common-monitor-utilization-info-block-progress-bar
17
+ v-if="props.demandItem"
18
+ :percent="props.barPercent"
19
+ :info-data="props.infoData"
20
+ :max-item="props.maxItem"
21
+ :color="`var(${props.demandItem.colorKey})`"
22
+ />
23
+ <common-monitor-utilization-info-block-progress-bar
24
+ v-if="props.overheadItem"
25
+ :percent="props.barPercent"
26
+ :info-data="props.infoData"
27
+ :max-item="props.maxItem"
28
+ :color="`var(${props.overheadItem.colorKey})`"
29
+ />
30
+ <div
31
+ v-if="props.limitItem"
32
+ :style="`left: calc(${props.limitPercent}% - 8px)`"
33
+ class="icon-box limit"
34
+ >
35
+ <ui-icon name="dotes-with-arrow" class="icon-limit" />
36
+ </div>
37
+ <div
38
+ v-if="props.entitlementItem"
39
+ :style="`left: calc(${props.entitlementPercent}% - 8px)`"
40
+ class="icon-box entitlement"
41
+ >
42
+ <ui-icon name="dotes-with-arrow" class="icon-entitlement" />
43
+ </div>
44
+ </div>
45
+ <div class="header-block-info-texts-block flex justify-between mt-3 pb-4">
46
+ <p class="text-info">{{ props.minValue }}</p>
47
+ <p class="text-info">{{ props.maxItem?.value }}</p>
48
+ </div>
49
+ </div>
50
+ <div class="footer-block flex flex-col gap-3">
51
+ <div
52
+ v-for="(item, key) in props.infoData.data"
53
+ :key="key"
54
+ class="footer-block-item flex justify-between"
55
+ >
56
+ <div class="left-block flex items-center gap-2">
57
+ <div
58
+ v-if="item.color"
59
+ :style="`background-color: ${
60
+ item.colorKey ? `var(${item.colorKey})` : item.color
61
+ }`"
62
+ class="color-block"
63
+ ></div>
64
+ <ui-icon
65
+ v-else-if="item.iconName"
66
+ :name="item.iconName"
67
+ :class="`icon-block ${item.labelKey}`"
68
+ />
69
+ <p class="name">{{ item.label }}</p>
70
+ </div>
71
+ <p class="value">{{ item.value }}</p>
72
+ </div>
73
+ </div>
74
+ </div>
75
+ </template>
2
76
 
3
- <script setup lang="ts"></script>
77
+ <script setup lang="ts">
78
+ import type { UI_I_UtilizationDataItem } from '~/components/common/monitor/utilization/lib/models/interfaces'
4
79
 
5
- <style scoped lang="scss"></style>
80
+ const props = defineProps<{
81
+ infoData: UI_I_UtilizationDataItem
82
+ maxItem: UI_I_UtilizationDataItem['data'][0] | null
83
+ consumedItem: UI_I_UtilizationDataItem['data'][0] | null
84
+ demandItem: UI_I_UtilizationDataItem['data'][0] | null
85
+ overheadItem: UI_I_UtilizationDataItem['data'][0] | null
86
+ limitItem: UI_I_UtilizationDataItem['data'][0] | null
87
+ entitlementItem: UI_I_UtilizationDataItem['data'][0] | null
88
+ entitlementPercent: string
89
+ barPercent: string
90
+ limitPercent: string
91
+ minValue: string
92
+ }>()
93
+ </script>
94
+
95
+ <style>
96
+ :root {
97
+ --utilization-settings-info-text-color: #4d5d69;
98
+ --utilization-settings-value-info-text-color: #182531;
99
+ --utilization-settings-limit-icon-color: #ea3223;
100
+ --utilization-settings-entitlement-icon-color: #213444;
101
+ }
102
+ :root.dark-theme {
103
+ --utilization-settings-info-text-color: #e9eaec;
104
+ --utilization-settings-value-info-text-color: #e9eaec;
105
+ --utilization-settings-limit-icon-color: #ec4235;
106
+ --utilization-settings-entitlement-icon-color: #e9eaec;
107
+ }
108
+ </style>
109
+
110
+ <style scoped lang="scss">
111
+ .info-block-new {
112
+ .header-block {
113
+ .progress-bar-container {
114
+ &.has-icon {
115
+ display: flex;
116
+ position: relative;
117
+ height: 60px;
118
+ justify-content: center;
119
+
120
+ .icon-box {
121
+ position: absolute;
122
+ top: 0;
123
+
124
+ &.entitlement {
125
+ z-index: 2;
126
+ transform: rotateY(170deg);
127
+ }
128
+ }
129
+ }
130
+
131
+ .progress-line {
132
+ width: 100%;
133
+ }
134
+ .icon-limit {
135
+ color: var(--utilization-settings-limit-icon-color);
136
+ }
137
+ .icon-entitlement {
138
+ color: var(--utilization-settings-entitlement-icon-color);
139
+ }
140
+ }
141
+ .header-block-info-texts-block {
142
+ border-bottom: 1px solid #e9ebeda3;
143
+
144
+ .text-info {
145
+ font-size: 12px;
146
+ font-weight: 500;
147
+ color: var(--utilization-settings-info-text-color);
148
+ }
149
+ }
150
+ }
151
+
152
+ .footer-block {
153
+ .footer-block-item {
154
+ .left-block {
155
+ .color-block {
156
+ width: 16px;
157
+ height: 16px;
158
+ border-radius: 50%;
159
+ }
160
+ .icon-block.limitMHz {
161
+ fill: var(--utilization-settings-limit-icon-color);
162
+ transform: rotate(225deg);
163
+ }
164
+ .icon-block.entitlementMHz,
165
+ .icon-block.entitlementBytes {
166
+ transform: rotate(145deg);
167
+ }
168
+
169
+ .name {
170
+ font-size: 13px;
171
+ line-height: 18px;
172
+ font-weight: 400;
173
+ color: var(--utilization-settings-info-text-color);
174
+ }
175
+ }
176
+ .value {
177
+ font-size: 13px;
178
+ font-weight: 400;
179
+ line-height: 18px;
180
+ color: var(--utilization-settings-value-info-text-color);
181
+ }
182
+ }
183
+ }
184
+ }
185
+ </style>
@@ -3,23 +3,47 @@
3
3
  <div class="header-block">
4
4
  <p class="title">{{ props.infoData.title }}</p>
5
5
  </div>
6
- <div class="body-block">
7
- <div class="bar">
8
- <div :title="currentTitle" class="track">
9
- <div
10
- :style="{
11
- width: animated ? barPercent + '%' : '0%',
12
- background: consumedItem?.color,
13
- boxShadow: `0 0 6px ${consumedItem?.color}88`,
14
- }"
15
- class="fill"
16
- />
6
+ <div class="flex">
7
+ <div class="body-block">
8
+ <common-monitor-utilization-info-block-progress-bar
9
+ :percent="props.barPercent"
10
+ :color="`var(${props.consumedItem.colorKey})`"
11
+ :info-data="null"
12
+ :max-item="props.maxItem"
13
+ />
14
+ <common-monitor-utilization-info-block-progress-bar
15
+ v-if="props.demandItem"
16
+ :percent="props.barPercent"
17
+ :info-data="props.infoData"
18
+ :max-item="props.maxItem"
19
+ :color="`var(${props.demandItem.colorKey})`"
20
+ />
21
+ <common-monitor-utilization-info-block-progress-bar
22
+ v-if="props.overheadItem"
23
+ :percent="props.barPercent"
24
+ :info-data="props.infoData"
25
+ :max-item="props.maxItem"
26
+ :color="`var(${props.overheadItem.colorKey})`"
27
+ />
28
+ <div class="footer-body-block">
29
+ <p>{{ props.minValue }}</p>
30
+ <p>{{ props.maxItem?.value }}</p>
17
31
  </div>
18
32
  </div>
19
- <div class="footer-body-block">
20
- <p>{{ consumedItem?.value }}</p>
21
- <p>{{ maxItem?.value }}</p>
22
- </div>
33
+ <ui-icon
34
+ v-if="props.limitItem"
35
+ name="arrow3"
36
+ class="limit-icon"
37
+ width="18px"
38
+ height="18px"
39
+ />
40
+ <ui-icon
41
+ v-if="props.entitlementItem"
42
+ name="arrow3"
43
+ class="entitlement-icon"
44
+ width="18px"
45
+ height="18px"
46
+ />
23
47
  </div>
24
48
  <div class="footer-block">
25
49
  <div
@@ -30,7 +54,9 @@
30
54
  <div class="left-block">
31
55
  <div
32
56
  v-if="item.color"
33
- :style="`background-color: ${item.color}`"
57
+ :style="`background-color: ${
58
+ item.colorKey ? `var(${item.colorKey})` : item.color
59
+ }`"
34
60
  class="color-block"
35
61
  ></div>
36
62
  <p class="name">{{ item.label }}</p>
@@ -42,59 +68,20 @@
42
68
  </template>
43
69
 
44
70
  <script setup lang="ts">
45
- import type {
46
- UI_I_UtilizationDataItem,
47
- UI_I_UtilizationDataItems,
48
- } from '~/components/common/monitor/utilization/lib/models/interfaces'
49
- import type { UI_I_Localization } from '~/lib/models/interfaces'
71
+ import type { UI_I_UtilizationDataItem } from '~/components/common/monitor/utilization/lib/models/interfaces'
50
72
 
51
73
  const props = defineProps<{
52
74
  infoData: UI_I_UtilizationDataItem
75
+ maxItem: UI_I_UtilizationDataItem['data'][0] | null
76
+ consumedItem: UI_I_UtilizationDataItem['data'][0] | null
77
+ overheadItem: UI_I_UtilizationDataItem['data'][0] | null
78
+ demandItem: UI_I_UtilizationDataItem['data'][0] | null
79
+ limitItem: UI_I_UtilizationDataItem['data'][0] | null
80
+ entitlementItem: UI_I_UtilizationDataItem['data'][0] | null
81
+ barPercent: string
82
+ currentTitle: string
83
+ minValue: string
53
84
  }>()
54
-
55
- const localization = computed<UI_I_Localization>(() => useLocal())
56
-
57
- const animated = ref<boolean>(false)
58
-
59
- const maxItem = computed<UI_I_UtilizationDataItems | null>(
60
- () =>
61
- props.infoData.data.find((item) =>
62
- item.label.toLowerCase().includes('capacity')
63
- ) || null
64
- )
65
-
66
- const consumedItem = computed<UI_I_UtilizationDataItems | null>(
67
- () =>
68
- props.infoData.data.find((item) =>
69
- item.label.toLowerCase().includes('consumed')
70
- ) || null
71
- )
72
-
73
- const usageItem = computed<UI_I_UtilizationDataItems | null>(
74
- () =>
75
- props.infoData.data.find((item) =>
76
- item.label.toLowerCase().includes('usagepercent')
77
- ) || null
78
- )
79
- const currentTitle = computed<string>(
80
- () =>
81
- `${consumedItem.value?.value} / ${maxItem.value?.value} - ${usageItem.value?.value}`
82
- )
83
-
84
- const barPercent = computed<string>(() => {
85
- const parse = (v: string) => parseFloat(v.replace(/[^\d.]/g, '')) || 0
86
- if (!maxItem.value || !consumedItem.value) return '0'
87
- return String(
88
- Math.min(
89
- (parse(consumedItem.value.value) / parse(maxItem.value.value)) * 100,
90
- 100
91
- )
92
- )
93
- })
94
-
95
- onMounted(() => {
96
- setTimeout(() => (animated.value = true), 100)
97
- })
98
85
  </script>
99
86
 
100
87
  <style scoped lang="scss">
@@ -103,7 +90,7 @@ onMounted(() => {
103
90
  padding: 20px;
104
91
  border: 1px solid #ccc;
105
92
  border-radius: 4px;
106
- box-shadow: 0px 0px 2px #ccc;
93
+ box-shadow: 0 0 2px #ccc;
107
94
 
108
95
  .header-block {
109
96
  margin-bottom: 20px;
@@ -115,12 +102,20 @@ onMounted(() => {
115
102
  }
116
103
 
117
104
  .body-block {
105
+ width: 80%;
118
106
  display: flex;
119
107
  flex-direction: column;
108
+ align-items: flex-start;
120
109
  gap: 8px;
121
110
  margin-bottom: 20px;
111
+ position: relative;
122
112
 
123
113
  .bar {
114
+ width: 100%;
115
+ display: grid;
116
+ grid-template-columns: auto max-content;
117
+ position: relative;
118
+
124
119
  .track {
125
120
  height: 18px;
126
121
  background: #e5e7eb;
@@ -134,8 +129,18 @@ onMounted(() => {
134
129
  border-radius: 2px;
135
130
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
136
131
  }
132
+
133
+ .limit-icon {
134
+ position: absolute;
135
+ right: -18px;
136
+ }
137
+ .entitlement-icon {
138
+ position: absolute;
139
+ right: -36px;
140
+ }
137
141
  }
138
142
  .footer-body-block {
143
+ width: 100%;
139
144
  display: flex;
140
145
  align-items: center;
141
146
  justify-content: space-between;
@@ -0,0 +1,64 @@
1
+ <template>
2
+ <div class="progress-line">
3
+ <div class="bg w-full">
4
+ <div
5
+ v-if="props.percent !== 0"
6
+ :style="props.innerFillContainerStyles"
7
+ class="inner-fill-container"
8
+ ></div>
9
+ <div class="cutted-container-block">
10
+ <div
11
+ v-for="(item, key) in props.itemsForPrint"
12
+ :key="key"
13
+ :style="`width: ${item.width}%;background-color: ${item.color}; left: ${item.left}%`"
14
+ :class="[
15
+ 'inner-fill-container',
16
+ { one: props.itemsForPrint.length === 1 },
17
+ ]"
18
+ ></div>
19
+ </div>
20
+ </div>
21
+ </div>
22
+ </template>
23
+
24
+ <script setup lang="ts">
25
+ import type {
26
+ UI_I_UtilizationProgressInnerFillStyles,
27
+ UI_I_UtilizationProgressItemForPrint,
28
+ } from '~/components/common/monitor/utilization/infoBlock/progressBar/lib/models/interfaces'
29
+
30
+ const props = defineProps<{
31
+ percent: number | string
32
+ innerFillContainerStyles: UI_I_UtilizationProgressInnerFillStyles
33
+ itemsForPrint: UI_I_UtilizationProgressItemForPrint[]
34
+ }>()
35
+ </script>
36
+
37
+ <style scoped lang="scss">
38
+ .progress-line {
39
+ .bg {
40
+ background: var(--progress-bar-bg);
41
+ height: 20px;
42
+ border-radius: 20px;
43
+
44
+ .inner-fill-container {
45
+ position: absolute;
46
+ height: 20px;
47
+ border-radius: 16px;
48
+ }
49
+
50
+ .cutted-container-block {
51
+ .inner-fill-container:not(.one) {
52
+ border-radius: 0;
53
+
54
+ &:first-child {
55
+ border-radius: 16px 0 0 16px;
56
+ }
57
+ &:last-child {
58
+ border-radius: 0 16px 16px 0;
59
+ }
60
+ }
61
+ }
62
+ }
63
+ }
64
+ </style>
@@ -0,0 +1,65 @@
1
+ <template>
2
+ <div class="bg w-full">
3
+ <div
4
+ v-if="props.percent !== 0"
5
+ :style="props.innerFillContainerStyles"
6
+ class="inner-fill-container"
7
+ ></div>
8
+ <div class="cutted-container-block">
9
+ <div
10
+ v-for="(item, key) in props.itemsForPrint"
11
+ :key="key"
12
+ :style="`width: ${item.width}%;background-color: ${item.color}; left: ${item.left}%`"
13
+ :class="[
14
+ 'inner-fill-container',
15
+ { one: props.itemsForPrint.length === 1 },
16
+ ]"
17
+ ></div>
18
+ </div>
19
+ </div>
20
+ </template>
21
+
22
+ <script setup lang="ts">
23
+ import type {
24
+ UI_I_UtilizationProgressInnerFillStyles,
25
+ UI_I_UtilizationProgressItemForPrint,
26
+ } from '~/components/common/monitor/utilization/infoBlock/progressBar/lib/models/interfaces'
27
+
28
+ const props = defineProps<{
29
+ percent: number | string
30
+ innerFillContainerStyles: UI_I_UtilizationProgressInnerFillStyles
31
+ itemsForPrint: UI_I_UtilizationProgressItemForPrint[]
32
+ }>()
33
+ </script>
34
+
35
+ <style scoped lang="scss">
36
+ .bg {
37
+ background: #ffffff;
38
+ border: 1px solid #666666;
39
+ height: 20px;
40
+ border-radius: 5px;
41
+
42
+ .inner-fill-container {
43
+ position: absolute;
44
+ height: 20px;
45
+ border-radius: 5px;
46
+ }
47
+
48
+ .cutted-container-block {
49
+ .inner-fill-container:not(.one) {
50
+ border-radius: 0;
51
+
52
+ &:first-child {
53
+ border-radius: 5px 0 0 5px;
54
+ }
55
+ &:not(:first-child):not(:last-child) {
56
+ border-left: 1px solid #ffffff;
57
+ border-right: 1px solid #ffffff;
58
+ }
59
+ &:last-child {
60
+ border-radius: 0 5px 5px 0;
61
+ }
62
+ }
63
+ }
64
+ }
65
+ </style>