shared-ritm 1.3.117 → 1.3.118

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 (76) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/shared-ritm.es.js +11 -11
  3. package/dist/shared-ritm.umd.js +2 -2
  4. package/dist/types/api/services/PhotoService.d.ts +40 -0
  5. package/dist/types/api/types/Api_Tasks.d.ts +2 -0
  6. package/dist/types/stories/Button.stories.d.ts +13 -0
  7. package/dist/types/stories/Checkbox.stories.d.ts +7 -0
  8. package/dist/types/stories/Confirm.stories.d.ts +8 -0
  9. package/dist/types/stories/DatePicker.stories.d.ts +8 -0
  10. package/dist/types/stories/Dropdown.stories.d.ts +8 -0
  11. package/dist/types/stories/File.stories.d.ts +8 -0
  12. package/dist/types/stories/Icon.stories.d.ts +7 -0
  13. package/dist/types/stories/Input.stories.d.ts +11 -0
  14. package/dist/types/stories/InputNew.stories.d.ts +12 -0
  15. package/dist/types/stories/InputSearch.stories.d.ts +10 -0
  16. package/dist/types/stories/Loader.stories.d.ts +8 -0
  17. package/dist/types/stories/Select.stories.d.ts +7 -0
  18. package/dist/types/stories/Toggle.stories.d.ts +8 -0
  19. package/package.json +70 -70
  20. package/src/App.vue +2461 -2461
  21. package/src/api/services/AuthService.ts +67 -67
  22. package/src/api/services/ControlsService.ts +100 -100
  23. package/src/api/services/EquipmentService.ts +68 -68
  24. package/src/api/services/InstrumentsService.ts +76 -76
  25. package/src/api/services/MetricsService.ts +148 -148
  26. package/src/api/services/RepairsService.ts +111 -111
  27. package/src/api/services/UserIssueService.ts +32 -32
  28. package/src/api/services/UserService.ts +129 -129
  29. package/src/api/services/VideoService.ts +118 -118
  30. package/src/api/types/Api_Auth.ts +121 -121
  31. package/src/api/types/Api_Controls.ts +112 -112
  32. package/src/api/types/Api_Equipment.ts +54 -54
  33. package/src/api/types/Api_Instruments.ts +182 -182
  34. package/src/api/types/Api_Metrics.ts +84 -84
  35. package/src/api/types/Api_Repairs.ts +200 -200
  36. package/src/api/types/Api_Search.ts +81 -81
  37. package/src/api/types/Api_Tasks.ts +378 -376
  38. package/src/api/types/Api_User.ts +160 -160
  39. package/src/api/types/Api_User_Issue.ts +36 -36
  40. package/src/api/types/Api_Video.ts +244 -244
  41. package/src/common/app-button/Button.stories.ts +369 -369
  42. package/src/common/app-checkbox/AppCheckbox.vue +31 -31
  43. package/src/common/app-checkbox/Checkbox.stories.ts +252 -252
  44. package/src/common/app-date-picker/DatePicker.stories.ts +66 -66
  45. package/src/common/app-datepicker/Datepicker.stories.ts +145 -145
  46. package/src/common/app-dialogs/AppConfirmDialog.vue +109 -109
  47. package/src/common/app-dialogs/Confirm.stories.ts +93 -93
  48. package/src/common/app-dropdown/Dropdown.stories.ts +94 -94
  49. package/src/common/app-file/File.stories.ts +104 -104
  50. package/src/common/app-icon/AppIcon.vue +110 -110
  51. package/src/common/app-icon/Icon.stories.ts +91 -91
  52. package/src/common/app-input/Input.stories.ts +160 -160
  53. package/src/common/app-input-new/AppInputNew.vue +181 -181
  54. package/src/common/app-input-new/InputNew.stories.ts +240 -240
  55. package/src/common/app-input-search/InputSearch.stories.ts +149 -149
  56. package/src/common/app-layout/components/AppLayoutHeader.vue +289 -289
  57. package/src/common/app-loader/Loader.stories.ts +114 -114
  58. package/src/common/app-modal/index.vue +101 -101
  59. package/src/common/app-select/Select.stories.ts +155 -155
  60. package/src/common/app-sidebar/AppSidebar.vue +174 -174
  61. package/src/common/app-table/AppTable.vue +313 -313
  62. package/src/common/app-table/components/ModalSelect.stories.ts +323 -323
  63. package/src/common/app-table/components/ModalSelect.vue +302 -302
  64. package/src/common/app-table/components/TableModal.vue +369 -369
  65. package/src/common/app-table/controllers/useColumnSelector.ts +45 -45
  66. package/src/common/app-table/controllers/useTableModel.ts +97 -97
  67. package/src/common/app-toggle/AppToggle.vue +12 -12
  68. package/src/common/app-toggle/Toggle.stories.ts +245 -245
  69. package/src/common/app-wrapper/AppWrapper.vue +31 -31
  70. package/src/configs/storybook.ts +14 -14
  71. package/src/icons/sidebar/user-requests-icon.vue +23 -23
  72. package/src/index.ts +134 -134
  73. package/src/shared/styles/general.css +140 -140
  74. package/src/styles/variables.sass +12 -12
  75. package/src/utils/files.ts +38 -38
  76. package/src/utils/helpers.ts +59 -59
@@ -1,129 +1,129 @@
1
- import ApiService from '../settings/ApiService'
2
- import {
3
- Api_User,
4
- Api_User_Create,
5
- Api_User_Delete_Body,
6
- Api_User_Delete_Photos_Body,
7
- Api_User_Position,
8
- Api_User_Role,
9
- Api_User_Team,
10
- Api_User_Team_Search,
11
- Api_User_Warehouse,
12
- Api_User_Change_Password_Payload,
13
- } from '../types/Api_User'
14
-
15
- import { ResponseApi } from '../types/Api_Service'
16
-
17
- class UserService extends ApiService {
18
- public async editUser({ id, model }: { id: string; model: any }): Promise<Api_User> {
19
- return await this.put<Partial<Api_User>, Api_User>(`/admin/users/${id}`, model)
20
- }
21
-
22
- public async getUser(id: string): Promise<Api_User> {
23
- return await this.get<Api_User>(`/admin/users/${id}`)
24
- }
25
-
26
- public async changeUserPassword(payload: Api_User_Change_Password_Payload): Promise<Api_User> {
27
- return await this.patch<Api_User_Change_Password_Payload, Api_User>(`/v2/auth/users/password`, payload)
28
- }
29
-
30
- public async getUserWarehouses(params: {
31
- user_id: string
32
- page?: number
33
- }): Promise<ResponseApi<Api_User_Warehouse[]>> {
34
- return await this.get<ResponseApi<Api_User_Warehouse[]>>(`users/get_warehouse_list_by_user`, { params })
35
- }
36
-
37
- public async createUser(model: Api_User_Create): Promise<Api_User> {
38
- return await this.post<Api_User_Create, Api_User>('/admin/users', model)
39
- }
40
-
41
- public async deleteUser({
42
- user_id,
43
- archive_reason,
44
- }: Api_User_Delete_Body): Promise<{ data: boolean; status: number }> {
45
- return await this.post(`/users/archive_user`, { user_id, archive_reason })
46
- }
47
-
48
- public async deleteUserPhotos({
49
- user_id,
50
- photos,
51
- }: Api_User_Delete_Photos_Body): Promise<{ data: boolean; status: number }> {
52
- return await this.post(`/users/photos/delete`, { user_id, photos })
53
- }
54
-
55
- public async restoreUser(user_id: string): Promise<{ data: boolean; status: number }> {
56
- return await this.post(`/users/restore_user`, { user_id })
57
- }
58
-
59
- public async getRoles(params?: { per_page?: number }): Promise<ResponseApi<Api_User_Role[]>> {
60
- return await this.get<ResponseApi<Api_User_Role[]>>('/search/roles', { params })
61
- }
62
-
63
- public async getPositions(params?: { per_page?: number }): Promise<ResponseApi<Api_User_Position[]>> {
64
- return await this.get<ResponseApi<Api_User_Position[]>>('/search/positions', { params })
65
- }
66
-
67
- public async createPosition(body: Partial<Api_User_Position>): Promise<ResponseApi<Api_User_Position>> {
68
- return await this.post<Partial<Api_User_Position>, ResponseApi<Api_User_Position>>('/admin/positions', body)
69
- }
70
-
71
- public async editPosition(id: string, body: Partial<Api_User_Position>): Promise<ResponseApi<Api_User_Position>> {
72
- return await this.put<Partial<Api_User_Position>, ResponseApi<Api_User_Position>>(`/admin/positions/${id}`, body)
73
- }
74
-
75
- public async deletePosition(id: string): Promise<{ data: boolean; status: number }> {
76
- return await this.delete(`/admin/positions/${id}`)
77
- }
78
-
79
- public async getTeams(params?: { per_page?: number }): Promise<ResponseApi<Api_User_Team_Search[]>> {
80
- return await this.get<ResponseApi<Api_User_Team_Search[]>>('/search/teams', { params })
81
- }
82
-
83
- public async createTeam(body: Partial<Api_User_Team_Search>): Promise<ResponseApi<Api_User_Team>> {
84
- return await this.post<Partial<Api_User_Team_Search>, ResponseApi<Api_User_Team>>('/teams', body)
85
- }
86
-
87
- public async editTeam(id: string, body: Partial<Api_User_Team_Search>): Promise<{ data: boolean; status: number }> {
88
- return await this.patch<Partial<Api_User_Team_Search>, { data: boolean; status: number }>(`/teams/${id}`, body)
89
- }
90
-
91
- public async deleteTeam(id: string): Promise<{ data: boolean; status: number }> {
92
- return await this.delete(`/teams/${id}`)
93
- }
94
-
95
- public async checkUserVectors(id: string): Promise<{ count: number }> {
96
- return await this.get(`/user/get-vectors/${id}`)
97
- }
98
-
99
- public async checkArchiveUserVectors(id: string): Promise<{ count: number }> {
100
- return await this.get(`/users/get_vector_count_by_user?user_id=${id}`)
101
- }
102
-
103
- public async addUserVectors(formData: FormData): Promise<{ response: string }> {
104
- return await this.post(`/user/add-vector`, formData, {
105
- headers: { 'Content-Type': 'multipart/form-data' },
106
- })
107
- }
108
-
109
- public async removeUserVectors(id: string): Promise<unknown> {
110
- return await this.delete(`/user/delete-vectors/${id}`)
111
- }
112
-
113
- public async deleteUserPasses(body: {
114
- personnel_number: number
115
- }): Promise<{ delete_passes: boolean; user: Partial<Api_User> }> {
116
- return await this.post('admin/delete/passes', body)
117
- }
118
-
119
- public async checkUserBeforeArchive(body: { user_id: string }): Promise<any> {
120
- return await this.post('users/check_user_before_archive', body)
121
- }
122
- }
123
-
124
- let api: UserService
125
-
126
- export default function useUserService() {
127
- if (!api) api = new UserService()
128
- return api
129
- }
1
+ import ApiService from '../settings/ApiService'
2
+ import {
3
+ Api_User,
4
+ Api_User_Create,
5
+ Api_User_Delete_Body,
6
+ Api_User_Delete_Photos_Body,
7
+ Api_User_Position,
8
+ Api_User_Role,
9
+ Api_User_Team,
10
+ Api_User_Team_Search,
11
+ Api_User_Warehouse,
12
+ Api_User_Change_Password_Payload,
13
+ } from '../types/Api_User'
14
+
15
+ import { ResponseApi } from '../types/Api_Service'
16
+
17
+ class UserService extends ApiService {
18
+ public async editUser({ id, model }: { id: string; model: any }): Promise<Api_User> {
19
+ return await this.put<Partial<Api_User>, Api_User>(`/admin/users/${id}`, model)
20
+ }
21
+
22
+ public async getUser(id: string): Promise<Api_User> {
23
+ return await this.get<Api_User>(`/admin/users/${id}`)
24
+ }
25
+
26
+ public async changeUserPassword(payload: Api_User_Change_Password_Payload): Promise<Api_User> {
27
+ return await this.patch<Api_User_Change_Password_Payload, Api_User>(`/v2/auth/users/password`, payload)
28
+ }
29
+
30
+ public async getUserWarehouses(params: {
31
+ user_id: string
32
+ page?: number
33
+ }): Promise<ResponseApi<Api_User_Warehouse[]>> {
34
+ return await this.get<ResponseApi<Api_User_Warehouse[]>>(`users/get_warehouse_list_by_user`, { params })
35
+ }
36
+
37
+ public async createUser(model: Api_User_Create): Promise<Api_User> {
38
+ return await this.post<Api_User_Create, Api_User>('/admin/users', model)
39
+ }
40
+
41
+ public async deleteUser({
42
+ user_id,
43
+ archive_reason,
44
+ }: Api_User_Delete_Body): Promise<{ data: boolean; status: number }> {
45
+ return await this.post(`/users/archive_user`, { user_id, archive_reason })
46
+ }
47
+
48
+ public async deleteUserPhotos({
49
+ user_id,
50
+ photos,
51
+ }: Api_User_Delete_Photos_Body): Promise<{ data: boolean; status: number }> {
52
+ return await this.post(`/users/photos/delete`, { user_id, photos })
53
+ }
54
+
55
+ public async restoreUser(user_id: string): Promise<{ data: boolean; status: number }> {
56
+ return await this.post(`/users/restore_user`, { user_id })
57
+ }
58
+
59
+ public async getRoles(params?: { per_page?: number }): Promise<ResponseApi<Api_User_Role[]>> {
60
+ return await this.get<ResponseApi<Api_User_Role[]>>('/search/roles', { params })
61
+ }
62
+
63
+ public async getPositions(params?: { per_page?: number }): Promise<ResponseApi<Api_User_Position[]>> {
64
+ return await this.get<ResponseApi<Api_User_Position[]>>('/search/positions', { params })
65
+ }
66
+
67
+ public async createPosition(body: Partial<Api_User_Position>): Promise<ResponseApi<Api_User_Position>> {
68
+ return await this.post<Partial<Api_User_Position>, ResponseApi<Api_User_Position>>('/admin/positions', body)
69
+ }
70
+
71
+ public async editPosition(id: string, body: Partial<Api_User_Position>): Promise<ResponseApi<Api_User_Position>> {
72
+ return await this.put<Partial<Api_User_Position>, ResponseApi<Api_User_Position>>(`/admin/positions/${id}`, body)
73
+ }
74
+
75
+ public async deletePosition(id: string): Promise<{ data: boolean; status: number }> {
76
+ return await this.delete(`/admin/positions/${id}`)
77
+ }
78
+
79
+ public async getTeams(params?: { per_page?: number }): Promise<ResponseApi<Api_User_Team_Search[]>> {
80
+ return await this.get<ResponseApi<Api_User_Team_Search[]>>('/search/teams', { params })
81
+ }
82
+
83
+ public async createTeam(body: Partial<Api_User_Team_Search>): Promise<ResponseApi<Api_User_Team>> {
84
+ return await this.post<Partial<Api_User_Team_Search>, ResponseApi<Api_User_Team>>('/teams', body)
85
+ }
86
+
87
+ public async editTeam(id: string, body: Partial<Api_User_Team_Search>): Promise<{ data: boolean; status: number }> {
88
+ return await this.patch<Partial<Api_User_Team_Search>, { data: boolean; status: number }>(`/teams/${id}`, body)
89
+ }
90
+
91
+ public async deleteTeam(id: string): Promise<{ data: boolean; status: number }> {
92
+ return await this.delete(`/teams/${id}`)
93
+ }
94
+
95
+ public async checkUserVectors(id: string): Promise<{ count: number }> {
96
+ return await this.get(`/user/get-vectors/${id}`)
97
+ }
98
+
99
+ public async checkArchiveUserVectors(id: string): Promise<{ count: number }> {
100
+ return await this.get(`/users/get_vector_count_by_user?user_id=${id}`)
101
+ }
102
+
103
+ public async addUserVectors(formData: FormData): Promise<{ response: string }> {
104
+ return await this.post(`/user/add-vector`, formData, {
105
+ headers: { 'Content-Type': 'multipart/form-data' },
106
+ })
107
+ }
108
+
109
+ public async removeUserVectors(id: string): Promise<unknown> {
110
+ return await this.delete(`/user/delete-vectors/${id}`)
111
+ }
112
+
113
+ public async deleteUserPasses(body: {
114
+ personnel_number: number
115
+ }): Promise<{ delete_passes: boolean; user: Partial<Api_User> }> {
116
+ return await this.post('admin/delete/passes', body)
117
+ }
118
+
119
+ public async checkUserBeforeArchive(body: { user_id: string }): Promise<any> {
120
+ return await this.post('users/check_user_before_archive', body)
121
+ }
122
+ }
123
+
124
+ let api: UserService
125
+
126
+ export default function useUserService() {
127
+ if (!api) api = new UserService()
128
+ return api
129
+ }
@@ -1,118 +1,118 @@
1
- import ApiService from '../settings/ApiService'
2
- import { ResponseApi } from '@/api/types/Api_Service'
3
- import {
4
- Api_Video_Combination,
5
- Api_Video_Source_By_Repair,
6
- Api_Video_Source_Create,
7
- Api_Video_Source_Economics,
8
- Api_Video_Source_Search,
9
- Api_Video_Training_Status,
10
- Api_Work_Zone,
11
- Api_Work_Zone_Search,
12
- } from '@/api/types/Api_Video'
13
-
14
- class VideoService extends ApiService {
15
- public async startVideoAnalytics(): Promise<boolean> {
16
- return await this.post('/statanly/start', null)
17
- }
18
-
19
- public reloadVideoAnalytics(ids: string[]): Promise<any> {
20
- return this.post('/horizon/video-source/reload', { video_source_ids: ids })
21
- }
22
-
23
- public hardReloadStream(): Promise<any> {
24
- return this.post('horizon/video-source/streams/add', null)
25
- }
26
-
27
- public async fetchWorkZones(params?: any): Promise<ResponseApi<Api_Work_Zone_Search[]>> {
28
- return await this.get('/search/work_zones', { params })
29
- }
30
-
31
- public async fetchWorkZone(id: string): Promise<ResponseApi<Api_Work_Zone>> {
32
- return await this.get(`/work_zone/get_work_zone/${id}`)
33
- }
34
-
35
- public async editWorkZone(id: string, body: { title: string }): Promise<{ data: Api_Work_Zone; status: number }> {
36
- return await this.put(`/admin/work-zones/${id}`, body)
37
- }
38
-
39
- public async deleteWorkZone(id: string): Promise<{ data: boolean; status: number }> {
40
- return await this.delete(`/admin/work-zones/${id}`)
41
- }
42
-
43
- public async fetchVideoSources(params?: any): Promise<ResponseApi<Api_Video_Source_Search[]>> {
44
- return await this.get('/search/video_sources/list', { params })
45
- }
46
-
47
- public async fetchVideoSourceEconomics(params?: any): Promise<ResponseApi<Api_Video_Source_Economics>> {
48
- return await this.get('horizon/video-source/economics', { params })
49
- }
50
-
51
- public async createVideoSource(body: Api_Video_Source_Create): Promise<Api_Video_Source_Search> {
52
- return await this.post('horizon/video-source', body)
53
- }
54
-
55
- public async editVideoSource(id: string, body: Partial<Api_Video_Source_Create>): Promise<Api_Video_Source_Search> {
56
- return await this.put(`/horizon/video-source/${id}`, body)
57
- }
58
-
59
- public async deleteVideoSource(id: string): Promise<void> {
60
- await this.delete(`/horizon/video-source/${id}`)
61
- }
62
-
63
- public async fetchListRepairsVideoSource(params?: any): Promise<Api_Video_Source_By_Repair[]> {
64
- return await this.get('work_zone/get_list_video_source_by_repair', { params })
65
- }
66
-
67
- public async sendCombination(body: { cameras_id: string[] }): Promise<any> {
68
- return await this.post('horizon/video-source/training', body)
69
- }
70
-
71
- public async saveCombination(body: any): Promise<any> {
72
- return await this.post('horizon/video-source/bind', body)
73
- }
74
-
75
- public async fetchCombination(params?: Record<string, string>): Promise<Api_Video_Combination> {
76
- return await this.get('horizon/video-source/bind/show', { params })
77
- }
78
-
79
- public async startTraining(body: { cameras_id: string[] }): Promise<any> {
80
- return await this.post('horizon/video-source/training/start', body)
81
- }
82
-
83
- public async stopTraining(body: { cameras_id: string[] }): Promise<any> {
84
- return await this.post('horizon/video-source/training/stop', body)
85
- }
86
-
87
- public async fetchTrainingInfo(params?: Record<string, string>): Promise<any> {
88
- return await this.get('horizon/video-source/training/info', { params })
89
- }
90
-
91
- public async fetchTrainingStatus(params?: Record<string, string>): Promise<Api_Video_Training_Status> {
92
- return await this.get('horizon/video-source/training/status', { params })
93
- }
94
-
95
- public async fetchVisualizationDataLink(params?: Record<string, string>): Promise<string> {
96
- return await this.get('horizon/video-source/link/video/training', { params })
97
- }
98
-
99
- public async updateVisualizationData(params?: Record<string, string>): Promise<number> {
100
- return await this.get('horizon/video-source/download/video/training', { params })
101
- }
102
-
103
- public async deleteFrameFromVideo(id: string): Promise<void> {
104
- await this.delete(`horizon/video-source/delete/fragment/video/training/${id}`)
105
- }
106
-
107
- // Для тестирования ws видеостены
108
- public async sendEvent(params?: Record<string, any>): Promise<number> {
109
- return await this.post('alerts_callback_url', params)
110
- }
111
- }
112
-
113
- let api: VideoService
114
-
115
- export default function useVideoService() {
116
- if (!api) api = new VideoService()
117
- return api
118
- }
1
+ import ApiService from '../settings/ApiService'
2
+ import { ResponseApi } from '@/api/types/Api_Service'
3
+ import {
4
+ Api_Video_Combination,
5
+ Api_Video_Source_By_Repair,
6
+ Api_Video_Source_Create,
7
+ Api_Video_Source_Economics,
8
+ Api_Video_Source_Search,
9
+ Api_Video_Training_Status,
10
+ Api_Work_Zone,
11
+ Api_Work_Zone_Search,
12
+ } from '@/api/types/Api_Video'
13
+
14
+ class VideoService extends ApiService {
15
+ public async startVideoAnalytics(): Promise<boolean> {
16
+ return await this.post('/statanly/start', null)
17
+ }
18
+
19
+ public reloadVideoAnalytics(ids: string[]): Promise<any> {
20
+ return this.post('/horizon/video-source/reload', { video_source_ids: ids })
21
+ }
22
+
23
+ public hardReloadStream(): Promise<any> {
24
+ return this.post('horizon/video-source/streams/add', null)
25
+ }
26
+
27
+ public async fetchWorkZones(params?: any): Promise<ResponseApi<Api_Work_Zone_Search[]>> {
28
+ return await this.get('/search/work_zones', { params })
29
+ }
30
+
31
+ public async fetchWorkZone(id: string): Promise<ResponseApi<Api_Work_Zone>> {
32
+ return await this.get(`/work_zone/get_work_zone/${id}`)
33
+ }
34
+
35
+ public async editWorkZone(id: string, body: { title: string }): Promise<{ data: Api_Work_Zone; status: number }> {
36
+ return await this.put(`/admin/work-zones/${id}`, body)
37
+ }
38
+
39
+ public async deleteWorkZone(id: string): Promise<{ data: boolean; status: number }> {
40
+ return await this.delete(`/admin/work-zones/${id}`)
41
+ }
42
+
43
+ public async fetchVideoSources(params?: any): Promise<ResponseApi<Api_Video_Source_Search[]>> {
44
+ return await this.get('/search/video_sources/list', { params })
45
+ }
46
+
47
+ public async fetchVideoSourceEconomics(params?: any): Promise<ResponseApi<Api_Video_Source_Economics>> {
48
+ return await this.get('horizon/video-source/economics', { params })
49
+ }
50
+
51
+ public async createVideoSource(body: Api_Video_Source_Create): Promise<Api_Video_Source_Search> {
52
+ return await this.post('horizon/video-source', body)
53
+ }
54
+
55
+ public async editVideoSource(id: string, body: Partial<Api_Video_Source_Create>): Promise<Api_Video_Source_Search> {
56
+ return await this.put(`/horizon/video-source/${id}`, body)
57
+ }
58
+
59
+ public async deleteVideoSource(id: string): Promise<void> {
60
+ await this.delete(`/horizon/video-source/${id}`)
61
+ }
62
+
63
+ public async fetchListRepairsVideoSource(params?: any): Promise<Api_Video_Source_By_Repair[]> {
64
+ return await this.get('work_zone/get_list_video_source_by_repair', { params })
65
+ }
66
+
67
+ public async sendCombination(body: { cameras_id: string[] }): Promise<any> {
68
+ return await this.post('horizon/video-source/training', body)
69
+ }
70
+
71
+ public async saveCombination(body: any): Promise<any> {
72
+ return await this.post('horizon/video-source/bind', body)
73
+ }
74
+
75
+ public async fetchCombination(params?: Record<string, string>): Promise<Api_Video_Combination> {
76
+ return await this.get('horizon/video-source/bind/show', { params })
77
+ }
78
+
79
+ public async startTraining(body: { cameras_id: string[] }): Promise<any> {
80
+ return await this.post('horizon/video-source/training/start', body)
81
+ }
82
+
83
+ public async stopTraining(body: { cameras_id: string[] }): Promise<any> {
84
+ return await this.post('horizon/video-source/training/stop', body)
85
+ }
86
+
87
+ public async fetchTrainingInfo(params?: Record<string, string>): Promise<any> {
88
+ return await this.get('horizon/video-source/training/info', { params })
89
+ }
90
+
91
+ public async fetchTrainingStatus(params?: Record<string, string>): Promise<Api_Video_Training_Status> {
92
+ return await this.get('horizon/video-source/training/status', { params })
93
+ }
94
+
95
+ public async fetchVisualizationDataLink(params?: Record<string, string>): Promise<string> {
96
+ return await this.get('horizon/video-source/link/video/training', { params })
97
+ }
98
+
99
+ public async updateVisualizationData(params?: Record<string, string>): Promise<number> {
100
+ return await this.get('horizon/video-source/download/video/training', { params })
101
+ }
102
+
103
+ public async deleteFrameFromVideo(id: string): Promise<void> {
104
+ await this.delete(`horizon/video-source/delete/fragment/video/training/${id}`)
105
+ }
106
+
107
+ // Для тестирования ws видеостены
108
+ public async sendEvent(params?: Record<string, any>): Promise<number> {
109
+ return await this.post('alerts_callback_url', params)
110
+ }
111
+ }
112
+
113
+ let api: VideoService
114
+
115
+ export default function useVideoService() {
116
+ if (!api) api = new VideoService()
117
+ return api
118
+ }