bfg-common 1.3.94 → 1.3.96

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.
@@ -770,7 +770,6 @@ const bodyItemsPresent = computed<UI_I_BodyItem[][]>(() => {
770
770
  if (props.serverOff) {
771
771
  // Sorting
772
772
  if (sortInfo.value[0] !== '') {
773
- console.log(items, 222, sortedColumnIndex.value, sortInfo.value[1])
774
773
  items = useDeepCopy(items).sort(
775
774
  (a: UI_I_BodyItem[], b: UI_I_BodyItem[]) => {
776
775
  let first = a[sortedColumnIndex.value].text.toString().toLowerCase()
@@ -785,16 +784,6 @@ const bodyItemsPresent = computed<UI_I_BodyItem[][]>(() => {
785
784
  second = sortValueB
786
785
  }
787
786
 
788
- console.log(
789
- first,
790
- 333,
791
- second,
792
- 333,
793
- a[sortedColumnIndex.value]?.data?.sortValue,
794
- 333,
795
- b[sortedColumnIndex.value]?.data?.sortValue
796
- )
797
-
798
787
  if (sortInfo.value[1]) {
799
788
  return first > second ? 1 : first < second ? -1 : 0
800
789
  } else {
@@ -319,7 +319,7 @@ watch(
319
319
  const model = passthroughHostCpu.value
320
320
  ? 'host-passthrough'
321
321
  : hostModelCpu.value
322
- ? 'host-models'
322
+ ? 'host-model'
323
323
  : cpuModel.value
324
324
 
325
325
  emits('send-data', {
@@ -357,7 +357,7 @@ watch(
357
357
  passthroughHostCpu.value = true
358
358
  cpuModel.value = ''
359
359
  break
360
- case 'host-models':
360
+ case 'host-model':
361
361
  hostModelCpu.value = true
362
362
  cpuModel.value = ''
363
363
  break
@@ -1,220 +1,220 @@
1
- <template>
2
- <div class="">
3
- <atoms-stack-block :has-children="false">
4
- <template #stackBlockKey>
5
- {{ localization.cpuModel }}
6
- </template>
7
- <template #stackBlockContent>
8
- <div class="flex-align-center">
9
- <atoms-tooltip-error
10
- :has-error="!!apiError"
11
- selector="#vm-wizard-cpu-model-field"
12
- @remove="onRemoveValidationError"
13
- >
14
- <template #elem>
15
- <div class="select">
16
- <select
17
- id="vm-wizard-cpu-model-field"
18
- :value="props.cpuModel"
19
- :disabled="props.disabled"
20
- @change="changeCpuModel"
21
- >
22
- <option
23
- v-for="(item, key) in cpuModelOptions"
24
- :key="key"
25
- :value="item.value"
26
- >
27
- {{ item.text }}
28
- </option>
29
- </select>
30
- </div>
31
- </template>
32
- <template #content>{{ apiError }}</template>
33
- </atoms-tooltip-error>
34
-
35
- <div class="passthrough-host-cpu-wrap flex-align-center">
36
- <input
37
- id="passthrough-host-cpu"
38
- v-model="passthroughHostCpuLocal"
39
- :disabled="props.disabled"
40
- type="checkbox"
41
- @change="changePassthroughHostCpu"
42
- />
43
- <label for="passthrough-host-cpu" class="label-text-normal">{{
44
- localization.passthroughHostCpu
45
- }}</label>
46
- <div id="passthrough-help-icon" class="flex-align-center relative">
47
- <atoms-the-icon
48
- fill="#0072a3"
49
- width="24px"
50
- height="24px"
51
- name="info-circle"
52
- class="pointer"
53
- @click.stop="isShowPassthroughHost = !isShowPassthroughHost"
54
- />
55
- <Teleport to="body">
56
- <atoms-tooltip-signpost
57
- v-if="isShowPassthroughHost"
58
- elem-id="passthrough-help-icon"
59
- @hide="isShowPassthroughHost = false"
60
- >
61
- <h3 class="passthrough-help-title">
62
- {{ localization.help }}
63
- </h3>
64
-
65
- <p class="passthrough-help-text">
66
- Lorem ipsum dolor sit amet, consectetur adipisicing elit. A
67
- cum eius expedita, fuga mollitia perferendis quod soluta
68
- vel? Dolor, illo, nam? A consequatur, consequuntur eos
69
- impedit iusto labore sunt tempora!
70
- </p>
71
- </atoms-tooltip-signpost>
72
- </Teleport>
73
- </div>
74
- </div>
75
- <div class="divider"></div>
76
- <div class="flex-align-center">
77
- <input
78
- id="host-model-cpu"
79
- v-model="hostModelCpuLocal"
80
- type="checkbox"
81
- :disabled="props.disabled"
82
- @change="changeHostModelCpu"
83
- />
84
- <label for="host-model-cpu" class="label-text-normal">{{
85
- localization.hostModelCpu
86
- }}</label>
87
- <div id="host-model-help-icon" class="flex-align-center relative">
88
- <atoms-the-icon
89
- fill="#0072a3"
90
- width="24px"
91
- height="24px"
92
- name="info-circle"
93
- class="pointer"
94
- @click.stop="isShowHostModel = !isShowHostModel"
95
- />
96
- <Teleport to="body">
97
- <atoms-tooltip-signpost
98
- v-if="isShowHostModel"
99
- elem-id="host-model-help-icon"
100
- @hide="isShowHostModel = false"
101
- >
102
- <h3 class="host-model-help-title">
103
- {{ localization.help }}
104
- </h3>
105
-
106
- <p class="host-model-help-text">
107
- Lorem ipsum dolor sit amet, consectetur adipisicing elit. A
108
- cum eius expedita, fuga mollitia perferendis quod soluta
109
- vel? Dolor, illo, nam? A consequatur, consequuntur eos
110
- impedit iusto labore sunt tempora!
111
- </p>
112
- </atoms-tooltip-signpost>
113
- </Teleport>
114
- </div>
115
- </div>
116
- </div>
117
- </template>
118
- </atoms-stack-block>
119
- </div>
120
- </template>
121
-
122
- <script setup lang="ts">
123
- import {
124
- UI_I_Localization,
125
- UI_I_HTMLSelectElement,
126
- } from '~/lib/models/interfaces'
127
- import { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
128
- import { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
129
- const localization = computed<UI_I_Localization>(() => useLocal())
130
-
131
- const props = defineProps<{
132
- cpuModel: string
133
- passthroughHostCpu: boolean
134
- hostModelCpu: boolean
135
- cpuModels: UI_I_OptionItem[]
136
- isEdit: boolean
137
- disabled: boolean
138
- errorValidationFields: UI_I_ErrorValidationField<string>[]
139
- }>()
140
- const emits = defineEmits<{
141
- (event: 'update:cpu-model', value: string): boolean
142
- (event: 'update:passthrough-host-cpu', value: boolean): boolean
143
- (event: 'update:host-model-cpu', value: boolean): boolean
144
- (event: 'remove-error-by-title', value: string): void
145
- }>()
146
-
147
- const cpuModelOptions = ref<UI_I_OptionItem[]>(props.cpuModels)
148
- watch(
149
- () => props.cpuModels,
150
- (newValue) => {
151
- cpuModelOptions.value = [...newValue]
152
- }
153
- )
154
-
155
- const passthroughHostCpuLocal = computed<boolean>({
156
- get() {
157
- return props.passthroughHostCpu
158
- },
159
- set(newValue) {
160
- emits('update:passthrough-host-cpu', newValue)
161
- },
162
- })
163
- const hostModelCpuLocal = computed<boolean>({
164
- get() {
165
- return props.hostModelCpu
166
- },
167
- set(newValue) {
168
- emits('update:host-models-cpu', newValue)
169
- },
170
- })
171
-
172
- const changeCpuModel = (event: UI_I_HTMLSelectElement): void => {
173
- emits('update:cpu-model', event.target.value)
174
- emits('update:passthrough-host-cpu', false)
175
- emits('update:host-models-cpu', false)
176
- }
177
- const changePassthroughHostCpu = (event: Event): void => {
178
- const target = event.target as HTMLInputElement
179
- emits('update:cpu-model', target.checked ? '' : props.cpuModels?.[0].value)
180
- emits('update:host-models-cpu', false)
181
- }
182
- const changeHostModelCpu = (event: Event): void => {
183
- const target = event.target as HTMLInputElement
184
- emits('update:cpu-model', target.checked ? '' : props.cpuModels?.[0].value)
185
- emits('update:passthrough-host-cpu', false)
186
- }
187
-
188
- const isShowPassthroughHost = ref<false>(false)
189
- const isShowHostModel = ref<false>(false)
190
-
191
- const typeError = 'cpu.model'
192
-
193
- const apiError = computed<string>(() => {
194
- return (
195
- props.errorValidationFields?.find((message) => message.field === typeError)
196
- ?.error_message || ''
197
- )
198
- })
199
-
200
- const onRemoveValidationError = (): void => {
201
- emits('remove-error-by-title', typeError)
202
- }
203
- </script>
204
-
205
- <style scoped lang="scss">
206
- .passthrough-host-cpu-wrap {
207
- margin-right: 8px;
208
- }
209
- #passthrough-host-cpu,
210
- #host-model-cpu {
211
- margin: 0 4px 0 0;
212
- }
213
-
214
- .divider {
215
- height: 16px;
216
- width: 1px;
217
- background-color: var(--global-border-color);
218
- margin: 0 6px 0 0;
219
- }
220
- </style>
1
+ <template>
2
+ <div class="">
3
+ <atoms-stack-block :has-children="false">
4
+ <template #stackBlockKey>
5
+ {{ localization.cpuModel }}
6
+ </template>
7
+ <template #stackBlockContent>
8
+ <div class="flex-align-center">
9
+ <atoms-tooltip-error
10
+ :has-error="!!apiError"
11
+ selector="#vm-wizard-cpu-model-field"
12
+ @remove="onRemoveValidationError"
13
+ >
14
+ <template #elem>
15
+ <div class="select">
16
+ <select
17
+ id="vm-wizard-cpu-model-field"
18
+ :value="props.cpuModel"
19
+ :disabled="props.disabled"
20
+ @change="changeCpuModel"
21
+ >
22
+ <option
23
+ v-for="(item, key) in cpuModelOptions"
24
+ :key="key"
25
+ :value="item.value"
26
+ >
27
+ {{ item.text }}
28
+ </option>
29
+ </select>
30
+ </div>
31
+ </template>
32
+ <template #content>{{ apiError }}</template>
33
+ </atoms-tooltip-error>
34
+
35
+ <div class="passthrough-host-cpu-wrap flex-align-center">
36
+ <input
37
+ id="passthrough-host-cpu"
38
+ v-model="passthroughHostCpuLocal"
39
+ :disabled="props.disabled"
40
+ type="checkbox"
41
+ @change="changePassthroughHostCpu"
42
+ />
43
+ <label for="passthrough-host-cpu" class="label-text-normal">{{
44
+ localization.passthroughHostCpu
45
+ }}</label>
46
+ <div id="passthrough-help-icon" class="flex-align-center relative">
47
+ <atoms-the-icon
48
+ fill="#0072a3"
49
+ width="24px"
50
+ height="24px"
51
+ name="info-circle"
52
+ class="pointer"
53
+ @click.stop="isShowPassthroughHost = !isShowPassthroughHost"
54
+ />
55
+ <Teleport to="body">
56
+ <atoms-tooltip-signpost
57
+ v-if="isShowPassthroughHost"
58
+ elem-id="passthrough-help-icon"
59
+ @hide="isShowPassthroughHost = false"
60
+ >
61
+ <h3 class="passthrough-help-title">
62
+ {{ localization.help }}
63
+ </h3>
64
+
65
+ <p class="passthrough-help-text">
66
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit. A
67
+ cum eius expedita, fuga mollitia perferendis quod soluta
68
+ vel? Dolor, illo, nam? A consequatur, consequuntur eos
69
+ impedit iusto labore sunt tempora!
70
+ </p>
71
+ </atoms-tooltip-signpost>
72
+ </Teleport>
73
+ </div>
74
+ </div>
75
+ <div class="divider"></div>
76
+ <div class="flex-align-center">
77
+ <input
78
+ id="host-model-cpu"
79
+ v-model="hostModelCpuLocal"
80
+ type="checkbox"
81
+ :disabled="props.disabled"
82
+ @change="changeHostModelCpu"
83
+ />
84
+ <label for="host-model-cpu" class="label-text-normal">{{
85
+ localization.hostModelCpu
86
+ }}</label>
87
+ <div id="host-model-help-icon" class="flex-align-center relative">
88
+ <atoms-the-icon
89
+ fill="#0072a3"
90
+ width="24px"
91
+ height="24px"
92
+ name="info-circle"
93
+ class="pointer"
94
+ @click.stop="isShowHostModel = !isShowHostModel"
95
+ />
96
+ <Teleport to="body">
97
+ <atoms-tooltip-signpost
98
+ v-if="isShowHostModel"
99
+ elem-id="host-model-help-icon"
100
+ @hide="isShowHostModel = false"
101
+ >
102
+ <h3 class="host-model-help-title">
103
+ {{ localization.help }}
104
+ </h3>
105
+
106
+ <p class="host-model-help-text">
107
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit. A
108
+ cum eius expedita, fuga mollitia perferendis quod soluta
109
+ vel? Dolor, illo, nam? A consequatur, consequuntur eos
110
+ impedit iusto labore sunt tempora!
111
+ </p>
112
+ </atoms-tooltip-signpost>
113
+ </Teleport>
114
+ </div>
115
+ </div>
116
+ </div>
117
+ </template>
118
+ </atoms-stack-block>
119
+ </div>
120
+ </template>
121
+
122
+ <script setup lang="ts">
123
+ import {
124
+ UI_I_Localization,
125
+ UI_I_HTMLSelectElement,
126
+ } from '~/lib/models/interfaces'
127
+ import { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
128
+ import { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
129
+ const localization = computed<UI_I_Localization>(() => useLocal())
130
+
131
+ const props = defineProps<{
132
+ cpuModel: string
133
+ passthroughHostCpu: boolean
134
+ hostModelCpu: boolean
135
+ cpuModels: UI_I_OptionItem[]
136
+ isEdit: boolean
137
+ disabled: boolean
138
+ errorValidationFields: UI_I_ErrorValidationField<string>[]
139
+ }>()
140
+ const emits = defineEmits<{
141
+ (event: 'update:cpu-model', value: string): boolean
142
+ (event: 'update:passthrough-host-cpu', value: boolean): boolean
143
+ (event: 'update:host-model-cpu', value: boolean): boolean
144
+ (event: 'remove-error-by-title', value: string): void
145
+ }>()
146
+
147
+ const cpuModelOptions = ref<UI_I_OptionItem[]>(props.cpuModels)
148
+ watch(
149
+ () => props.cpuModels,
150
+ (newValue) => {
151
+ cpuModelOptions.value = [...newValue]
152
+ }
153
+ )
154
+
155
+ const passthroughHostCpuLocal = computed<boolean>({
156
+ get() {
157
+ return props.passthroughHostCpu
158
+ },
159
+ set(newValue) {
160
+ emits('update:passthrough-host-cpu', newValue)
161
+ },
162
+ })
163
+ const hostModelCpuLocal = computed<boolean>({
164
+ get() {
165
+ return props.hostModelCpu
166
+ },
167
+ set(newValue) {
168
+ emits('update:host-model-cpu', newValue)
169
+ },
170
+ })
171
+
172
+ const changeCpuModel = (event: UI_I_HTMLSelectElement): void => {
173
+ emits('update:cpu-model', event.target.value)
174
+ emits('update:passthrough-host-cpu', false)
175
+ emits('update:host-model-cpu', false)
176
+ }
177
+ const changePassthroughHostCpu = (event: Event): void => {
178
+ const target = event.target as HTMLInputElement
179
+ emits('update:cpu-model', target.checked ? '' : props.cpuModels?.[0].value)
180
+ emits('update:host-model-cpu', false)
181
+ }
182
+ const changeHostModelCpu = (event: Event): void => {
183
+ const target = event.target as HTMLInputElement
184
+ emits('update:cpu-model', target.checked ? '' : props.cpuModels?.[0].value)
185
+ emits('update:passthrough-host-cpu', false)
186
+ }
187
+
188
+ const isShowPassthroughHost = ref<false>(false)
189
+ const isShowHostModel = ref<false>(false)
190
+
191
+ const typeError = 'cpu.model'
192
+
193
+ const apiError = computed<string>(() => {
194
+ return (
195
+ props.errorValidationFields?.find((message) => message.field === typeError)
196
+ ?.error_message || ''
197
+ )
198
+ })
199
+
200
+ const onRemoveValidationError = (): void => {
201
+ emits('remove-error-by-title', typeError)
202
+ }
203
+ </script>
204
+
205
+ <style scoped lang="scss">
206
+ .passthrough-host-cpu-wrap {
207
+ margin-right: 8px;
208
+ }
209
+ #passthrough-host-cpu,
210
+ #host-model-cpu {
211
+ margin: 0 4px 0 0;
212
+ }
213
+
214
+ .divider {
215
+ height: 16px;
216
+ width: 1px;
217
+ background-color: var(--global-border-color);
218
+ margin: 0 6px 0 0;
219
+ }
220
+ </style>
@@ -119,7 +119,7 @@ export const capabilities: UI_I_Compatibility = {
119
119
  },
120
120
  {
121
121
  text: 'Host Model',
122
- value: 'host-models',
122
+ value: 'host-model',
123
123
  },
124
124
  {
125
125
  text: 'Host Passthrough',
@@ -81,24 +81,14 @@ const bodyItems = computed<UI_I_BodyItem[][]>(() => {
81
81
  return table.bodyItems(props.datastore || [], localization.value)
82
82
  })
83
83
 
84
- // const sort = ref<string | null>(null)
85
84
  const pagination = ref<UI_I_Pagination>({
86
85
  page: 1,
87
86
  pageSize: 100,
88
87
  })
89
88
 
90
- // const sorting = (data: [string, boolean]): void => {
91
- // const [column, status] = data
92
- // const direction = status ? 'asc' : 'desc'
93
- // sort.value = `${column}.${direction}`
94
- //
95
- // getStorage()
96
- // }
97
-
98
89
  const getStorage = async (): Promise<void> => {
99
90
  const payload: UI_I_TablePayload = {
100
91
  pagination: pagination.value,
101
- // sortBy: sort.value,
102
92
  sortBy: null,
103
93
  type: 'datastore',
104
94
  schema: 'full',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.3.94",
4
+ "version": "1.3.96",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",