2020-11-02 21:15:25 +08:00
|
|
|
Tea.context(function () {
|
|
|
|
|
this.tab = "summary"
|
|
|
|
|
|
|
|
|
|
this.switchTab = function (tab) {
|
|
|
|
|
this.tab = tab
|
|
|
|
|
}
|
2022-04-05 15:38:22 +08:00
|
|
|
|
|
|
|
|
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
|
|
|
|
|
})
|
2020-11-02 21:15:25 +08:00
|
|
|
})
|