bfg-common 1.6.49 → 1.6.50

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 (134) hide show
  1. package/assets/localization/local_be.json +255 -9
  2. package/assets/localization/local_en.json +264 -17
  3. package/assets/localization/local_hy.json +257 -11
  4. package/assets/localization/local_kk.json +255 -9
  5. package/assets/localization/local_ru.json +264 -18
  6. package/assets/localization/local_zh.json +255 -9
  7. package/assets/scss/common/global.scss +11 -0
  8. package/assets/scss/common/theme.scss +2 -2
  9. package/components/atoms/stack/StackBlock.vue +1 -1
  10. package/components/atoms/tooltip/TooltipError.vue +3 -0
  11. package/components/common/adapterManager/addAdapterModal/AddAdapterModalNew.vue +1 -1
  12. package/components/common/adapterManager/addAdapterWarningModal/AddAdapterWarningModalNew.vue +0 -1
  13. package/components/common/adapterManager/ui/table/adapters/AdaptersNew.vue +1 -0
  14. package/components/common/certificate/CertificateInfo.vue +7 -1
  15. package/components/common/configure/physicalAdapters/PhysicalAdapters.vue +6 -0
  16. package/components/common/configure/physicalAdapters/PhysicalAdaptersNew.vue +219 -192
  17. package/components/common/configure/physicalAdapters/PhysicalAdaptersOld.vue +6 -4
  18. package/components/common/configure/physicalAdapters/buttons/Buttons.vue +1 -0
  19. package/components/common/configure/physicalAdapters/modals/edit/Edit.vue +26 -1
  20. package/components/common/configure/physicalAdapters/modals/edit/EditNew.vue +30 -1
  21. package/components/common/configure/physicalAdapters/modals/edit/lib/models/interfaces.ts +5 -0
  22. package/components/common/configure/physicalAdapters/modals/edit/lib/validations/validations.ts +19 -0
  23. package/components/common/configure/physicalAdapters/tableView/TableViewNew.vue +12 -1
  24. package/components/common/configure/physicalAdapters/tableView/lib/config/physicalAdaptersTableConfigNew.ts +21 -21
  25. package/components/common/configure/physicalAdapters/tableView/lib/config/settings.ts +12 -5
  26. package/components/common/configure/physicalAdapters/tableView/lib/models/interfaces.ts +4 -1
  27. package/components/common/diagramMain/Diagram.vue +167 -85
  28. package/components/common/diagramMain/DiagramMain.vue +34 -10
  29. package/components/common/diagramMain/header/Header.vue +49 -0
  30. package/components/common/diagramMain/header/HeaderNew.vue +155 -0
  31. package/components/common/diagramMain/{Header.vue → header/HeaderOld.vue} +78 -67
  32. package/components/common/diagramMain/modals/Modals.vue +4 -0
  33. package/components/common/diagramMain/modals/editSettings/tabs/NetworkProperties.vue +2 -2
  34. package/components/common/diagramMain/modals/lib/config/diagramConfig.ts +43 -2
  35. package/components/common/diagramMain/modals/lib/config/index.ts +2 -1
  36. package/components/common/diagramMain/modals/lib/config/vmKernelAdapter.ts +1 -1
  37. package/components/common/diagramMain/modals/migrateVmkernelAdapter/MigrateVmkernelAdapter.vue +2 -2
  38. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/common.ts +1 -1
  39. package/components/common/diagramMain/skeleton/Header.vue +31 -0
  40. package/components/common/diagramMain/skeleton/Switch.vue +75 -0
  41. package/components/common/layout/theHeader/ThemeSwitch.vue +1 -1
  42. package/components/common/layout/theHeader/modals/reconnect/New.vue +38 -30
  43. package/components/common/layout/theHeader/userMenu/modals/changePassword/New.vue +8 -9
  44. package/components/common/layout/theHeader/userMenu/modals/preferences/New.vue +4 -0
  45. package/components/common/layout/theHeader/userMenu/modals/preferences/Old.vue +9 -2
  46. package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/ChangeLanguage.vue +11 -7
  47. package/components/common/layout/theHeader/userMenu/modals/preferences/defaultConsole/DefaultConsole.vue +7 -1
  48. package/components/common/layout/theHeader/userMenu/modals/preferences/defaultConsole/lib/config/consoleOptions.ts +8 -5
  49. package/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/TimeFormat.vue +9 -5
  50. package/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/lib/config/formatOptions.ts +1 -1
  51. package/components/common/layout/theHeader/userMenu/modals/preferences/view/Old.vue +5 -9
  52. package/components/common/layout/theHeader/userMenu/modals/preferences/view/View.vue +9 -6
  53. package/components/common/mainNavigationPanel/MainNavigationPanelNew.vue +3 -1
  54. package/components/common/monitor/advanced/tools/Tools.vue +10 -9
  55. package/components/common/monitor/advanced/tools/chartOptionsModal/ChartOptionsModal.vue +16 -19
  56. package/components/common/monitor/advanced/tools/lib/config/advancedToolbar.ts +62 -9
  57. package/components/common/noDataProvided/NoDataProvidedNew.vue +1 -1
  58. package/components/common/pages/backups/modals/createBackup/datastores/tableView/new/lib/config/table.ts +4 -4
  59. package/components/common/pages/backups/modals/createBackup/datastores/tableView/old/lib/config/table.ts +4 -4
  60. package/components/common/pages/hardwareHealth/HardwareHealth.vue +4 -0
  61. package/components/common/pages/hardwareHealth/HardwareHealthNew.vue +12 -3
  62. package/components/common/pages/hardwareHealth/HardwareHealthOld.vue +3 -0
  63. package/components/common/pages/hardwareHealth/historyTestimony/Graph.vue +4 -4
  64. package/components/common/pages/hardwareHealth/historyTestimony/GraphNew.vue +4 -3
  65. package/components/common/pages/hardwareHealth/historyTestimony/GraphOld.vue +3 -2
  66. package/components/common/pages/hardwareHealth/historyTestimony/tools/Tools.vue +32 -8
  67. package/components/common/pages/hardwareHealth/historyTestimony/tools/ToolsNew.vue +11 -18
  68. package/components/common/pages/hardwareHealth/historyTestimony/tools/ToolsOld.vue +10 -19
  69. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/ChartOptionsModal.vue +19 -7
  70. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/actions/ActionsNew.vue +1 -1
  71. package/components/common/pages/hardwareHealth/historyTestimony/tools/lib/config/toolbar.ts +68 -5
  72. package/components/common/pages/scheduledTasks/table/lib/models/enums.ts +9 -0
  73. package/components/common/pages/scheduledTasks/table/new/New.vue +12 -10
  74. package/components/common/pages/tasks/Tasks.vue +4 -1
  75. package/components/common/pages/tasks/table/Table.vue +25 -23
  76. package/components/common/readyToComplete/New.vue +1 -0
  77. package/components/common/split/vertical/New.vue +42 -8
  78. package/components/common/split/vertical/Old.vue +31 -2
  79. package/components/common/split/vertical/Vertical.vue +4 -0
  80. package/components/common/vm/actions/add/New.vue +21 -6
  81. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/Media.vue +14 -1
  82. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/New.vue +5 -0
  83. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/Old.vue +1 -0
  84. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/New.vue +1 -0
  85. package/components/common/vm/actions/common/customizeHardware/virtualHardware/reservation/New.vue +2 -0
  86. package/components/common/vm/actions/common/select/storage/new/lib/config/table.ts +13 -15
  87. package/components/common/vm/actions/confirm/Confirm.vue +3 -0
  88. package/components/common/vm/snapshots/DetailView.vue +6 -6
  89. package/components/common/wizards/datastore/add/New.vue +6 -0
  90. package/components/common/wizards/datastore/add/lib/config/steps.ts +1 -1
  91. package/components/common/wizards/datastore/add/steps/nameAndDevice/NameAndDeviceNew.vue +1 -1
  92. package/components/common/wizards/datastore/add/steps/nameAndDevice/advancedOptions/New.vue +1 -1
  93. package/components/common/wizards/network/add/Add.vue +13 -2
  94. package/components/common/wizards/network/add/AddNew.vue +22 -26
  95. package/components/common/wizards/network/add/lib/config/initialData.ts +6 -4
  96. package/components/common/wizards/network/add/lib/config/steps.ts +1 -1
  97. package/components/common/wizards/network/add/lib/models/interfaces.ts +1 -0
  98. package/components/common/wizards/network/add/lib/utils/utils.ts +1 -1
  99. package/components/common/wizards/network/add/steps/connectionSettings/ConnectionSettingsOld.vue +5 -1
  100. package/components/common/wizards/network/add/steps/ipFourSettings/IpFourSettingsNew.vue +2 -8
  101. package/components/common/wizards/network/add/steps/ipFourSettings/IpFourSettingsOld.vue +3 -0
  102. package/components/common/wizards/network/add/steps/portProperties/PortPropertiesNew.vue +2 -8
  103. package/components/common/wizards/network/add/steps/portProperties/PortPropertiesOld.vue +6 -2
  104. package/components/common/wizards/network/add/steps/selectTargetDevice/SelectTargetDeviceNew.vue +10 -3
  105. package/components/common/wizards/network/add/steps/selectTargetDevice/SelectTargetDeviceOld.vue +4 -0
  106. package/components/common/wizards/network/add/steps/selectTargetDevice/modals/new/SelectNetwork.vue +5 -1
  107. package/components/common/wizards/network/add/validations/common.ts +1 -1
  108. package/components/common/wizards/vm/migrate/New.vue +13 -3
  109. package/components/common/wizards/vm/migrate/lib/config/constructDataReady.ts +5 -0
  110. package/components/common/wizards/vm/migrate/lib/config/steps.ts +3 -2
  111. package/components/common/wizards/vm/migrate/steps/computeResource/New.vue +2 -1
  112. package/components/common/wizards/vm/migrate/steps/computeResource/tableView/new/New.vue +40 -21
  113. package/components/common/wizards/vm/migrate/steps/computeResource/tableView/new/lib/config/clusterTable.ts +340 -0
  114. package/components/common/wizards/vm/migrate/steps/computeResource/tableView/new/lib/config/hostTable.ts +44 -14
  115. package/components/common/wizards/vm/migrate/steps/computeResource/tableView/new/lib/models/enums.ts +4 -0
  116. package/components/common/wizards/vm/migrate/steps/priority/New.vue +7 -2
  117. package/components/common/wizards/vm/migrate/steps/selectStorage/New.vue +22 -7
  118. package/components/common/wizards/vm/migrate/steps/selectStorage/configure/batch/New.vue +6 -0
  119. package/components/common/wizards/vm/migrate/steps/selectStorage/configure/batch/table/new/New.vue +4 -1
  120. package/components/common/wizards/vm/migrate/steps/selectStorage/configure/batch/table/new/lib/config/datastoreTable.ts +12 -16
  121. package/components/common/wizards/vm/migrate/steps/selectStorage/configure/disk/table/new/New.vue +10 -5
  122. package/components/common/wizards/vm/migrate/steps/selectStorage/configure/disk/table/new/lib/config/diskTable.ts +16 -11
  123. package/components/common/wizards/vm/migrate/steps/selectStorage/configure/disk/table/old/lib/config/diskTable.ts +7 -1
  124. package/components/common/wizards/vm/migrate/steps/selectStorage/selectedPerDisk/New.vue +17 -10
  125. package/components/common/wizards/vm/migrate/steps/type/TypeNew.vue +1 -0
  126. package/components/common/wizards/vm/migrate/vmOrigin/New.vue +35 -15
  127. package/lib/models/store/tasks/enums.ts +3 -0
  128. package/lib/models/store/tasks/types.ts +7 -6
  129. package/package.json +2 -2
  130. package/plugins/directives.ts +3 -5
  131. package/public/spice-console/application/agent.js +18 -17
  132. package/store/tasks/actions.ts +26 -8
  133. package/store/tasks/mappers/recentTasks.ts +1 -0
  134. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/actions/SaveOptionsModal.vue +0 -81
@@ -1,12 +1,17 @@
1
1
  <template>
2
- <div class="tooltip-info">
3
- <span class="tooltip-info__title">{{ localization.common.vmOrigin }}</span>
2
+ <div :class="['tooltip-info', { isOpen: isShowTooltipLocal }]">
3
+ <span
4
+ class="tooltip-info__title"
5
+ @click.stop="isShowTooltipLocal = !isShowTooltipLocal"
6
+ >
7
+ {{ localization.common.vmOrigin }}
8
+ </span>
4
9
  <ui-icon
5
10
  id="vm-origin-info-trigger"
6
- :class="['tooltip-info__icon pointer', { active: isShowTooltipLocal }]"
11
+ class="tooltip-info__icon pointer"
7
12
  name="info"
8
- width="20"
9
- height="20"
13
+ width="16"
14
+ height="16"
10
15
  @click.stop="isShowTooltipLocal = !isShowTooltipLocal"
11
16
  />
12
17
  <ui-popup-window
@@ -40,7 +45,7 @@
40
45
  :key="item2.name"
41
46
  class="flex items-center mt-2"
42
47
  >
43
- <span :class="item2.iconName"></span>
48
+ <span :class="['icon-row', item2.iconName]"></span>
44
49
  <span class="item-name">{{ item2.name }}</span>
45
50
  </div>
46
51
  </div>
@@ -67,22 +72,29 @@ const localization = computed<UI_I_Localization>(() => useLocal())
67
72
  @import 'assets/scss/common/mixins.scss';
68
73
  .tooltip-info {
69
74
  @include flex($align: center);
75
+ column-gap: 8px;
76
+ &:hover {
77
+ .tooltip-info__title,
78
+ .tooltip-info__icon {
79
+ color: var(--close-icon);
80
+ cursor: pointer;
81
+ }
82
+ }
83
+ &.isOpen {
84
+ .tooltip-info__title,
85
+ .tooltip-info__icon {
86
+ color: var(--btn-primary-fill-bg-color);
87
+ }
88
+ }
70
89
  &__title {
71
90
  font-family: 'Inter', sans-serif;
72
- color: var(--title-form-first-color);
91
+ color: #9da6ad; // for dark and light mode
73
92
  font-weight: 500;
74
93
  font-size: 12px;
75
94
  white-space: nowrap;
76
- margin-right: 4px;
77
95
  }
78
96
  &__icon {
79
97
  color: var(--form-icon-color);
80
- &:hover {
81
- color: var(--close-icon);
82
- }
83
- &.active {
84
- color: var(--btn-primary-fill-bg-color);
85
- }
86
98
  }
87
99
 
88
100
  .common-widget-info {
@@ -99,14 +111,22 @@ const localization = computed<UI_I_Localization>(() => useLocal())
99
111
  &__content {
100
112
  .item-row {
101
113
  margin-top: 12px;
114
+ &:first-child {
115
+ margin-top: 20px;
116
+ }
102
117
  }
103
118
  .title-row {
104
119
  font-family: 'Inter', sans-serif;
105
- color: var(--title-form-second-color);
120
+ color: #9da6ad; // for dark and light mode
106
121
  font-weight: 500;
107
122
  font-size: 13px;
123
+ line-height: 18px;
108
124
  margin-bottom: 8px;
109
125
  }
126
+ .icon-row {
127
+ width: 20px;
128
+ height: 20px;
129
+ }
110
130
 
111
131
  .item-name {
112
132
  font-family: 'Inter', sans-serif;
@@ -3,6 +3,9 @@ export enum UI_E_RecentTaskStatus {
3
3
  'running',
4
4
  'completed',
5
5
  'failed',
6
+ 'canceled',
7
+ 'retrying',
8
+ 'warning',
6
9
  }
7
10
 
8
11
  export enum UI_E_IconNameByRecentTaskStatus {
@@ -1,8 +1,9 @@
1
1
  export type UI_T_TasksStateLoading = 'tasks' | 'recentTasks'
2
2
  export type UI_T_TaskStatus =
3
- 0 | // queued
4
- 1 | // running
5
- 2 | // completed
6
- 3 | // failed
7
- 4 | // canceled
8
- 5 // retrying
3
+ | 0 // queued
4
+ | 1 // running
5
+ | 2 // completed
6
+ | 3 // failed
7
+ | 4 // canceled
8
+ | 5 // retrying
9
+ | 6 // warning
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.6.49",
4
+ "version": "1.6.50",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",
@@ -18,7 +18,7 @@
18
18
  "@vueuse/core": "10.1.2",
19
19
  "@vueuse/nuxt": "10.1.2",
20
20
  "bfg-nuxt-3-graph": "1.0.27",
21
- "bfg-uikit": "1.1.9",
21
+ "bfg-uikit": "1.1.29",
22
22
  "eslint-config-prettier": "^8.5.0",
23
23
  "eslint-plugin-myrules": "file:./eslint",
24
24
  "nuxt": "3.11.2",
@@ -1,5 +1,5 @@
1
1
  import type { DirectiveBinding } from '@vue/runtime-core'
2
- import type {UI_I_Localization} from "~/lib/models/interfaces";
2
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
3
3
 
4
4
  export default defineNuxtPlugin((nuxtApp) => {
5
5
  nuxtApp.vueApp.directive('development', {
@@ -22,8 +22,7 @@ function applyDevelopmentState(el: HTMLElement, isDevelopment: boolean) {
22
22
 
23
23
  el.setAttribute('title', localization.value.common.inDevelopment)
24
24
  el.setAttribute('disabled', 'true')
25
- el.style.opacity = '0.6'
26
- el.style.cursor = 'not-allowed'
25
+ el.classList.add('in-development')
27
26
 
28
27
  // Оборачиваем, чтобы не навешивать несколько обработчиков
29
28
  const preventClick = (e: MouseEvent) => {
@@ -40,8 +39,7 @@ function applyDevelopmentState(el: HTMLElement, isDevelopment: boolean) {
40
39
 
41
40
  function cleanupDevelopment(el: HTMLElement) {
42
41
  el.removeAttribute('title')
43
- el.style.opacity = ''
44
- el.style.cursor = ''
42
+ el.classList.remove('in-development')
45
43
 
46
44
  const handler = (el as any)._developmentClickHandler
47
45
  if (handler) {
@@ -70,6 +70,7 @@ wdi.Agent = $.spcExtend(wdi.EventObject.prototype, {
70
70
 
71
71
  setResolution: function(width, height) {
72
72
  //TODO move this to a setting
73
+ // SC-2122
73
74
  if(width < 800) {
74
75
  width = 800;
75
76
  }
@@ -80,23 +81,23 @@ wdi.Agent = $.spcExtend(wdi.EventObject.prototype, {
80
81
 
81
82
  //adapt resolution, TODO: this needs to be refractored
82
83
  var packetData = {
83
- type: wdi.AgentMessageTypes.VD_AGENT_MONITORS_CONFIG,
84
- opaque: 0,
85
- data: new wdi.VDAgentMonitorsConfig({
86
- num_of_monitors: 1,
87
- flags: 0,
88
- data: new wdi.VDAgentMonConfig({
89
- width: width,
90
- height: height,
91
- // Custom code
92
- // depth: 64,
93
- depth: 32, // SC-2122
94
- // Custom code end
95
- x: 0,
96
- y: 0
97
- })
98
- })
99
- };
84
+ type: wdi.AgentMessageTypes.VD_AGENT_MONITORS_CONFIG,
85
+ opaque: 0,
86
+ data: new wdi.VDAgentMonitorsConfig({
87
+ num_of_monitors: 1,
88
+ flags: 0,
89
+ data: new wdi.VDAgentMonConfig({
90
+ width: width,
91
+ height: height,
92
+ // Custom code
93
+ // depth: 64,
94
+ depth: 32,
95
+ // Custom code end
96
+ x: 0,
97
+ y: 0,
98
+ }),
99
+ }),
100
+ }
100
101
  this.sendAgentPacket(packetData);
101
102
  },
102
103
 
@@ -18,6 +18,7 @@ import type {
18
18
  } from '~/lib/models/store/tasks/interfaces'
19
19
  import type { UI_I_TasksState } from '~/store/tasks/lib/models/interfaces'
20
20
  import type { UI_I_RefreshStack } from '~/store/main/lib/interfaces'
21
+ import type { UI_T_Project } from '~/lib/models/types'
21
22
  import { tasksConstructor } from '~/store/tasks/mappers/tasks'
22
23
  import { recentTasks } from '~/store/tasks/mappers/recentTasks'
23
24
 
@@ -28,9 +29,13 @@ export default {
28
29
  state: UI_I_TasksState
29
30
  dispatch: <T>(arg0: string, arg1: T, arg2: UI_I_CommitOptions) => void
30
31
  },
31
- payload: UI_I_DataTableQuery
32
+ payload: {
33
+ data: UI_I_DataTableQuery
34
+ project: UI_T_Project
35
+ }
32
36
  ): Promise<API_UI_I_Error | void> {
33
- const { page, pageSize, sortBy, filter } = payload
37
+ const { data, project } = payload
38
+ const { page, pageSize, sortBy, filter } = data
34
39
 
35
40
  const query: UI_I_TableQuery = {
36
41
  page_size: pageSize,
@@ -38,7 +43,21 @@ export default {
38
43
  }
39
44
 
40
45
  if (sortBy) query.sortBy = sortBy
41
- if (filter) query.filter = filter
46
+ if (filter) {
47
+ if (project === 'procurator') {
48
+ query.filter = filter
49
+ } else {
50
+ const filters = filter.split(',')
51
+ filters.forEach((item) => {
52
+ const [field, value] = item.split('.')
53
+
54
+ if (field && value) {
55
+ // @ts-ignore
56
+ query[field] = value
57
+ }
58
+ })
59
+ }
60
+ }
42
61
 
43
62
  const queryJson: string = JSON.stringify({ type: 'tasks', ...query })
44
63
  const lastQuery: string = context.state.taskQuery || ''
@@ -63,7 +82,9 @@ export default {
63
82
  value: true,
64
83
  })
65
84
  },
66
- onResponse({ response }: API_UI_I_Response<API_UI_I_Task<string> | null>) {
85
+ onResponse({
86
+ response,
87
+ }: API_UI_I_Response<API_UI_I_Task<string> | null>) {
67
88
  const tasks = tasksConstructor(response._data)
68
89
 
69
90
  context.commit('M_SET_TASKS_LIST', tasks)
@@ -140,10 +161,7 @@ export default {
140
161
  payload: string
141
162
  ): Promise<void> {
142
163
  // Скрываем кнопку cancel
143
- context.commit(
144
- 'M_HIDE_CANCEL_RECENT_TASK_BY_ID',
145
- payload
146
- )
164
+ context.commit('M_HIDE_CANCEL_RECENT_TASK_BY_ID', payload)
147
165
  const { error } = await useMyFetch<
148
166
  API_UI_I_RecentTask<string>,
149
167
  API_UI_I_Error
@@ -82,6 +82,7 @@ export const recentTasks = (
82
82
  statusIcon = 'error-outline'
83
83
  break
84
84
  case 5:
85
+ case 6:
85
86
  statusIcon = 'warning-outline'
86
87
  break
87
88
  }
@@ -1,81 +0,0 @@
1
- <template>
2
- <atoms-modal
3
- :title="localization.inventoryMonitor.saveOptionsAs"
4
- width="575px"
5
- show
6
- @hide="onHide"
7
- @submit="onSave"
8
- >
9
- <template #modalBody>
10
- <common-pages-hardware-health-history-testimony-tools-chart-options-modal-actions-save-options-modal
11
- v-show="isShowAlerts"
12
- :alerts="alerts"
13
- @remove="onRemoveAlerts"
14
- />
15
- <div class="form-control">
16
- <label class="save-option-name-label" for="chartOptionsName"
17
- >{{ localization.common.chartOptionsName }}:</label
18
- >
19
- <input
20
- id="chartOptionsName"
21
- v-model="name"
22
- data-id="chart-options-name"
23
- type="text"
24
- />
25
- </div>
26
- </template>
27
- </atoms-modal>
28
- </template>
29
-
30
- <script setup lang="ts">
31
- import type { UI_I_Localization } from '~/lib/models/interfaces'
32
-
33
- const emits = defineEmits<{
34
- (event: 'hide'): void
35
- (event: 'save', value: string): void
36
- }>()
37
-
38
- const localization = computed<UI_I_Localization>(() => useLocal())
39
-
40
- const name = ref<string>('')
41
- const isShowAlerts = ref<boolean>(false)
42
- const alerts = ref<string[]>([])
43
-
44
- const onHide = (): void => {
45
- emits('hide')
46
- }
47
- const onSave = (): void => {
48
- if (!name.value) {
49
- alerts.value = [localization.value.common.settingsNameErrorDesc]
50
- isShowAlerts.value = true
51
-
52
- return
53
- }
54
-
55
- emits('save', name.value)
56
- }
57
-
58
- const onRemoveAlerts = (): void => {
59
- isShowAlerts.value = false
60
- alerts.value = []
61
- }
62
- </script>
63
-
64
- <style scoped lang="scss">
65
- :deep(.modal-dialog) {
66
- .alert {
67
- margin-bottom: 20px;
68
- }
69
-
70
- .form-control {
71
- display: flex;
72
-
73
- .save-option-name-label {
74
- white-space: nowrap;
75
- }
76
- #chartOptionsName {
77
- width: 100%;
78
- }
79
- }
80
- }
81
- </style>