Skip to content

Commit d86d08b

Browse files
committed
fixup
1 parent aca617d commit d86d08b

2 files changed

Lines changed: 19 additions & 10 deletions

File tree

ui/src/components/view/SearchFilter.vue

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<a-tag
2929
v-if="!filter.isTag"
3030
closable
31-
@close="() => $emit('close', filter.key)"
31+
@close="() => $emit('removeFilter', filter)"
3232
>
3333
<a-tooltip
3434
:title="retrieveFieldLabel(filter.key) + ': ' + filter.value"
@@ -40,7 +40,7 @@
4040
<a-tag
4141
v-else
4242
closable
43-
@close="() => $emit('close', filter.key)"
43+
@close="() => $emit('removeFilter', filter)"
4444
>
4545
<a-tooltip
4646
:title="$t('label.tag') + ': ' + filter.key + '=' + filter.value"
@@ -55,7 +55,8 @@
5555
</template>
5656

5757
<script>
58-
import { api } from '@/api'
58+
59+
import { getAPI, postAPI } from '@/api/index'
5960
6061
export default {
6162
name: 'SearchFilter',
@@ -81,7 +82,7 @@ export default {
8182
default: () => false
8283
}
8384
},
84-
emits: ['close'],
85+
emits: ['removeFilter'],
8586
data () {
8687
return {
8788
searchFilters: [],
@@ -130,6 +131,12 @@ export default {
130131
responseKey2: 'cluster',
131132
field: 'name'
132133
},
134+
hostid: {
135+
apiName: 'listHosts',
136+
responseKey1: 'listhostsresponse',
137+
responseKey2: 'host',
138+
field: 'name'
139+
},
133140
groupid: {
134141
apiName: 'listInstanceGroups',
135142
responseKey1: 'listinstancegroupsresponse',
@@ -289,7 +296,7 @@ export default {
289296
},
290297
getHypervisor (value) {
291298
return new Promise((resolve) => {
292-
api('listHypervisors').then(json => {
299+
getAPI('listHypervisors').then(json => {
293300
if (json?.listhypervisorsresponse?.hypervisor) {
294301
for (const key in json.listhypervisorsresponse.hypervisor) {
295302
const hypervisor = json.listhypervisorsresponse.hypervisor[key]
@@ -308,7 +315,7 @@ export default {
308315
if (!this.$isValidUuid(id)) {
309316
return resolve('')
310317
}
311-
api(apiName, { listAll: true, id: id }).then(json => {
318+
postAPI(apiName, { listAll: true, id: id }).then(json => {
312319
if (json[responseKey1] && json[responseKey1][responseKey2]) {
313320
resolve(json[responseKey1][responseKey2][0][field])
314321
}
@@ -326,7 +333,7 @@ export default {
326333
},
327334
getAlertType (type) {
328335
return new Promise((resolve) => {
329-
api('listAlertTypes').then(json => {
336+
getAPI('listAlertTypes').then(json => {
330337
const alertTypes = {}
331338
for (const key in json.listalerttypesresponse.alerttype) {
332339
const alerttype = json.listalerttypesresponse.alerttype[key]
@@ -340,7 +347,7 @@ export default {
340347
},
341348
getAffinityGroupType (type) {
342349
return new Promise((resolve) => {
343-
api('listAffinityGroupTypes').then(json => {
350+
getAPI('listAffinityGroupTypes').then(json => {
344351
const alertTypes = {}
345352
for (const key in json.listaffinitygrouptypesresponse.affinityGroupType) {
346353
const affinityGroupType = json.listaffinitygrouptypesresponse.affinityGroupType[key]

ui/src/views/AutogenView.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
<search-filter
134134
:filters="getActiveFilters()"
135135
:apiName="apiName"
136-
@close="removeFilter(filter)"
136+
@removeFilter="removeFilter"
137137
/>
138138
</a-row>
139139
</a-card>
@@ -1304,7 +1304,9 @@ export default {
13041304
} else {
13051305
delete queryParams[filter.key]
13061306
}
1307-
this.onSearch(queryParams)
1307+
queryParams.page = '1'
1308+
queryParams.pagesize = String(this.pageSize)
1309+
this.$router.push({ query: queryParams })
13081310
},
13091311
onRowSelectionChange (selection) {
13101312
this.selectedRowKeys = selection

0 commit comments

Comments
 (0)