Skip to content

Commit

Permalink
scope in admin dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
kdudkov committed Mar 17, 2024
1 parent a315904 commit f4f51e9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 7 additions & 5 deletions cmd/goatak_server/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<th>UIDS</th>
<th>user</th>
<th>scope</th>
<th>proto</th>
<th>ver</th>
<th>last seen</th>
</tr>
<tr v-for="c in all_conns">
Expand All @@ -38,6 +38,7 @@
<tr>
<th></th>
<th>Callsign</th>
<th>Scope</th>
<th>Status</th>
<th>coords</th>
<th>TAK ver.</th>
Expand All @@ -47,6 +48,7 @@
<img v-bind:src="getImg(u)"/>
</td>
<td>{{ u.callsign }}</td>
<td>{{ u.scope }}</td>
<td><span class="badge"
v-bind:class="[u.status=='Online' ? 'bg-success' : 'bg-secondary']">{{ u.status }}</span>
</td>
Expand All @@ -67,7 +69,7 @@
<th></th>
<th>Callsign</th>
<th>coords</th>
<th>mission</th>
<th>scope</th>
<th>stale time</th>
</tr>
<tr v-for="u in byCategory('unit')">
Expand All @@ -76,7 +78,7 @@
</td>
<td>{{ u.callsign }}</td>
<td>{{ printCoords(u.lat, u.lon) }}</td>
<td>{{ u.missions }}</td>
<td>{{ u.scope }}</td>
<td>{{ dt(u.stale_time) }}</td>
</tr>
</table>
Expand All @@ -90,15 +92,15 @@
<th></th>
<th>Callsign</th>
<th>coords</th>
<th>mission</th>
<th>scope</th>
<th>send time</th>
<th>stale time</th>
</tr>
<tr v-for="u in byCategory('point')">
<td><img v-bind:src="getImg(u)"/></td>
<td>{{ u.callsign }}</td>
<td>{{ printCoords(u.lat, u.lon) }}</td>
<td>{{ u.missions }}</td>
<td>{{ u.scope }}</td>
<td>{{ dt(u.send_time) }}</td>
<td>{{ dt(u.stale_time) }}</td>
</tr>
Expand Down
4 changes: 3 additions & 1 deletion pkg/model/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -168,7 +170,7 @@ func (w *WebUnit) ToMsg() *cot.CotMessage {

return &cot.CotMessage{
From: "",
Scope: "",
Scope: w.Scope,
TakMessage: msg,
Detail: xd,
}
Expand Down

0 comments on commit f4f51e9

Please sign in to comment.