bfg-common 1.1.70 → 1.1.72

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,175 +1,177 @@
1
- <template>
2
- <div class="hardware-cpu">
3
- <atoms-stack-block :has-children="true">
4
- <template #stackBlockKey>
5
- <div id="vm-wizard-toggle-block-video-card" class="flex-align-center">
6
- <span>{{ localization.videoCard }}: {{ videoCardModelName }}</span>
7
- <atoms-the-icon
8
- v-show="invalid"
9
- width="24px"
10
- height="24px"
11
- class="is-error tooltip-trigger"
12
- name="info"
13
- />
14
- </div>
15
- </template>
16
- <template #stackBlockContent>
17
- <atoms-tooltip-error
18
- :has-error="!!apiError"
19
- selector=".vm-wizard-video-card"
20
- @remove="onRemoveValidationError"
21
- >
22
- <template #elem>
23
- <div class="select">
24
- <select
25
- id="vm-wizard-video-card"
26
- v-model="selectedVideoCard"
27
- class="vm-wizard-video-card input-text-color"
28
- :disabled="props.isEdit && props.state !== 1"
29
- @click.stop
30
- >
31
- <option
32
- v-for="(item, key) in videoCardOptions"
33
- :key="key"
34
- :value="item.value"
35
- >
36
- {{ item.text }}
37
- </option>
38
- </select>
39
- </div>
40
- </template>
41
- <template #content>{{ apiError }}</template>
42
- </atoms-tooltip-error>
43
- </template>
44
- <template #stackChildren>
45
- <common-vm-actions-add-customize-hardware-virtual-hardware-video-card-number-displays
46
- v-model:number-displays="numberDisplays"
47
- :disabled="isDisabled"
48
- :error-validation-fields="props.errorValidationFields"
49
- @remove-error-by-title="emits('remove-error-by-title', $event)"
50
- />
51
- <common-vm-actions-add-customize-hardware-virtual-hardware-video-card-total-video-memory
52
- v-model:total-video-memory="totalVideoMemory"
53
- :disabled="isDisabled"
54
- :is-edit="props.isEdit"
55
- :error-validation-fields="props.errorValidationFields"
56
- @invalid="invalid = $event"
57
- @remove-error-by-title="emits('remove-error-by-title', $event)"
58
- />
59
- <!-- <templates-home-vm-actions-add-customize-hardware-virtual-hardware-video-card-graphics-->
60
- <!-- v-model:graphics="graphics"-->
61
- <!-- />-->
62
- <common-vm-actions-add-customize-hardware-virtual-hardware-video-card-model
63
- v-model:video-card-model="videoCardModel"
64
- :disabled="isDisabled"
65
- />
66
- </template>
67
- </atoms-stack-block>
68
- </div>
69
- </template>
70
-
71
- <script setup lang="ts">
72
- import { UI_I_SendDataVideoCard } from '~/components/common/vm/actions/add/customizeHardware/virtualHardware/models/interfaces'
73
- import { UI_I_Localization } from '~/models/interfaces'
74
- import { UI_I_ErrorValidationField } from '~/models/store/interfaces'
75
- import { UI_I_OptionItem } from '~/components/atoms/models/interfaces'
76
- import { videoCardModelOptionsConfig } from '~/components/common/vm/actions/add/customizeHardware/virtualHardware/videoCard/model/config/options'
77
- import { videoCardOptionsFunc } from '~/components/common/vm/actions/add/customizeHardware/virtualHardware/videoCard/config/options'
78
-
79
- const props = defineProps<{
80
- isEdit: boolean
81
- errorValidationFields: UI_I_ErrorValidationField[]
82
- videoCard?: UI_I_SendDataVideoCard
83
- state?: string | number
84
- }>()
85
- const emits = defineEmits<{
86
- (event: 'send-data', value: UI_I_SendDataVideoCard): void
87
- (event: 'invalid', value: boolean): void
88
- (event: 'remove-error-by-title', value: string): void
89
- }>()
90
-
91
- const localization = computed<UI_I_Localization>(() => useLocal())
92
-
93
- const selectedVideoCard = ref<number>(1)
94
- const videoCardOptions = ref<UI_I_OptionItem[]>(
95
- videoCardOptionsFunc(localization.value)
96
- )
97
-
98
- const isDisabled = computed<boolean>(() => selectedVideoCard.value === 0 || props.isEdit && props.state !== 1)
99
- watch(isDisabled, (val) => {
100
- if (!val) {
101
- return
102
- }
103
-
104
- numberDisplays.value = '1'
105
- })
106
- const numberDisplays = ref<string>('1')
107
-
108
- const totalVideoMemory = ref<number>(8)
109
- const invalid = ref<boolean>(false)
110
- watch(
111
- invalid,
112
- (newValue) => {
113
- emits('invalid', newValue)
114
- },
115
- { immediate: true }
116
- )
117
-
118
- // const graphics = ref(false)
119
-
120
- const videoCardModel = ref<string>('qxl')
121
- const videoCardModelOptions = ref<UI_I_OptionItem[]>(
122
- videoCardModelOptionsConfig
123
- )
124
- const videoCardModelName = computed<string>(
125
- () =>
126
- videoCardModelOptions.value.find(
127
- (videoCard) => videoCard.value === videoCardModel.value
128
- )?.text || ''
129
- )
130
-
131
- watch(
132
- [numberDisplays, totalVideoMemory, videoCardModel],
133
- () => {
134
- emits('send-data', {
135
- adapter: videoCardModel.value,
136
- displays: +numberDisplays.value,
137
- memory_mb: totalVideoMemory.value,
138
- })
139
- },
140
- { immediate: true }
141
- )
142
-
143
- // Добавляем данные для редактирования
144
- watch(
145
- () => props.videoCard,
146
- (newValue) => {
147
- if (!newValue) return
148
-
149
- selectedVideoCard.value = 1
150
- videoCardModel.value = newValue.adapter
151
- numberDisplays.value = '' + newValue.displays
152
- totalVideoMemory.value = newValue.memory_mb
153
- },
154
- { immediate: true }
155
- )
156
-
157
- const typeError = 'video_card.adapter'
158
-
159
- const apiError = computed<string>(() => {
160
- return (
161
- props.errorValidationFields?.find((message) => message.field === typeError)
162
- ?.error_message || ''
163
- )
164
- })
165
-
166
- const onRemoveValidationError = (): void => {
167
- emits('remove-error-by-title', typeError)
168
- }
169
- </script>
170
-
171
- <style scoped lang="scss">
172
- #network-connect {
173
- margin-right: 4px;
174
- }
175
- </style>
1
+ <template>
2
+ <div class="hardware-cpu">
3
+ <atoms-stack-block :has-children="true">
4
+ <template #stackBlockKey>
5
+ <div id="vm-wizard-toggle-block-video-card" class="flex-align-center">
6
+ <span>{{ localization.videoCard }}: {{ videoCardModelName }}</span>
7
+ <atoms-the-icon
8
+ v-show="invalid"
9
+ width="24px"
10
+ height="24px"
11
+ class="is-error tooltip-trigger"
12
+ name="info"
13
+ />
14
+ </div>
15
+ </template>
16
+ <template #stackBlockContent>
17
+ <atoms-tooltip-error
18
+ :has-error="!!apiError"
19
+ selector=".vm-wizard-video-card"
20
+ @remove="onRemoveValidationError"
21
+ >
22
+ <template #elem>
23
+ <div class="select">
24
+ <select
25
+ id="vm-wizard-video-card"
26
+ v-model="selectedVideoCard"
27
+ class="vm-wizard-video-card input-text-color"
28
+ :disabled="props.isEdit && props.state !== 1"
29
+ @click.stop
30
+ >
31
+ <option
32
+ v-for="(item, key) in videoCardOptions"
33
+ :key="key"
34
+ :value="item.value"
35
+ >
36
+ {{ item.text }}
37
+ </option>
38
+ </select>
39
+ </div>
40
+ </template>
41
+ <template #content>{{ apiError }}</template>
42
+ </atoms-tooltip-error>
43
+ </template>
44
+ <template #stackChildren>
45
+ <common-vm-actions-add-customize-hardware-virtual-hardware-video-card-number-displays
46
+ v-model:number-displays="numberDisplays"
47
+ :disabled="isDisabled"
48
+ :error-validation-fields="props.errorValidationFields"
49
+ @remove-error-by-title="emits('remove-error-by-title', $event)"
50
+ />
51
+ <common-vm-actions-add-customize-hardware-virtual-hardware-video-card-total-video-memory
52
+ v-model:total-video-memory="totalVideoMemory"
53
+ :disabled="isDisabled"
54
+ :is-edit="props.isEdit"
55
+ :error-validation-fields="props.errorValidationFields"
56
+ @invalid="invalid = $event"
57
+ @remove-error-by-title="emits('remove-error-by-title', $event)"
58
+ />
59
+ <!-- <templates-home-vm-actions-add-customize-hardware-virtual-hardware-video-card-graphics-->
60
+ <!-- v-model:graphics="graphics"-->
61
+ <!-- />-->
62
+ <common-vm-actions-add-customize-hardware-virtual-hardware-video-card-model
63
+ v-model:video-card-model="videoCardModel"
64
+ :disabled="isDisabled"
65
+ />
66
+ </template>
67
+ </atoms-stack-block>
68
+ </div>
69
+ </template>
70
+
71
+ <script setup lang="ts">
72
+ import { UI_I_SendDataVideoCard } from '~/components/common/vm/actions/add/customizeHardware/virtualHardware/models/interfaces'
73
+ import { UI_I_Localization } from '~/models/interfaces'
74
+ import { UI_I_ErrorValidationField } from '~/models/store/interfaces'
75
+ import { UI_I_OptionItem } from '~/components/atoms/models/interfaces'
76
+ import { videoCardModelOptionsConfig } from '~/components/common/vm/actions/add/customizeHardware/virtualHardware/videoCard/model/config/options'
77
+ import { videoCardOptionsFunc } from '~/components/common/vm/actions/add/customizeHardware/virtualHardware/videoCard/config/options'
78
+
79
+ const props = defineProps<{
80
+ isEdit: boolean
81
+ errorValidationFields: UI_I_ErrorValidationField[]
82
+ videoCard?: UI_I_SendDataVideoCard
83
+ state?: string | number
84
+ }>()
85
+ const emits = defineEmits<{
86
+ (event: 'send-data', value: UI_I_SendDataVideoCard): void
87
+ (event: 'invalid', value: boolean): void
88
+ (event: 'remove-error-by-title', value: string): void
89
+ }>()
90
+
91
+ const localization = computed<UI_I_Localization>(() => useLocal())
92
+
93
+ const selectedVideoCard = ref<number>(1)
94
+ const videoCardOptions = ref<UI_I_OptionItem[]>(
95
+ videoCardOptionsFunc(localization.value)
96
+ )
97
+
98
+ const isDisabled = computed<boolean>(
99
+ () => selectedVideoCard.value === 0 || (props.isEdit && props.state !== 1)
100
+ )
101
+ watch(isDisabled, (val) => {
102
+ if (!val) {
103
+ return
104
+ }
105
+
106
+ numberDisplays.value = '1'
107
+ })
108
+ const numberDisplays = ref<string>('1')
109
+
110
+ const totalVideoMemory = ref<number>(8)
111
+ const invalid = ref<boolean>(false)
112
+ watch(
113
+ invalid,
114
+ (newValue) => {
115
+ emits('invalid', newValue)
116
+ },
117
+ { immediate: true }
118
+ )
119
+
120
+ // const graphics = ref(false)
121
+
122
+ const videoCardModel = ref<string>('qxl')
123
+ const videoCardModelOptions = ref<UI_I_OptionItem[]>(
124
+ videoCardModelOptionsConfig
125
+ )
126
+ const videoCardModelName = computed<string>(
127
+ () =>
128
+ videoCardModelOptions.value.find(
129
+ (videoCard) => videoCard.value === videoCardModel.value
130
+ )?.text || ''
131
+ )
132
+
133
+ watch(
134
+ [numberDisplays, totalVideoMemory, videoCardModel],
135
+ () => {
136
+ emits('send-data', {
137
+ adapter: videoCardModel.value,
138
+ displays: +numberDisplays.value,
139
+ memory_mb: totalVideoMemory.value,
140
+ })
141
+ },
142
+ { immediate: true }
143
+ )
144
+
145
+ // Добавляем данные для редактирования
146
+ watch(
147
+ () => props.videoCard,
148
+ (newValue) => {
149
+ if (!newValue) return
150
+
151
+ selectedVideoCard.value = 1
152
+ videoCardModel.value = newValue.adapter
153
+ numberDisplays.value = '' + newValue.displays
154
+ totalVideoMemory.value = newValue.memory_mb
155
+ },
156
+ { immediate: true }
157
+ )
158
+
159
+ const typeError = 'video_card.adapter'
160
+
161
+ const apiError = computed<string>(() => {
162
+ return (
163
+ props.errorValidationFields?.find((message) => message.field === typeError)
164
+ ?.error_message || ''
165
+ )
166
+ })
167
+
168
+ const onRemoveValidationError = (): void => {
169
+ emits('remove-error-by-title', typeError)
170
+ }
171
+ </script>
172
+
173
+ <style scoped lang="scss">
174
+ #network-connect {
175
+ margin-right: 4px;
176
+ }
177
+ </style>
@@ -23,7 +23,7 @@
23
23
  </template>
24
24
  <template
25
25
  v-for="(item, index) in bootList"
26
- :key="index + 5"
26
+ :key="bootList.length + index"
27
27
  #[`rightSide${index}`]
28
28
  >
29
29
  <div :class="['device-icon', item.iconClassName]" />
@@ -131,7 +131,6 @@ const vmNameLocal = computed<string>({
131
131
 
132
132
  const guestMachineTypeLocal = computed<UI_I_OptionItem | null>({
133
133
  get() {
134
- console.log(props.guestMachineType, 111);
135
134
  return props.guestMachineType
136
135
  },
137
136
  set(newValue) {
@@ -142,7 +141,6 @@ const machineTypeOptions = ref<UI_I_OptionItem[]>(capabilities.machineTypes)
142
141
 
143
142
  const guestOsFamilyLocal = computed<UI_I_OptionItem | null>({
144
143
  get() {
145
- console.log(props.guestOsFamily, 2222);
146
144
  return props.guestOsFamily
147
145
  },
148
146
  set(newValue) {
@@ -156,7 +154,6 @@ const onChangeOS = (): void => {
156
154
 
157
155
  const guestOsVersionLocal = computed<UI_I_OptionItem | null>({
158
156
  get() {
159
- console.log(props.guestOsVersion, 333);
160
157
  return props.guestOsVersion
161
158
  },
162
159
  set(newValue) {
@@ -1,46 +1,51 @@
1
- <template>
2
- <div class="">
3
- <atoms-stack-block :has-children="false">
4
- <template #stackBlockKey>
5
- {{ localization.copyPaste }}
6
- </template>
7
- <template #stackBlockContent>
8
- <div class="flex-align-center">
9
- <input id="copy-paste" v-model="copyPasteLocal" :disabled="props.disabled" type="checkbox" />
10
- <label for="copy-paste" class="label-text-normal">{{
11
- localization.enable
12
- }}</label>
13
- </div>
14
- </template>
15
- </atoms-stack-block>
16
- </div>
17
- </template>
18
-
19
- <script setup lang="ts">
20
- import { UI_I_Localization } from '~/models/interfaces'
21
-
22
- const localization = computed<UI_I_Localization>(() => useLocal())
23
-
24
- const props = defineProps<{
25
- copyPaste: boolean
26
- disabled: boolean
27
- }>()
28
- const emits = defineEmits<{
29
- (event: 'update:copy-paste', value: boolean): void
30
- }>()
31
-
32
- const copyPasteLocal = computed<boolean>({
33
- get() {
34
- return props.copyPaste
35
- },
36
- set(newValue) {
37
- emits('update:copy-paste', newValue)
38
- },
39
- })
40
- </script>
41
-
42
- <style scoped>
43
- #copy-paste {
44
- margin: 0 4px 4px 0;
45
- }
46
- </style>
1
+ <template>
2
+ <div class="">
3
+ <atoms-stack-block :has-children="false">
4
+ <template #stackBlockKey>
5
+ {{ localization.copyPaste }}
6
+ </template>
7
+ <template #stackBlockContent>
8
+ <div class="flex-align-center">
9
+ <input
10
+ id="copy-paste"
11
+ v-model="copyPasteLocal"
12
+ :disabled="props.disabled"
13
+ type="checkbox"
14
+ />
15
+ <label for="copy-paste" class="label-text-normal">{{
16
+ localization.enable
17
+ }}</label>
18
+ </div>
19
+ </template>
20
+ </atoms-stack-block>
21
+ </div>
22
+ </template>
23
+
24
+ <script setup lang="ts">
25
+ import { UI_I_Localization } from '~/models/interfaces'
26
+
27
+ const localization = computed<UI_I_Localization>(() => useLocal())
28
+
29
+ const props = defineProps<{
30
+ copyPaste: boolean
31
+ disabled: boolean
32
+ }>()
33
+ const emits = defineEmits<{
34
+ (event: 'update:copy-paste', value: boolean): void
35
+ }>()
36
+
37
+ const copyPasteLocal = computed<boolean>({
38
+ get() {
39
+ return props.copyPaste
40
+ },
41
+ set(newValue) {
42
+ emits('update:copy-paste', newValue)
43
+ },
44
+ })
45
+ </script>
46
+
47
+ <style scoped>
48
+ #copy-paste {
49
+ margin: 0 4px 4px 0;
50
+ }
51
+ </style>
@@ -1,51 +1,55 @@
1
- <template>
2
- <div class="">
3
- <atoms-stack-block :has-children="false">
4
- <template #stackBlockKey>
5
- {{ localization.keymap }}
6
- </template>
7
- <template #stackBlockContent>
8
- <div class="select">
9
- <select v-model="remoteConsoleTypeLocal" :disabled="props.disabled" id="keymap-select">
10
- <option
11
- v-for="(item, key) in keymapOptions"
12
- :key="key"
13
- :value="item.value"
14
- >
15
- {{ item.text }}
16
- </option>
17
- </select>
18
- </div>
19
- </template>
20
- </atoms-stack-block>
21
- </div>
22
- </template>
23
-
24
- <script setup lang="ts">
25
- import { keymapOptionsConfig } from '~/components/common/vm/actions/add/customizeHardware/vmoptions/remoteConsoleOptions/keymap/config/config'
26
- import { UI_I_OptionItem } from '~/components/atoms/models/interfaces'
27
- import { UI_I_Localization } from '~/models/interfaces'
28
-
29
- const localization = computed<UI_I_Localization>(() => useLocal())
30
-
31
- const props = defineProps<{
32
- keymap: string
33
- disabled: boolean
34
- }>()
35
- const emits = defineEmits<{
36
- (event: 'update:keymap', value: string): void
37
- }>()
38
-
39
- const keymapOptions = ref<UI_I_OptionItem[]>(keymapOptionsConfig)
40
-
41
- const remoteConsoleTypeLocal = computed<string>({
42
- get() {
43
- return props.keymap
44
- },
45
- set(newValue) {
46
- emits('update:keymap', newValue)
47
- },
48
- })
49
- </script>
50
-
51
- <style scoped></style>
1
+ <template>
2
+ <div class="">
3
+ <atoms-stack-block :has-children="false">
4
+ <template #stackBlockKey>
5
+ {{ localization.keymap }}
6
+ </template>
7
+ <template #stackBlockContent>
8
+ <div class="select">
9
+ <select
10
+ v-model="remoteConsoleTypeLocal"
11
+ :disabled="props.disabled"
12
+ id="keymap-select"
13
+ >
14
+ <option
15
+ v-for="(item, key) in keymapOptions"
16
+ :key="key"
17
+ :value="item.value"
18
+ >
19
+ {{ item.text }}
20
+ </option>
21
+ </select>
22
+ </div>
23
+ </template>
24
+ </atoms-stack-block>
25
+ </div>
26
+ </template>
27
+
28
+ <script setup lang="ts">
29
+ import { keymapOptionsConfig } from '~/components/common/vm/actions/add/customizeHardware/vmoptions/remoteConsoleOptions/keymap/config/config'
30
+ import { UI_I_OptionItem } from '~/components/atoms/models/interfaces'
31
+ import { UI_I_Localization } from '~/models/interfaces'
32
+
33
+ const localization = computed<UI_I_Localization>(() => useLocal())
34
+
35
+ const props = defineProps<{
36
+ keymap: string
37
+ disabled: boolean
38
+ }>()
39
+ const emits = defineEmits<{
40
+ (event: 'update:keymap', value: string): void
41
+ }>()
42
+
43
+ const keymapOptions = ref<UI_I_OptionItem[]>(keymapOptionsConfig)
44
+
45
+ const remoteConsoleTypeLocal = computed<string>({
46
+ get() {
47
+ return props.keymap
48
+ },
49
+ set(newValue) {
50
+ emits('update:keymap', newValue)
51
+ },
52
+ })
53
+ </script>
54
+
55
+ <style scoped></style>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.1.70",
4
+ "version": "1.1.72",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",