added map
This commit is contained in:
@@ -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
@@ -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
@@ -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', {
|
||||||
|
|||||||
Reference in New Issue
Block a user