@sigmaott/base-next 1.4.41 → 1.4.44

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.
@@ -91,6 +91,7 @@ const [encoderIdValue, encoderIdAttrs] = useElField<string>(getProp('encoderId')
91
91
  },
92
92
  },
93
93
  ])
94
+ const [encoderTypeValue] = useElField<string>(getProp('encoderType'), [])
94
95
 
95
96
  const paramsMachine = reactive({
96
97
  page: 1,
@@ -191,12 +192,14 @@ function handleChangeType(_value: string) {
191
192
  modeValue.value = 'AUTO'
192
193
  }
193
194
  encoderIdValue.value = undefined
195
+ encoderTypeValue.value = undefined
194
196
  encoderModeValue.value = 'AUTO'
195
197
  }
196
198
 
197
199
  function handleChangeServer(_id: string) {
198
200
  specMachineIdValue.value = undefined
199
201
  encoderIdValue.value = undefined
202
+ encoderTypeValue.value = undefined
200
203
 
201
204
  if (channelConfigValue.value?.pte?.path)
202
205
  channelConfigValue.value.pte.path = undefined
@@ -206,13 +209,14 @@ function handleChangeServer(_id: string) {
206
209
 
207
210
  function handleChangePrimaryServer(_id: string) {
208
211
  encoderIdValue.value = undefined
212
+ encoderTypeValue.value = undefined
209
213
  }
210
214
 
211
215
  const optionsEncoder = computed(() => {
212
- const value = encoderIdValue.value
216
+ // const value = encoderIdValue.value
213
217
 
214
- // TH1: encoderIdValue === -1
215
- if (value === -1) {
218
+ // TH1: encoderTypeValue === 'SOFTWARE'
219
+ if (encoderTypeValue.value === 'SOFTWARE') {
216
220
  return [
217
221
  'open_h264',
218
222
  'open_hevc',
@@ -220,15 +224,22 @@ const optionsEncoder = computed(() => {
220
224
  ]
221
225
  }
222
226
 
223
- // TH2: encoderIdValue là null, undefined, '' hoặc bất kỳ giá trị nào khác
224
- if (value === null || value === undefined || value === '') {
227
+ // TH2: encoderTypeValue là null, undefined, '' hoặc bất kỳ giá trị nào khác
228
+ else if (encoderTypeValue.value === null || encoderTypeValue.value === undefined || encoderTypeValue.value === '') {
225
229
  return [
226
230
  'open_h264',
227
231
  'open_hevc',
232
+ 'netint',
228
233
  'nvenc',
229
234
  'passthrough',
230
235
  ]
231
236
  }
237
+ // TH3: encoderTypeValue === 'NETINT'
238
+ else if (encoderTypeValue.value === 'NETINT') {
239
+ return [
240
+ 'netint',
241
+ ]
242
+ }
232
243
 
233
244
  // Mặc định cho các giá trị khác (ví dụ: 0, 1, 2, 3,...)
234
245
  return [
@@ -261,6 +272,7 @@ function handleChangeServerMode(_newValue: string) {
261
272
  specMachineIdValue.value = undefined
262
273
  encoderModeValue.value = 'AUTO'
263
274
  encoderIdValue.value = undefined
275
+ encoderTypeValue.value = undefined
264
276
  if (serverTypeValue.value !== 'SIGMA_MACHINE')
265
277
  optionsVideoEncoder.value = []
266
278
 
@@ -348,9 +360,12 @@ function setDefaultEncoder() {
348
360
  profilesValue.value = updateAllEncoderTypes('open_h264')
349
361
  }
350
362
  else {
351
- if (encoderIdValue.value === -1) {
363
+ if (encoderModeValue.value === 'SOFTWARE') {
352
364
  profilesValue.value = updateAllEncoderTypes('open_h264')
353
365
  }
366
+ else if (encoderTypeValue.value === 'NETINT') {
367
+ profilesValue.value = updateAllEncoderTypes('netint')
368
+ }
354
369
  else {
355
370
  profilesValue.value = updateAllEncoderTypes('nvenc')
356
371
  }
@@ -377,40 +392,19 @@ function handleChangeVideoEncoder(newValue: string) {
377
392
 
378
393
  <template>
379
394
  <el-form-item class="flex-1" :label="t('SSConfig.label.machineType')" v-bind="serverTypeAttrs">
380
- <el-select
381
- v-model="serverTypeValue"
382
- class="w-full"
383
- :placeholder="t('SSConfig.placeholder.select')"
384
- :disabled="channelModeValue === 'active-active' || props.disabled"
385
- @change="handleChangeType"
386
- >
387
- <el-option
388
- v-for="item in machineTypeDto"
389
- :key="item.value"
390
- :label="item.label"
391
- :value="item.value"
392
- />
395
+ <el-select v-model="serverTypeValue" class="w-full" :placeholder="t('SSConfig.placeholder.select')"
396
+ :disabled="channelModeValue === 'active-active' || props.disabled" @change="handleChangeType">
397
+ <el-option v-for="item in machineTypeDto" :key="item.value" :label="item.label" :value="item.value" />
393
398
  </el-select>
394
399
  </el-form-item>
395
- <el-form-item class="flex-1" v-bind="serverIdAttrs" :label="serverTypeValue !== 'SIGMA_MACHINE' ? t('SSConfig.label.cluster') : t('Input.label.machine')">
400
+ <el-form-item class="flex-1" v-bind="serverIdAttrs"
401
+ :label="serverTypeValue !== 'SIGMA_MACHINE' ? t('SSConfig.label.cluster') : t('Input.label.machine')">
396
402
  <div class="w-full flex gap-1">
397
- <el-select
398
- v-model="serverIdValue"
399
- :placeholder="t('SSConfig.placeholder.select')"
400
- class="w-full"
401
- :clearable="true"
402
- :disabled="props.disabled"
403
- @change="handleChangeServer"
404
- >
403
+ <el-select v-model="serverIdValue" :placeholder="t('SSConfig.placeholder.select')" class="w-full"
404
+ :clearable="true" :disabled="props.disabled" @change="handleChangeServer">
405
405
  <template v-if="serverTypeValue === 'SIGMA_MACHINE'">
406
- <el-option
407
- v-for="item in optionServer"
408
- :key="item.id"
409
- class="w-full h-auto! not-last:border-b"
410
- :label="`${item.name}`"
411
- :value="item.id"
412
- :disabled="item.isDeleted || item.status !== 'running'"
413
- >
406
+ <el-option v-for="item in optionServer" :key="item.id" class="w-full h-auto! not-last:border-b"
407
+ :label="`${item.name}`" :value="item.id" :disabled="item.isDeleted || item.status !== 'running'">
414
408
  <div>
415
409
  <div class="font-semibold">
416
410
  {{ item.machine }}
@@ -429,14 +423,9 @@ function handleChangeVideoEncoder(newValue: string) {
429
423
  </el-option>
430
424
  </template>
431
425
  <template v-else-if="serverTypeValue === 'SIGMA_MACHINE_CLUSTER'">
432
- <el-option
433
- v-for="item in optionServer"
434
- :key="item.id"
435
- class="w-full h-auto! not-last:border-b"
436
- :label="item.name"
437
- :value="item.id!"
438
- :disabled="(item.isDeleted || item.status === 'red') || (channelModeValue === 'active-active' && item?.mode !== '1+1')"
439
- >
426
+ <el-option v-for="item in optionServer" :key="item.id" class="w-full h-auto! not-last:border-b"
427
+ :label="item.name" :value="item.id!"
428
+ :disabled="(item.isDeleted || item.status === 'red') || (channelModeValue === 'active-active' && item?.mode !== '1+1')">
440
429
  <div>
441
430
  <div class="flex justify-between font-semibold">
442
431
  {{ item.name }}
@@ -446,7 +435,8 @@ function handleChangeVideoEncoder(newValue: string) {
446
435
  </div>
447
436
  <div v-else class="w-full flex items-center justify-between">
448
437
  <div class="flex-1">
449
- {{ t('SSConfig.label.machines') }}({{ item?.mode === 'no_backup' ? item.machines?.length : item?.mode === 'N+M' ? item?.nPlusMMachines?.length : item?.onePlusOneMachines?.length * 2 }})
438
+ {{ t('SSConfig.label.machines') }}({{ item?.mode === 'no_backup' ? item.machines?.length : item?.mode
439
+ === 'N+M' ? item?.nPlusMMachines?.length : item?.onePlusOneMachines?.length * 2 }})
450
440
  </div>
451
441
  <div class="flex flex-1 justify-center">
452
442
  <span class="h-24px flex items-center border rounded p-3px">
@@ -467,40 +457,25 @@ function handleChangeVideoEncoder(newValue: string) {
467
457
  </el-form-item>
468
458
  <el-form-item v-if="serverTypeValue === 'SIGMA_MACHINE_CLUSTER'" v-bind="modeAttrs" class="flex-1">
469
459
  <template #label>
470
- <SSInformationLabel :label="t('SSConfig.label.server_mode')" :information="schemaItem?.properties?.mode?.description" />
460
+ <SSInformationLabel :label="t('SSConfig.label.server_mode')"
461
+ :information="schemaItem?.properties?.mode?.description" />
471
462
  </template>
472
- <el-select
473
- v-model="modeValue"
474
- :placeholder="t('SSConfig.placeholder.select')"
475
- class="w-full"
476
- @change="handleChangeServerMode"
477
- >
478
- <el-option
479
- v-for="item in ['MANUAL', 'AUTO']"
480
- :key="item"
481
- :label="item"
482
- :value="item"
483
- />
463
+ <el-select v-model="modeValue" :placeholder="t('SSConfig.placeholder.select')" class="w-full"
464
+ @change="handleChangeServerMode">
465
+ <el-option v-for="item in ['MANUAL', 'AUTO']" :key="item" :label="item" :value="item" />
484
466
  </el-select>
485
467
  </el-form-item>
486
- <el-form-item v-if="modeValue === 'MANUAL' && serverTypeValue === 'SIGMA_MACHINE_CLUSTER'" v-bind="specMachineIdAttrs" class="flex-1">
468
+ <el-form-item v-if="modeValue === 'MANUAL' && serverTypeValue === 'SIGMA_MACHINE_CLUSTER'" v-bind="specMachineIdAttrs"
469
+ class="flex-1">
487
470
  <template #label>
488
- <SSInformationLabel :label="t('SSConfig.label.primaryServer')" :information="schemaItem?.properties?.specMachineId?.description" />
471
+ <SSInformationLabel :label="t('SSConfig.label.primaryServer')"
472
+ :information="schemaItem?.properties?.specMachineId?.description" />
489
473
  </template>
490
- <el-select
491
- v-model="specMachineIdValue"
492
- :placeholder="t('SSConfig.placeholder.select')"
493
- class="w-full"
494
- @change="handleChangePrimaryServer"
495
- >
496
- <el-option
497
- v-for="item in optionSpecMachineIds"
498
- :key="item?.id"
499
- class="w-full h-auto! not-last:border-b"
500
- :label="item?.machine?.name"
501
- :value="item?.id"
502
- :disabled="item?.machine?.isDeleted || item?.machine?.status !== 'running'"
503
- >
474
+ <el-select v-model="specMachineIdValue" :placeholder="t('SSConfig.placeholder.select')" class="w-full"
475
+ @change="handleChangePrimaryServer">
476
+ <el-option v-for="item in optionSpecMachineIds" :key="item?.id" class="w-full h-auto! not-last:border-b"
477
+ :label="item?.machine?.name" :value="item?.id"
478
+ :disabled="item?.machine?.isDeleted || item?.machine?.status !== 'running'">
504
479
  <div>
505
480
  <div class="font-semibold">
506
481
  {{ !item?.machine?.isDeleted ? item?.machine?.name : item?.id }}
@@ -520,22 +495,14 @@ function handleChangeVideoEncoder(newValue: string) {
520
495
  </el-select>
521
496
  </el-form-item>
522
497
 
523
- <el-form-item v-if="modeValue === 'MANUAL' || serverTypeValue === 'SIGMA_MACHINE'" v-bind="encoderModeAttrs" class="flex-1">
498
+ <el-form-item v-if="modeValue === 'MANUAL' || serverTypeValue === 'SIGMA_MACHINE'" v-bind="encoderModeAttrs"
499
+ class="flex-1">
524
500
  <template #label>
525
501
  <SSInformationLabel label="Encoder mode" :information="schemaItem?.properties?.mode?.description" />
526
502
  </template>
527
- <el-select
528
- v-model="encoderModeValue"
529
- :placeholder="t('EventChannel.placeholder.select')"
530
- class="w-full"
531
- @change="handleChangeEncoderMode"
532
- >
533
- <el-option
534
- v-for="item in optionsEncoderMode"
535
- :key="item.value"
536
- :label="item.label"
537
- :value="item.value"
538
- />
503
+ <el-select v-model="encoderModeValue" :placeholder="t('EventChannel.placeholder.select')" class="w-full"
504
+ @change="handleChangeEncoderMode">
505
+ <el-option v-for="item in optionsEncoderMode" :key="item.value" :label="item.label" :value="item.value" />
539
506
  </el-select>
540
507
  </el-form-item>
541
508
 
@@ -543,20 +510,10 @@ function handleChangeVideoEncoder(newValue: string) {
543
510
  <template #label>
544
511
  <SSInformationLabel label="Video Encoder" :information="schemaItem?.properties?.mode?.description" />
545
512
  </template>
546
- <el-select
547
- v-model="encoderIdValue"
548
- :placeholder="t('EventChannel.placeholder.select')"
549
- class="w-full"
550
- filterable
551
- @change="handleChangeVideoEncoder"
552
- >
553
- <el-option
554
- v-for="item in optionsVideoEncoder"
555
- :key="item.id"
556
- :label="item.cardName"
557
- :value="item.id"
558
- class="w-full border-b-$el-border-color !h-auto not-last:border-b"
559
- >
513
+ <el-select v-model="encoderIdValue" :placeholder="t('EventChannel.placeholder.select')" class="w-full" filterable
514
+ @change="handleChangeVideoEncoder">
515
+ <el-option v-for="item in optionsVideoEncoder" :key="item.id" :label="item.cardName" :value="item.id"
516
+ class="w-full border-b-$el-border-color !h-auto not-last:border-b">
560
517
  <el-text class="font-semibold">
561
518
  {{ item.cardName }}
562
519
  </el-text>