mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-12-10 00:00:26 +08:00
访问日志中的响应Header和请求Header排序后显示
This commit is contained in:
@@ -4,4 +4,39 @@ Tea.context(function () {
|
||||
this.switchTab = function (tab) {
|
||||
this.tab = tab
|
||||
}
|
||||
|
||||
this.requestHeaders = []
|
||||
if (this.accessLog.header != null) {
|
||||
for (let k in this.accessLog.header) {
|
||||
let v = this.accessLog.header[k]
|
||||
if (typeof (v) != "object") {
|
||||
continue
|
||||
}
|
||||
this.requestHeaders.push({
|
||||
name: k,
|
||||
values: v.values
|
||||
})
|
||||
}
|
||||
}
|
||||
this.requestHeaders.sort(function (v1, v2) {
|
||||
return (v1.name < v2.name) ? -1 : 1
|
||||
})
|
||||
|
||||
this.responseHeaders = []
|
||||
|
||||
if (this.accessLog.sentHeader != null) {
|
||||
for (let k in this.accessLog.sentHeader) {
|
||||
let v = this.accessLog.sentHeader[k]
|
||||
if (typeof (v) != "object") {
|
||||
continue
|
||||
}
|
||||
this.responseHeaders.push({
|
||||
name: k,
|
||||
values: v.values
|
||||
})
|
||||
}
|
||||
}
|
||||
this.responseHeaders.sort(function (v1, v2) {
|
||||
return (v1.name < v2.name) ? -1 : 1
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user