bfg-common 1.4.621 → 1.4.623

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.
@@ -12,7 +12,7 @@
12
12
  :versions-options="versionsOptions"
13
13
  @change-os="onChangeOS"
14
14
  />
15
- <common-vm-actions-common-customize-hardware-vmoptions-general-options-new
15
+ <common-vm-actions-common-customize-hardware-vmoptions-general-options-old
16
16
  v-else
17
17
  v-model:vm-name="vmName"
18
18
  v-model:guest-machine-type="guestMachineType"
@@ -9,7 +9,7 @@
9
9
  >
10
10
  <span>{{ localization.common.remoteConsoleOptions }}</span>
11
11
  <atoms-the-icon
12
- v-show="remoteConsoleOptionsInvalid"
12
+ v-show="props.remoteConsoleOptionsInvalid"
13
13
  width="24px"
14
14
  height="24px"
15
15
  class="is-error tooltip-trigger"
@@ -23,17 +23,17 @@
23
23
  <!-- <common-vm-actions-common-customize-hardware-vmoptions-remote-console-options-type-->
24
24
  <!-- v-models:remote-console-type="remoteConsoleType"-->
25
25
  <!-- :error-validation-fields="props.errorValidationFields"-->
26
- <!-- :disabled="isDisabled"-->
26
+ <!-- :disabled="props.isDisabled"-->
27
27
  <!-- @input="changeRemoteConsoleType"-->
28
28
  <!-- @remove-error-by-title="emits('remove-error-by-title', $event)"-->
29
29
  <!-- />-->
30
30
  <common-vm-actions-common-customize-hardware-vmoptions-remote-console-options-keymap
31
31
  v-model:keymap="keymap"
32
- :disabled="isDisabled"
32
+ :disabled="props.isDisabled"
33
33
  />
34
34
  <common-vm-actions-common-customize-hardware-vmoptions-remote-console-options-password
35
35
  v-model:password="password"
36
- :disabled="isDisabled"
36
+ :disabled="props.isDisabled"
37
37
  @valid="passwordIsValid = $event"
38
38
  />
39
39
  <!-- <common-vm-actions-common-customize-hardware-vmoptions-remote-console-options-power-control-->
@@ -49,39 +49,39 @@
49
49
  <!-- v-if="remoteConsoleType === 'spice'"-->
50
50
  <!-- v-models:img-compression="imgCompression"-->
51
51
  <!-- :error-validation-fields="props.errorValidationFields"-->
52
- <!-- :disabled="isDisabled"-->
52
+ <!-- :disabled="props.isDisabled"-->
53
53
  <!-- @remove-error-by-title="emits('remove-error-by-title', $event)"-->
54
54
  <!-- />-->
55
55
  <!-- <common-vm-actions-common-customize-hardware-vmoptions-remote-console-options-jpeg-compression-->
56
56
  <!-- v-if="remoteConsoleType === 'spice'"-->
57
57
  <!-- v-models:jpeg-compression="jpegCompression"-->
58
58
  <!-- :error-validation-fields="props.errorValidationFields"-->
59
- <!-- :disabled="isDisabled"-->
59
+ <!-- :disabled="props.isDisabled"-->
60
60
  <!-- @remove-error-by-title="emits('remove-error-by-title', $event)"-->
61
61
  <!-- />-->
62
62
  <!-- <common-vm-actions-common-customize-hardware-vmoptions-remote-console-options-zlib-compression-->
63
63
  <!-- v-if="remoteConsoleType === 'spice'"-->
64
64
  <!-- v-models:zlib-compression="zlibCompression"-->
65
65
  <!-- :error-validation-fields="props.errorValidationFields"-->
66
- <!-- :disabled="isDisabled"-->
66
+ <!-- :disabled="props.isDisabled"-->
67
67
  <!-- @remove-error-by-title="emits('remove-error-by-title', $event)"-->
68
68
  <!-- />-->
69
69
  <!-- <common-vm-actions-common-customize-hardware-vmoptions-remote-console-options-playback-compression-->
70
70
  <!-- v-if="remoteConsoleType === 'spice'"-->
71
- <!-- :disabled="isDisabled"-->
71
+ <!-- :disabled="props.isDisabled"-->
72
72
  <!-- v-models:playback-compression="playbackCompression"-->
73
73
  <!-- />-->
74
74
  <!-- <common-vm-actions-common-customize-hardware-vmoptions-remote-console-options-streaming-mode-->
75
75
  <!-- v-if="remoteConsoleType === 'spice'"-->
76
76
  <!-- v-models:streaming-mode="streamingMode"-->
77
77
  <!-- :error-validation-fields="props.errorValidationFields"-->
78
- <!-- :disabled="isDisabled"-->
78
+ <!-- :disabled="props.isDisabled"-->
79
79
  <!-- @remove-error-by-title="emits('remove-error-by-title', $event)"-->
80
80
  <!-- />-->
81
81
  <common-vm-actions-common-customize-hardware-vmoptions-remote-console-options-copy-paste
82
82
  v-if="remoteConsoleType === 'spice'"
83
83
  v-model:copy-paste="copyPaste"
84
- :disabled="isDisabled"
84
+ :disabled="props.isDisabled"
85
85
  />
86
86
  <!-- TODO возможно вернем, НЕ УДАЛЯТЬ-->
87
87
  <!-- <common-vm-actions-common-customize-hardware-vmoptions-remote-console-options-mouse-mode-->
@@ -91,17 +91,17 @@
91
91
  <common-vm-actions-common-customize-hardware-vmoptions-remote-console-options-file-transfer
92
92
  v-if="remoteConsoleType === 'spice'"
93
93
  v-model:file-transfer="fileTransfer"
94
- :disabled="isDisabled"
94
+ :disabled="props.isDisabled"
95
95
  />
96
96
  <common-vm-actions-common-customize-hardware-vmoptions-remote-console-options-usb-redirection
97
97
  v-if="remoteConsoleType === 'spice'"
98
98
  v-model:usb-redirection="usbRedirection"
99
- :disabled="isDisabled"
99
+ :disabled="props.isDisabled"
100
100
  />
101
101
  <common-vm-actions-common-customize-hardware-vmoptions-remote-console-options-folder-sharing
102
102
  v-if="remoteConsoleType === 'spice'"
103
103
  v-model:folder-sharing="folderSharing"
104
- :disabled="isDisabled"
104
+ :disabled="props.isDisabled"
105
105
  />
106
106
  </template>
107
107
  </atoms-stack-block>
@@ -109,146 +109,31 @@
109
109
  </template>
110
110
 
111
111
  <script setup lang="ts">
112
- import type { UI_I_SendDataRemoteConsoleOptions } from '~/components/common/vm/actions/common/customizeHardware/vmoptions/lib/models/interfaces'
113
112
  import type { UI_I_Localization } from '~/lib/models/interfaces'
114
- // import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
113
+
114
+ const keymap = defineModel<string>('keymap', { required: true })
115
+ const password = defineModel<string>('password', { required: true })
116
+ const passwordIsValid = defineModel<boolean>('passwordIsValid', {
117
+ required: true,
118
+ })
119
+ const remoteConsoleType = defineModel<string>('remoteConsoleType', {
120
+ required: true,
121
+ })
122
+ const copyPaste = defineModel<boolean>('copyPaste', { required: true })
123
+ const fileTransfer = defineModel<boolean>('fileTransfer', { required: true })
124
+ const usbRedirection = defineModel<number>('usbRedirection', {
125
+ required: true,
126
+ })
127
+ const folderSharing = defineModel<boolean>('folderSharing', { required: true })
115
128
 
116
129
  const props = defineProps<{
117
- remoteConsoleOptions?: UI_I_SendDataRemoteConsoleOptions
118
130
  // TODO возможно вернем, НЕ УДАЛЯТЬ
119
131
  // errorValidationFields: UI_I_ErrorValidationField<string>[]
120
- isEdit: boolean
121
- state?: string | number
122
- }>()
123
- const emits = defineEmits<{
124
- (event: 'send-data', value: UI_I_SendDataRemoteConsoleOptions): void
125
- (event: 'invalid', value: boolean): void
126
- // TODO возможно вернем, НЕ УДАЛЯТЬ
127
- // (event: 'remove-error-by-title', value: string): void
132
+ remoteConsoleOptionsInvalid: boolean
133
+ isDisabled: boolean
128
134
  }>()
129
135
 
130
136
  const localization = computed<UI_I_Localization>(() => useLocal())
131
-
132
- const isDisabled = computed<boolean>(() => props.isEdit && props.state !== 1)
133
-
134
- const remoteConsoleType = ref<string>('spice')
135
- // TODO возможно вернем, НЕ УДАЛЯТЬ
136
- // const changeRemoteConsoleType = (): void => {
137
- // // powerControl.value = false
138
- // // sharePolicy.value = 'allow-exclusive'
139
- // imgCompression.value = 'auto_glz'
140
- // jpegCompression.value = 'auto'
141
- // zlibCompression.value = 'auto'
142
- // playbackCompression.value = true
143
- // streamingMode.value = 'all'
144
- // copyPaste.value = true
145
- // mouseMode.value = 'client'
146
- // fileTransfer.value = true
147
- // usbRedirection.value = 3
148
- // folderSharing.value = true
149
- // }
150
-
151
- const keymap = ref<string>('en_US')
152
-
153
- const password = ref<string>('')
154
- const passwordIsValid = ref<boolean>(true)
155
-
156
- // const powerControl = ref<boolean>(false)
157
-
158
- // const sharePolicy = ref<string>('allow-exclusive')
159
-
160
- const imgCompression = ref<string>('auto_glz')
161
-
162
- const jpegCompression = ref<string>('auto')
163
-
164
- const zlibCompression = ref<string>('auto')
165
-
166
- const playbackCompression = ref<boolean>(true)
167
-
168
- const streamingMode = ref<string>('all')
169
-
170
- const copyPaste = ref<boolean>(true)
171
-
172
- const mouseMode = ref<string>('client')
173
-
174
- const fileTransfer = ref<boolean>(true)
175
-
176
- const usbRedirection = ref<number>(3)
177
-
178
- const folderSharing = ref<boolean>(true)
179
-
180
- watch(
181
- [
182
- remoteConsoleType,
183
- keymap,
184
- password,
185
- // powerControl,
186
- // sharePolicy,
187
- imgCompression,
188
- jpegCompression,
189
- zlibCompression,
190
- playbackCompression,
191
- streamingMode,
192
- copyPaste,
193
- mouseMode,
194
- fileTransfer,
195
- usbRedirection,
196
- folderSharing,
197
- ],
198
- () => {
199
- emits('send-data', {
200
- type: remoteConsoleType.value,
201
- port: 0,
202
- keymap: keymap.value,
203
- password: password.value,
204
- guest_os_lock: false,
205
- limit_sessions: 0,
206
- spice: {
207
- img_compression: imgCompression.value,
208
- jpeg_compression: jpegCompression.value,
209
- zlib_glz_compression: zlibCompression.value,
210
- streaming_mode: streamingMode.value,
211
- playback_compression: playbackCompression.value,
212
- file_transfer: fileTransfer.value,
213
- clipboard: copyPaste.value,
214
- },
215
- })
216
- },
217
- { immediate: true }
218
- )
219
-
220
- // Добавляем данные для редактирования
221
- watch(
222
- () => props.remoteConsoleOptions,
223
- (newValue) => {
224
- if (!newValue || !props.remoteConsoleOptions) return
225
-
226
- remoteConsoleType.value = props.remoteConsoleOptions.type
227
- keymap.value = props.remoteConsoleOptions.keymap
228
- password.value = props.remoteConsoleOptions.password
229
- imgCompression.value = props.remoteConsoleOptions.spice.img_compression
230
- jpegCompression.value = props.remoteConsoleOptions.spice.jpeg_compression
231
- zlibCompression.value =
232
- props.remoteConsoleOptions.spice.zlib_glz_compression
233
- streamingMode.value = props.remoteConsoleOptions.spice.streaming_mode
234
- playbackCompression.value =
235
- props.remoteConsoleOptions.spice.playback_compression
236
- fileTransfer.value = props.remoteConsoleOptions.spice.file_transfer
237
- copyPaste.value = props.remoteConsoleOptions.spice.clipboard
238
- },
239
- { immediate: true }
240
- )
241
-
242
- const remoteConsoleOptionsInvalid = computed<boolean>(
243
- () => !passwordIsValid.value
244
- )
245
- watch(
246
- remoteConsoleOptionsInvalid,
247
- (newValue) => {
248
- emits('invalid', newValue)
249
- },
250
- { immediate: true }
251
- )
252
137
  </script>
253
138
 
254
139
  <style scoped lang="scss"></style>
@@ -1,101 +1,103 @@
1
- <template>
2
- <common-vm-actions-common-customize-hardware-vmoptions-remote-console-options-password-new
3
- v-if="isNewView"
4
- v-model:is-enabled-password="isEnabledPassword"
5
- v-model:form="form"
6
- :disabled="props.disabled"
7
- :error-text="passwordErrorText"
8
- @set-password-disable="setPasswordDisable"
9
- @change-password="changePassword"
10
- @generate-password="onGeneratePassword"
11
- />
12
- <common-vm-actions-common-customize-hardware-vmoptions-remote-console-options-password-old
13
- v-else
14
- v-model:is-enabled-password="isEnabledPassword"
15
- v-model:form="form"
16
- :disabled="props.disabled"
17
- :error-text="passwordErrorText"
18
- @set-password-disable="setPasswordDisable"
19
- @change-password="changePassword"
20
- @generate-password="onGeneratePassword"
21
- />
22
- </template>
23
-
24
- <script setup lang="ts">
25
- import type { UI_I_DefaultForm } from '~/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/lib/models/interfaces'
26
- import type {
27
- UI_I_Localization,
28
- UI_I_HTMLSelectElement,
29
- } from '~/lib/models/interfaces'
30
- import { generatePassword } from '~/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/lib/utils'
31
-
32
- const password = defineModel<string>('password', {required: true})
33
-
34
- const props = defineProps<{
35
- disabled: boolean
36
- }>()
37
- const emits = defineEmits<{
38
- (event: 'valid', value: boolean): void
39
- }>()
40
-
41
- const { $store, $validation }: any = useNuxtApp()
42
- const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
43
-
44
- const localization = computed<UI_I_Localization>(() => useLocal())
45
-
46
- const validation = $validation.call({})
47
- const defaultForm: UI_I_DefaultForm = {
48
- password: {
49
- value: password.value,
50
- validations: [
51
- { value: 'password', errorText: localization.value.common.changePasswordError },
52
- ],
53
- },
54
- }
55
- const form = ref<UI_I_DefaultForm>(useDeepCopy(defaultForm))
56
- const setForm = (): void => {
57
- form.value = useDeepCopy(defaultForm)
58
- validation.setForm(form)
59
- }
60
- setForm()
61
-
62
- const showValidationErrors = (): void => {
63
- const valid = validation.touch()
64
- passwordErrorText.value = !valid.isValid ? valid.errors.password[0] : ''
65
- emits('valid', valid.isValid)
66
- }
67
- const removeValidationErrors = (): void => {
68
- passwordErrorText.value = ''
69
- emits('valid', true)
70
- }
71
-
72
- const setPasswordDisable = (): void => {
73
- if (isEnabledPassword.value) {
74
- return
75
- }
76
-
77
- removeValidationErrors()
78
- setForm()
79
- password.value = ''
80
- }
81
-
82
- const passwordErrorText = ref<string>('')
83
-
84
- const changePassword = (event: UI_I_HTMLSelectElement): void => {
85
- showValidationErrors()
86
-
87
- password.value = event.target.value
88
- }
89
-
90
- const isEnabledPassword = ref<boolean>(false)
91
-
92
- const onGeneratePassword = (): void => {
93
- const generatedPassword = generatePassword()
94
-
95
- form.value.password.value = generatedPassword
96
- password.value = generatedPassword
97
- }
98
- </script>
99
-
100
- <style scoped>
101
- </style>
1
+ <template>
2
+ <common-vm-actions-common-customize-hardware-vmoptions-remote-console-options-password-new
3
+ v-if="isNewView"
4
+ v-model:is-enabled-password="isEnabledPassword"
5
+ v-model:form="form"
6
+ :disabled="props.disabled"
7
+ :error-text="passwordErrorText"
8
+ @set-password-disable="setPasswordDisable"
9
+ @change-password="changePassword"
10
+ @generate-password="onGeneratePassword"
11
+ />
12
+ <common-vm-actions-common-customize-hardware-vmoptions-remote-console-options-password-old
13
+ v-else
14
+ v-model:is-enabled-password="isEnabledPassword"
15
+ v-model:form="form"
16
+ :disabled="props.disabled"
17
+ :error-text="passwordErrorText"
18
+ @set-password-disable="setPasswordDisable"
19
+ @change-password="changePassword"
20
+ @generate-password="onGeneratePassword"
21
+ />
22
+ </template>
23
+
24
+ <script setup lang="ts">
25
+ import type { UI_I_DefaultForm } from '~/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/lib/models/interfaces'
26
+ import type {
27
+ UI_I_Localization,
28
+ UI_I_HTMLSelectElement,
29
+ } from '~/lib/models/interfaces'
30
+ import { generatePassword } from '~/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/lib/utils'
31
+
32
+ const password = defineModel<string>('password', { required: true })
33
+
34
+ const props = defineProps<{
35
+ disabled: boolean
36
+ }>()
37
+ const emits = defineEmits<{
38
+ (event: 'valid', value: boolean): void
39
+ }>()
40
+
41
+ const { $store, $validation }: any = useNuxtApp()
42
+ const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
43
+
44
+ const localization = computed<UI_I_Localization>(() => useLocal())
45
+
46
+ const validation = $validation.call({})
47
+ const defaultForm: UI_I_DefaultForm = {
48
+ password: {
49
+ value: password.value,
50
+ validations: [
51
+ {
52
+ value: 'password',
53
+ errorText: localization.value.common.changePasswordError,
54
+ },
55
+ ],
56
+ },
57
+ }
58
+ const form = ref<UI_I_DefaultForm>(useDeepCopy(defaultForm))
59
+ const setForm = (): void => {
60
+ form.value = useDeepCopy(defaultForm)
61
+ validation.setForm(form)
62
+ }
63
+ setForm()
64
+
65
+ const showValidationErrors = (): void => {
66
+ const valid = validation.touch()
67
+ passwordErrorText.value = !valid.isValid ? valid.errors.password[0] : ''
68
+ emits('valid', valid.isValid)
69
+ }
70
+ const removeValidationErrors = (): void => {
71
+ passwordErrorText.value = ''
72
+ emits('valid', true)
73
+ }
74
+
75
+ const setPasswordDisable = (): void => {
76
+ if (isEnabledPassword.value) {
77
+ return
78
+ }
79
+
80
+ removeValidationErrors()
81
+ setForm()
82
+ password.value = ''
83
+ }
84
+
85
+ const passwordErrorText = ref<string>('')
86
+
87
+ const changePassword = (value: string): void => {
88
+ showValidationErrors()
89
+
90
+ password.value = value
91
+ }
92
+
93
+ const isEnabledPassword = ref<boolean>(!!password.value)
94
+
95
+ const onGeneratePassword = (): void => {
96
+ const generatedPassword = generatePassword()
97
+
98
+ form.value.password.value = generatedPassword
99
+ password.value = generatedPassword
100
+ }
101
+ </script>
102
+
103
+ <style scoped></style>
@@ -23,7 +23,7 @@
23
23
  :class="[{ 'has-error': !!props.errorText }]"
24
24
  :disabled="!isEnabledPassword || props.disabled"
25
25
  :error-text="props.errorText"
26
- @change="emits('change-password')"
26
+ @change="onChangePassword"
27
27
  >
28
28
  <template #icon>
29
29
  <div class="pointer" @click="onCopyToClipboard">
@@ -54,9 +54,7 @@
54
54
 
55
55
  <script setup lang="ts">
56
56
  import type { UI_I_DefaultForm } from '~/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/lib/models/interfaces'
57
- import type {
58
- UI_I_Localization,
59
- } from '~/lib/models/interfaces'
57
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
60
58
 
61
59
  const isEnabledPassword = defineModel<boolean>('isEnabledPassword', {
62
60
  required: true,
@@ -69,12 +67,16 @@ const props = defineProps<{
69
67
  }>()
70
68
  const emits = defineEmits<{
71
69
  (event: 'set-password-disable'): void
72
- (event: 'change-password'): void
70
+ (event: 'change-password', value: string): void
73
71
  (event: 'generate-password'): void
74
72
  }>()
75
73
 
76
74
  const localization = computed<UI_I_Localization>(() => useLocal())
77
75
 
76
+ const onChangePassword = (): void => {
77
+ emits('change-password', form.value.password.value)
78
+ }
79
+
78
80
  const onCopyToClipboard = (): void => {
79
81
  navigator.clipboard.writeText(form.value.password.value)
80
82
  }
@@ -1,92 +1,94 @@
1
- <template>
2
- <div class="">
3
- <atoms-stack-block :has-children="false">
4
- <template #stackBlockKey>
5
- {{ localization.auth.password }}
6
- </template>
7
- <template #stackBlockContent>
8
- <div class="flex-align-center">
9
- <input
10
- id="enable-password"
11
- v-model="isEnabledPassword"
12
- data-id="enable-password-input"
13
- :disabled="props.disabled"
14
- type="checkbox"
15
- @change="emits('set-password-disable')"
16
- />
17
- <label for="enable-password" class="label-text-normal mr-1">{{
18
- localization.common.enable
19
- }}</label>
20
-
21
- <atoms-tooltip-error :has-error="!!props.errorText">
22
- <template #elem>
23
- <input
24
- id="password-input"
25
- v-model="form.password.value"
26
- data-id="password-input"
27
- type="text"
28
- :class="[{ 'has-error': !!props.errorText }]"
29
- :disabled="!isEnabledPassword || props.disabled"
30
- @input="emits('change-password')"
31
- />
32
- </template>
33
- <template #content>
34
- {{ props.errorText }}
35
- </template>
36
- </atoms-tooltip-error>
37
-
38
- <button
39
- id="generate-password-button"
40
- data-id="generate-password-button"
41
- class="generate-password-btn btn btn-primary"
42
- :disabled="!isEnabledPassword || props.disabled"
43
- :title="localization.common.generatePassword"
44
- @click="emits('generate-password')"
45
- >
46
- <atoms-the-icon name="lock" width="16px" height="16px" />
47
- </button>
48
- </div>
49
- </template>
50
- </atoms-stack-block>
51
- </div>
52
- </template>
53
-
54
- <script setup lang="ts">
55
- import type {
56
- UI_I_Localization,
57
- } from '~/lib/models/interfaces'
58
-
59
- const isEnabledPassword = defineModel<boolean>('isEnabledPassword', {required: true})
60
- const form = defineModel<any>('form', {required: true})
61
-
62
- const props = defineProps<{
63
- password: string
64
- disabled: boolean
65
- errorText: string
66
- }>()
67
- const emits = defineEmits<{
68
- (event: 'update:password', value: string): void
69
- (event: 'valid', value: boolean): void
70
- (event: 'set-password-disable'): void
71
- (event: 'change-password'): void
72
- (event: 'generate-password'): void
73
- }>()
74
-
75
- const localization = computed<UI_I_Localization>(() => useLocal())
76
- </script>
77
-
78
- <style scoped>
79
- #enable-password {
80
- margin: 4px 4px 0 0;
81
- }
82
- .has-error {
83
- border: 1px solid #db2100;
84
- }
85
- .generate-password-btn {
86
- min-width: unset;
87
- margin: 0;
88
- padding: 3px;
89
- height: unset;
90
- display: flex;
91
- }
92
- </style>
1
+ <template>
2
+ <div class="">
3
+ <atoms-stack-block :has-children="false">
4
+ <template #stackBlockKey>
5
+ {{ localization.auth.password }}
6
+ </template>
7
+ <template #stackBlockContent>
8
+ <div class="flex-align-center">
9
+ <input
10
+ id="enable-password"
11
+ v-model="isEnabledPassword"
12
+ data-id="enable-password-input"
13
+ :disabled="props.disabled"
14
+ type="checkbox"
15
+ @change="emits('set-password-disable')"
16
+ />
17
+ <label for="enable-password" class="label-text-normal mr-1">{{
18
+ localization.common.enable
19
+ }}</label>
20
+
21
+ <atoms-tooltip-error :has-error="!!props.errorText">
22
+ <template #elem>
23
+ <input
24
+ id="password-input"
25
+ v-model="form.password.value"
26
+ data-id="password-input"
27
+ type="text"
28
+ :class="[{ 'has-error': !!props.errorText }]"
29
+ :disabled="!isEnabledPassword || props.disabled"
30
+ @input="onChangePassword"
31
+ />
32
+ </template>
33
+ <template #content>
34
+ {{ props.errorText }}
35
+ </template>
36
+ </atoms-tooltip-error>
37
+
38
+ <button
39
+ id="generate-password-button"
40
+ data-id="generate-password-button"
41
+ class="generate-password-btn btn btn-primary"
42
+ :disabled="!isEnabledPassword || props.disabled"
43
+ :title="localization.common.generatePassword"
44
+ @click="emits('generate-password')"
45
+ >
46
+ <atoms-the-icon name="lock" width="16px" height="16px" />
47
+ </button>
48
+ </div>
49
+ </template>
50
+ </atoms-stack-block>
51
+ </div>
52
+ </template>
53
+
54
+ <script setup lang="ts">
55
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
56
+ import type { UI_I_DefaultForm } from '~/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/lib/models/interfaces'
57
+
58
+ const isEnabledPassword = defineModel<boolean>('isEnabledPassword', {
59
+ required: true,
60
+ })
61
+ const form = defineModel<UI_I_DefaultForm>('form', { required: true })
62
+
63
+ const props = defineProps<{
64
+ disabled: boolean
65
+ errorText: string
66
+ }>()
67
+ const emits = defineEmits<{
68
+ (event: 'set-password-disable'): void
69
+ (event: 'change-password', value: string): void
70
+ (event: 'generate-password'): void
71
+ }>()
72
+
73
+ const localization = computed<UI_I_Localization>(() => useLocal())
74
+
75
+ const onChangePassword = (): void => {
76
+ emits('change-password', form.value.password.value)
77
+ }
78
+ </script>
79
+
80
+ <style scoped>
81
+ #enable-password {
82
+ margin: 4px 4px 0 0;
83
+ }
84
+ .has-error {
85
+ border: 1px solid #db2100;
86
+ }
87
+ .generate-password-btn {
88
+ min-width: unset;
89
+ margin: 0;
90
+ padding: 3px;
91
+ height: unset;
92
+ display: flex;
93
+ }
94
+ </style>
@@ -1,28 +1,28 @@
1
- <template>
2
- <common-vm-actions-common-customize-hardware-vmoptions-remote-console-options-usb-redirection-new
3
- v-if="isNewView"
4
- v-model:usb-redirection="usbRedirection"
5
- :usb-redirection-options="usbRedirectionOptions"
6
- />
7
- <common-vm-actions-common-customize-hardware-vmoptions-remote-console-options-usb-redirection-old
8
- v-else
9
- v-model:usb-redirection="usbRedirection"
10
- :usb-redirection-options="usbRedirectionOptions"
11
- />
12
- </template>
13
-
14
- <script setup lang="ts">
15
- import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
16
- import { usbRedirectionOptionsConfig } from '~/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/lib/config/config'
17
-
18
- const usbRedirection = defineModel<number>('usbRedirection', {required: true})
19
-
20
- const { $store }: any = useNuxtApp()
21
- const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
22
-
23
- const usbRedirectionOptions = ref<UI_I_OptionItem[]>(
24
- usbRedirectionOptionsConfig
25
- )
26
- </script>
27
-
28
- <style scoped></style>
1
+ <template>
2
+ <common-vm-actions-common-customize-hardware-vmoptions-remote-console-options-usb-redirection-new
3
+ v-if="isNewView"
4
+ v-model:usb-redirection="usbRedirection"
5
+ :usb-redirection-options="usbRedirectionOptions"
6
+ />
7
+ <common-vm-actions-common-customize-hardware-vmoptions-remote-console-options-usb-redirection-old
8
+ v-else
9
+ v-model:usb-redirection="usbRedirection"
10
+ :usb-redirection-options="usbRedirectionOptions"
11
+ />
12
+ </template>
13
+
14
+ <script setup lang="ts">
15
+ import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
16
+ import { usbRedirectionOptionsConfig } from '~/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/lib/config/config'
17
+
18
+ const usbRedirection = defineModel<number>('usbRedirection', { required: true })
19
+
20
+ const { $store }: any = useNuxtApp()
21
+ const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
22
+
23
+ const usbRedirectionOptions = ref<UI_I_OptionItem[]>(
24
+ usbRedirectionOptionsConfig
25
+ )
26
+ </script>
27
+
28
+ <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.4.621",
4
+ "version": "1.4.623",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",