From 2fe44c51e218d5bb4653b07e7974314a8f136d35 Mon Sep 17 00:00:00 2001 From: Rhythm <35167328+kRhythm@users.noreply.github.com> Date: Thu, 16 Dec 2021 17:47:16 +0530 Subject: [PATCH] changed a bit --- handlers/services.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/handlers/services.go b/handlers/services.go index 2e67238b..2b16f596 100755 --- a/handlers/services.go +++ b/handlers/services.go @@ -10,6 +10,7 @@ import ( "github.com/statping/statping/types/services" "github.com/statping/statping/utils" "net/http" + "net/url" "sort" "time" ) @@ -513,7 +514,20 @@ func apiServiceDeleteHandler(w http.ResponseWriter, r *http.Request) { sendJsonAction(service, "delete", w, r) } +func convertToMap(query url.Values) map[string]string{ + vars := make(map[string]string) + if query.Get("time") != "" { + vars["time"] = query.Get("time") + } + return vars +} + func apiAllServicesHandler(r *http.Request) interface{} { + query := r.URL.Query() + timeVar := time.Now().Unix() + if query.Get("time") != ""{ + timeVar = + } var srvs []services.Service for _, v := range services.AllInOrder() { if !v.Public.Bool && !IsUser(r) {