Initial commit (code only without large binaries)

This commit is contained in:
robin
2026-02-15 18:58:44 +08:00
commit 35df75498f
9442 changed files with 1495866 additions and 0 deletions

View 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 */

View File

@@ -0,0 +1 @@
{"version":3,"sources":["index.less"],"names":[],"mappings":"AAAA;EACC,+BAAA;EACA,iBAAA;EACA,UAAA;;AAGD;EACC,UAAA","file":"index.css"}

View File

@@ -0,0 +1,73 @@
{$layout "layout_popup"}
<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" style="margin-bottom: 0.5em">
{{ipList.name}}
<!-- 过期时间 -->
<span v-if="ipList.itemExpiredTime.length == 0" class="grey small">(不过期)</span>
<span v-else class="grey small">(有效至:{{ipList.itemExpiredTime}}</span>
<!-- 操作 -->
<a href="" title="删除" @click.prevent="deleteFromList(ipList.id, ipList.itemId)"><i class="icon remove small"></i></a>
</div>
<span v-if="ipLists.length == 0" class="disabled">暂时未在任何名单。</span>
&nbsp; &nbsp;
<div>
<a href="" @click.prevent="showBlackLists"><i class="icon angle" :class="{up: blackListsVisible, down: !blackListsVisible}"></i>加入到<span v-if="ipLists.length > 0">其他</span>黑名单</a>
</div>
</td>
</tr>
<tr v-if="publicBlackIPLists.length > 0 && blackListsVisible">
<td>加入黑名单</td>
<td colspan="5">
<form class="ui form">
<table class="ui table">
<tr>
<td class="title">过期时间</td>
<td>
<datetime-input :v-timestamp="defaultItemExpiredAt" ref="itemExpiredTimestamp"></datetime-input>
</td>
</tr>
<tr>
<td>选择名单 *</td>
<td>
<a class="ui label basic small" :class="{blue: selectedListId == ipList.id}" v-for="ipList in publicBlackIPLists" @click.prevent="addBlackIP(ipList)" style="margin-top: 0.3em">
{{ipList.name}}
</a>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<p class="comment" v-if="accessLogs.length == 0">暂时还没有访问日志。</p>
<table class="ui table selectable" v-if="accessLogs.length > 0">
<tr v-for="accessLog in accessLogs" :key="accessLog.requestId">
<td><http-access-log-box :v-access-log="accessLog"></http-access-log-box></td>
</tr>
</table>

View File

@@ -0,0 +1,53 @@
Tea.context(function () {
this.blackListsVisible = false
this.allPublicBlackIPLists = this.publicBlackIPLists.$copy()
this.defaultItemExpiredAt = Math.floor(new Date().getTime() / 1000) + 86400
this.showBlackLists = function () {
this.defaultItemExpiredAt = Math.floor(new Date().getTime() / 1000) + 86400
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.selectedListId = 0
this.addBlackIP = function (list) {
this.selectedListId = list.id
let expiredAt = this.$refs.itemExpiredTimestamp.resultTimestamp()
let that = this
teaweb.confirm("确定要将此IP添加到黑名单'" + list.name + "'吗?", function () {
that.$post(".addIP")
.params({
listId: list.id,
ip: that.ip,
expiredAt: expiredAt
})
.success(function () {
teaweb.reload()
})
})
}
this.deleteFromList = function (listId, itemId) {
teaweb.confirm("确定要从此名单中删除此IP吗", function () {
this.$post(".deleteFromList")
.params({
listId: listId,
itemId: itemId
})
.success(function () {
teaweb.reload()
})
})
}
})

View File

@@ -0,0 +1,9 @@
.cell-title {
background: rgba(0, 0, 0, 0.03);
font-weight: bold;
width: 7em;
}
.cell-content {
width: 22%;
}