Skip to content
Permalink
Browse files
service governance service scope spilt service name (#777)
  • Loading branch information
haoyann committed Jun 30, 2021
1 parent dd0fd7a commit 063dde309dcbf0318615dde1b963c17d8db80056
Show file tree
Hide file tree
Showing 5 changed files with 268 additions and 125 deletions.
@@ -26,19 +26,22 @@
<v-card-text>
<v-form>
<v-layout row wrap>
<v-combobox
id="serviceSearch"
v-model="filter"
:loading="searchLoading"
:items="typeAhead"
:search-input.sync="input"
@keyup.enter="submit"
flat
append-icon=""
hide-no-data
:suffix="queryBy"
:label="$t('searchAccessRule')"
></v-combobox>
` <v-flex>
<v-combobox
id="serviceSearch"
v-model="filter"
:loading="searchLoading"
:items="typeAhead"
:search-input.sync="input"
@keyup.enter="submit"
flat
append-icon=""
hide-no-data
:suffix="queryBy"
:label="$t('searchAccessRule')"
@input="split($event)"
></v-combobox>
</v-flex>
<v-menu class="hidden-xs-only">
<v-btn slot="activator" large icon>
<v-icon>unfold_more</v-icon>
@@ -53,18 +56,21 @@
</v-list-tile>
</v-list>
</v-menu>
<v-text-field
v-show="selected === 0"
label="Version"
:hint="$t('dataIdVersionHint')"
v-model="serviceVersion4Search"
></v-text-field>
<v-text-field
v-show="selected === 0"
label="Group"
:hint="$t('dataIdGroupHint')"
v-model="serviceGroup4Search"
></v-text-field>
<v-flex xs6 sm3 md2 v-show="selected === 0">
<v-text-field
label="Version"
:hint="$t('dataIdVersionHint')"
v-model="serviceVersion4Search"
></v-text-field>
</v-flex>
<v-flex xs6 sm3 md2 v-show="selected === 0">
<v-text-field
v-show="selected === 0"
label="Group"
:hint="$t('dataIdGroupHint')"
v-model="serviceGroup4Search"
></v-text-field>
</v-flex>
<v-btn @click="submit" color="primary" large>{{$t('search')}}</v-btn>

</v-layout>
@@ -382,6 +388,28 @@ export default {
this.filter = document.querySelector('#serviceSearch').value.trim()
this.search(true)
},
split: function (service) {
if (this.selected === 0) {
const groupSplit = service.split('/')
const versionSplit = service.split(':')
if (groupSplit.length > 1) {
this.serviceGroup4Search = groupSplit[0]
} else {
this.serviceGroup4Search = ''
}
if (versionSplit.length > 1) {
this.serviceVersion4Search = versionSplit[1]
} else {
this.serviceVersion4Search = ''
}
const serviceSplit = versionSplit[0].split('/')
if (serviceSplit.length === 1) {
this.filter = serviceSplit[0]
} else {
this.filter = serviceSplit[1]
}
}
},
search (rewrite) {
if (!this.filter) {
this.$notify.error('Either service or application is needed')
@@ -26,19 +26,22 @@
<v-card-text>
<v-form>
<v-layout row wrap>
<v-combobox
id="serviceSearch"
:loading="searchLoading"
:items="typeAhead"
:search-input.sync="input"
@keyup.enter="submit"
v-model="filter"
flat
append-icon=""
hide-no-data
:suffix="queryBy"
:label="$t('searchBalanceRule')"
></v-combobox>
<v-flex>
<v-combobox
id="serviceSearch"
:loading="searchLoading"
:items="typeAhead"
:search-input.sync="input"
@keyup.enter="submit"
v-model="filter"
flat
append-icon=""
hide-no-data
:suffix="queryBy"
:label="$t('searchBalanceRule')"
@input="split($event)"
></v-combobox>
</v-flex>
<v-menu class="hidden-xs-only">
<v-btn slot="activator" large icon>
<v-icon>unfold_more</v-icon>
@@ -53,18 +56,22 @@
</v-list-tile>
</v-list>
</v-menu>
<v-text-field
v-show="selected === 0"
label="Version"
:hint="$t('dataIdVersionHint')"
v-model="serviceVersion4Search"
></v-text-field>
<v-text-field
v-show="selected === 0"
label="Group"
:hint="$t('dataIdGroupHint')"
v-model="serviceGroup4Search"
></v-text-field>
<v-flex xs6 sm3 md2 v-show="selected === 0">
<v-text-field
v-show="selected === 0"
label="Version"
:hint="$t('dataIdVersionHint')"
v-model="serviceVersion4Search"
></v-text-field>
</v-flex>
<v-flex xs6 sm3 md2 v-show="selected === 0">
<v-text-field
v-show="selected === 0"
label="Group"
:hint="$t('dataIdGroupHint')"
v-model="serviceGroup4Search"
></v-text-field>
</v-flex>
<v-btn @click="submit" color="primary" large>{{$t('search')}}</v-btn>

</v-layout>
@@ -354,6 +361,28 @@
this.filter = document.querySelector('#serviceSearch').value.trim()
this.search(true)
},
split: function (service) {
if (this.selected === 0) {
const groupSplit = service.split('/')
const versionSplit = service.split(':')
if (groupSplit.length > 1) {
this.serviceGroup4Search = groupSplit[0]
} else {
this.serviceGroup4Search = ''
}
if (versionSplit.length > 1) {
this.serviceVersion4Search = versionSplit[1]
} else {
this.serviceVersion4Search = ''
}
const serviceSplit = versionSplit[0].split('/')
if (serviceSplit.length === 1) {
this.filter = serviceSplit[0]
} else {
this.filter = serviceSplit[1]
}
}
},
search: function (rewrite) {
if (!this.filter) {
this.$notify.error('Either service or application is needed')
@@ -26,19 +26,22 @@
<v-card-text>
<v-form>
<v-layout row wrap>
<v-combobox
id="serviceSearch"
v-model="filter"
:loading="searchLoading"
:items="typeAhead"
:search-input.sync="input"
@keyup.enter="submit"
flat
append-icon=""
hide-no-data
:suffix="queryBy"
:label="$t('searchDynamicConfig')"
></v-combobox>
<v-flex>
<v-combobox
id="serviceSearch"
v-model="filter"
:loading="searchLoading"
:items="typeAhead"
:search-input.sync="input"
@keyup.enter="submit"
flat
append-icon=""
hide-no-data
:suffix="queryBy"
:label="$t('searchDynamicConfig')"
@input="split($event)"
></v-combobox>
</v-flex>
<v-menu class="hidden-xs-only">
<v-btn slot="activator" large icon>
<v-icon>unfold_more</v-icon>
@@ -53,18 +56,20 @@
</v-list-tile>
</v-list>
</v-menu>
<v-text-field
v-show="selected === 0"
label="Version"
:hint="$t('dataIdVersionHint')"
v-model="serviceVersion4Search"
></v-text-field>
<v-text-field
v-show="selected === 0"
label="Group"
:hint="$t('dataIdGroupHint')"
v-model="serviceGroup4Search"
></v-text-field>
<v-flex xs6 sm3 md2 v-show="selected === 0">
<v-text-field
label="Version"
:hint="$t('dataIdVersionHint')"
v-model="serviceVersion4Search"
></v-text-field>
</v-flex>
<v-flex xs6 sm3 md2 v-show="selected === 0">
<v-text-field
label="Group"
:hint="$t('dataIdGroupHint')"
v-model="serviceGroup4Search"
></v-text-field>
</v-flex>
<v-btn @click="submit" color="primary" large>{{$t('search')}}</v-btn>

</v-layout>
@@ -310,6 +315,28 @@
this.filter = document.querySelector('#serviceSearch').value.trim()
this.search(true)
},
split: function (service) {
if (this.selected === 0) {
const groupSplit = service.split('/')
const versionSplit = service.split(':')
if (groupSplit.length > 1) {
this.serviceGroup4Search = groupSplit[0]
} else {
this.serviceGroup4Search = ''
}
if (versionSplit.length > 1) {
this.serviceVersion4Search = versionSplit[1]
} else {
this.serviceVersion4Search = ''
}
const serviceSplit = versionSplit[0].split('/')
if (serviceSplit.length === 1) {
this.filter = serviceSplit[0]
} else {
this.filter = serviceSplit[1]
}
}
},
search: function (rewrite) {
if (!this.filter) {
this.$notify.error('Either service or application is needed')
@@ -26,19 +26,22 @@
<v-card-text>
<v-form>
<v-layout row wrap>
<v-combobox
id="serviceSearch"
v-model="filter"
:loading="searchLoading"
:items="typeAhead"
:search-input.sync="input"
@keyup.enter="submit"
flat
append-icon=""
hide-no-data
:suffix="queryBy"
:label="$t('searchRoutingRule')"
></v-combobox>
<v-flex>
<v-combobox
id="serviceSearch"
v-model="filter"
:loading="searchLoading"
:items="typeAhead"
:search-input.sync="input"
@keyup.enter="submit"
flat
append-icon=""
hide-no-data
:suffix="queryBy"
:label="$t('searchRoutingRule')"
@input="split($event)"
></v-combobox>
</v-flex>
<v-menu class="hidden-xs-only">
<v-btn slot="activator" large icon>
<v-icon>unfold_more</v-icon>
@@ -53,18 +56,21 @@
</v-list-tile>
</v-list>
</v-menu>
<v-text-field
v-show="selected === 0"
label="Version"
:hint="$t('dataIdVersionHint')"
v-model="serviceVersion4Search"
></v-text-field>
<v-text-field
v-show="selected === 0"
label="Group"
:hint="$t('dataIdGroupHint')"
v-model="serviceGroup4Search"
></v-text-field>
<v-flex xs6 sm3 md2 v-show="selected === 0">
<v-text-field
v-show="selected === 0"
label="Version"
:hint="$t('dataIdVersionHint')"
v-model="serviceVersion4Search"
></v-text-field>
</v-flex>
<v-flex xs6 sm3 md2 v-show="selected === 0">
<v-text-field
label="Group"
:hint="$t('dataIdGroupHint')"
v-model="serviceGroup4Search"
></v-text-field>
</v-flex>
<v-btn @click="submit" color="primary" large>{{$t('search')}}</v-btn>

</v-layout>
@@ -330,6 +336,30 @@ export default {
this.filter = document.querySelector('#serviceSearch').value.trim()
this.search(true)
},
split: function (service) {
if (this.selected === 0) {
const groupSplit = service.split('/')
const versionSplit = service.split(':')
console.log(groupSplit)
console.log(versionSplit)
if (groupSplit.length > 1) {
this.serviceGroup4Search = groupSplit[0]
} else {
this.serviceGroup4Search = ''
}
if (versionSplit.length > 1) {
this.serviceVersion4Search = versionSplit[1]
} else {
this.serviceVersion4Search = ''
}
const serviceSplit = versionSplit[0].split('/')
if (serviceSplit.length === 1) {
this.filter = serviceSplit[0]
} else {
this.filter = serviceSplit[1]
}
}
},
search: function (rewrite) {
if (!this.filter) {
this.$notify.error('Either service or application is needed')

0 comments on commit 063dde3

Please sign in to comment.