diff --git a/ui/src/components/view/SearchView.vue b/ui/src/components/view/SearchView.vue index d7084e5989b..14a80422bef 100644 --- a/ui/src/components/view/SearchView.vue +++ b/ui/src/components/view/SearchView.vue @@ -53,7 +53,9 @@ + v-decorator="[field.name, { + initialValue: fieldValues[field.name] || null + }]" />
-1) { const cluster = response.filter(item => item.type === 'clusterid') - console.log(cluster) if (cluster && cluster.length > 0) { this.fields[clusterIndex].opts = cluster[0].data } @@ -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 => { diff --git a/ui/src/views/AutogenView.vue b/ui/src/views/AutogenView.vue index 0b8fa23e7f6..efb11763162 100644 --- a/ui/src/views/AutogenView.vue +++ b/ui/src/views/AutogenView.vue @@ -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