Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions ui/src/components/view/SearchView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@
<a-select
allowClear
v-if="field.type==='list'"
v-decorator="[field.name]"
v-decorator="[field.name, {
initialValue: fieldValues[field.name] || null
}]"
:loading="field.loading">
<a-select-option
v-for="(opt, idx) in field.opts"
Expand All @@ -62,7 +64,9 @@
</a-select>
<a-input
v-else-if="field.type==='input'"
v-decorator="[field.name]" />
v-decorator="[field.name, {
initialValue: fieldValues[field.name] || null
}]" />
<div v-else-if="field.type==='tag'">
<div>
<a-input-group
Expand Down Expand Up @@ -135,7 +139,8 @@ export default {
visibleFilter: false,
fields: [],
inputKey: null,
inputValue: null
inputValue: null,
fieldValues: {}
}
},
beforeCreate () {
Expand Down Expand Up @@ -275,7 +280,6 @@ export default {
}
if (clusterIndex > -1) {
const cluster = response.filter(item => item.type === 'clusterid')
console.log(cluster)
if (cluster && cluster.length > 0) {
this.fields[clusterIndex].opts = cluster[0].data
}
Expand All @@ -294,8 +298,20 @@ export default {
if (clusterIndex > -1) {
this.fields[clusterIndex].loading = false
}
this.fillFormFieldValues()
})
},
fillFormFieldValues () {
this.fieldValues = {}
if (Object.keys(this.$route.query).length > 0) {
this.fieldValues = this.$route.query
}
if (this.$route.meta.params) {
Object.assign(this.fieldValues, this.$route.meta.params)
}
this.inputKey = this.fieldValues['tags[0].key'] || null
this.inputValue = this.fieldValues['tags[0].value'] || null
},
fetchZones () {
return new Promise((resolve, reject) => {
api('listZones', { listAll: true }).then(json => {
Expand Down
1 change: 1 addition & 0 deletions ui/src/views/AutogenView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,7 @@ export default {

params.page = this.page
params.pagesize = this.pageSize
this.searchParams = params
api(this.apiName, params).then(json => {
var responseName
var objectName
Expand Down