bfg-common 1.1.62 → 1.1.63

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 (90) hide show
  1. package/assets/localization/local_be.json +1 -1
  2. package/assets/localization/local_hy.json +1 -1
  3. package/assets/localization/local_kk.json +1 -1
  4. package/assets/localization/local_ru.json +1 -1
  5. package/components/atoms/alert/Notification.vue +167 -167
  6. package/components/atoms/autocomplete/Autocomplete.vue +236 -236
  7. package/components/atoms/datepicker/Datepicker.vue +612 -612
  8. package/components/atoms/list/SelectList.vue +62 -62
  9. package/components/atoms/nav/NavBar.vue +116 -116
  10. package/components/atoms/nav/VerticalNavBar.vue +89 -89
  11. package/components/atoms/notificationBar/NotificationBar.vue +175 -175
  12. package/components/atoms/perPage/PerPage.vue +52 -52
  13. package/components/atoms/popup/SimplePopup.vue +90 -90
  14. package/components/atoms/step/VerticalStep.vue +104 -104
  15. package/components/atoms/switch/Switch.vue +107 -107
  16. package/components/atoms/table/dataGrid/DataGridColumnSwitch.vue +206 -206
  17. package/components/atoms/table/dataGrid/DataGridPage.vue +189 -189
  18. package/components/atoms/tabs/Tabs.vue +189 -189
  19. package/components/atoms/tooltip/Signpost.vue +224 -224
  20. package/components/common/adapterManager/AddAdapterWarningModal.vue +82 -82
  21. package/components/common/adapterManager/NoActiveAdaptersModal.vue +62 -62
  22. package/components/common/adapterManager/NoConnectedActiveAdaptersModal.vue +62 -62
  23. package/components/common/browse/Browse.vue +182 -182
  24. package/components/common/browse/blocks/Title.vue +66 -66
  25. package/components/common/diagramMain/Diagram.vue +186 -186
  26. package/components/common/diagramMain/DiagramMain.vue +986 -986
  27. package/components/common/diagramMain/adapter/AdapterItem.vue +227 -227
  28. package/components/common/diagramMain/adapter/AdapterItems.vue +57 -57
  29. package/components/common/diagramMain/modals/editSettings/tabs/port/IpvFourSettings.vue +339 -339
  30. package/components/common/diagramMain/modals/editSettings/tabs/port/PortProperties.vue +202 -202
  31. package/components/common/diagramMain/modals/remove/RemoveModal.vue +226 -226
  32. package/components/common/diagramMain/network/Contents.vue +238 -238
  33. package/components/common/feedback/Buttons.vue +232 -232
  34. package/components/common/feedback/Message.vue +468 -468
  35. package/components/common/feedback/VisitPortal.vue +54 -54
  36. package/components/common/graph/Graph.vue +20 -18
  37. package/components/common/help/navbar/left/Left.vue +159 -159
  38. package/components/common/help/navbar/left/utils/constructAccordion.ts +27 -27
  39. package/components/common/mainNavigationPanel/MainNavigationPanel.vue +359 -359
  40. package/components/common/modals/Rename.vue +165 -165
  41. package/components/common/monitor/advanced/Advanced.vue +33 -3
  42. package/components/common/monitor/advanced/GraphView.vue +4 -4
  43. package/components/common/monitor/advanced/table/Table.vue +5 -5
  44. package/components/common/monitor/advanced/tools/Tools.vue +91 -27
  45. package/components/common/monitor/advanced/tools/chartOptionsModal/ChartOptionsModal.vue +101 -17
  46. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/Counters.vue +25 -7
  47. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/config/utils.ts +55 -0
  48. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/models/interfaces.ts +1 -1
  49. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/Timespan.vue +32 -3
  50. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/form/Form.vue +25 -8
  51. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/Object.vue +41 -19
  52. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/models/interfaces.ts +1 -1
  53. package/components/common/monitor/advanced/tools/config/advancedToolbar.ts +50 -38
  54. package/components/common/monitor/advanced/tools/utils/countCores.ts +7 -0
  55. package/components/common/monitor/config/getValidDateByOption.ts +105 -6
  56. package/components/common/monitor/overview/filters/Filters.vue +6 -6
  57. package/components/common/monitor/overview/filters/customIntervalModal/CustomIntervalModal.vue +8 -8
  58. package/components/common/monitor/overview/filters/customIntervalModal/config/dateChecker.ts +1 -1
  59. package/components/common/perPage/PerPage.vue +51 -51
  60. package/components/common/recursionTree/RecursionTree.vue +201 -201
  61. package/components/common/vm/actions/add/customizeHardware/virtualHardware/VirtualHardware.vue +642 -641
  62. package/components/common/vm/actions/add/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDrive.vue +274 -245
  63. package/components/common/vm/actions/add/customizeHardware/virtualHardware/cpu/Cpu.vue +375 -375
  64. package/components/common/vm/actions/add/customizeHardware/virtualHardware/limit/Limit.vue +234 -234
  65. package/components/common/vm/actions/add/customizeHardware/virtualHardware/limit/config/options.ts +28 -28
  66. package/components/common/vm/actions/add/customizeHardware/virtualHardware/memory/Memory.vue +316 -316
  67. package/components/common/vm/actions/add/customizeHardware/virtualHardware/memory/config/memoryOptions.ts +35 -35
  68. package/components/common/vm/actions/add/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +447 -447
  69. package/components/common/vm/actions/add/customizeHardware/virtualHardware/reservation/Reservation.vue +235 -235
  70. package/components/common/vm/actions/add/select/storage/config/config.ts +154 -154
  71. package/components/common/wizards/datastore/add/nfs/configuration/Configuration.vue +373 -373
  72. package/components/common/wizards/datastore/add/nfs/configuration/serversList/ServersList.vue +123 -123
  73. package/components/common/wizards/datastore/add/nfs/kerberosAuthentication/KerberosAuthentication.vue +54 -54
  74. package/components/common/wizards/datastore/add/sharedStorm/deviceSelection/hostTable/HostTable.vue +131 -131
  75. package/components/common/wizards/datastore/add/sharedStorm/partitionConfiguration/PartitionConfiguration.vue +230 -230
  76. package/models/store/interfaces.ts +37 -37
  77. package/models/store/storage/interfaces.ts +32 -32
  78. package/models/store/types.ts +32 -32
  79. package/modules/fixContentBuild/utils/methods.ts +114 -114
  80. package/package.json +1 -1
  81. package/public/spice-console/application/codec.js +257 -257
  82. package/public/spice-console/lib/rasterEngine.js +907 -907
  83. package/public/spice-console/network/spicechannel.js +369 -369
  84. package/public/spice-console-minify/lib/decoder/dixie.min.js +4 -4
  85. package/public/spice-console-minify/lib/jgestures.min.js +24 -24
  86. package/public/spice-console-minify/lib/jquery-2.0.3.min.js +24 -24
  87. package/public/spice-console-minify/lib/jquery-mousewheel.min.js +11 -11
  88. package/public/spice-console-minify/lib/jquery-visibility.min.js +1 -1
  89. package/public/spice-console-minify/lib/lodash.4.0.0.min.js +5 -5
  90. package/utils/contentBuild.ts +34 -34
@@ -1,165 +1,165 @@
1
- <template>
2
- <atoms-modal
3
- :test-id="`${props.testId}-rename`"
4
- width="576px"
5
- class="rename"
6
- :show="true"
7
- :title="localization.rename"
8
- :second-title="name"
9
- @submit="onRename"
10
- @hide="onHide"
11
- >
12
- <template #modalBody>
13
- <div class="rename__body">
14
- <form
15
- :id="`${props.testId}-rename-form`"
16
- class="clr-form clr-form-horizontal"
17
- @submit.prevent
18
- >
19
- <slot v-if="$slots.description" name="description"></slot>
20
-
21
- <div class="clr-row clr-error clr-form-control">
22
- <label
23
- for="rename"
24
- :class="['clr-control-label', `clr-col-md-${labelWidth}`]"
25
- >{{ labelName }}</label
26
- >
27
- <div class="clr-control-container clr-col-8">
28
- <div class="form-group__input">
29
- <input
30
- id="rename"
31
- v-model="form.name.value"
32
- type="text"
33
- :class="nameErrorText && 'clr-input'"
34
- @blur="initValidation"
35
- @input="initValidation"
36
- />
37
- <div v-show="nameErrorText" class="form-validate">
38
- <atoms-the-icon
39
- class="is-error tooltip-trigger"
40
- name="info"
41
- />
42
- </div>
43
- </div>
44
- <div
45
- v-show="nameErrorText"
46
- class="form-group__input-error clr-subtext"
47
- >
48
- {{ nameErrorText }}
49
- </div>
50
- </div>
51
- </div>
52
- </form>
53
- </div>
54
- </template>
55
- </atoms-modal>
56
- </template>
57
-
58
- <script lang="ts" setup>
59
- import { UI_I_ValidationTouchResult } from '~/models/plugins/validation/interfaces'
60
- import { UI_I_Localization } from '~/models/interfaces'
61
- import { UI_I_RenameForm } from '~/components/common/modals/models/interfaces'
62
- import { defaultFormRenameFunc } from '~/components/common/modals/config/defaultForm'
63
- import { labelWidthFunc } from '~/components/common/modals/config/renameLabelWidth'
64
-
65
- const props = withDefaults(
66
- defineProps<{
67
- testId: string
68
- name: string
69
- label?: string
70
- }>(),
71
- {
72
- label: 'enterNewName',
73
- }
74
- )
75
- const emits = defineEmits<{
76
- (event: 'hide'): void
77
- (event: 'apply-changes', value: string): void
78
- }>()
79
-
80
- const localization = computed<UI_I_Localization>(() => useLocal())
81
- const { $validation } = useNuxtApp()
82
-
83
- const validation = $validation.call({})
84
- const defaultForm: UI_I_RenameForm = defaultFormRenameFunc(
85
- localization.value,
86
- props?.name || ''
87
- )
88
- const form = ref<UI_I_RenameForm>(useDeepCopy(defaultForm))
89
-
90
- const setForm = () => {
91
- form.value = useDeepCopy(defaultForm)
92
- validation.setForm(form)
93
- }
94
- setForm()
95
-
96
- const validForm = ref<UI_I_ValidationTouchResult | null>(null)
97
-
98
- const labelName = computed<string>(() => localization.value[props.label])
99
-
100
- /* Validation for Name input */
101
- const initValidation = () => {
102
- validForm.value = validation.touch()
103
- }
104
-
105
- const nameErrorText = computed<string>(() => {
106
- return validForm.value?.errors?.name?.[0] || ''
107
- })
108
- /* Validation Name input end */
109
-
110
- const labelWidth = computed<number>(() => labelWidthFunc(labelName.value))
111
-
112
- const onRename = (): void => {
113
- const { isValid = true } = validForm?.value || {}
114
-
115
- if (!isValid) return
116
- emits('apply-changes', form.value.name.value)
117
- }
118
-
119
- const onHide = (): void => {
120
- emits('hide')
121
- }
122
- </script>
123
-
124
- <style lang="scss" scoped>
125
- @import '~/assets/scss/common/mixins.scss';
126
- .rename {
127
- &__body {
128
- @include flex($dir: column);
129
- .clr-form-control {
130
- @include flex($dir: row);
131
-
132
- .clr-control-container {
133
- min-height: 48px;
134
- }
135
- .form-group {
136
- &__input {
137
- @include flex();
138
- input {
139
- width: 100%;
140
- }
141
- .form-validate {
142
- svg {
143
- width: 24px;
144
- height: 24px;
145
- }
146
- }
147
- &-error {
148
- margin-top: 0;
149
- }
150
- }
151
- }
152
- }
153
- }
154
- :deep(.modal-content) {
155
- .modal-title {
156
- white-space: nowrap;
157
- }
158
- .secondary-title {
159
- word-break: break-all;
160
- font-size: 18px;
161
- font-weight: 300;
162
- }
163
- }
164
- }
165
- </style>
1
+ <template>
2
+ <atoms-modal
3
+ :test-id="`${props.testId}-rename`"
4
+ width="576px"
5
+ class="rename"
6
+ :show="true"
7
+ :title="localization.rename"
8
+ :second-title="name"
9
+ @submit="onRename"
10
+ @hide="onHide"
11
+ >
12
+ <template #modalBody>
13
+ <div class="rename__body">
14
+ <form
15
+ :id="`${props.testId}-rename-form`"
16
+ class="clr-form clr-form-horizontal"
17
+ @submit.prevent
18
+ >
19
+ <slot v-if="$slots.description" name="description"></slot>
20
+
21
+ <div class="clr-row clr-error clr-form-control">
22
+ <label
23
+ for="rename"
24
+ :class="['clr-control-label', `clr-col-md-${labelWidth}`]"
25
+ >{{ labelName }}</label
26
+ >
27
+ <div class="clr-control-container clr-col-8">
28
+ <div class="form-group__input">
29
+ <input
30
+ id="rename"
31
+ v-model="form.name.value"
32
+ type="text"
33
+ :class="nameErrorText && 'clr-input'"
34
+ @blur="initValidation"
35
+ @input="initValidation"
36
+ />
37
+ <div v-show="nameErrorText" class="form-validate">
38
+ <atoms-the-icon
39
+ class="is-error tooltip-trigger"
40
+ name="info"
41
+ />
42
+ </div>
43
+ </div>
44
+ <div
45
+ v-show="nameErrorText"
46
+ class="form-group__input-error clr-subtext"
47
+ >
48
+ {{ nameErrorText }}
49
+ </div>
50
+ </div>
51
+ </div>
52
+ </form>
53
+ </div>
54
+ </template>
55
+ </atoms-modal>
56
+ </template>
57
+
58
+ <script lang="ts" setup>
59
+ import { UI_I_ValidationTouchResult } from '~/models/plugins/validation/interfaces'
60
+ import { UI_I_Localization } from '~/models/interfaces'
61
+ import { UI_I_RenameForm } from '~/components/common/modals/models/interfaces'
62
+ import { defaultFormRenameFunc } from '~/components/common/modals/config/defaultForm'
63
+ import { labelWidthFunc } from '~/components/common/modals/config/renameLabelWidth'
64
+
65
+ const props = withDefaults(
66
+ defineProps<{
67
+ testId: string
68
+ name: string
69
+ label?: string
70
+ }>(),
71
+ {
72
+ label: 'enterNewName',
73
+ }
74
+ )
75
+ const emits = defineEmits<{
76
+ (event: 'hide'): void
77
+ (event: 'apply-changes', value: string): void
78
+ }>()
79
+
80
+ const localization = computed<UI_I_Localization>(() => useLocal())
81
+ const { $validation } = useNuxtApp()
82
+
83
+ const validation = $validation.call({})
84
+ const defaultForm: UI_I_RenameForm = defaultFormRenameFunc(
85
+ localization.value,
86
+ props?.name || ''
87
+ )
88
+ const form = ref<UI_I_RenameForm>(useDeepCopy(defaultForm))
89
+
90
+ const setForm = () => {
91
+ form.value = useDeepCopy(defaultForm)
92
+ validation.setForm(form)
93
+ }
94
+ setForm()
95
+
96
+ const validForm = ref<UI_I_ValidationTouchResult | null>(null)
97
+
98
+ const labelName = computed<string>(() => localization.value[props.label])
99
+
100
+ /* Validation for Name input */
101
+ const initValidation = () => {
102
+ validForm.value = validation.touch()
103
+ }
104
+
105
+ const nameErrorText = computed<string>(() => {
106
+ return validForm.value?.errors?.name?.[0] || ''
107
+ })
108
+ /* Validation Name input end */
109
+
110
+ const labelWidth = computed<number>(() => labelWidthFunc(labelName.value))
111
+
112
+ const onRename = (): void => {
113
+ const { isValid = true } = validForm?.value || {}
114
+
115
+ if (!isValid) return
116
+ emits('apply-changes', form.value.name.value)
117
+ }
118
+
119
+ const onHide = (): void => {
120
+ emits('hide')
121
+ }
122
+ </script>
123
+
124
+ <style lang="scss" scoped>
125
+ @import '~/assets/scss/common/mixins.scss';
126
+ .rename {
127
+ &__body {
128
+ @include flex($dir: column);
129
+ .clr-form-control {
130
+ @include flex($dir: row);
131
+
132
+ .clr-control-container {
133
+ min-height: 48px;
134
+ }
135
+ .form-group {
136
+ &__input {
137
+ @include flex();
138
+ input {
139
+ width: 100%;
140
+ }
141
+ .form-validate {
142
+ svg {
143
+ width: 24px;
144
+ height: 24px;
145
+ }
146
+ }
147
+ &-error {
148
+ margin-top: 0;
149
+ }
150
+ }
151
+ }
152
+ }
153
+ }
154
+ :deep(.modal-content) {
155
+ .modal-title {
156
+ white-space: nowrap;
157
+ }
158
+ .secondary-title {
159
+ word-break: break-all;
160
+ font-size: 18px;
161
+ font-weight: 300;
162
+ }
163
+ }
164
+ }
165
+ </style>
@@ -26,7 +26,13 @@
26
26
  :period-type="props.periodType"
27
27
  :selected-custom-time="props.selectedCustomTime"
28
28
  :selected-chart-option-name="props.selectedChartOptionName"
29
- @update-tools="onUpdateTools"
29
+ :custom-date-from="props.customDateFrom"
30
+ :custom-date-to="props.customDateTo"
31
+ :custom-time-from="props.customTimeFrom"
32
+ :custom-time-to="props.customTimeTo"
33
+ :total-cores="totalCores"
34
+ :host-id="props.hostId"
35
+ @update-tools="emits('update-tools', $event)"
30
36
  @exporting="onExporting"
31
37
  @open-advanced-page="onGetEmptyPage"
32
38
  @select-row="emits('select-row', $event)"
@@ -38,6 +44,11 @@
38
44
  @update-custom-time="emits('update-custom-time', $event)"
39
45
  @select-chart-name="emits('select-chart-name', $event)"
40
46
  @delete-option="emits('delete-option')"
47
+ @update-custom-date-from="emits('update-custom-date-from', $event)"
48
+ @update-custom-date-to="emits('update-custom-date-to', $event)"
49
+ @update-custom-time-from="emits('update-custom-time-from', $event)"
50
+ @update-custom-time-to="emits('update-custom-time-to', $event)"
51
+ @submit-options="emits('submit-options', $event)"
41
52
  />
42
53
 
43
54
  <div v-show="!props.data" class="empty-container">
@@ -85,6 +96,7 @@ import {
85
96
  T_ChartHost,
86
97
  T_ChartVm,
87
98
  } from '~/components/common/monitor/advanced/tools/chartOptionsModal/models/types'
99
+ import { getCountCores } from '~/components/common/monitor/advanced/tools/utils/countCores'
88
100
 
89
101
  const props = defineProps<{
90
102
  type: UI_T_AdvancedType
@@ -103,6 +115,11 @@ const props = defineProps<{
103
115
  periodType: string
104
116
  selectedCustomTime: string
105
117
  selectedChartOptionName: string
118
+ customDateFrom: string
119
+ customDateTo: string
120
+ customTimeFrom: string
121
+ customTimeTo: string
122
+ hostId: string
106
123
  disabledPeriod?: boolean
107
124
  disabledView?: boolean
108
125
  }>()
@@ -120,12 +137,25 @@ const emits = defineEmits<{
120
137
  (event: 'update-custom-time', value: string): void
121
138
  (event: 'select-chart-name', value: string): void
122
139
  (event: 'delete-option'): void
140
+ (event: 'update-custom-date-from', value: string): void
141
+ (event: 'update-custom-date-to', value: string): void
142
+ (event: 'update-custom-time-from', value: string): void
143
+ (event: 'update-custom-time-to', value: string): void
144
+ (event: 'submit-options', value: string): void
123
145
  }>()
124
146
 
125
147
  const localization = computed<UI_I_Localization>(() => useLocal())
126
148
 
127
- const onUpdateTools = (tools: UI_I_MonitorGraphPayload): void =>
128
- emits('update-tools', tools)
149
+ const totalCores = ref<number>(0)
150
+ watch(
151
+ () => props.data,
152
+ (newValue) => {
153
+ if (!newValue) return
154
+
155
+ totalCores.value = getCountCores(newValue)
156
+ },
157
+ { immediate: true }
158
+ )
129
159
 
130
160
  const exportGraph = ref<string>('')
131
161
  const onExporting = (key: string): void => {
@@ -6,7 +6,7 @@
6
6
  :data="chartData"
7
7
  :update="chartHelper"
8
8
  :export-type="exportType"
9
- :selected-row="selectedRow"
9
+ :selected-row="props.selectedRow"
10
10
  />
11
11
  </template>
12
12
  </div>
@@ -129,10 +129,10 @@ watch(width, (newValue) => {
129
129
  const exportType = ref<string>('')
130
130
  watch(
131
131
  () => props.export,
132
- (val) => {
133
- if (!val) return
132
+ (newValue) => {
133
+ if (!newValue) return
134
134
 
135
- exportType.value = val
135
+ exportType.value = newValue
136
136
  },
137
137
  { immediate: true }
138
138
  )
@@ -59,17 +59,17 @@ const dataBody = ref<UI_I_BodyItem[][]>([])
59
59
 
60
60
  watch(
61
61
  () => props.data,
62
- (val) => {
63
- if (!val) return
62
+ (newValue) => {
63
+ if (!newValue) return
64
64
 
65
- dataBody.value = table.bodyItems(val)
65
+ dataBody.value = table.bodyItems(newValue)
66
66
  },
67
67
  { immediate: true }
68
68
  )
69
69
  watch(
70
70
  selectedRow,
71
- (val) => {
72
- emits('select', val)
71
+ (newValue) => {
72
+ emits('select', newValue)
73
73
  },
74
74
  { deep: true }
75
75
  )
@@ -19,6 +19,7 @@
19
19
  id="periodSelect"
20
20
  v-model="selectedPeriod"
21
21
  :disabled="props.disabledPeriod"
22
+ @change="onChangePeriod"
22
23
  >
23
24
  <option
24
25
  v-for="(item, index) in periodOptions"
@@ -46,6 +47,7 @@
46
47
  id="viewSelect"
47
48
  v-model="selectedView"
48
49
  :disabled="props.disabledView"
50
+ @change="onChangeView"
49
51
  >
50
52
  <option
51
53
  v-for="(item, index) in viewOptions"
@@ -93,6 +95,12 @@
93
95
  :period-type="props.periodType"
94
96
  :selected-custom-time="props.selectedCustomTime"
95
97
  :selected-chart-option-name="props.selectedChartOptionName"
98
+ :custom-date-from="props.customDateFrom"
99
+ :custom-date-to="props.customDateTo"
100
+ :custom-time-from="props.customTimeFrom"
101
+ :custom-time-to="props.customTimeTo"
102
+ :total-cores="props.totalCores"
103
+ :host-id="props.hostId"
96
104
  @hide="isShowModal = false"
97
105
  @select-row="emits('select-row', $event)"
98
106
  @select-metric="emits('select-metric', $event)"
@@ -104,6 +112,11 @@
104
112
  @select-chart-name="onSelectChartName"
105
113
  @delete-option="onDeleteOption"
106
114
  @save-option-name="onSaveOptionName"
115
+ @update-custom-date-from="emits('update-custom-date-from', $event)"
116
+ @update-custom-date-to="emits('update-custom-date-to', $event)"
117
+ @update-custom-time-from="emits('update-custom-time-from', $event)"
118
+ @update-custom-time-to="emits('update-custom-time-to', $event)"
119
+ @submit-options="emits('submit-options', $event)"
107
120
  />
108
121
  </template>
109
122
 
@@ -125,6 +138,7 @@ import {
125
138
  exportFunc,
126
139
  getCurrentOptionsStorageFunc,
127
140
  } from '~/components/common/monitor/advanced/tools/config/advancedToolbar'
141
+ import { checkDateFunc } from '~/components/common/monitor/overview/filters/customIntervalModal/config/dateChecker'
128
142
 
129
143
  const props = defineProps<{
130
144
  type: UI_T_AdvancedType
@@ -139,6 +153,12 @@ const props = defineProps<{
139
153
  periodType: string
140
154
  selectedCustomTime: string
141
155
  selectedChartOptionName: string
156
+ customDateFrom: string
157
+ customDateTo: string
158
+ customTimeFrom: string
159
+ customTimeTo: string
160
+ totalCores: number
161
+ hostId: string
142
162
  disabledPeriod?: boolean
143
163
  disabledView?: boolean
144
164
  }>()
@@ -156,6 +176,11 @@ const emits = defineEmits<{
156
176
  (event: 'update-custom-time', value: string): void
157
177
  (event: 'select-chart-name', value: string): void
158
178
  (event: 'delete-option'): void
179
+ (event: 'update-custom-date-from', value: string): void
180
+ (event: 'update-custom-date-to', value: string): void
181
+ (event: 'update-custom-time-from', value: string): void
182
+ (event: 'update-custom-time-to', value: string): void
183
+ (event: 'submit-options', value: string): void
159
184
  }>()
160
185
 
161
186
  const routeType = '' + useRoute().params.type
@@ -199,7 +224,7 @@ const onDeleteOption = (): void => {
199
224
 
200
225
  const selectedPeriod = ref<string>('')
201
226
  const periodOptions = computed<UI_I_OptionItem[]>(() =>
202
- periodFunc(localization.value)
227
+ periodFunc(localization.value, props.selectedTimespanType)
203
228
  )
204
229
  watch(
205
230
  () => periodOptions.value,
@@ -208,6 +233,15 @@ watch(
208
233
  },
209
234
  { immediate: true }
210
235
  )
236
+ watch(
237
+ () => props.selectedTimespanType,
238
+ (newValue) => {
239
+ if (!newValue) return
240
+
241
+ selectedPeriod.value = newValue
242
+ updateTools()
243
+ }
244
+ )
211
245
 
212
246
  const isShowModal = ref<boolean>(false)
213
247
  watch(isShowModal, (newValue) => {
@@ -215,34 +249,63 @@ watch(isShowModal, (newValue) => {
215
249
  selectedView.value = viewOptions.value[0].value
216
250
  })
217
251
 
218
- watch(
219
- () => [selectedPeriod.value, selectedView.value],
220
- (newValue: string[]) => {
221
- const selectedValue = useLocalStorage(
222
- newValue[1] + 'ChartOptions',
223
- undefined,
224
- false
252
+ const selectedObjects = ref<string>('')
253
+
254
+ const updateTools = (): void => {
255
+ const periodValue = selectedPeriod.value
256
+ const viewValue = selectedView.value
257
+ const selectedValue = useLocalStorage(
258
+ viewValue + 'ChartOptions',
259
+ undefined,
260
+ false
261
+ )
262
+
263
+ const fields = selectedValue
264
+ ? selectedValue.counters.map((item) => item.name).join(', ')
265
+ : ''
266
+ const validPeriodData = getValidDateByOptionFunc(
267
+ periodValue,
268
+ selectedValue,
269
+ props.unitsCount,
270
+ props.selectedCustomTime
271
+ )
272
+
273
+ const period = [
274
+ Math.round(validPeriodData[0] / 1000),
275
+ Math.round(validPeriodData[1] / 1000),
276
+ ]
277
+
278
+ if (periodValue === 'custom_interval' && props.periodType === 'period') {
279
+ const checkDateResult = checkDateFunc(
280
+ localization.value,
281
+ props.customDateFrom,
282
+ props.customDateTo,
283
+ props.customTimeFrom,
284
+ props.customTimeTo
225
285
  )
226
- const fields = selectedValue
227
- ? selectedValue.counters.map((item) => item.name).join(', ')
228
- : ''
229
-
230
- const validPeriodData = getValidDateByOptionFunc(newValue[0])
231
-
232
- const period = [
233
- Math.round(validPeriodData[0] / 1000),
234
- Math.round(validPeriodData[1] / 1000),
235
- ]
236
- const tools: UI_I_MonitorGraphPayload = {
237
- fields,
238
- period,
239
- periodType: newValue[0],
240
- view: newValue[1],
286
+ if (Array.isArray(checkDateResult)) {
287
+ period[0] = Math.round(checkDateResult[0] / 1000)
288
+ period[1] = Math.round(checkDateResult[1] / 1000)
241
289
  }
242
- emits('update-tools', tools)
243
- },
244
- { immediate: true }
245
- )
290
+ }
291
+
292
+ const tools: UI_I_MonitorGraphPayload = {
293
+ fields,
294
+ period,
295
+ periodType: periodValue,
296
+ view: viewValue,
297
+ }
298
+ emits('update-timespan-type', selectedPeriod.value)
299
+ emits('update-tools', tools)
300
+ }
301
+
302
+ const onChangePeriod = (): void => {
303
+ updateTools()
304
+ }
305
+
306
+ const onChangeView = (): void => {
307
+ updateTools()
308
+ }
246
309
 
247
310
  const chartTitleDate = computed<string>(() => {
248
311
  if (!props.startDate) return ''
@@ -269,6 +332,7 @@ const onSaveOptionName = (): void => {
269
332
 
270
333
  onMounted(() => {
271
334
  optionsNames.value = getCurrentOptionsStorageFunc(routeType)
335
+ updateTools()
272
336
  })
273
337
  </script>
274
338