mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-05 22:30:28 +08:00
实现点击访问日志显示详情窗口
This commit is contained in:
@@ -14,9 +14,33 @@ Vue.component("http-access-log-box", {
|
||||
}
|
||||
|
||||
return pieces[0] + "." + pieces[1].substr(0, 3);
|
||||
},
|
||||
showLog: function () {
|
||||
let that = this
|
||||
let requestId = this.accessLog.requestId
|
||||
this.$parent.$children.forEach(function (v) {
|
||||
if (v.deselect != null) {
|
||||
v.deselect()
|
||||
}
|
||||
})
|
||||
this.select()
|
||||
teaweb.popup("/servers/server/log/viewPopup?requestId=" + requestId, {
|
||||
width: "50em",
|
||||
height: "24em",
|
||||
onClose: function () {
|
||||
that.deselect()
|
||||
}
|
||||
})
|
||||
},
|
||||
select: function () {
|
||||
this.$refs.box.parentNode.style.cssText = "background: rgba(0, 0, 0, 0.1)"
|
||||
},
|
||||
deselect: function () {
|
||||
this.$refs.box.parentNode.style.cssText = ""
|
||||
}
|
||||
},
|
||||
template: `<div :style="{'color': (accessLog.status >= 400) ? '#dc143c' : ''}">
|
||||
template: `<div :style="{'color': (accessLog.status >= 400) ? '#dc143c' : ''}" ref="box">
|
||||
{{accessLog.remoteAddr}} [{{accessLog.timeLocal}}] <em>"{{accessLog.requestMethod}} {{accessLog.scheme}}://{{accessLog.host}}{{accessLog.requestURI}} <a :href="accessLog.scheme + '://' + accessLog.host + accessLog.requestURI" target="_blank" title="新窗口打开" class="disabled"><i class="external icon tiny"></i> </a> {{accessLog.proto}}" </em> {{accessLog.status}} <span v-if="accessLog.attrs != null && accessLog.attrs['cache_cached'] == '1'">[cached]</span> <span v-if="accessLog.attrs != null && accessLog.attrs['waf.action'] != null && accessLog.attrs['waf.action'].length > 0">[waf {{accessLog.attrs['waf.action']}}]</span> - 耗时:{{formatCost(accessLog.requestTime)}} ms
|
||||
<a href="" @click.prevent="showLog" title="查看详情"><i class="icon expand"></i></a>
|
||||
</div>`
|
||||
})
|
||||
Reference in New Issue
Block a user