bfg-common 1.3.239 → 1.3.240
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.
- package/components/atoms/switch/Switch.vue +111 -111
- package/components/atoms/table/compact/Compact.vue +526 -526
- package/components/common/BadBrowser.vue +16 -12
- package/components/common/accordion/Accordion.vue +1 -0
- package/components/common/accordion/Recursion.vue +2 -0
- package/components/common/accordion/lib/models/interfaces.ts +1 -0
- package/components/common/adapterManager/AddAdapterModal.vue +8 -5
- package/components/common/adapterManager/AddAdapterWarningModal.vue +1 -0
- package/components/common/adapterManager/ui/actions/AddAdapterButton.vue +2 -0
- package/components/common/adapterManager/ui/actions/MoveDownAdapterButton.vue +2 -0
- package/components/common/adapterManager/ui/actions/MoveUpAdapterButton.vue +2 -0
- package/components/common/adapterManager/ui/actions/RemoveAdapterButton.vue +2 -0
- package/components/common/adapterManager/ui/table/Adapters.vue +14 -13
- package/components/common/adapterManager/ui/table/Header.vue +6 -4
- package/components/common/adapterManager/ui/table/Table.vue +13 -4
- package/components/common/browse/Browse.vue +5 -1
- package/components/common/browse/blocks/Container.vue +3 -0
- package/components/common/browse/blocks/contents/Files.vue +1 -0
- package/components/common/context/ContextRecursion.vue +6 -1
- package/components/common/details/DetailsItem.vue +3 -0
- package/components/common/diagramMain/Header.vue +4 -0
- package/components/common/diagramMain/adapter/AdapterItem.vue +2 -0
- package/components/common/diagramMain/adapter/Contents.vue +2 -0
- package/components/common/diagramMain/lib/models/interfaces.ts +1 -0
- package/components/common/diagramMain/modals/editSettings/tabs/NetworkProperties.vue +1 -0
- package/components/common/diagramMain/modals/editSettings/tabs/Security.vue +13 -27
- package/components/common/diagramMain/modals/editSettings/tabs/SwitchProperties.vue +1 -0
- package/components/common/diagramMain/modals/editSettings/tabs/TeamingFailover.vue +3 -0
- package/components/common/diagramMain/modals/editSettings/tabs/TrafficShaping.vue +8 -0
- package/components/common/diagramMain/modals/editSettings/tabs/port/IpvFourSettings.vue +6 -0
- package/components/common/diagramMain/modals/editSettings/tabs/port/PortProperties.vue +2 -0
- package/components/common/diagramMain/modals/lib/config/networkModal.ts +4 -0
- package/components/common/diagramMain/modals/lib/config/portModal.ts +7 -2
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/ConnectionSettings.vue +19 -13
- package/components/common/diagramMain/modals/remove/RemoveModal.vue +5 -0
- package/components/common/diagramMain/modals/viewSettings/ViewSettings.vue +11 -7
- package/components/common/diagramMain/network/Contents.vue +5 -4
- package/components/common/diagramMain/port/Port.vue +1 -0
- package/components/common/feedback/Buttons.vue +2 -0
- package/components/common/feedback/Feedback.vue +9 -2
- package/components/common/feedback/Message.vue +9 -0
- package/components/common/feedback/VisitPortal.vue +11 -2
- package/components/common/help/navbar/left/Left.vue +1 -0
- package/components/common/help/navbar/right/Right.vue +12 -2
- package/components/common/help/navbar/right/lib/models/interfaces.ts +1 -0
- package/components/common/home/alertsTable/AlertsTable.vue +1 -0
- package/components/common/modals/Confirmation.vue +10 -2
- package/components/common/modals/Rename.vue +1 -0
- package/components/common/monitor/advanced/tools/Tools.vue +10 -1
- package/components/common/monitor/advanced/tools/chartOptionsModal/actions/Actions.vue +7 -1
- package/components/common/monitor/advanced/tools/chartOptionsModal/actions/saveOptionsModal/SaveOptionsModal.vue +6 -1
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/form/Form.vue +14 -1
- package/components/common/monitor/overview/filters/Filters.vue +12 -5
- package/components/common/monitor/overview/filters/customIntervalModal/CustomIntervalModal.vue +4 -0
- package/components/common/pages/Tasks.vue +120 -120
- package/components/common/perPage/PerPage.vue +1 -0
- package/components/common/recursionTree/RecursionTree.vue +205 -203
- package/components/common/recursionTree/lib/models/interfaces.ts +4 -2
- package/components/common/select/button/ButtonDropdown.vue +2 -0
- package/components/common/select/button/lib/models/interfaces.ts +1 -0
- package/components/common/select/input/Input.vue +1 -0
- package/components/common/select/radio/RadioGroup.vue +2 -0
- package/components/common/select/radio/lib/models/interfaces.ts +1 -0
- package/components/common/shortcuts/Block.vue +2 -0
- package/components/common/shortcuts/Category.vue +1 -0
- package/components/common/shortcuts/lib/models/interfaces.ts +1 -0
- package/components/common/spiceConsole/Drawer.vue +4 -0
- package/components/common/spiceConsole/keyboard/Keyboard.vue +1 -0
- package/components/common/spiceConsole/keyboard/lib/config/keyboardRows.ts +81 -6
- package/components/common/spiceConsole/keyboard/lib/models/interfaces.ts +1 -0
- package/components/common/split/horizontal/Horizontal.vue +1 -0
- package/components/common/vm/actions/add/Add.vue +576 -575
- package/components/common/vm/actions/clone/Clone.vue +518 -518
- package/components/common/vm/actions/clone/select/options/Options.vue +9 -3
- package/components/common/vm/actions/common/customizeHardware/CustomizeHardware.vue +269 -269
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue +693 -693
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/bus/Bus.vue +5 -1
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDrive.vue +7 -2
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/Media.vue +2 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CoresPerSocket.vue +1 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CpuHotPlug.vue +1 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CpuModel.vue +225 -220
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Hv.vue +2 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Iommu.vue +1 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Pc.vue +1 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Sa.vue +2 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/Shares.vue +5 -1
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/tooltip/Tooltip.vue +1 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/config/dropdownItems.ts +59 -59
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/limit/Limit.vue +2 -1
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/Memory.vue +1 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/MemoryHotPlug.vue +1 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/Location.vue +6 -6
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +5 -6
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/cache/Cache.vue +1 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/limitIops/LimitIops.vue +1 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/mode/Mode.vue +1 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/provisioning/Provisioning.vue +1 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/sharing/Sharing.vue +1 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/Location.vue +2 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +295 -294
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/adapterType/AdapterType.vue +1 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddress.vue +12 -4
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDevice.vue +165 -165
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIo.vue +5 -1
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/NvidiaGrid.vue +2 -1
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/typeSelection/TypeSelection.vue +2 -1
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbController.vue +1 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/reservation/Reservation.vue +3 -1
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/Graphics.vue +6 -1
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/TotalVideoMemory.vue +2 -1
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCard.vue +1 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/model/Model.vue +1 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/numberDisplays/NumberDisplays.vue +1 -0
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/Menu.vue +6 -1
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/Secure.vue +6 -1
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/delay/Delay.vue +5 -1
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/firmware/Firmware.vue +1 -0
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +5 -1
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/lib/models/interfaces.ts +1 -0
- package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptions.vue +4 -1
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/CopyPaste.vue +1 -0
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/FileTransfer.vue +1 -0
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/FolderSharing.vue +1 -0
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/PlaybackCompression.vue +1 -0
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/PowerControl.vue +1 -0
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/imgCompression/ImgCompression.vue +1 -0
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/jpegCompression/JpegCompression.vue +1 -0
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +2 -1
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/mouseMode/MouseMode.vue +6 -1
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/Password.vue +7 -1
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/sharePolicy/SharePolicy.vue +5 -1
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/streamingMode/StreamingMode.vue +1 -0
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/type/Type.vue +1 -0
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirection.vue +2 -1
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/zlibCompression/ZlibCompression.vue +1 -0
- package/components/common/vm/actions/common/customizeHardware/vmoptions/tools/Tools.vue +6 -1
- package/components/common/vm/actions/common/select/compatibility/Compatibility.vue +31 -27
- package/components/common/vm/actions/common/select/name/Name.vue +7 -1
- package/components/common/vm/actions/common/select/os/os.vue +7 -1
- package/components/common/vm/actions/common/select/storage/lib/config/config.ts +166 -166
- package/components/common/vm/actions/editSettings/EditSettings.vue +313 -313
- package/components/common/weekSelect/WeekSelect.vue +143 -112
- package/components/common/weekSelect/lib/config/options.ts +10 -10
- package/components/common/weekSelect/lib/models/interfaces.ts +1 -0
- package/components/common/wizards/datastore/add/local/createName/CreateName.vue +1 -0
- package/components/common/wizards/datastore/add/nfs/accessibility/Accessibility.vue +8 -7
- package/components/common/wizards/datastore/add/nfs/configuration/Configuration.vue +9 -1
- package/components/common/wizards/datastore/add/nfs/configuration/serversList/DeletePopover.vue +6 -3
- package/components/common/wizards/datastore/add/nfs/kerberosAuthentication/KerberosAuthentication.vue +1 -0
- package/components/common/wizards/datastore/add/nfs/kerberosAuthentication/lib/config/radioOptions.ts +3 -0
- package/components/common/wizards/datastore/add/sharedStorm/deviceSelection/DeviceSelection.vue +2 -0
- package/components/common/wizards/datastore/add/sharedStorm/partitionConfiguration/PartitionConfiguration.vue +2 -0
- package/components/common/wizards/datastore/add/types/Types.vue +1 -0
- package/components/common/wizards/network/add/modals/SelectNetwork.vue +16 -3
- package/components/common/wizards/network/add/modals/SelectStandardSwitch.vue +10 -2
- package/components/common/wizards/network/add/modals/SelectSwitch.vue +10 -2
- package/components/common/wizards/network/add/steps/ConnectionSettings.vue +5 -1
- package/components/common/wizards/network/add/steps/IpFourSettings.vue +12 -2
- package/components/common/wizards/network/add/steps/PortProperties.vue +16 -3
- package/components/common/wizards/network/add/steps/SelectConnectionType.vue +6 -3
- package/components/common/wizards/network/add/steps/SelectedTargetDevice.vue +11 -0
- package/components/common/wizards/vm/common/tooltip/Tooltip.vue +2 -0
- package/components/common/wizards/vm/migrate/select/network/Network.vue +1 -0
- package/components/common/wizards/vm/migrate/select/network/table/network/Network.vue +1 -0
- package/components/common/wizards/vm/migrate/select/storage/Storage.vue +5 -1
- package/components/common/wizards/vm/migrate/select/storage/configure/disk/Disk.vue +1 -0
- package/components/common/wizards/vm/migrate/select/storage/diskFormat/DiskFormat.vue +1 -0
- package/components/common/wizards/vm/migrate/select/storage/policy/Policy.vue +1 -0
- package/components/common/wizards/vm/migrate/select/storage/selectedPerDisk/SelectedPerDisk.vue +1 -0
- package/components/common/wizards/vm/migrate/select/targetServer/new/New.vue +9 -1
- package/composables/useAppVersion.ts +21 -21
- package/composables/useEnvLanguage.ts +20 -20
- package/lib/utils/sendTask.ts +72 -72
- package/minify.js +146 -146
- package/package.json +1 -1
- package/public/spice-console/application/codec.js +257 -257
- package/public/spice-console/lib/rasterEngine.js +907 -907
- package/public/spice-console/network/spicechannel.js +369 -369
- package/store/main/lib/interfaces.ts +9 -9
- package/store/tasks/actions.ts +133 -133
- package/store/tasks/getters.ts +25 -25
- package/store/tasks/lib/models/interfaces.ts +18 -18
- package/store/tasks/mutations.ts +58 -58
- package/store/tasks/state.ts +16 -16
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { UI_I_Options } from '~/lib/models/composables/useMyFetch/interfaces'
|
|
2
|
-
|
|
3
|
-
export interface UI_I_RefreshStack {
|
|
4
|
-
key: string
|
|
5
|
-
// method: () => void | any
|
|
6
|
-
url: string
|
|
7
|
-
options: UI_I_Options
|
|
8
|
-
paused?: boolean
|
|
9
|
-
}
|
|
1
|
+
import type { UI_I_Options } from '~/lib/models/composables/useMyFetch/interfaces'
|
|
2
|
+
|
|
3
|
+
export interface UI_I_RefreshStack {
|
|
4
|
+
key: string
|
|
5
|
+
// method: () => void | any
|
|
6
|
+
url: string
|
|
7
|
+
options: UI_I_Options
|
|
8
|
+
paused?: boolean
|
|
9
|
+
}
|
package/store/tasks/actions.ts
CHANGED
|
@@ -1,133 +1,133 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
API_UI_I_Error,
|
|
3
|
-
API_UI_I_Response,
|
|
4
|
-
UI_I_CommitOptions,
|
|
5
|
-
} from '~/lib/models/store/interfaces'
|
|
6
|
-
import type {
|
|
7
|
-
UI_I_DataTableQuery,
|
|
8
|
-
UI_I_TableQuery,
|
|
9
|
-
} from '~/lib/models/table/interfaces'
|
|
10
|
-
import type { UI_I_Options } from '~/lib/models/composables/useMyFetch/interfaces'
|
|
11
|
-
import type {
|
|
12
|
-
API_UI_I_RecentTask,
|
|
13
|
-
UI_I_RTaskQuery,
|
|
14
|
-
UI_I_TasksLoadingPayload,
|
|
15
|
-
UI_I_RawRecentTask,
|
|
16
|
-
UI_I_RecentTask,
|
|
17
|
-
API_UI_I_Task,
|
|
18
|
-
} from '~/lib/models/store/tasks/interfaces'
|
|
19
|
-
import type { UI_I_TasksState } from '~/store/tasks/lib/models/interfaces'
|
|
20
|
-
import type { UI_I_RefreshStack } from '~/store/main/lib/interfaces'
|
|
21
|
-
import { tasksConstructor } from '~/store/tasks/mappers/tasks'
|
|
22
|
-
import { recentTasks } from '~/store/tasks/mappers/recentTasks'
|
|
23
|
-
|
|
24
|
-
export default {
|
|
25
|
-
async A_GET_TASKS(
|
|
26
|
-
context: {
|
|
27
|
-
commit: <T>(arg0: string, arg1: T) => void
|
|
28
|
-
state: UI_I_TasksState
|
|
29
|
-
dispatch: <T>(arg0: string, arg1: T, arg2: UI_I_CommitOptions) => void
|
|
30
|
-
},
|
|
31
|
-
payload: UI_I_DataTableQuery
|
|
32
|
-
): Promise<API_UI_I_Error | void> {
|
|
33
|
-
const { page, pageSize, sortBy } = payload
|
|
34
|
-
|
|
35
|
-
const query: UI_I_TableQuery = {
|
|
36
|
-
page_size: pageSize,
|
|
37
|
-
page,
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
if (sortBy) query.sortBy = sortBy
|
|
41
|
-
|
|
42
|
-
const queryJson: string = JSON.stringify({ type: 'tasks', ...query })
|
|
43
|
-
const lastQuery: string = context.state.taskQuery || ''
|
|
44
|
-
|
|
45
|
-
if (queryJson === lastQuery) {
|
|
46
|
-
// Снимаем с паузы сам запрос, для глобального обновления
|
|
47
|
-
context.dispatch<string>('main/A_CONTINUE_GLOBAL_REFRESH', queryJson, {
|
|
48
|
-
root: true,
|
|
49
|
-
})
|
|
50
|
-
return
|
|
51
|
-
}
|
|
52
|
-
context.commit('M_SET_TASKS_LAST_QUERY', queryJson)
|
|
53
|
-
|
|
54
|
-
const url = '/ui/tasks'
|
|
55
|
-
const options: UI_I_Options = {
|
|
56
|
-
query,
|
|
57
|
-
method: 'GET',
|
|
58
|
-
key: Date.now().toString(),
|
|
59
|
-
onRequest() {
|
|
60
|
-
context.commit<UI_I_TasksLoadingPayload>('M_SET_LOADING', {
|
|
61
|
-
prop: 'tasks',
|
|
62
|
-
value: true,
|
|
63
|
-
})
|
|
64
|
-
},
|
|
65
|
-
onResponse({ response }: API_UI_I_Response<API_UI_I_Task<string>>) {
|
|
66
|
-
const tasks = tasksConstructor(response._data)
|
|
67
|
-
|
|
68
|
-
context.commit('M_SET_TASKS_LIST', tasks)
|
|
69
|
-
context.commit<UI_I_TasksLoadingPayload>('M_SET_LOADING', {
|
|
70
|
-
prop: 'tasks',
|
|
71
|
-
value: false,
|
|
72
|
-
})
|
|
73
|
-
},
|
|
74
|
-
}
|
|
75
|
-
const { error } = await useMyFetch<API_UI_I_Task<string>, API_UI_I_Error>(
|
|
76
|
-
url,
|
|
77
|
-
options
|
|
78
|
-
)
|
|
79
|
-
|
|
80
|
-
if (error.value?.data?.error_code)
|
|
81
|
-
throw new Error(error.value.data.error_message)
|
|
82
|
-
|
|
83
|
-
context.dispatch<UI_I_RefreshStack>(
|
|
84
|
-
'main/A_ADD_IN_GLOBAL_REFRESH',
|
|
85
|
-
{ key: queryJson, url, options },
|
|
86
|
-
{ root: true }
|
|
87
|
-
)
|
|
88
|
-
},
|
|
89
|
-
async A_GET_RECENT_TASKS(
|
|
90
|
-
context: {
|
|
91
|
-
commit: <T>(arg0: string, arg1: T) => void
|
|
92
|
-
state: UI_I_TasksState
|
|
93
|
-
},
|
|
94
|
-
payload: string
|
|
95
|
-
): Promise<void> {
|
|
96
|
-
const query: UI_I_RTaskQuery = {
|
|
97
|
-
last: context.state.recentTaskList?.last || 0,
|
|
98
|
-
}
|
|
99
|
-
if (payload) query.sortBy = payload
|
|
100
|
-
|
|
101
|
-
const { data, error } = await useMyFetch<
|
|
102
|
-
API_UI_I_RecentTask<string>,
|
|
103
|
-
API_UI_I_Error
|
|
104
|
-
>('/ui/rtasks', {
|
|
105
|
-
query,
|
|
106
|
-
method: 'GET',
|
|
107
|
-
initialCache: false,
|
|
108
|
-
})
|
|
109
|
-
|
|
110
|
-
if (error.value?.data?.error_code)
|
|
111
|
-
throw new Error(error.value.data.error_message)
|
|
112
|
-
|
|
113
|
-
context.commit<UI_I_RecentTask<string>>(
|
|
114
|
-
'M_SET_RECENT_TASKS_LIST',
|
|
115
|
-
recentTasks(data.value)
|
|
116
|
-
)
|
|
117
|
-
context.commit<UI_I_RawRecentTask<string>>(
|
|
118
|
-
'M_SET_UPDATED_RECENT_TASKS_LIST',
|
|
119
|
-
data.value
|
|
120
|
-
)
|
|
121
|
-
// context.commit<I_TasksLoadingPayload>('M_SET_LOADING', {
|
|
122
|
-
// prop: 'recentTasks',
|
|
123
|
-
// value: false,
|
|
124
|
-
// })
|
|
125
|
-
},
|
|
126
|
-
|
|
127
|
-
// Вызывается в useMyFetch когда получаем первый ответ от запроса с url tasks
|
|
128
|
-
// и default.vue когда срабатывает watch на recentTasks
|
|
129
|
-
// Нужно для того чтобы не обрабатывали те таски которые были сделаны перед загрузкой страницы
|
|
130
|
-
A_SET_FIRST_TASK(context: { commit: (arg0: string) => void }): void {
|
|
131
|
-
context.commit('M_SET_FIRST_TASK')
|
|
132
|
-
},
|
|
133
|
-
}
|
|
1
|
+
import type {
|
|
2
|
+
API_UI_I_Error,
|
|
3
|
+
API_UI_I_Response,
|
|
4
|
+
UI_I_CommitOptions,
|
|
5
|
+
} from '~/lib/models/store/interfaces'
|
|
6
|
+
import type {
|
|
7
|
+
UI_I_DataTableQuery,
|
|
8
|
+
UI_I_TableQuery,
|
|
9
|
+
} from '~/lib/models/table/interfaces'
|
|
10
|
+
import type { UI_I_Options } from '~/lib/models/composables/useMyFetch/interfaces'
|
|
11
|
+
import type {
|
|
12
|
+
API_UI_I_RecentTask,
|
|
13
|
+
UI_I_RTaskQuery,
|
|
14
|
+
UI_I_TasksLoadingPayload,
|
|
15
|
+
UI_I_RawRecentTask,
|
|
16
|
+
UI_I_RecentTask,
|
|
17
|
+
API_UI_I_Task,
|
|
18
|
+
} from '~/lib/models/store/tasks/interfaces'
|
|
19
|
+
import type { UI_I_TasksState } from '~/store/tasks/lib/models/interfaces'
|
|
20
|
+
import type { UI_I_RefreshStack } from '~/store/main/lib/interfaces'
|
|
21
|
+
import { tasksConstructor } from '~/store/tasks/mappers/tasks'
|
|
22
|
+
import { recentTasks } from '~/store/tasks/mappers/recentTasks'
|
|
23
|
+
|
|
24
|
+
export default {
|
|
25
|
+
async A_GET_TASKS(
|
|
26
|
+
context: {
|
|
27
|
+
commit: <T>(arg0: string, arg1: T) => void
|
|
28
|
+
state: UI_I_TasksState
|
|
29
|
+
dispatch: <T>(arg0: string, arg1: T, arg2: UI_I_CommitOptions) => void
|
|
30
|
+
},
|
|
31
|
+
payload: UI_I_DataTableQuery
|
|
32
|
+
): Promise<API_UI_I_Error | void> {
|
|
33
|
+
const { page, pageSize, sortBy } = payload
|
|
34
|
+
|
|
35
|
+
const query: UI_I_TableQuery = {
|
|
36
|
+
page_size: pageSize,
|
|
37
|
+
page,
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (sortBy) query.sortBy = sortBy
|
|
41
|
+
|
|
42
|
+
const queryJson: string = JSON.stringify({ type: 'tasks', ...query })
|
|
43
|
+
const lastQuery: string = context.state.taskQuery || ''
|
|
44
|
+
|
|
45
|
+
if (queryJson === lastQuery) {
|
|
46
|
+
// Снимаем с паузы сам запрос, для глобального обновления
|
|
47
|
+
context.dispatch<string>('main/A_CONTINUE_GLOBAL_REFRESH', queryJson, {
|
|
48
|
+
root: true,
|
|
49
|
+
})
|
|
50
|
+
return
|
|
51
|
+
}
|
|
52
|
+
context.commit('M_SET_TASKS_LAST_QUERY', queryJson)
|
|
53
|
+
|
|
54
|
+
const url = '/ui/tasks'
|
|
55
|
+
const options: UI_I_Options = {
|
|
56
|
+
query,
|
|
57
|
+
method: 'GET',
|
|
58
|
+
key: Date.now().toString(),
|
|
59
|
+
onRequest() {
|
|
60
|
+
context.commit<UI_I_TasksLoadingPayload>('M_SET_LOADING', {
|
|
61
|
+
prop: 'tasks',
|
|
62
|
+
value: true,
|
|
63
|
+
})
|
|
64
|
+
},
|
|
65
|
+
onResponse({ response }: API_UI_I_Response<API_UI_I_Task<string>>) {
|
|
66
|
+
const tasks = tasksConstructor(response._data)
|
|
67
|
+
|
|
68
|
+
context.commit('M_SET_TASKS_LIST', tasks)
|
|
69
|
+
context.commit<UI_I_TasksLoadingPayload>('M_SET_LOADING', {
|
|
70
|
+
prop: 'tasks',
|
|
71
|
+
value: false,
|
|
72
|
+
})
|
|
73
|
+
},
|
|
74
|
+
}
|
|
75
|
+
const { error } = await useMyFetch<API_UI_I_Task<string>, API_UI_I_Error>(
|
|
76
|
+
url,
|
|
77
|
+
options
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
if (error.value?.data?.error_code)
|
|
81
|
+
throw new Error(error.value.data.error_message)
|
|
82
|
+
|
|
83
|
+
context.dispatch<UI_I_RefreshStack>(
|
|
84
|
+
'main/A_ADD_IN_GLOBAL_REFRESH',
|
|
85
|
+
{ key: queryJson, url, options },
|
|
86
|
+
{ root: true }
|
|
87
|
+
)
|
|
88
|
+
},
|
|
89
|
+
async A_GET_RECENT_TASKS(
|
|
90
|
+
context: {
|
|
91
|
+
commit: <T>(arg0: string, arg1: T) => void
|
|
92
|
+
state: UI_I_TasksState
|
|
93
|
+
},
|
|
94
|
+
payload: string
|
|
95
|
+
): Promise<void> {
|
|
96
|
+
const query: UI_I_RTaskQuery = {
|
|
97
|
+
last: context.state.recentTaskList?.last || 0,
|
|
98
|
+
}
|
|
99
|
+
if (payload) query.sortBy = payload
|
|
100
|
+
|
|
101
|
+
const { data, error } = await useMyFetch<
|
|
102
|
+
API_UI_I_RecentTask<string>,
|
|
103
|
+
API_UI_I_Error
|
|
104
|
+
>('/ui/rtasks', {
|
|
105
|
+
query,
|
|
106
|
+
method: 'GET',
|
|
107
|
+
initialCache: false,
|
|
108
|
+
})
|
|
109
|
+
|
|
110
|
+
if (error.value?.data?.error_code)
|
|
111
|
+
throw new Error(error.value.data.error_message)
|
|
112
|
+
|
|
113
|
+
context.commit<UI_I_RecentTask<string>>(
|
|
114
|
+
'M_SET_RECENT_TASKS_LIST',
|
|
115
|
+
recentTasks(data.value)
|
|
116
|
+
)
|
|
117
|
+
context.commit<UI_I_RawRecentTask<string>>(
|
|
118
|
+
'M_SET_UPDATED_RECENT_TASKS_LIST',
|
|
119
|
+
data.value
|
|
120
|
+
)
|
|
121
|
+
// context.commit<I_TasksLoadingPayload>('M_SET_LOADING', {
|
|
122
|
+
// prop: 'recentTasks',
|
|
123
|
+
// value: false,
|
|
124
|
+
// })
|
|
125
|
+
},
|
|
126
|
+
|
|
127
|
+
// Вызывается в useMyFetch когда получаем первый ответ от запроса с url tasks
|
|
128
|
+
// и default.vue когда срабатывает watch на recentTasks
|
|
129
|
+
// Нужно для того чтобы не обрабатывали те таски которые были сделаны перед загрузкой страницы
|
|
130
|
+
A_SET_FIRST_TASK(context: { commit: (arg0: string) => void }): void {
|
|
131
|
+
context.commit('M_SET_FIRST_TASK')
|
|
132
|
+
},
|
|
133
|
+
}
|
package/store/tasks/getters.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import type { UI_T_TasksStateLoading } from '~/lib/models/store/tasks/types'
|
|
2
|
-
import type {
|
|
3
|
-
UI_I_RawRecentTaskItem,
|
|
4
|
-
UI_I_RecentTask,
|
|
5
|
-
UI_I_Task,
|
|
6
|
-
} from '~/lib/models/store/tasks/interfaces'
|
|
7
|
-
import type { UI_I_TasksState } from '~/store/tasks/lib/models/interfaces'
|
|
8
|
-
|
|
9
|
-
export default {
|
|
10
|
-
getFirstTask: (state: UI_I_TasksState): boolean => state.hasFirstTask,
|
|
11
|
-
getTaskList: (state: UI_I_TasksState): UI_I_Task<string> | null =>
|
|
12
|
-
state.taskList,
|
|
13
|
-
getTasksLastRequestType: (state: UI_I_TasksState): string | null =>
|
|
14
|
-
state.taskLastRequestType,
|
|
15
|
-
getRecentTaskList: (
|
|
16
|
-
state: UI_I_TasksState
|
|
17
|
-
): UI_I_RecentTask<string> | null => state.recentTaskList,
|
|
18
|
-
getUpdatedRecentTasks: (
|
|
19
|
-
state: UI_I_TasksState
|
|
20
|
-
): UI_I_RawRecentTaskItem<string>[] | null => state.updatedTaskList,
|
|
21
|
-
getLoading:
|
|
22
|
-
(state: UI_I_TasksState) =>
|
|
23
|
-
(type: UI_T_TasksStateLoading): boolean =>
|
|
24
|
-
state.loading[type],
|
|
25
|
-
}
|
|
1
|
+
import type { UI_T_TasksStateLoading } from '~/lib/models/store/tasks/types'
|
|
2
|
+
import type {
|
|
3
|
+
UI_I_RawRecentTaskItem,
|
|
4
|
+
UI_I_RecentTask,
|
|
5
|
+
UI_I_Task,
|
|
6
|
+
} from '~/lib/models/store/tasks/interfaces'
|
|
7
|
+
import type { UI_I_TasksState } from '~/store/tasks/lib/models/interfaces'
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
getFirstTask: (state: UI_I_TasksState): boolean => state.hasFirstTask,
|
|
11
|
+
getTaskList: (state: UI_I_TasksState): UI_I_Task<string> | null =>
|
|
12
|
+
state.taskList,
|
|
13
|
+
getTasksLastRequestType: (state: UI_I_TasksState): string | null =>
|
|
14
|
+
state.taskLastRequestType,
|
|
15
|
+
getRecentTaskList: (
|
|
16
|
+
state: UI_I_TasksState
|
|
17
|
+
): UI_I_RecentTask<string> | null => state.recentTaskList,
|
|
18
|
+
getUpdatedRecentTasks: (
|
|
19
|
+
state: UI_I_TasksState
|
|
20
|
+
): UI_I_RawRecentTaskItem<string>[] | null => state.updatedTaskList,
|
|
21
|
+
getLoading:
|
|
22
|
+
(state: UI_I_TasksState) =>
|
|
23
|
+
(type: UI_T_TasksStateLoading): boolean =>
|
|
24
|
+
state.loading[type],
|
|
25
|
+
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
UI_I_Task,
|
|
3
|
-
UI_I_RecentTask,
|
|
4
|
-
UI_I_RawRecentTaskItem,
|
|
5
|
-
} from '~/lib/models/store/tasks/interfaces'
|
|
6
|
-
|
|
7
|
-
export interface UI_I_TasksState {
|
|
8
|
-
hasFirstTask: boolean
|
|
9
|
-
taskList: UI_I_Task<string> | null
|
|
10
|
-
taskLastRequestType: string
|
|
11
|
-
taskQuery: string
|
|
12
|
-
recentTaskList: UI_I_RecentTask<string> | null
|
|
13
|
-
updatedTaskList: UI_I_RawRecentTaskItem<string>[] | null
|
|
14
|
-
loading: {
|
|
15
|
-
tasks: boolean
|
|
16
|
-
recentTasks: boolean
|
|
17
|
-
}
|
|
18
|
-
}
|
|
1
|
+
import type {
|
|
2
|
+
UI_I_Task,
|
|
3
|
+
UI_I_RecentTask,
|
|
4
|
+
UI_I_RawRecentTaskItem,
|
|
5
|
+
} from '~/lib/models/store/tasks/interfaces'
|
|
6
|
+
|
|
7
|
+
export interface UI_I_TasksState {
|
|
8
|
+
hasFirstTask: boolean
|
|
9
|
+
taskList: UI_I_Task<string> | null
|
|
10
|
+
taskLastRequestType: string
|
|
11
|
+
taskQuery: string
|
|
12
|
+
recentTaskList: UI_I_RecentTask<string> | null
|
|
13
|
+
updatedTaskList: UI_I_RawRecentTaskItem<string>[] | null
|
|
14
|
+
loading: {
|
|
15
|
+
tasks: boolean
|
|
16
|
+
recentTasks: boolean
|
|
17
|
+
}
|
|
18
|
+
}
|
package/store/tasks/mutations.ts
CHANGED
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
UI_I_RawRecentTask,
|
|
3
|
-
UI_I_TasksLoadingPayload,
|
|
4
|
-
UI_I_RecentTask,
|
|
5
|
-
UI_I_Task,
|
|
6
|
-
} from '~/lib/models/store/tasks/interfaces'
|
|
7
|
-
import type { UI_I_TasksState } from '~/store/tasks/lib/models/interfaces'
|
|
8
|
-
|
|
9
|
-
export default {
|
|
10
|
-
M_SET_RECENT_TASKS_LIST(
|
|
11
|
-
state: UI_I_TasksState,
|
|
12
|
-
payload: UI_I_RecentTask<string>
|
|
13
|
-
): void {
|
|
14
|
-
if (state.recentTaskList) {
|
|
15
|
-
state.recentTaskList.last = payload.last
|
|
16
|
-
|
|
17
|
-
// Заменяем которые уже имеются и удаляем их из payload.items
|
|
18
|
-
state.recentTaskList.items = state.recentTaskList.items.map((task) => {
|
|
19
|
-
let changedTask = null
|
|
20
|
-
payload.items = payload.items.filter((task2) => {
|
|
21
|
-
if (task2.id === task.id) changedTask = task2
|
|
22
|
-
return task2.id !== task.id
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
return changedTask || task
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
// Делаем слияние новых и старых tasks
|
|
29
|
-
state.recentTaskList.items = [
|
|
30
|
-
...payload.items,
|
|
31
|
-
...state.recentTaskList.items,
|
|
32
|
-
]
|
|
33
|
-
return
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
state.recentTaskList = payload
|
|
37
|
-
},
|
|
38
|
-
M_SET_TASKS_LAST_QUERY(state: UI_I_TasksState, payload: string): void {
|
|
39
|
-
state.taskLastRequestType = payload
|
|
40
|
-
},
|
|
41
|
-
M_SET_TASKS_LIST(state: UI_I_TasksState, payload: UI_I_Task<string>): void {
|
|
42
|
-
state.taskList = payload
|
|
43
|
-
},
|
|
44
|
-
M_SET_UPDATED_RECENT_TASKS_LIST(
|
|
45
|
-
state: UI_I_TasksState,
|
|
46
|
-
payload: UI_I_RawRecentTask<string>
|
|
47
|
-
): void {
|
|
48
|
-
state.updatedTaskList = payload.items
|
|
49
|
-
},
|
|
50
|
-
M_SET_FIRST_TASK(state: UI_I_TasksState): void {
|
|
51
|
-
state.hasFirstTask = true
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
M_SET_LOADING(state: UI_I_TasksState, payload: UI_I_TasksLoadingPayload): void {
|
|
55
|
-
const { prop, value } = payload
|
|
56
|
-
state.loading[prop] = value
|
|
57
|
-
},
|
|
58
|
-
}
|
|
1
|
+
import type {
|
|
2
|
+
UI_I_RawRecentTask,
|
|
3
|
+
UI_I_TasksLoadingPayload,
|
|
4
|
+
UI_I_RecentTask,
|
|
5
|
+
UI_I_Task,
|
|
6
|
+
} from '~/lib/models/store/tasks/interfaces'
|
|
7
|
+
import type { UI_I_TasksState } from '~/store/tasks/lib/models/interfaces'
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
M_SET_RECENT_TASKS_LIST(
|
|
11
|
+
state: UI_I_TasksState,
|
|
12
|
+
payload: UI_I_RecentTask<string>
|
|
13
|
+
): void {
|
|
14
|
+
if (state.recentTaskList) {
|
|
15
|
+
state.recentTaskList.last = payload.last
|
|
16
|
+
|
|
17
|
+
// Заменяем которые уже имеются и удаляем их из payload.items
|
|
18
|
+
state.recentTaskList.items = state.recentTaskList.items.map((task) => {
|
|
19
|
+
let changedTask = null
|
|
20
|
+
payload.items = payload.items.filter((task2) => {
|
|
21
|
+
if (task2.id === task.id) changedTask = task2
|
|
22
|
+
return task2.id !== task.id
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
return changedTask || task
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
// Делаем слияние новых и старых tasks
|
|
29
|
+
state.recentTaskList.items = [
|
|
30
|
+
...payload.items,
|
|
31
|
+
...state.recentTaskList.items,
|
|
32
|
+
]
|
|
33
|
+
return
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
state.recentTaskList = payload
|
|
37
|
+
},
|
|
38
|
+
M_SET_TASKS_LAST_QUERY(state: UI_I_TasksState, payload: string): void {
|
|
39
|
+
state.taskLastRequestType = payload
|
|
40
|
+
},
|
|
41
|
+
M_SET_TASKS_LIST(state: UI_I_TasksState, payload: UI_I_Task<string>): void {
|
|
42
|
+
state.taskList = payload
|
|
43
|
+
},
|
|
44
|
+
M_SET_UPDATED_RECENT_TASKS_LIST(
|
|
45
|
+
state: UI_I_TasksState,
|
|
46
|
+
payload: UI_I_RawRecentTask<string>
|
|
47
|
+
): void {
|
|
48
|
+
state.updatedTaskList = payload.items
|
|
49
|
+
},
|
|
50
|
+
M_SET_FIRST_TASK(state: UI_I_TasksState): void {
|
|
51
|
+
state.hasFirstTask = true
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
M_SET_LOADING(state: UI_I_TasksState, payload: UI_I_TasksLoadingPayload): void {
|
|
55
|
+
const { prop, value } = payload
|
|
56
|
+
state.loading[prop] = value
|
|
57
|
+
},
|
|
58
|
+
}
|
package/store/tasks/state.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import type { UI_I_TasksState } from '~/store/tasks/lib/models/interfaces'
|
|
2
|
-
|
|
3
|
-
const state: UI_I_TasksState = {
|
|
4
|
-
hasFirstTask: false,
|
|
5
|
-
recentTaskList: null,
|
|
6
|
-
updatedTaskList: null,
|
|
7
|
-
taskLastRequestType: '',
|
|
8
|
-
taskQuery: '',
|
|
9
|
-
taskList: null,
|
|
10
|
-
loading: {
|
|
11
|
-
tasks: false,
|
|
12
|
-
recentTasks: false,
|
|
13
|
-
},
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export default state
|
|
1
|
+
import type { UI_I_TasksState } from '~/store/tasks/lib/models/interfaces'
|
|
2
|
+
|
|
3
|
+
const state: UI_I_TasksState = {
|
|
4
|
+
hasFirstTask: false,
|
|
5
|
+
recentTaskList: null,
|
|
6
|
+
updatedTaskList: null,
|
|
7
|
+
taskLastRequestType: '',
|
|
8
|
+
taskQuery: '',
|
|
9
|
+
taskList: null,
|
|
10
|
+
loading: {
|
|
11
|
+
tasks: false,
|
|
12
|
+
recentTasks: false,
|
|
13
|
+
},
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default state
|