@sigmaott/base-library-next 2.1.9

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 (71) hide show
  1. package/README.md +1 -0
  2. package/locales/en.yaml +289 -0
  3. package/locales/vi.yaml +294 -0
  4. package/nuxt.config.ts +18 -0
  5. package/package.json +33 -0
  6. package/public/routes.json +34 -0
  7. package/src/api/axios.ts +3 -0
  8. package/src/api/index.ts +86 -0
  9. package/src/api-client-library/.openapi-generator/FILES +20 -0
  10. package/src/api-client-library/.openapi-generator/VERSION +1 -0
  11. package/src/api-client-library/.openapi-generator-ignore +23 -0
  12. package/src/api-client-library/api/health-api.ts +119 -0
  13. package/src/api-client-library/api/presets-api.ts +599 -0
  14. package/src/api-client-library/api/profiles-api.ts +676 -0
  15. package/src/api-client-library/api.ts +20 -0
  16. package/src/api-client-library/base.ts +72 -0
  17. package/src/api-client-library/common.ts +150 -0
  18. package/src/api-client-library/configuration.ts +101 -0
  19. package/src/api-client-library/git_push.sh +57 -0
  20. package/src/api-client-library/index.ts +18 -0
  21. package/src/api-client-library/models/create-preset-dto.ts +223 -0
  22. package/src/api-client-library/models/create-profile-dto.ts +45 -0
  23. package/src/api-client-library/models/health-controller-get-health200-response-info-value.ts +32 -0
  24. package/src/api-client-library/models/health-controller-get-health200-response.ts +51 -0
  25. package/src/api-client-library/models/health-controller-get-health503-response.ts +51 -0
  26. package/src/api-client-library/models/index.ts +7 -0
  27. package/src/api-client-library/models/update-preset-dto.ts +223 -0
  28. package/src/api-client-library/models/update-profile-dto.ts +45 -0
  29. package/src/components/MediaSelection.vue +40 -0
  30. package/src/components/PresetModify.vue +154 -0
  31. package/src/components/PresetTable.vue +114 -0
  32. package/src/components/ProfileAllList.vue +137 -0
  33. package/src/components/ProfileFormModal.vue +79 -0
  34. package/src/components/ProfileModify.vue +152 -0
  35. package/src/components/ProfileTable.vue +68 -0
  36. package/src/components/WatermarkDraggableItem.vue +88 -0
  37. package/src/components/channel/ConfigWatermarkItem.vue +239 -0
  38. package/src/components/channel/WatermarkPreview.vue +19 -0
  39. package/src/components/common/Vue3DraggableResizable/Container.vue +71 -0
  40. package/src/components/common/Vue3DraggableResizable/index.vue +1327 -0
  41. package/src/components/common/Vue3DraggableResizable/utils/dom.js +63 -0
  42. package/src/components/common/Vue3DraggableResizable/utils/fns.js +37 -0
  43. package/src/components/common/VueDraggableResizable/dom.js +63 -0
  44. package/src/components/common/VueDraggableResizable/fns.js +37 -0
  45. package/src/components/common/VueDraggableResizable/index.vue +958 -0
  46. package/src/components/preset/ConfigItem.vue +956 -0
  47. package/src/components/profile/ConfigItem.vue +765 -0
  48. package/src/components/profile/TableColumns.vue +137 -0
  49. package/src/components/shared/AudioInfoViewer.vue +101 -0
  50. package/src/components/shared/MediaInfoViewer.vue +249 -0
  51. package/src/components/shared/MediaInfoViewerSmall.vue +105 -0
  52. package/src/components/shared/PopoverProfile.vue +17 -0
  53. package/src/components/shared/VideoInfoViewer.vue +136 -0
  54. package/src/components/shared/fileSizeFilter.ts +26 -0
  55. package/src/composables/preset.ts +141 -0
  56. package/src/public/apple-touch-icon-180x180.png +0 -0
  57. package/src/public/build-time.json +1 -0
  58. package/src/public/favicon.ico +0 -0
  59. package/src/public/favicon.svg +15 -0
  60. package/src/public/logo.png +0 -0
  61. package/src/public/logo.svg +9 -0
  62. package/src/public/maskable-icon-512x512.png +0 -0
  63. package/src/public/pwa-192x192.png +0 -0
  64. package/src/public/pwa-512x512.png +0 -0
  65. package/src/public/pwa-64x64.png +0 -0
  66. package/src/public/routes.json +87 -0
  67. package/src/utils/common.ts +175 -0
  68. package/src/utils/config.ts +19 -0
  69. package/src/utils/preset.ts +353 -0
  70. package/src/utils/profile.ts +30 -0
  71. package/tsconfig.json +3 -0
@@ -0,0 +1,353 @@
1
+ import { klona } from 'klona'
2
+ import { emptyStr2Undefined } from './common'
3
+
4
+ export function convertStringToNumber(str) {
5
+ if (!str)
6
+ return
7
+ else if (typeof str === 'number')
8
+ return str
9
+
10
+ return Number.parseFloat(str.replace(/\./g, '')) || 0
11
+ }
12
+ export function serializePreset(data) {
13
+ const _preset = klona(data)
14
+ const kind = _preset && _preset.type
15
+
16
+ if (kind === 'video') {
17
+ const {
18
+ name,
19
+ option,
20
+ description,
21
+ type,
22
+ fps,
23
+ codec,
24
+ encoderType,
25
+ preset,
26
+ videoPreset,
27
+ videoCodec,
28
+ videoBitrate,
29
+ videoProfile,
30
+ videoLevel,
31
+ bufsize,
32
+ rateControlMode,
33
+ rc,
34
+ gopMode,
35
+ gopValue,
36
+ minrate,
37
+ bitrate,
38
+ maxrate,
39
+ width,
40
+ height,
41
+ pixelFormat,
42
+ scaleType,
43
+ scanType,
44
+ cq,
45
+ interlaced,
46
+ fixedGOP,
47
+ cbr,
48
+ hdr,
49
+ bframe,
50
+ id,
51
+ aspectRatioMode,
52
+ aspectRatioWidth,
53
+ aspectRatioHeight,
54
+ pteEnabled,
55
+ vmafMin,
56
+ vmafMax,
57
+ vmafThres,
58
+ } = _preset
59
+ const newPreset = emptyStr2Undefined({
60
+ name,
61
+ options: option,
62
+ description,
63
+ type,
64
+ fps,
65
+ codec,
66
+ encoderType,
67
+ preset,
68
+ videoPreset,
69
+ videoCodec,
70
+ videoBitrate: convertStringToNumber(videoBitrate),
71
+ videoProfile,
72
+ videoLevel,
73
+ bufsize: convertStringToNumber(bufsize),
74
+ rc,
75
+ rateControlMode,
76
+ gopMode,
77
+ gopValue: convertStringToNumber(gopValue),
78
+ minrate: convertStringToNumber(minrate),
79
+ bitrate: convertStringToNumber(bitrate),
80
+ maxrate: convertStringToNumber(maxrate),
81
+ width: width === 0 ? 0 : convertStringToNumber(width),
82
+ height: height === 0 ? 0 : convertStringToNumber(height),
83
+ pixelFormat,
84
+ scaleType,
85
+ scanType,
86
+ cq: cq === 0 ? 0 : convertStringToNumber(cq),
87
+ interlaced,
88
+ fixedGOP,
89
+ cbr,
90
+ hdr,
91
+ bframe: bframe === 0 ? 0 : convertStringToNumber(bframe),
92
+ id,
93
+ aspectRatioMode,
94
+ aspectRatioWidth,
95
+ aspectRatioHeight,
96
+ pteEnabled,
97
+ vmafMin,
98
+ vmafMax,
99
+ vmafThres,
100
+ })
101
+ return { ...newPreset, fixedGOP: _preset.fixedGOP, width: width === 0 ? 0 : convertStringToNumber(width), height: height === 0 ? 0 : convertStringToNumber(height), bframe: bframe === 0 ? 0 : convertStringToNumber(bframe), cq: cq === 0 ? 0 : convertStringToNumber(cq) }
102
+ }
103
+ if (kind === 'audio') {
104
+ const {
105
+ name,
106
+ option,
107
+ description,
108
+ type,
109
+ codec,
110
+ audioCodec,
111
+ audioGroupId,
112
+ defaultAudio,
113
+ audioDefault,
114
+ audioGroup,
115
+ bitrate,
116
+ audioBitrate,
117
+ audioProfile,
118
+ sampleRate,
119
+ channel,
120
+ profile,
121
+ volume,
122
+ id,
123
+ language,
124
+ label,
125
+ } = _preset
126
+ return emptyStr2Undefined({
127
+ name,
128
+ options: option,
129
+ description,
130
+ type,
131
+ codec,
132
+ audioCodec,
133
+ audioGroupId,
134
+ defaultAudio,
135
+ audioDefault,
136
+ audioGroup,
137
+ bitrate: convertStringToNumber(bitrate),
138
+ audioBitrate: convertStringToNumber(audioBitrate),
139
+ sampleRate,
140
+ channel,
141
+ profile,
142
+ audioProfile,
143
+ volume,
144
+ id,
145
+ language,
146
+ label,
147
+ })
148
+ }
149
+ if (kind === 'data') {
150
+ const { name, option, description, type, codec, dataCodec, id, scte35OverwriteConfig = {
151
+ enabled: false,
152
+ overwriteDuration: 30,
153
+ overwriteDelayTime: 0,
154
+ } } = _preset
155
+ return emptyStr2Undefined({
156
+ name,
157
+ options: option,
158
+ description,
159
+ type,
160
+ codec,
161
+ dataCodec,
162
+ id,
163
+ scte35OverwriteConfig,
164
+ })
165
+ }
166
+ return _preset
167
+ }
168
+
169
+ export function serializeChannelPreset(data, enabled?: boolean) {
170
+ const _preset = klona(data)
171
+ const kind = _preset && _preset.type
172
+
173
+ if (kind === 'video') {
174
+ const {
175
+ name,
176
+ option,
177
+ description,
178
+ type,
179
+ fps,
180
+ codec,
181
+ encoderType,
182
+ preset,
183
+ videoPreset,
184
+ videoCodec,
185
+ videoBitrate,
186
+ videoProfile,
187
+ videoLevel,
188
+ bufsize,
189
+ rc,
190
+ rateControlMode,
191
+ gopMode,
192
+ gopValue,
193
+ minrate,
194
+ bitrate,
195
+ maxrate,
196
+ width,
197
+ height,
198
+ pixelFormat,
199
+ scaleType,
200
+ cq,
201
+ fixedGOP = false,
202
+ interlaced,
203
+ cbr,
204
+ scanType,
205
+ bframe,
206
+ streamIndex,
207
+ streamId,
208
+ pid,
209
+ sourceIndex,
210
+ hdr,
211
+ id,
212
+ aspectRatioMode,
213
+ aspectRatioWidth,
214
+ aspectRatioHeight,
215
+ pteEnabled,
216
+ vmafMin,
217
+ vmafMax,
218
+ vmafThres,
219
+ } = _preset
220
+ const newPreset = emptyStr2Undefined({
221
+ name,
222
+ options: option,
223
+ description,
224
+ type,
225
+ fps,
226
+ codec,
227
+ encoderType,
228
+ videoCodec,
229
+ videoBitrate: convertStringToNumber(videoBitrate),
230
+ videoProfile,
231
+ videoLevel,
232
+ bufsize: convertStringToNumber(bufsize),
233
+ rc,
234
+ rateControlMode,
235
+ gopMode,
236
+ gopValue: convertStringToNumber(gopValue),
237
+ preset,
238
+ videoPreset,
239
+ minrate: convertStringToNumber(minrate),
240
+ bitrate: convertStringToNumber(bitrate),
241
+ maxrate: convertStringToNumber(maxrate),
242
+ width: width === 0 ? 0 : convertStringToNumber(width),
243
+ height: height === 0 ? 0 : convertStringToNumber(height),
244
+ pixelFormat,
245
+ scaleType,
246
+ scanType,
247
+ cq: cq === 0 ? 0 : convertStringToNumber(cq),
248
+ interlaced,
249
+ cbr,
250
+ bframe: bframe === 0 ? 0 : convertStringToNumber(bframe),
251
+ streamId,
252
+ pid,
253
+ streamIndex,
254
+ fixedGOP,
255
+ sourceIndex,
256
+ id,
257
+ hdr,
258
+ aspectRatioMode,
259
+ aspectRatioWidth,
260
+ aspectRatioHeight,
261
+ pteEnabled: !enabled ? undefined : pteEnabled,
262
+ vmafMin: !enabled ? undefined : pteEnabled ? vmafMin : undefined,
263
+ vmafMax: !enabled ? undefined : pteEnabled ? vmafMax : undefined,
264
+ vmafThres: !enabled ? undefined : pteEnabled ? vmafThres : undefined,
265
+ })
266
+ return { ...newPreset, fixedGOP: !!_preset.fixedGOP, width: width === 0 ? 0 : convertStringToNumber(width), height: height === 0 ? 0 : convertStringToNumber(height), bframe: bframe === 0 ? 0 : convertStringToNumber(bframe), cq: cq === 0 ? 0 : convertStringToNumber(cq) }
267
+ }
268
+ if (kind === 'audio') {
269
+ const {
270
+ name,
271
+ option,
272
+ description,
273
+ type,
274
+ codec,
275
+ audioCodec,
276
+ audioGroupId,
277
+ audioGroup,
278
+ defaultAudio,
279
+ audioDefault,
280
+ bitrate,
281
+ audioBitrate,
282
+ audioProfile,
283
+ sampleRate,
284
+ channel,
285
+ profile,
286
+ volume,
287
+ streamIndex,
288
+ streamId,
289
+ pid,
290
+ sourceIndex,
291
+ id,
292
+ language,
293
+ label,
294
+ } = _preset
295
+ return emptyStr2Undefined({
296
+ name,
297
+ options: option,
298
+ description,
299
+ type,
300
+ codec,
301
+ audioCodec,
302
+ audioGroupId,
303
+ audioGroup,
304
+ defaultAudio,
305
+ audioDefault,
306
+ bitrate: convertStringToNumber(bitrate),
307
+ audioBitrate: convertStringToNumber(audioBitrate),
308
+ sampleRate,
309
+ channel,
310
+ profile,
311
+ audioProfile,
312
+ volume,
313
+ streamIndex,
314
+ streamId,
315
+ pid,
316
+ sourceIndex,
317
+ id,
318
+ language,
319
+ label,
320
+ })
321
+ }
322
+ if (kind === 'data') {
323
+ const { name, option, description, type, codec, dataCodec, streamIndex, streamId, pid, sourceIndex, id, scte35OverwriteConfig = {
324
+ enabled: false,
325
+ overwriteDuration: 30,
326
+ overwriteDelayTime: 0,
327
+ }, scte35LogEnabled = false } = _preset
328
+ return emptyStr2Undefined({
329
+ name,
330
+ options: option,
331
+ description,
332
+ type,
333
+ codec,
334
+ dataCodec,
335
+ streamIndex,
336
+ streamId,
337
+ pid,
338
+ sourceIndex,
339
+ id,
340
+ scte35OverwriteConfig,
341
+ scte35LogEnabled,
342
+ })
343
+ }
344
+ return _preset
345
+ }
346
+
347
+ export function normalizePreset(data) {
348
+ const preset = klona(data)
349
+ return {
350
+ ...preset,
351
+ option: preset?.options,
352
+ }
353
+ }
@@ -0,0 +1,30 @@
1
+ import { normalizePreset, serializePreset } from './preset'
2
+
3
+ export function normalizeProfile(data) {
4
+ const normalizedData = klona(data)
5
+ const presets = (data && data.presets) || []
6
+ for (let i = presets.length - 1; i >= 0; i--) {
7
+ const tmp = normalizePreset(presets[i])
8
+ if (!(normalizedData[tmp.type] || Array.isArray(normalizedData[tmp.type])))
9
+ normalizedData[tmp.type] = []
10
+
11
+ normalizedData[tmp.type].push(tmp)
12
+ normalizedData.presets[i] = tmp
13
+ }
14
+ return normalizedData
15
+ }
16
+
17
+ export function serializeProfile(data) {
18
+ const profile = klona(data)
19
+ const presetTypes = ['video', 'audio', 'data']
20
+ const parsedPresets = []
21
+ presetTypes.forEach((type) => {
22
+ const presets = (profile && profile[type]) || []
23
+ presets.forEach((preset) => {
24
+ const parsedPreset = serializePreset(preset)
25
+ parsedPresets.push(parsedPreset)
26
+ })
27
+ })
28
+ profile.presets = parsedPresets
29
+ return profile
30
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "./.nuxt/tsconfig.json"
3
+ }