Skip to content

Commit 180edaf

Browse files
committed
[chores] Reduced map popup spacing and font-sizes (when applicable)
1 parent c160a6a commit 180edaf

File tree

5 files changed

+40
-31
lines changed

5 files changed

+40
-31
lines changed

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

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
text-transform: uppercase;
2929
}
3030
#device-map-container {
31-
margin: 50px auto 0px auto;
31+
margin: 30px auto 0px auto;
3232
position: relative;
33-
height: 350px;
33+
height: 430px;
3434
width: 90%;
3535
border: 1px solid rgba(0, 0, 0, 0.3);
3636
}
@@ -64,7 +64,7 @@
6464
}
6565
.leaflet-popup-content {
6666
display: flex;
67-
min-width: fit-content;
67+
min-width: 410px;
6868
margin: 15px 20px !important;
6969
}
7070
.leaflet-popup-close-button {
@@ -84,12 +84,12 @@
8484
box-sizing: border-box;
8585
}
8686
.map-detail h2 {
87-
margin: 0 0 7px 0;
88-
font-size: 16px;
87+
margin: 0 0 5px 0;
88+
font-size: 15px;
8989
width: 90%;
9090
}
9191
.input-container {
92-
margin: 7px 0;
92+
margin: 5px 0;
9393
position: relative;
9494
width: 100%;
9595
}
@@ -99,38 +99,39 @@
9999
top: 46%;
100100
left: 10px;
101101
transform: translateY(-54%);
102-
width: 20px;
103-
height: 20px;
102+
width: 15px;
103+
height: 15px;
104104
background-color: #717680;
105105
mask-image: url("search.svg");
106106
-webkit-mask-image: url("search.svg");
107107
}
108108
.map-detail input {
109109
outline: none;
110110
width: 100%;
111-
padding: 6px 14px;
112-
padding-left: 38px;
111+
padding: 5px 14px;
112+
padding-left: 30px;
113113
box-sizing: border-box;
114114
border-radius: 6px;
115-
font-size: 14px;
115+
font-size: 12px;
116116
border: 1px solid #d5d7da;
117117
}
118118
.label-container {
119119
display: flex;
120120
flex-wrap: wrap;
121121
align-items: center;
122-
margin: 7px 0;
123-
gap: 8px;
122+
margin: 5px 0;
123+
gap: 6px;
124124
}
125125
.status-filter {
126126
cursor: pointer;
127127
}
128128
.health-status {
129-
padding: 3px 10px;
129+
padding: 3px 7px;
130130
border-radius: 12px;
131131
white-space: nowrap;
132-
font-size: 11px;
132+
font-size: 10px;
133133
opacity: 0.8;
134+
letter-spacing: -0.25px;
134135
}
135136
.health-status.active {
136137
opacity: 1;
@@ -143,21 +144,20 @@
143144
display: inline-block;
144145
}
145146
.table-container {
146-
height: 97px;
147+
max-height: 181px;
147148
overflow-y: auto;
148-
min-width: 330px;
149149
box-sizing: border-box;
150-
margin: 7px 0;
150+
margin: 10px 0;
151151
}
152152
.table-container table {
153153
width: 100%;
154154
}
155155
.table-container table thead th {
156156
font-size: 13px;
157-
padding: 7px !important;
157+
padding: 8px 10px !important;
158158
}
159159
.table-container table tbody td {
160-
padding: 7px !important;
160+
padding: 10px !important;
161161
font-size: 13px !important;
162162
}
163163
.th-status {
@@ -183,17 +183,18 @@
183183
}
184184
.floor-icon {
185185
display: inline-block;
186-
width: 23px;
187-
height: 23px;
186+
width: 20px;
187+
height: 20px;
188188
background-color: white;
189189
mask-repeat: no-repeat;
190-
margin-right: 16px;
190+
margin-right: 10px;
191+
mask-size: 90%;
192+
mask-position: center;
191193
}
192194
.floorplan-btn {
193-
padding: 7px 16px;
194-
margin-top: 7px;
195-
width: fit-content;
196-
font-size: 15px;
195+
padding: 5px 13px;
196+
margin-top: 5px;
197+
font-size: 13px;
197198
border-radius: 8px;
198199
align-self: center;
199200
display: flex;
Lines changed: 1 addition & 1 deletion
Loading

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,10 @@
8181
</span>`;
8282
});
8383
const has_floorplan = data.has_floorplan;
84+
const buttonText = gettext("Switch to Indoor View");
8485
const floorplan_btn = has_floorplan
8586
? `<button class="default-btn floorplan-btn">
86-
<span class="ow-floor floor-icon"></span> Switch to Floor Plan
87+
<span class="ow-floor floor-icon"></span> ${buttonText}
8788
</button>`
8889
: "";
8990

@@ -138,7 +139,13 @@
138139
</div>
139140
`;
140141

141-
currentPopup = L.popup().setLatLng(latLng).setContent(popupContent).openOn(map);
142+
currentPopup = L.popup({
143+
autoPan: true,
144+
autoPanPadding: [50, 50], // extra margin around the popup
145+
})
146+
.setLatLng(latLng)
147+
.setContent(popupContent)
148+
.openOn(map);
142149

143150
const el = $(currentPopup.getElement());
144151
function renderRows() {

requirements-test.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
openwisp-utils[qa,selenium] @ https://github.com/openwisp/openwisp-utils/tarball/1.2
1+
openwisp-utils[qa,selenium] @ https://github.com/openwisp/openwisp-utils/tarball/gsoc25-map-adjustments
22
django-redis~=6.0.0
33
mock-ssh-server~=0.9.1
44
channels_redis~=4.3.0

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
openwisp-controller @ https://github.com/openwisp/openwisp-controller/tarball/gsoc25-map
2+
openwisp-utils[celery,channels] @ https://github.com/openwisp/openwisp-utils/tarball/gsoc25-map-adjustments
23
influxdb~=5.3.2
34
django-nested-admin~=4.1.4
45
python-dateutil>=2.7.0,<3.0.0

0 commit comments

Comments
 (0)