From f4f51e9e6c64f3723298c3fc395c36cc1e66c9a0 Mon Sep 17 00:00:00 2001 From: Konstantin Dudkov Date: Sun, 17 Mar 2024 21:44:41 +0300 Subject: [PATCH] scope in admin dashboard --- cmd/goatak_server/templates/index.html | 12 +++++++----- pkg/model/http.go | 4 +++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/cmd/goatak_server/templates/index.html b/cmd/goatak_server/templates/index.html index 3c4d3c2..751ecd7 100644 --- a/cmd/goatak_server/templates/index.html +++ b/cmd/goatak_server/templates/index.html @@ -13,7 +13,7 @@ UIDS user scope - proto + ver last seen @@ -38,6 +38,7 @@ Callsign + Scope Status coords TAK ver. @@ -47,6 +48,7 @@ {{ u.callsign }} + {{ u.scope }} {{ u.status }} @@ -67,7 +69,7 @@ Callsign coords - mission + scope stale time @@ -76,7 +78,7 @@ {{ u.callsign }} {{ printCoords(u.lat, u.lon) }} - {{ u.missions }} + {{ u.scope }} {{ dt(u.stale_time) }} @@ -90,7 +92,7 @@ Callsign coords - mission + scope send time stale time @@ -98,7 +100,7 @@ {{ u.callsign }} {{ printCoords(u.lat, u.lon) }} - {{ u.missions }} + {{ u.scope }} {{ dt(u.send_time) }} {{ dt(u.stale_time) }} diff --git a/pkg/model/http.go b/pkg/model/http.go index 2fd00c0..3d50423 100644 --- a/pkg/model/http.go +++ b/pkg/model/http.go @@ -15,6 +15,7 @@ type WebUnit struct { UID string `json:"uid"` Callsign string `json:"callsign"` Category string `json:"category"` + Scope string `json:"scope"` Team string `json:"team"` Role string `json:"role"` Time time.Time `json:"time"` @@ -68,6 +69,7 @@ func (i *Item) ToWeb() *WebUnit { w := &WebUnit{ UID: i.uid, Category: i.class, + Scope: i.msg.Scope, Callsign: i.msg.GetCallsign(), Time: cot.TimeFromMillis(evt.GetSendTime()), LastSeen: i.lastSeen, @@ -168,7 +170,7 @@ func (w *WebUnit) ToMsg() *cot.CotMessage { return &cot.CotMessage{ From: "", - Scope: "", + Scope: w.Scope, TakMessage: msg, Detail: xd, }