Skip to content

Commit e88ef64

Browse files
[change] Updated netjsongraph.js to fix geo map cluster overlap
Co-authored-by: Federico Capoano <f.capoano@openwisp.io>
1 parent d3f8740 commit e88ef64

File tree

5 files changed

+320
-187
lines changed

5 files changed

+320
-187
lines changed

openwisp_monitoring/device/static/monitoring/css/device-map.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
background-color: #000000;
3030
color: #fff;
3131
}
32+
.map-detail table {
33+
width: 100%;
34+
}
3235
#device-map-container {
3336
margin: 50px auto;
3437
position: relative;
Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,41 @@
1-
.leaflet-control-fullscreen a {
1+
.njg-container .leaflet-control-fullscreen a {
22
background: #fff url(fullscreen.png) no-repeat 0 0;
33
background-size: 26px 52px;
44
}
5-
.leaflet-touch .leaflet-control-fullscreen a {
5+
.njg-container .leaflet-touch .leaflet-control-fullscreen a {
66
background-position: 2px 2px;
77
}
8-
.leaflet-fullscreen-on .leaflet-control-fullscreen a {
8+
.njg-container.leaflet-fullscreen-on .leaflet-control-fullscreen a,
9+
.njg-container .leaflet-container-fullscreen .leaflet-control-fullscreen a {
910
background-position: 0 -26px;
1011
}
11-
.leaflet-touch.leaflet-fullscreen-on .leaflet-control-fullscreen a {
12+
.njg-container.leaflet-touch.leaflet-fullscreen-on
13+
.leaflet-control-fullscreen
14+
a,
15+
.njg-container
16+
.leaflet-touch
17+
.leaflet-container-fullscreen
18+
.leaflet-control-fullscreen
19+
a {
1220
background-position: 2px -24px;
1321
}
1422

1523
/* Do not combine these two rules; IE will break. */
16-
.leaflet-container:-webkit-full-screen {
24+
.njg-container:has(.leaflet-fullscreen-on) {
25+
position: fixed !important;
1726
width: 100% !important;
1827
height: 100% !important;
28+
top: 0 !important;
29+
left: 0 !important;
30+
z-index: 99999;
1931
}
20-
.leaflet-container.leaflet-fullscreen-on {
32+
33+
.njg-container:has(.leaflet-fullscreen-on) .leaflet-container {
2134
width: 100% !important;
2235
height: 100% !important;
2336
}
24-
.leaflet-pseudo-fullscreen {
37+
38+
.njg-container .leaflet-container.leaflet-fullscreen-on {
2539
position: fixed !important;
2640
width: 100% !important;
2741
height: 100% !important;
@@ -31,7 +45,7 @@
3145
}
3246

3347
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
34-
.leaflet-control-fullscreen a {
48+
.njg-container .leaflet-control-fullscreen a {
3549
background-image: url(fullscreen@2x.png);
3650
}
3751
}

openwisp_monitoring/device/static/monitoring/css/netjsongraph.css

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,60 +4,62 @@
44
right: 0;
55
}
66
.njg-container {
7+
position: relative;
8+
left: 0;
9+
right: 0;
710
background: #fbfbfb;
811
border-radius: 2px;
912
border: 1px solid #ccc;
1013
color: #6d6357;
1114
line-height: 20px;
12-
max-width: 400px;
15+
max-width: 100%;
1316
min-width: 200px;
14-
padding: 10px 15px;
1517
}
16-
#graphChartContainer {
18+
.njg-container #graphChartContainer {
1719
width: 100%;
1820
height: 100%;
1921
overflow: hidden;
2022
z-index: 0;
2123
}
22-
.leaflet-control-zoom {
24+
.njg-container .leaflet-control-zoom {
2325
top: 5px;
2426
}
25-
.leaflet-control-zoom-in {
27+
.njg-container .leaflet-control-zoom-in {
2628
border-top-left-radius: 5px !important;
2729
border-top-right-radius: 5px !important;
2830
}
29-
.leaflet-control-zoom-out {
31+
.njg-container .leaflet-control-zoom-out {
3032
border-bottom-left-radius: 5px !important;
3133
border-bottom-right-radius: 5px !important;
3234
}
33-
.leaflet-control-fullscreen {
35+
.njg-container .leaflet-control-fullscreen {
3436
top: 5px;
3537
}
36-
.leaflet-control-fullscreen-button {
38+
.njg-container .leaflet-control-fullscreen-button {
3739
border-radius: 5px !important;
3840
}
39-
.leaflet-control-layers-toggle {
41+
.njg-container .leaflet-control-layers-toggle {
4042
height: 35px !important;
4143
width: 35px !important;
4244
background-size: 20px 20px !important;
4345
}
44-
.marker-cluster div {
46+
.njg-container .marker-cluster div {
4547
color: #fff;
4648
background-color: rgba(53, 60, 68, 0.8) !important;
4749
}
48-
.ok div {
50+
.njg-container .ok div {
4951
background-color: rgba(38, 113, 38, 0.8) !important;
5052
}
51-
.problem div {
53+
.njg-container .problem div {
5254
background-color: rgba(255, 180, 66, 0.8) !important;
5355
}
54-
.critical div {
56+
.njg-container .critical div {
5557
background-color: rgba(167, 45, 29, 0.8) !important;
5658
}
57-
.unknown div {
59+
.njg-container .unknown div {
5860
background-color: rgba(53, 60, 68, 0.8) !important;
5961
}
60-
.njg-controls {
62+
.njg-container .njg-controls {
6163
display: flex;
6264
justify-content: space-between;
6365
align-items: center;
@@ -67,29 +69,29 @@
6769
z-index: 999;
6870
background-color: inherit;
6971
}
70-
.njg-sideBar {
72+
.njg-container .njg-sideBar {
7173
display: none;
7274
}
73-
.njg-tooltip {
75+
.njg-container .njg-tooltip {
7476
background: #fff !important;
7577
border: none !important;
7678
}
77-
.njg-tooltip-item {
79+
.njg-container .njg-tooltip-item {
7880
display: flex;
7981
align-items: center;
8082
width: 100%;
8183
padding: 1px 0;
8284
flex-wrap: wrap;
8385
}
84-
.njg-tooltip-key {
86+
.njg-container .njg-tooltip-key {
8587
display: inline-flex;
8688
flex-basis: 40%;
8789
flex-wrap: wrap;
8890
text-transform: capitalize;
8991
font-weight: 600;
9092
color: #000;
9193
}
92-
.njg-tooltip-value {
94+
.njg-container .njg-tooltip-value {
9395
display: inline-flex;
9496
align-items: center;
9597
flex-wrap: wrap;

0 commit comments

Comments
 (0)