Skip to content

Commit

Permalink
修改数据为倒序排列
Browse files Browse the repository at this point in the history
  • Loading branch information
lanyi1998 committed Dec 11, 2020
1 parent ec4862c commit 5435371
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Dns/Core.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package Dns

import (
"../Core"
"DnsLog/Core"
"encoding/json"
"fmt"
"golang.org/x/net/dns/dnsmessage"
Expand Down Expand Up @@ -56,6 +56,7 @@ func serverDNS(addr *net.UDPAddr, conn *net.UDPConn, msg dnsmessage.Message) {
queryType = question.Type
queryName, _ = dnsmessage.NewName(queryNameStr)
)
//域名过滤,避免网络扫描
if strings.Contains(queryNameStr, Core.Config.Dns.Domain) {
D.Set(DnsInfo{
Subdomain: queryNameStr[:len(queryNameStr)-1],
Expand Down
2 changes: 1 addition & 1 deletion Http/Core.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package Http

import (
"../Core"
"DnsLog/Core"
"log"
"net/http"
)
Expand Down
4 changes: 2 additions & 2 deletions Http/Route.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package Http

import (
"../Core"
"../Dns"
"DnsLog/Core"
"DnsLog/Dns"
"encoding/json"
"fmt"
"io/ioutil"
Expand Down
9 changes: 9 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module DnsLog

go 1.14

require (
golang.org/x/net v0.0.0-20201031054903-ff519b6c9102
gopkg.in/gcfg.v1 v1.2.3
gopkg.in/warnings.v0 v0.1.2 // indirect
)
15 changes: 15 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20201031054903-ff519b6c9102 h1:42cLlJJdEh+ySyeUUbEQ5bsTiq8voBeTuweGVkY6Puw=
golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
gopkg.in/gcfg.v1 v1.2.3 h1:m8OOJ4ccYHnx2f4gQwpno8nAX5OGOh7RLaaz0pj3Ogs=
gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o=
gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=
gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package main

import (
"./Core"
"./Http"
"./Dns"
"DnsLog/Core"
"DnsLog/Dns"
"DnsLog/Http"
"gopkg.in/gcfg.v1"
)

Expand Down
2 changes: 1 addition & 1 deletion template/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
res => {
if (res['data']['HTTPStatusCode'] == 200) {
if (res['data']['Msg'] != 'null') {
this.DnsData = JSON.parse(res['data']['Msg'])
this.DnsData = JSON.parse(res['data']['Msg']).reverse()
for (var i = 0; i < this.DnsData.length; i++) {
this.DnsData[i].Time = formatTimeToStr(this.DnsData[i].Time)
}
Expand Down

0 comments on commit 5435371

Please sign in to comment.