Skip to content

Commit

Permalink
Merge pull request #22 from bakraw/testing
Browse files Browse the repository at this point in the history
Testing - 2024-05-27 09:14
  • Loading branch information
bakraw authored May 27, 2024
2 parents a318a02 + 433decc commit d42eaa6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/mikromap-api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func getMikromap(writer http.ResponseWriter, request *http.Request) {
// Récupération du nom d'utilisateur transmis par Grafana
user := request.URL.Query().Get("user")

fmt.Printf("Requête GET entrante sur /mikromap (user = %s)\n", user)
fmt.Printf("\033[32mRequête GET entrante sur /mikromap (user = %s)\033[0m\n", user)

// Récupération routers.json dans un struct
dataRouters := readJSON()
Expand Down
7 changes: 7 additions & 0 deletions src/mikromap-cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,13 @@ func addRouter() {
fmt.Printf("- %s\n- %f, %f\n", adresse, lat, lon)
}

// A chaque routeur avec la même adresse, on le décale légèrement pour éviter une superposition.
for _, v := range dataRouters {
if v.Adresse == adresse {
lat += 0.0001
}
}

// Récupération entreprise
fmt.Print("\033[36mUtilisateur Grafana associé >>> \033[0m")
if scanner.Scan() {
Expand Down

0 comments on commit d42eaa6

Please sign in to comment.