mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-12-10 00:00:26 +08:00
简化IP名单中创建IP操作/支持IP以CIDR方式显示
This commit is contained in:
@@ -140,6 +140,15 @@ Vue.component("datetime-input", {
|
||||
resultTimestamp: function () {
|
||||
return this.timestamp
|
||||
},
|
||||
nextYear: function () {
|
||||
let date = new Date()
|
||||
date.setFullYear(date.getFullYear()+1)
|
||||
this.day = date.getFullYear() + "-" + this.leadingZero(date.getMonth() + 1, 2) + "-" + this.leadingZero(date.getDate(), 2)
|
||||
this.hour = this.leadingZero(date.getHours(), 2)
|
||||
this.minute = this.leadingZero(date.getMinutes(), 2)
|
||||
this.second = this.leadingZero(date.getSeconds(), 2)
|
||||
this.change()
|
||||
},
|
||||
nextDays: function (days) {
|
||||
let date = new Date()
|
||||
date.setTime(date.getTime() + days * 86400 * 1000)
|
||||
@@ -171,6 +180,6 @@ Vue.component("datetime-input", {
|
||||
<div class="ui field">:</div>
|
||||
<div class="ui field" :class="{error: hasSecondError}"><input type="text" v-model="second" maxlength="2" style="width:4em" placeholder="秒" @input="change"/></div>
|
||||
</div>
|
||||
<p class="comment">常用时间:<a href="" @click.prevent="nextHours(1)"> 1小时 </a> <span class="disabled">|</span> <a href="" @click.prevent="nextDays(1)"> 1天 </a> <span class="disabled">|</span> <a href="" @click.prevent="nextDays(3)"> 3天 </a> <span class="disabled">|</span> <a href="" @click.prevent="nextDays(7)"> 1周 </a> <span class="disabled">|</span> <a href="" @click.prevent="nextDays(30)"> 30天 </a> </p>
|
||||
<p class="comment">常用时间:<a href="" @click.prevent="nextHours(1)"> 1小时 </a> <span class="disabled">|</span> <a href="" @click.prevent="nextDays(1)"> 1天 </a> <span class="disabled">|</span> <a href="" @click.prevent="nextDays(3)"> 3天 </a> <span class="disabled">|</span> <a href="" @click.prevent="nextDays(7)"> 1周 </a> <span class="disabled">|</span> <a href="" @click.prevent="nextDays(30)"> 30天 </a> <span class="disabled">|</span> <a href="" @click.prevent="nextYear()"> 1年 </a> </p>
|
||||
</div>`
|
||||
})
|
||||
@@ -2,13 +2,13 @@ Vue.component("ip-item-text", {
|
||||
props: ["v-item"],
|
||||
template: `<span>
|
||||
<span v-if="vItem.type == 'all'">*</span>
|
||||
<span v-if="vItem.type == 'ipv4' || vItem.type.length == 0">
|
||||
{{vItem.ipFrom}}
|
||||
<span v-if="vItem.ipTo.length > 0">- {{vItem.ipTo}}</span>
|
||||
</span>
|
||||
<span v-if="vItem.type == 'ipv6'">{{vItem.ipFrom}}
|
||||
<span v-if="vItem.ipTo.length > 0">- {{vItem.ipTo}}</span>
|
||||
</span>
|
||||
<span v-else>
|
||||
<span v-if="vItem.value != null && vItem.value.length > 0">{{vItem.value}}</span>
|
||||
<span v-else>
|
||||
{{vItem.ipFrom}}
|
||||
<span v-if="vItem.ipTo != null &&vItem.ipTo.length > 0">- {{vItem.ipTo}}</span>
|
||||
</span>
|
||||
</span>
|
||||
<span v-if="vItem.eventLevelName != null && vItem.eventLevelName.length > 0"> 级别:{{vItem.eventLevelName}}</span>
|
||||
</span>`
|
||||
})
|
||||
@@ -155,8 +155,12 @@ Vue.component("ip-list-table", {
|
||||
</td>
|
||||
<td>
|
||||
<span v-if="item.type != 'all'" :class="{green: item.list != null && item.list.type == 'white'}">
|
||||
<keyword :v-word="keyword">{{item.ipFrom}}</keyword> <span> <span class="small red" v-if="item.isRead != null && !item.isRead"> New </span> <a :href="'/servers/iplists?ip=' + item.ipFrom" v-if="vShowSearchButton" title="搜索此IP"><span><i class="icon search small" style="color: #ccc"></i></span></a></span>
|
||||
<span v-if="item.ipTo.length > 0"> - <keyword :v-word="keyword">{{item.ipTo}}</keyword></span></span>
|
||||
<span v-if="item.value != null && item.value.length > 0"><keyword :v-word="keyword">{{item.value}}</keyword></span>
|
||||
<span v-else>
|
||||
<keyword :v-word="keyword">{{item.ipFrom}}</keyword> <span> <span class="small red" v-if="item.isRead != null && !item.isRead"> New </span> <a :href="'/servers/iplists?ip=' + item.ipFrom" v-if="vShowSearchButton" title="搜索此IP"><span><i class="icon search small" style="color: #ccc"></i></span></a></span>
|
||||
<span v-if="item.ipTo.length > 0"> - <keyword :v-word="keyword">{{item.ipTo}}</keyword></span>
|
||||
</span>
|
||||
</span>
|
||||
<span v-else class="disabled">*</span>
|
||||
|
||||
<div v-if="item.region != null && item.region.length > 0">
|
||||
|
||||
Reference in New Issue
Block a user