bfg-common 1.3.93 → 1.3.95

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.
@@ -3,6 +3,12 @@ export interface UI_I_BodyItem {
3
3
  text: string | number
4
4
  id: number | string
5
5
  selected?: boolean
6
+ /*
7
+ Для сортировки нужно вот так отправить
8
+ data: {
9
+ sortValue: ...
10
+ }
11
+ */
6
12
  data?: any
7
13
  dataId?: string
8
14
  disabled?: boolean
@@ -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>
@@ -19,7 +19,6 @@
19
19
  :total-pages="1"
20
20
  server-off
21
21
  hide-page-size
22
- @sorting="sorting"
23
22
  @change="changeStorage"
24
23
  >
25
24
  <template #icon="{ item }">
@@ -82,24 +81,15 @@ const bodyItems = computed<UI_I_BodyItem[][]>(() => {
82
81
  return table.bodyItems(props.datastore || [], localization.value)
83
82
  })
84
83
 
85
- const sort = ref<string | null>(null)
86
84
  const pagination = ref<UI_I_Pagination>({
87
85
  page: 1,
88
86
  pageSize: 100,
89
87
  })
90
88
 
91
- const sorting = (data: [string, boolean]): void => {
92
- const [column, status] = data
93
- const direction = status ? 'asc' : 'desc'
94
- sort.value = `${column}.${direction}`
95
-
96
- getStorage()
97
- }
98
-
99
89
  const getStorage = async (): Promise<void> => {
100
90
  const payload: UI_I_TablePayload = {
101
91
  pagination: pagination.value,
102
- sortBy: sort.value,
92
+ sortBy: null,
103
93
  type: 'datastore',
104
94
  schema: 'full',
105
95
  }