From 2ecc1315da86cb2af0ae404b7faa8ae201fb6eb3 Mon Sep 17 00:00:00 2001 From: Konstantin Dudkov Date: Fri, 10 Jan 2025 13:09:44 +0300 Subject: [PATCH] templates --- cmd/goatak_server/marti_api.go | 16 ++++------------ cmd/goatak_server/templates/missions.html | 4 ++-- cmd/goatak_server/templates/mp.html | 2 +- cmd/goatak_server/templates/points.html | 4 ++-- 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/cmd/goatak_server/marti_api.go b/cmd/goatak_server/marti_api.go index 0aab4cb..704a986 100644 --- a/cmd/goatak_server/marti_api.go +++ b/cmd/goatak_server/marti_api.go @@ -129,11 +129,7 @@ func getEndpointsHandler(app *App) fiber.Handler { data := make([]map[string]any, 0) app.items.ForEach(func(item *model.Item) bool { - if !user.CanSeeScope(item.GetScope()) { - return true - } - - if item.GetClass() == model.CONTACT { + if user.CanSeeScope(item.GetScope()) && item.GetClass() == model.CONTACT { info := make(map[string]any) info["uid"] = item.GetUID() info["callsign"] = item.GetCallsign() @@ -161,11 +157,7 @@ func getContactsHandler(app *App) fiber.Handler { result := make([]*model.Contact, 0) app.items.ForEach(func(item *model.Item) bool { - if !user.CanSeeScope(item.GetScope()) { - return true - } - - if item.GetClass() == model.CONTACT { + if user.CanSeeScope(item.GetScope()) && item.GetClass() == model.CONTACT { c := &model.Contact{ UID: item.GetUID(), Callsign: item.GetCallsign(), @@ -247,7 +239,7 @@ func getUploadHandler(app *App) fiber.Handler { return ctx.SendStatus(fiber.StatusNotAcceptable) } - return ctx.SendString(fmt.Sprintf("/Marti/sync/content?hash=%s", c.Hash)) + return ctx.SendString(packageUrl(c)) default: c, err := app.uploadFile(ctx, uid, fname) @@ -256,7 +248,7 @@ func getUploadHandler(app *App) fiber.Handler { return ctx.SendStatus(fiber.StatusNotAcceptable) } - return ctx.SendString(fmt.Sprintf("/Marti/sync/content?hash=%s", c.Hash)) + return ctx.SendString(packageUrl(c)) } } } diff --git a/cmd/goatak_server/templates/missions.html b/cmd/goatak_server/templates/missions.html index 5c35ba3..20c25b5 100644 --- a/cmd/goatak_server/templates/missions.html +++ b/cmd/goatak_server/templates/missions.html @@ -9,14 +9,14 @@ {{ c.name }} {{ c.scope }} - {{ c.creatorUid }} + {{ c.creatorUID }}

{{ current.name }}

- creator: {{ current.creatorUid }} + creator: {{ current.creator }} uid {{ current.creatorUID }}
Points
diff --git a/cmd/goatak_server/templates/mp.html b/cmd/goatak_server/templates/mp.html index 7bed70f..2621794 100644 --- a/cmd/goatak_server/templates/mp.html +++ b/cmd/goatak_server/templates/mp.html @@ -13,7 +13,7 @@ {{ p.UID }} {{ p.Name }} {{ p.Scope }} - {{ p.CreatorUid }} + {{ p.CreatorUID }} {{ p.Size }} {{ p.MIMEType }} {{ p.Keywords }} diff --git a/cmd/goatak_server/templates/points.html b/cmd/goatak_server/templates/points.html index 72eb09e..32700e1 100644 --- a/cmd/goatak_server/templates/points.html +++ b/cmd/goatak_server/templates/points.html @@ -1,5 +1,5 @@
-
+
-
+
Units