bfg-common 1.6.74 → 1.6.75

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 (165) hide show
  1. package/assets/localization/local_be.json +272 -11
  2. package/assets/localization/local_en.json +291 -29
  3. package/assets/localization/local_hy.json +274 -13
  4. package/assets/localization/local_kk.json +272 -11
  5. package/assets/localization/local_ru.json +286 -25
  6. package/assets/localization/local_zh.json +273 -12
  7. package/assets/scss/common/global.scss +11 -0
  8. package/assets/scss/common/normalize.scss +3 -0
  9. package/assets/scss/common/theme.scss +2 -2
  10. package/components/atoms/stack/StackBlock.vue +1 -1
  11. package/components/atoms/table/dataGrid/DataGridColumnSwitch.vue +2 -2
  12. package/components/atoms/tooltip/TooltipError.vue +3 -0
  13. package/components/common/adapterManager/AdapterManagerNew.vue +86 -0
  14. package/components/common/adapterManager/addAdapterModal/AddAdapterModalNew.vue +1 -1
  15. package/components/common/adapterManager/addAdapterWarningModal/AddAdapterWarningModalNew.vue +0 -1
  16. package/components/common/adapterManager/ui/actions/bar/Bar.vue +2 -0
  17. package/components/common/adapterManager/ui/actions/bar/BarNew.vue +3 -2
  18. package/components/common/adapterManager/ui/table/adapters/AdaptersNew.vue +1 -0
  19. package/components/common/certificate/CertificateInfo.vue +7 -1
  20. package/components/common/configure/physicalAdapters/PhysicalAdapters.vue +6 -0
  21. package/components/common/configure/physicalAdapters/PhysicalAdaptersNew.vue +219 -192
  22. package/components/common/configure/physicalAdapters/PhysicalAdaptersOld.vue +6 -4
  23. package/components/common/configure/physicalAdapters/buttons/Buttons.vue +1 -0
  24. package/components/common/configure/physicalAdapters/modals/edit/Edit.vue +26 -1
  25. package/components/common/configure/physicalAdapters/modals/edit/EditNew.vue +30 -1
  26. package/components/common/configure/physicalAdapters/modals/edit/lib/models/interfaces.ts +5 -0
  27. package/components/common/configure/physicalAdapters/modals/edit/lib/validations/validations.ts +19 -0
  28. package/components/common/configure/physicalAdapters/tableView/TableViewNew.vue +12 -1
  29. package/components/common/configure/physicalAdapters/tableView/lib/config/physicalAdaptersTableConfigNew.ts +21 -21
  30. package/components/common/configure/physicalAdapters/tableView/lib/config/settings.ts +12 -5
  31. package/components/common/configure/physicalAdapters/tableView/lib/models/interfaces.ts +4 -1
  32. package/components/common/diagramMain/Diagram.vue +169 -85
  33. package/components/common/diagramMain/DiagramMain.vue +40 -10
  34. package/components/common/diagramMain/header/Header.vue +49 -0
  35. package/components/common/diagramMain/header/HeaderNew.vue +155 -0
  36. package/components/common/diagramMain/{Header.vue → header/HeaderOld.vue} +78 -67
  37. package/components/common/diagramMain/modals/Modals.vue +4 -0
  38. package/components/common/diagramMain/modals/UnsavedChangesModal.vue +32 -0
  39. package/components/common/diagramMain/modals/editSettings/EditSettings.vue +104 -102
  40. package/components/common/diagramMain/modals/editSettings/EditSettingsNew.vue +285 -0
  41. package/components/common/diagramMain/modals/editSettings/EditSettingsOld.vue +254 -0
  42. package/components/common/diagramMain/modals/editSettings/confirmTeamingSettingsModal/ConfirmTeamingSettingsModal.vue +31 -0
  43. package/components/common/diagramMain/modals/editSettings/confirmTeamingSettingsModal/ConfirmTeamingSettingsModalNew.vue +82 -0
  44. package/components/common/diagramMain/modals/editSettings/{ConfirmTeamingSettingsModal.vue → confirmTeamingSettingsModal/ConfirmTeamingSettingsModalOld.vue} +2 -5
  45. package/components/common/diagramMain/modals/editSettings/lib/config/config.ts +15 -0
  46. package/components/common/diagramMain/modals/editSettings/lib/models/interfaces.ts +6 -0
  47. package/components/common/diagramMain/modals/editSettings/lib/utils/utils.ts +177 -0
  48. package/components/common/diagramMain/modals/editSettings/modal/EditSettingsModal.vue +137 -0
  49. package/components/common/diagramMain/modals/editSettings/modal/EditSettingsModalNew.vue +91 -0
  50. package/components/common/diagramMain/modals/editSettings/{EditSettingsModal.vue → modal/EditSettingsModalOld.vue} +12 -51
  51. package/components/common/diagramMain/modals/editSettings/tabs/networkProperties/NetworkProperties.vue +158 -0
  52. package/components/common/diagramMain/modals/editSettings/tabs/networkProperties/NetworkPropertiesNew.vue +262 -0
  53. package/components/common/diagramMain/modals/editSettings/tabs/{NetworkProperties.vue → networkProperties/NetworkPropertiesOld.vue} +12 -113
  54. package/components/common/diagramMain/modals/editSettings/tabs/port/ipvFourSettings/IpvFourSettings.vue +192 -0
  55. package/components/common/diagramMain/modals/editSettings/tabs/port/ipvFourSettings/IpvFourSettingsNew.vue +388 -0
  56. package/components/common/diagramMain/modals/editSettings/tabs/port/{IpvFourSettings.vue → ipvFourSettings/IpvFourSettingsOld.vue} +11 -152
  57. package/components/common/diagramMain/modals/editSettings/tabs/port/portProperties/PortProperties.vue +139 -0
  58. package/components/common/diagramMain/modals/editSettings/tabs/port/portProperties/PortPropertiesNew.vue +286 -0
  59. package/components/common/diagramMain/modals/editSettings/tabs/port/{PortProperties.vue → portProperties/PortPropertiesOld.vue} +12 -103
  60. package/components/common/diagramMain/modals/editSettings/tabs/security/Security.vue +209 -0
  61. package/components/common/diagramMain/modals/editSettings/tabs/security/SecurityNew.vue +233 -0
  62. package/components/common/diagramMain/modals/editSettings/tabs/{Security.vue → security/SecurityOld.vue} +25 -48
  63. package/components/common/diagramMain/modals/editSettings/tabs/switchProperties/SwitchProperties.vue +128 -0
  64. package/components/common/diagramMain/modals/editSettings/tabs/switchProperties/SwitchPropertiesNew.vue +235 -0
  65. package/components/common/diagramMain/modals/editSettings/tabs/{SwitchProperties.vue → switchProperties/SwitchPropertiesOld.vue} +12 -89
  66. package/components/common/diagramMain/modals/editSettings/tabs/teamingFailover/TeamingFailover.vue +99 -0
  67. package/components/common/diagramMain/modals/editSettings/tabs/teamingFailover/TeamingFailoverNew.vue +319 -0
  68. package/components/common/diagramMain/modals/editSettings/tabs/{TeamingFailover.vue → teamingFailover/TeamingFailoverOld.vue} +11 -48
  69. package/components/common/diagramMain/modals/editSettings/tabs/trafficShaping/TrafficShaping.vue +173 -0
  70. package/components/common/diagramMain/modals/editSettings/tabs/trafficShaping/TrafficShapingNew.vue +348 -0
  71. package/components/common/diagramMain/modals/editSettings/tabs/{TrafficShaping.vue → trafficShaping/TrafficShapingOld.vue} +12 -134
  72. package/components/common/diagramMain/modals/lib/config/diagramConfig.ts +43 -2
  73. package/components/common/diagramMain/modals/lib/config/index.ts +2 -1
  74. package/components/common/diagramMain/modals/lib/config/vmKernelAdapter.ts +1 -1
  75. package/components/common/diagramMain/modals/lib/utils/index.ts +34 -4
  76. package/components/common/diagramMain/modals/migrateVmkernelAdapter/MigrateVmkernelAdapter.vue +2 -2
  77. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/common.ts +1 -1
  78. package/components/common/diagramMain/skeleton/Header.vue +31 -0
  79. package/components/common/diagramMain/skeleton/Switch.vue +75 -0
  80. package/components/common/layout/theHeader/ThemeSwitch.vue +1 -1
  81. package/components/common/layout/theHeader/modals/reconnect/New.vue +38 -30
  82. package/components/common/layout/theHeader/userMenu/modals/changePassword/New.vue +8 -9
  83. package/components/common/layout/theHeader/userMenu/modals/preferences/New.vue +4 -0
  84. package/components/common/layout/theHeader/userMenu/modals/preferences/Old.vue +9 -2
  85. package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/ChangeLanguage.vue +11 -7
  86. package/components/common/layout/theHeader/userMenu/modals/preferences/defaultConsole/DefaultConsole.vue +7 -1
  87. package/components/common/layout/theHeader/userMenu/modals/preferences/defaultConsole/lib/config/consoleOptions.ts +8 -5
  88. package/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/TimeFormat.vue +9 -5
  89. package/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/lib/config/formatOptions.ts +1 -1
  90. package/components/common/layout/theHeader/userMenu/modals/preferences/view/Old.vue +5 -9
  91. package/components/common/layout/theHeader/userMenu/modals/preferences/view/View.vue +9 -6
  92. package/components/common/mainNavigationPanel/MainNavigationPanelNew.vue +3 -1
  93. package/components/common/modals/Rename.vue +3 -1
  94. package/components/common/noDataProvided/NoDataProvidedNew.vue +1 -1
  95. package/components/common/pages/backups/modals/createBackup/datastores/tableView/new/lib/config/table.ts +4 -4
  96. package/components/common/pages/backups/modals/createBackup/datastores/tableView/old/lib/config/table.ts +4 -4
  97. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/ChartOptionsModal.vue +184 -253
  98. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/actions/ActionsNew.vue +1 -1
  99. package/components/common/pages/scheduledTasks/table/lib/models/enums.ts +9 -0
  100. package/components/common/pages/scheduledTasks/table/new/New.vue +12 -10
  101. package/components/common/pages/tasks/Tasks.vue +4 -1
  102. package/components/common/pages/tasks/table/Table.vue +25 -23
  103. package/components/common/readyToComplete/New.vue +1 -0
  104. package/components/common/split/vertical/New.vue +42 -8
  105. package/components/common/split/vertical/Old.vue +31 -2
  106. package/components/common/split/vertical/Vertical.vue +4 -0
  107. package/components/common/tools/Actions.vue +7 -3
  108. package/components/common/tools/lib/models/interfaces.ts +1 -0
  109. package/components/common/vm/actions/add/New.vue +21 -6
  110. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/Media.vue +14 -1
  111. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/New.vue +5 -0
  112. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/Old.vue +1 -0
  113. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/New.vue +1 -0
  114. package/components/common/vm/actions/common/customizeHardware/virtualHardware/reservation/New.vue +2 -0
  115. package/components/common/vm/actions/common/select/options/New.vue +14 -12
  116. package/components/common/vm/actions/common/select/options/Old.vue +16 -15
  117. package/components/common/vm/actions/common/select/storage/new/lib/config/table.ts +13 -15
  118. package/components/common/vm/actions/confirm/Confirm.vue +3 -0
  119. package/components/common/vm/actions/rename/Old.vue +1 -0
  120. package/components/common/vm/snapshots/DetailView.vue +6 -6
  121. package/components/common/wizards/datastore/add/New.vue +6 -0
  122. package/components/common/wizards/datastore/add/lib/config/steps.ts +1 -1
  123. package/components/common/wizards/datastore/add/steps/nameAndDevice/NameAndDeviceNew.vue +1 -1
  124. package/components/common/wizards/datastore/add/steps/nameAndDevice/advancedOptions/New.vue +1 -1
  125. package/components/common/wizards/network/add/Add.vue +13 -2
  126. package/components/common/wizards/network/add/AddNew.vue +22 -26
  127. package/components/common/wizards/network/add/lib/config/initialData.ts +6 -4
  128. package/components/common/wizards/network/add/lib/config/steps.ts +1 -1
  129. package/components/common/wizards/network/add/lib/models/interfaces.ts +1 -0
  130. package/components/common/wizards/network/add/lib/utils/utils.ts +1 -1
  131. package/components/common/wizards/network/add/steps/connectionSettings/ConnectionSettingsOld.vue +5 -1
  132. package/components/common/wizards/network/add/steps/ipFourSettings/IpFourSettingsNew.vue +2 -8
  133. package/components/common/wizards/network/add/steps/ipFourSettings/IpFourSettingsOld.vue +3 -0
  134. package/components/common/wizards/network/add/steps/portProperties/PortPropertiesNew.vue +2 -8
  135. package/components/common/wizards/network/add/steps/portProperties/PortPropertiesOld.vue +6 -2
  136. package/components/common/wizards/network/add/steps/selectTargetDevice/SelectTargetDeviceNew.vue +10 -3
  137. package/components/common/wizards/network/add/steps/selectTargetDevice/SelectTargetDeviceOld.vue +4 -0
  138. package/components/common/wizards/network/add/steps/selectTargetDevice/modals/new/SelectNetwork.vue +5 -1
  139. package/components/common/wizards/network/add/validations/common.ts +1 -1
  140. package/components/common/wizards/vm/migrate/New.vue +13 -3
  141. package/components/common/wizards/vm/migrate/lib/config/constructDataReady.ts +5 -0
  142. package/components/common/wizards/vm/migrate/lib/config/steps.ts +3 -2
  143. package/components/common/wizards/vm/migrate/steps/computeResource/New.vue +2 -1
  144. package/components/common/wizards/vm/migrate/steps/computeResource/tableView/new/New.vue +40 -21
  145. package/components/common/wizards/vm/migrate/steps/computeResource/tableView/new/lib/config/clusterTable.ts +340 -0
  146. package/components/common/wizards/vm/migrate/steps/computeResource/tableView/new/lib/config/hostTable.ts +44 -14
  147. package/components/common/wizards/vm/migrate/steps/computeResource/tableView/new/lib/models/enums.ts +4 -0
  148. package/components/common/wizards/vm/migrate/steps/priority/New.vue +7 -2
  149. package/components/common/wizards/vm/migrate/steps/selectStorage/New.vue +22 -7
  150. package/components/common/wizards/vm/migrate/steps/selectStorage/configure/batch/New.vue +6 -0
  151. package/components/common/wizards/vm/migrate/steps/selectStorage/configure/batch/table/new/New.vue +4 -1
  152. package/components/common/wizards/vm/migrate/steps/selectStorage/configure/batch/table/new/lib/config/datastoreTable.ts +12 -16
  153. package/components/common/wizards/vm/migrate/steps/selectStorage/configure/disk/table/new/New.vue +10 -5
  154. package/components/common/wizards/vm/migrate/steps/selectStorage/configure/disk/table/new/lib/config/diskTable.ts +16 -11
  155. package/components/common/wizards/vm/migrate/steps/selectStorage/configure/disk/table/old/lib/config/diskTable.ts +7 -1
  156. package/components/common/wizards/vm/migrate/steps/selectStorage/selectedPerDisk/New.vue +17 -10
  157. package/components/common/wizards/vm/migrate/steps/type/TypeNew.vue +1 -0
  158. package/components/common/wizards/vm/migrate/vmOrigin/New.vue +35 -15
  159. package/lib/models/store/tasks/enums.ts +3 -0
  160. package/lib/models/store/tasks/types.ts +7 -6
  161. package/package.json +2 -2
  162. package/plugins/directives.ts +3 -5
  163. package/public/spice-console/application/agent.js +18 -17
  164. package/store/tasks/actions.ts +26 -8
  165. package/store/tasks/mappers/recentTasks.ts +1 -0
@@ -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.74",
4
+ "version": "1.6.75",
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.28",
21
- "bfg-uikit": "1.1.9",
21
+ "bfg-uikit": "1.1.32",
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
  }