mirror of
https://github.com/tuna/mirror-web.git
synced 2025-12-25 20:32:46 +00:00
Merge remote-tracking branch 'origin/add-mirror-search'
Signed-off-by: 王邈 <shankerwangmiao@gmail.com>
This commit is contained in:
commit
c5ae0b6e38
|
|
@ -14,7 +14,10 @@ permalink: /
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{% raw %}
|
{% raw %}
|
||||||
<div class="col-md-8 table-responsive" id="mirror-list">
|
<div class="col-md-8 table-responsive" id="mirror-list">
|
||||||
<h3><span class="fa fa-cube"></span> 镜像列表 </h3>
|
<div class="row">
|
||||||
|
<h3 id="mirror-title"><span class="fa fa-cube"></span> 镜像列表 </h3>
|
||||||
|
<input type="search" v-model="filter" id="search" placeholder="搜索" autocomplete="off">
|
||||||
|
</div>
|
||||||
<table class="table" v-if="mirrorList.length">
|
<table class="table" v-if="mirrorList.length">
|
||||||
<thead>
|
<thead>
|
||||||
<tr class="row">
|
<tr class="row">
|
||||||
|
|
@ -23,7 +26,7 @@ permalink: /
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="mir in mirrorList" :class="['row', 'status-'+mir.status]">
|
<tr v-for="mir in filteredMirrorList" :class="['row', 'status-'+mir.status]">
|
||||||
<template v-if="mir.is_master">
|
<template v-if="mir.is_master">
|
||||||
<td class="col-md-8">
|
<td class="col-md-8">
|
||||||
<a class="mirror-item-label" data-toggle="popover" data-trigger="hover" data-placement="right"
|
<a class="mirror-item-label" data-toggle="popover" data-trigger="hover" data-placement="right"
|
||||||
|
|
|
||||||
|
|
@ -248,3 +248,19 @@ body {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#search {
|
||||||
|
float: right;
|
||||||
|
line-height: 18px;
|
||||||
|
padding: 8px;
|
||||||
|
border: 1px solid #e3e3e3;
|
||||||
|
margin-top: 20px;
|
||||||
|
margin-right: 10px;
|
||||||
|
max-width: 240px;
|
||||||
|
height: 30px;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#mirror-title {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,8 @@ var vmMirList = new Vue({
|
||||||
el: "#mirror-list",
|
el: "#mirror-list",
|
||||||
data: {
|
data: {
|
||||||
test: "hello",
|
test: "hello",
|
||||||
mirrorList: []
|
mirrorList: [],
|
||||||
|
filter: "",
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
this.refreshMirrorList();
|
this.refreshMirrorList();
|
||||||
|
|
@ -98,7 +99,13 @@ var vmMirList = new Vue({
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
},
|
||||||
|
filteredMirrorList: function() {
|
||||||
|
var filter = this.filter.toLowerCase();
|
||||||
|
return this.mirrorList.filter(function(m){
|
||||||
|
return m.name.toLowerCase().indexOf(filter) !== -1;
|
||||||
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getURL (mir) {
|
getURL (mir) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue