DNS线路选择器增加代号搜索

This commit is contained in:
GoEdgeLab
2022-11-28 19:00:14 +08:00
parent f4b00b0513
commit 3d521276fe

View File

@@ -80,7 +80,7 @@ Vue.component("dns-route-selector", {
return return
} }
this.searchingRoutes = this.vAllRoutes.filter(function (route) { this.searchingRoutes = this.vAllRoutes.filter(function (route) {
return teaweb.match(route.name, keyword) || teaweb.match(route.domainName, keyword) return teaweb.match(route.name, keyword) || teaweb.match(route.code, keyword) || teaweb.match(route.domainName, keyword)
}) })
if (this.searchingRoutes.length > 0) { if (this.searchingRoutes.length > 0) {
this.routeCode = this.searchingRoutes[0].code + "@" + this.searchingRoutes[0].domainId this.routeCode = this.searchingRoutes[0].code + "@" + this.searchingRoutes[0].domainId
@@ -99,24 +99,25 @@ Vue.component("dns-route-selector", {
</div> </div>
<button type="button" class="ui button small" @click.prevent="add" v-if="!isAdding">+</button> <button type="button" class="ui button small" @click.prevent="add" v-if="!isAdding">+</button>
<div v-if="isAdding"> <div v-if="isAdding">
<div class="ui fields inline"> <table class="ui table">
<div class="ui field"> <tr>
<select class="ui dropdown" style="width: 18em" v-model="routeCode"> <td class="title">所有线路</td>
<option value="" v-if="keyword.length == 0">[请选择]</option> <td>
<option v-for="route in searchingRoutes" :value="route.code + '@' + route.domainId">{{route.name}}{{route.domainName}}</option> <select class="ui dropdown auto-width" v-model="routeCode">
</select> <option value="" v-if="keyword.length == 0">[请选择]</option>
</div> <option v-for="route in searchingRoutes" :value="route.code + '@' + route.domainId">{{route.name}}{{route.code}}/{{route.domainName}}</option>
<div class="ui field"> </select>
<input type="text" placeholder="搜索..." size="10" v-model="keyword" ref="keywordRef" @keyup.enter="confirm" @keypress.enter.prevent="1"/> </td>
</div> </tr>
<tr>
<div class="ui field"> <td>搜索</td>
<button class="ui button tiny" type="button" @click.prevent="confirm">确定</button> <td>
</div> <input type="text" placeholder="搜索..." size="10" style="width: 10em" v-model="keyword" ref="keywordRef" @keyup.enter="confirm" @keypress.enter.prevent="1"/>
<div class="ui field"> </td>
<a href="" @click.prevent="cancel()"><i class="icon remove small"></i></a> </tr>
</div> </table>
</div>
<button class="ui button tiny" type="button" @click.prevent="confirm">确定</button> &nbsp; <a href="" @click.prevent="cancel()"><i class="icon remove small"></i></a>
</div> </div>
</div>` </div>`
}) })