Files
EdgeAdmin/web/views/@default/servers/server/log/viewPopup.js

44 lines
910 B
JavaScript
Raw Normal View History

Tea.context(function () {
this.tab = "summary"
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,
2022-04-05 15:43:49 +08:00
values: v.values,
isGeneral: !k.startsWith("X-")
})
}
}
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,
2022-04-05 15:43:49 +08:00
values: v.values,
isGeneral: !k.startsWith("X-")
})
}
}
this.responseHeaders.sort(function (v1, v2) {
return (v1.name < v2.name) ? -1 : 1
})
})