added map

This commit is contained in:
Acid
2026-05-26 22:50:12 -04:00
parent 5288323831
commit 0d3515ad07
3 changed files with 8 additions and 2 deletions
+3
View File
@@ -117,6 +117,9 @@ func callApi(ip string) ipResponse {
err = json.Unmarshal(body, &values) err = json.Unmarshal(body, &values)
slog.Debug("Api1 res:", "ip", values.IP, "country", values.Country, "continent:", values.ContinentCode,
"ISP", values.AsName)
return values return values
} }
+4 -1
View File
@@ -15,9 +15,11 @@ h1 {
.layout { .layout {
display: flex; display: flex;
gap: 40px;
align-items: flex-start; align-items: flex-start;
padding: 0 40px; padding: 0 40px;
gap: 40px;
width: 100%;
box-sizing: border-box;
} }
.container { .container {
@@ -28,6 +30,7 @@ h1 {
width: 400px; width: 400px;
height: 400px; height: 400px;
flex-shrink: 0; flex-shrink: 0;
margin: 0 auto;
} }
.info { .info {
+1 -1
View File
@@ -45,8 +45,8 @@
</div> </div>
</div> </div>
<div id="map"></div> <div id="map"></div>
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script> <script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
<!-- prettier-ignore -->
<script> <script>
var map = L.map('map', { maxZoom: 10 }).setView([{{.IP2.Lat}}, {{.IP2.Lon}}], 8); var map = L.map('map', { maxZoom: 10 }).setView([{{.IP2.Lat}}, {{.IP2.Lon}}], 8);
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', { L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {