mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-12-29 14:26:34 +08:00
IPBox增加地域、ISP、添加到黑名单等功能
This commit is contained in:
9
web/views/@default/servers/ipbox/index.css
Normal file
9
web/views/@default/servers/ipbox/index.css
Normal file
@@ -0,0 +1,9 @@
|
||||
.cell-title {
|
||||
background: rgba(0, 0, 0, 0.03);
|
||||
font-weight: bold;
|
||||
width: 7em;
|
||||
}
|
||||
.cell-content {
|
||||
width: 22%;
|
||||
}
|
||||
/*# sourceMappingURL=index.css.map */
|
||||
1
web/views/@default/servers/ipbox/index.css.map
Normal file
1
web/views/@default/servers/ipbox/index.css.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["index.less"],"names":[],"mappings":"AAAA;EACC,+BAAA;EACA,iBAAA;EACA,UAAA;;AAGD;EACC,UAAA","file":"index.css"}
|
||||
@@ -1,6 +1,44 @@
|
||||
{$layout "layout_popup"}
|
||||
|
||||
<h3>最近访问日志<span class="grey">({{ip}})</span></h3>
|
||||
<h3>IP最近访问日志<span class="grey">(<span>{{ip}}</span>)</span></h3>
|
||||
|
||||
<table class="ui table definition celled selectable">
|
||||
<tr>
|
||||
<td class="cell-title">IP</td>
|
||||
<td class="cell-content">
|
||||
<span id="ip-text">{{ip}}</span>
|
||||
<copy-to-clipboard :v-target="'ip-text'"></copy-to-clipboard>
|
||||
</td>
|
||||
<td class="cell-title">区域</td>
|
||||
<td class="cell-content">
|
||||
<span v-if="regions.length > 0">{{regions}}</span>
|
||||
<span v-else class="disabled">-</span>
|
||||
</td>
|
||||
<td class="cell-title">ISP</td>
|
||||
<td>
|
||||
<span v-if="isp.length > 0">{{isp}}</span>
|
||||
<span v-else class="disabled">-</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="publicBlackIPLists.length > 0">
|
||||
<td>所在IP名单</td>
|
||||
<td colspan="5">
|
||||
<div class="ui label basic small" v-for="ipList in ipLists">
|
||||
{{ipList.name}}
|
||||
</div>
|
||||
|
||||
<a href="" @click.prevent="showBlackLists"><i class="icon angle" :class="{up: blackListsVisible, down: !blackListsVisible}"></i>添加黑名单</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="publicBlackIPLists.length > 0 && blackListsVisible">
|
||||
<td>加入黑名单</td>
|
||||
<td colspan="5">
|
||||
<a class="ui label basic small" v-for="ipList in publicBlackIPLists" @click.prevent="addBlackIP(ipList)">
|
||||
{{ipList.name}}
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p class="comment" v-if="accessLogs.length == 0">暂时还没有访问日志。</p>
|
||||
<table class="ui table selectable" v-if="accessLogs.length > 0">
|
||||
|
||||
30
web/views/@default/servers/ipbox/index.js
Normal file
30
web/views/@default/servers/ipbox/index.js
Normal file
@@ -0,0 +1,30 @@
|
||||
Tea.context(function () {
|
||||
this.blackListsVisible = false
|
||||
this.allPublicBlackIPLists = this.publicBlackIPLists.$copy()
|
||||
|
||||
this.showBlackLists = function () {
|
||||
let that = this
|
||||
this.publicBlackIPLists = this.allPublicBlackIPLists.filter(function (allList) {
|
||||
let found = true
|
||||
that.ipLists.forEach(function (list) {
|
||||
if (allList.id == list.id) {
|
||||
found = false
|
||||
}
|
||||
})
|
||||
return found
|
||||
})
|
||||
this.blackListsVisible = !this.blackListsVisible
|
||||
}
|
||||
|
||||
this.addBlackIP = function (list) {
|
||||
this.$post(".addIP")
|
||||
.params({
|
||||
listId: list.id,
|
||||
ip: this.ip
|
||||
})
|
||||
.success(function () {
|
||||
this.ipLists.push(list)
|
||||
this.blackListsVisible = false
|
||||
})
|
||||
}
|
||||
})
|
||||
9
web/views/@default/servers/ipbox/index.less
Normal file
9
web/views/@default/servers/ipbox/index.less
Normal file
@@ -0,0 +1,9 @@
|
||||
.cell-title {
|
||||
background: rgba(0, 0, 0, 0.03);
|
||||
font-weight: bold;
|
||||
width: 7em;
|
||||
}
|
||||
|
||||
.cell-content {
|
||||
width: 22%;
|
||||
}
|
||||
Reference in New Issue
Block a user