Skip to content
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
aa271b2
[feature] Setting url fragments and applying to that data #562
dee077 Sep 11, 2025
2b616a5
[fix] Update netjsongraph.min.js
dee077 Sep 11, 2025
173748a
[fix] Use decode istead of image.onLoad
dee077 Sep 11, 2025
435a728
[fix] Add support for going back in history
dee077 Sep 17, 2025
061992c
[tests] Add tests
dee077 Sep 18, 2025
6a52557
[feature] Allow showing moving device in dashboard map #664
dee077 Sep 20, 2025
5066fe4
[fix] Test approach
dee077 Sep 26, 2025
a3175c6
[fix] Update netjsongraph.js
dee077 Oct 2, 2025
9207784
[fix] Added onmessage for all location updates ws endpoint
dee077 Dec 3, 2025
31bc19d
[tests] Add selenium tests for mobile device
dee077 Dec 30, 2025
7992f80
[fix] Rebased and update netjsongraph.js
dee077 Dec 30, 2025
25f1982
[tests] Fix tests
dee077 Dec 31, 2025
b245600
[fix] Minor changes
dee077 Jan 4, 2026
795ca0e
[tests] Fixed issue with MONITORING_API_BASEURL
pandafy Jan 7, 2026
cbc641b
[fix] Add comment and fix ci
dee077 Jan 7, 2026
f416270
[fix] Update we endpoint
dee077 Jan 14, 2026
6b10bcb
[fix] Add srid and fix ci
dee077 Jan 15, 2026
3e99366
[fix] Update to latest netjsongraph.js master
dee077 Jan 27, 2026
9071a11
[fix] Minor changes
dee077 Jan 27, 2026
d88ef63
[chores] Updated netjsongraph.js theme
pandafy Jan 28, 2026
e683967
[chores] Added loading gif
pandafy Jan 28, 2026
b489d33
[revert] Revert "[chores] Updated netjsongraph.js theme"
pandafy Jan 28, 2026
fdd5a71
[fix] Add loaders and button tags
dee077 Jan 29, 2026
ba08b28
[fix] Removed source map from netjsongraph lib
nemesifier Jan 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ jobs:
pip install -r requirements-test.txt
pip install -U -I -e .
pip uninstall -y Django
# TODO: Remove before merging - install branch build of openwisp-utils for CI testing
pip install -U -I "openwisp-utils @ https://github.com/openwisp/openwisp-utils/tarball/gsoc25-map-adjustments"
pip install -U ${{ matrix.django-version }}
sudo npm install -g prettier

Expand Down
23 changes: 22 additions & 1 deletion openwisp_monitoring/device/static/monitoring/js/device-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@
}
const option = map.echarts.getOption();
const series = option.series.find(
(s) => s.type === "scatter" || "effectScatter",
(s) => s.type === "scatter" || s.type === "effectScatter",
);
const seriesIndex = option.series.indexOf(series);

Expand All @@ -573,6 +573,7 @@
},
});
map.render();
listenForLocationUpdates(map);
window._owGeoMap = map;
}

Expand All @@ -588,4 +589,24 @@
success: onAjaxSuccess,
context: window,
});
function listenForLocationUpdates(map) {
if (!map) {
return;
}
var host = window.location.host,
protocol = window.location.protocol === "http:" ? "ws" : "wss",
ws = new ReconnectingWebSocket(protocol + "://" + host + "/ws/loci/location/");
ws.onmessage = function (e) {
const data = JSON.parse(e.data);
const [lng, lat] = data.geometry.coordinates;
if (currentPopup) {
$(".leaflet-popup").hide();
}
map.utils.moveNodeInRealTime(data.id, { lng, lat });
if (currentPopup) {
currentPopup.setLatLng([lat, lng]);
$(".leaflet-popup").show();
}
};
}
})(django.jQuery);
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
// When switching maps we expect only two maps at most; the previous map should
// be removed before adding the new one.
// Note: future logic to manage this will be implemented in netjsongraph.js.
const rawUrlFragments = window.location.hash.replace(/^#/, "");
const rawUrlFragments = decodeURIComponent(window.location.hash.replace(/^#/, ""));
const fragments = rawUrlFragments.split(";").filter((f) => f.trim() !== "");

const indoorMapFragment = fragments.find((fragment) => {
Expand Down

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions openwisp_monitoring/device/tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ def test_device_admin(self):
def test_dashboard_map_on_index(self):
url = reverse("admin:index")
response = self.client.get(url)
self.assertContains(response, "geoJsonUrl: 'http://testserver/api")
self.assertContains(response, "locationDeviceUrl: 'http://testserver/api")
self.assertContains(response, "geoJsonUrl: 'http://testserver/api/")
self.assertContains(response, "locationDeviceUrl: 'http://testserver/api/")

def test_wifisession_dashboard_chart_query(self):
url = reverse("admin:index")
Expand Down
Loading
Loading