bfg-common 1.2.170 → 1.2.171

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.
@@ -1,68 +1,77 @@
1
- <template>
2
- <div class="hardware-cpu">
3
- <atoms-stack-block :has-children="false">
4
- <template #stackBlockKey>
5
- <div class="flex-align-center">
6
- <span>{{ localization.newUsbController }}</span>
7
- </div>
8
- </template>
9
- <template #stackBlockContent>
10
- <div class="select">
11
- <select
12
- id="usb-controller-select"
13
- v-model="selectedUsbController"
14
- :disabled="props.isEdit && props.state !== 1"
15
- @click.stop
16
- >
17
- <option
18
- v-for="(item, key) in usbControllerOptions"
19
- :key="key"
20
- :value="item.value"
21
- >
22
- {{ item.text }}
23
- </option>
24
- </select>
25
- </div>
26
- </template>
27
- </atoms-stack-block>
28
- </div>
29
- </template>
30
-
31
- <script setup lang="ts">
32
- import { UI_I_OptionItem } from '~/components/atoms/models/interfaces'
33
- import { UI_I_Localization } from '~/models/interfaces'
34
- import { usbControllerOptionsConfig } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/config/options'
35
-
36
- const props = withDefaults(
37
- defineProps<{
38
- usbController: string
39
- isEdit: boolean
40
- state?: string | number
41
- }>(),
42
- {
43
- usbController: 'usb2',
44
- }
45
- )
46
- const emits = defineEmits<{
47
- (event: 'send-data', value: string): void
48
- }>()
49
-
50
- const localization = computed<UI_I_Localization>(() => useLocal())
51
-
52
- const selectedUsbController = ref<string>(props.usbController)
53
- const usbControllerOptions = ref<UI_I_OptionItem[]>(usbControllerOptionsConfig)
54
-
55
- watch(
56
- selectedUsbController,
57
- (newValue) => {
58
- emits('send-data', newValue)
59
- },
60
- { immediate: true }
61
- )
62
- </script>
63
-
64
- <style scoped lang="scss">
65
- #network-connect {
66
- margin-right: 4px;
67
- }
68
- </style>
1
+ <template>
2
+ <div class="hardware-cpu">
3
+ <atoms-stack-block :has-children="false">
4
+ <template #stackBlockKey>
5
+ <div class="flex-align-center">
6
+ <span>{{ localization.newUsbController }}</span>
7
+ </div>
8
+ </template>
9
+ <template #stackBlockContent>
10
+ <div v-if="props.isEdit">
11
+ {{ selectedUsbControllerText }}
12
+ </div>
13
+ <div v-else class="select">
14
+ <select
15
+ id="usb-controller-select"
16
+ v-model="selectedUsbController"
17
+ :disabled="props.isEdit"
18
+ @click.stop
19
+ >
20
+ <option
21
+ v-for="(item, key) in usbControllerOptions"
22
+ :key="key"
23
+ :value="item.value"
24
+ >
25
+ {{ item.text }}
26
+ </option>
27
+ </select>
28
+ </div>
29
+ </template>
30
+ </atoms-stack-block>
31
+ </div>
32
+ </template>
33
+
34
+ <script setup lang="ts">
35
+ import { UI_I_OptionItem } from '~/components/atoms/models/interfaces'
36
+ import { UI_I_Localization } from '~/models/interfaces'
37
+ import { usbControllerOptionsConfig } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/config/options'
38
+
39
+ const props = withDefaults(
40
+ defineProps<{
41
+ usbController: string
42
+ isEdit: boolean
43
+ state?: string | number
44
+ }>(),
45
+ {
46
+ usbController: 'usb2',
47
+ }
48
+ )
49
+ const emits = defineEmits<{
50
+ (event: 'send-data', value: string): void
51
+ }>()
52
+
53
+ const localization = computed<UI_I_Localization>(() => useLocal())
54
+
55
+ const usbControllerOptions = ref<UI_I_OptionItem[]>(usbControllerOptionsConfig)
56
+ const selectedUsbController = ref<string>(props.usbController)
57
+ const selectedUsbControllerText = computed<string>(
58
+ () =>
59
+ usbControllerOptions.value.find(
60
+ (option) => option.value === selectedUsbController.value
61
+ )?.text || ''
62
+ )
63
+
64
+ watch(
65
+ selectedUsbController,
66
+ (newValue) => {
67
+ emits('send-data', newValue)
68
+ },
69
+ { immediate: true }
70
+ )
71
+ </script>
72
+
73
+ <style scoped lang="scss">
74
+ #network-connect {
75
+ margin-right: 4px;
76
+ }
77
+ </style>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.2.170",
4
+ "version": "1.2.171",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",