Skip to content

Commit 07d7aa3

Browse files
committed
fix: netstat time
1 parent 855c1d0 commit 07d7aa3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

frontend/src/pages/netstat.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const columns = [{
4444
const data = computed(() => netstats.value.map(n => {
4545
return {
4646
...n,
47-
time: n.time ? dayjs(n.time * 1000).format('YYYY-MM-DD HH:mm:ss') : '未知时间',
47+
time: n.time ? dayjs(n.time).format('YYYY-MM-DD HH:mm:ss') : '未知时间',
4848
src: n.srcIP && n.srcPort ? `${n.srcIP}:${n.srcPort}` : '未知地址',
4949
dst: n.dstIP && n.dstPort ? `${n.dstIP}:${n.dstPort}` : '未知地址',
5050
location: n.location || '未知位置',

util/netstat.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ var (
3737
func capture(ps *gopacket.PacketSource) {
3838
for packet := range ps.Packets() {
3939
n := Netstat{
40-
Time: packet.Metadata().Timestamp.Unix(),
40+
Time: packet.Metadata().Timestamp.UnixMilli(),
4141
Packet: packet,
4242
}
4343

0 commit comments

Comments
 (0)