记录和显示最近常用的服务

This commit is contained in:
刘祥超
2021-05-03 15:15:31 +08:00
parent 19a2af8bfa
commit c2ebf81e6c
7 changed files with 70 additions and 4 deletions

View File

@@ -25,6 +25,9 @@
<div class="ui field">
<button type="submit" class="ui button">搜索</button>
</div>
<div class="ui field" v-if="latestServers.length > 0">
<a href="" @click.prevent="showLatest()">常用<i class="icon angle" :class="{down: !latestVisible, up: latestVisible}"></i> </a>
</div>
</div>
</div>
<div class="item right">
@@ -33,6 +36,11 @@
</div>
</form>
<!-- 常用服务 -->
<div class="ui segment" v-if="latestVisible">
常用服务:<span v-for="server in latestServers"><a :href="'/servers/server?serverId=' + server.id">{{server.name}}</a> &nbsp; </span>
</div>
<p class="ui message" v-if="servers.length == 0">暂时还没有服务。</p>
<table class="ui table selectable celled" v-if="servers.length > 0">

View File

@@ -37,4 +37,13 @@ Tea.context(function () {
})
})
}
});
/**
* 最近使用
*/
this.latestVisible = false
this.showLatest = function () {
this.latestVisible = !this.latestVisible
}
})