域名服务增加访问日志

This commit is contained in:
刘祥超
2021-06-02 11:53:08 +08:00
parent 201c3e2f97
commit b6fd9aeb14
25 changed files with 577 additions and 35 deletions

View File

@@ -0,0 +1,38 @@
Vue.component("ns-access-log-box", {
props: ["v-access-log"],
data: function () {
let accessLog = this.vAccessLog
return {
accessLog: accessLog
}
},
methods: {
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("/ns/clusters/accessLogs/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 class="access-log-row" :style="{'color': (accessLog.nsRecordId == null || accessLog.nsRecordId == 0) ? '#dc143c' : ''}" ref="box">
<span v-if="accessLog.region != null && accessLog.region.length > 0" class="grey">[{{accessLog.region}}]</span> {{accessLog.remoteAddr}} [{{accessLog.timeLocal}}] [{{accessLog.networking}}] <em>{{accessLog.questionType}} {{accessLog.questionName}}</em> -&gt; <em>{{accessLog.recordType}} {{accessLog.recordValue}}</em><!-- &nbsp; <a href="" @click.prevent="showLog" title="查看详情"><i class="icon expand"></i></a>-->
</div>`
})

View File

@@ -0,0 +1,27 @@
Vue.component("ns-access-log-ref-box", {
props:["v-access-log-ref"],
data: function () {
let config = this.vAccessLogRef
if (config == null) {
config = {
isOn: false,
isPrior: false
}
}
return {
config: config
}
},
template: `<div>
<input type="hidden" name="accessLogJSON" :value="JSON.stringify(config)"/>
<table class="ui table definition selectable">
<tr>
<td class="title">是否启用</td>
<td>
<checkbox name="isOn" value="1" v-model="config.isOn"></checkbox>
</td>
</tr>
</table>
<div class="margin"></div>
</div>`
})

View File

@@ -1,4 +1,5 @@
Vue.component("ns-cluster-selector", {
props: ["v-cluster-id"],
mounted: function () {
let that = this
@@ -8,7 +9,6 @@ Vue.component("ns-cluster-selector", {
that.clusters = resp.data.clusters
})
},
props: ["v-cluster-id"],
data: function () {
let clusterId = this.vClusterId
if (clusterId == null) {