From 4beb97fc6fc2d9b38fa06ee874a21160884e83eb Mon Sep 17 00:00:00 2001 From: Russ Handorf Date: Tue, 28 Feb 2023 12:57:50 -0500 Subject: [PATCH] dot graph map --- .../dbview/__pycache__/views.cpython-38.pyc | Bin 15820 -> 16410 bytes logviewer/dbview/views.py | 16 ++ logviewer/dotmap/__init__.py | 0 .../__pycache__/__init__.cpython-38.pyc | Bin 0 -> 152 bytes .../dotmap/__pycache__/urls.cpython-38.pyc | Bin 0 -> 283 bytes .../dotmap/__pycache__/views.cpython-38.pyc | Bin 0 -> 614 bytes logviewer/dotmap/admin.py | 3 + logviewer/dotmap/apps.py | 6 + logviewer/dotmap/migrations/__init__.py | 0 logviewer/dotmap/models.py | 3 + logviewer/dotmap/tests.py | 3 + logviewer/dotmap/urls.py | 8 + logviewer/dotmap/views.py | 15 + .../logviewer/__pycache__/urls.cpython-38.pyc | Bin 2953 -> 3037 bytes logviewer/logviewer/urls.py | 2 + logviewer/static/dot_map_panel.html | 270 ++++++++++++++++++ logviewer/static/dynamic.js | 2 + logviewer/static/js/kismet.ui.dotmap.js | 30 ++ 18 files changed, 358 insertions(+) create mode 100644 logviewer/dotmap/__init__.py create mode 100644 logviewer/dotmap/__pycache__/__init__.cpython-38.pyc create mode 100644 logviewer/dotmap/__pycache__/urls.cpython-38.pyc create mode 100644 logviewer/dotmap/__pycache__/views.cpython-38.pyc create mode 100644 logviewer/dotmap/admin.py create mode 100644 logviewer/dotmap/apps.py create mode 100644 logviewer/dotmap/migrations/__init__.py create mode 100644 logviewer/dotmap/models.py create mode 100644 logviewer/dotmap/tests.py create mode 100644 logviewer/dotmap/urls.py create mode 100644 logviewer/dotmap/views.py create mode 100644 logviewer/static/dot_map_panel.html create mode 100644 logviewer/static/js/kismet.ui.dotmap.js diff --git a/logviewer/dbview/__pycache__/views.cpython-38.pyc b/logviewer/dbview/__pycache__/views.cpython-38.pyc index 7e183cbbd6fdb4a67527f58af4cc6d6c5c0f508c..714a6c4bc1c0ea3f18fb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ap/__pycache__/urls.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fbce56cb81fc16d126188fd5c297b38a2724adb8 GIT binary patch literal 283 zcmYjLJ5Izf5Vhkttk};jC{hsDE3MF;fCkZ|Gt7`=@h7sg3mk%ja15^DmTC(wK(maY zfG5qHd796g+vW0{5iUO8?>*&@EdE21*iyuX2pDj~EN?kyP=GLn6|LY5Ig}`NB}k}V zMaNqSXE&^#9chQvJe8xK`Xm1p@-X02Of1R40Y2xp(-yDmD$QZ1UFVy9FfkM~9`%tyHZ literal 0 HcmV?d00001 diff --git a/logviewer/dotmap/__pycache__/views.cpython-38.pyc b/logviewer/dotmap/__pycache__/views.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..87ecb61221b098722ef9e1eefe436ca525628d49 GIT binary patch literal 614 zcmYjO!EV$r5VajAyWOTzwXMXN8#%Dyii8jn95|J#TP_i372;`=t`n#BY-v}!C%E<> z%8~!zD}3d|FCZZ?4hTBZJiTYn*w3D~dwUZ`@eqDh-#BC6gSa1p#0yIIgg`OHHEVgn zdEi2eHY%c47IM&$j*D1H6@O+$qM|v=k{{H?GVT)#odTN)pT0)yPr&u2bKrOXsLK^N zJgUgRzmUX2zNB=g1RHii*Dr;AM2z2wFYFb2KYb^*d@C^8@QwH+IJ-PVsRUKT515LS zycOFhC>2xZF(#WxC2Djl=JWtEI6m_7_|5!uJ#tuLQ{`UR59C+2M#1_ZR|Xet*)RIC z13jy;)$1LEYs>?sy0kJKLWc{y=^-2Wqy?;vvN0L)@b<3?34>LT>A_Q^ua<%f`_)kF`0!YTzT- z{68bVWH%4%Zr0P84SoA{aN|+}CMSH#Q!(WeZVyS5<$ZNgcIRg1YGbilp|fG;e)sQk mP2(E;+As|-j2jvUXZPSBY>uDNx2-fh4})|GLCW{}So{XyDxgXL literal 0 HcmV?d00001 diff --git a/logviewer/dotmap/admin.py b/logviewer/dotmap/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/logviewer/dotmap/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/logviewer/dotmap/apps.py b/logviewer/dotmap/apps.py new file mode 100644 index 0000000..673bc46 --- /dev/null +++ b/logviewer/dotmap/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class DotmapConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'dotmap' diff --git a/logviewer/dotmap/migrations/__init__.py b/logviewer/dotmap/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/logviewer/dotmap/models.py b/logviewer/dotmap/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/logviewer/dotmap/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/logviewer/dotmap/tests.py b/logviewer/dotmap/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/logviewer/dotmap/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/logviewer/dotmap/urls.py b/logviewer/dotmap/urls.py new file mode 100644 index 0000000..4c9189f --- /dev/null +++ b/logviewer/dotmap/urls.py @@ -0,0 +1,8 @@ +from django.urls import path + +from . import views + +urlpatterns = [ + path('', views.index, name='index'), +] + diff --git a/logviewer/dotmap/views.py b/logviewer/dotmap/views.py new file mode 100644 index 0000000..33c4107 --- /dev/null +++ b/logviewer/dotmap/views.py @@ -0,0 +1,15 @@ +from django.shortcuts import render +from django.http import HttpResponse, HttpRequest +import os + +def index(request): + #print("===") + #print(request) + #print("====") + if request.method == 'POST': + for key, value in request.POST.items(): + print(key,value) + + load_file = open('static/'+request.path, mode='rb') + if request.path == "/dot_map_panel.html": + return HttpResponse(load_file, content_type='text/html') diff --git a/logviewer/logviewer/__pycache__/urls.cpython-38.pyc b/logviewer/logviewer/__pycache__/urls.cpython-38.pyc index 693196dc72df57ba329e2c1f556435cba101f6d5..6300a7dd2ca94289fe4eaa3ed1a6a8daa77763fc 100644 GIT binary patch delta 218 zcmeAazbmdC%FD~e00g-?f0H};7#JRdILN>N$Z-JT;((3XQjCmplY#Xn?o1?PH3#-zy_+zFEdxLFu40|1>B BH!J`E delta 157 zcmcaB-YKpf%FD~e00i5n+)5VXV_', include('kiscontent.urls')), path('adsb_map_panel.html', include('adsbmap.urls')), path('russ_map_panel.html', include('russmap.urls')), + path('dot_map_panel.html', include('dotmap.urls')), path('system/status.json', include('dbview.urls')), path('alerts/wrapped/last-time/0/alerts.json', include('dbview.urls')), path('messagebus/last-time/0/messages.json', include('dbview.urls')), @@ -56,6 +57,7 @@ urlpatterns = [ path('devices/views/phy-IEEE802.11/devices.json', include('dbview.urls')), path('phy/ADSB/map_data.json', include('dbview.urls')), path('phy/RUSS/map_data.json', include('dbview.urls')), + path('phy/DOT/map_data.json', include('dbview.urls')), path('devices/by-key//device.json', include('devices.urls')), path('devices/multikey/as-object/devices.json', include('dbview.urls')), path('datasource/by-uuid//source.json', include('devices.urls')), diff --git a/logviewer/static/dot_map_panel.html b/logviewer/static/dot_map_panel.html new file mode 100644 index 0000000..bd8eb9f --- /dev/null +++ b/logviewer/static/dot_map_panel.html @@ -0,0 +1,270 @@ + + + + dot map + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Warning! +

To display the Russ map, your browser will connect to the Leaflet and Open Street Map servers to fetch the map tiles. This requires you have a functional Internet connection, and will reveal something about your location (the bounding region where planes have been seen.) +

Don't warn me again +

+

+
+ + + + diff --git a/logviewer/static/dynamic.js b/logviewer/static/dynamic.js index 8c386ea..1edfd01 100644 --- a/logviewer/static/dynamic.js +++ b/logviewer/static/dynamic.js @@ -11,6 +11,7 @@ var kismet_ui_rtl433; var kismet_ui_uav; var kismet_ui_zwave; var kismet_ui_russmap; +var kismet_ui_dotmap; async function load_dynamics() { kismet_ui_adsb = await import(`${local_uri_prefix}js/kismet.ui.adsb.js`); kismet_ui_bluetooth = await import(`${local_uri_prefix}js/kismet.ui.bluetooth.js`); @@ -22,4 +23,5 @@ kismet_ui_rtl433 = await import(`${local_uri_prefix}js/kismet.ui.rtl433.js`); kismet_ui_uav = await import(`${local_uri_prefix}js/kismet.ui.uav.js`); kismet_ui_zwave = await import(`${local_uri_prefix}js/kismet.ui.zwave.js`); kismet_ui_russmap = await import(`${local_uri_prefix}js/kismet.ui.russmap.js`); +kismet_ui_dotmap = await import(`${local_uri_prefix}js/kismet.ui.dotmap.js`); } diff --git a/logviewer/static/js/kismet.ui.dotmap.js b/logviewer/static/js/kismet.ui.dotmap.js new file mode 100644 index 0000000..82ec5f8 --- /dev/null +++ b/logviewer/static/js/kismet.ui.dotmap.js @@ -0,0 +1,30 @@ + +"use strict"; + +var local_uri_prefix = ""; +if (typeof(KISMET_URI_PREFIX) !== 'undefined') + local_uri_prefix = KISMET_URI_PREFIX; + +kismet_ui_tabpane.AddTab({ + id: 'dotmap', + tabTitle: 'Relationship Map', + expandable: false, + createCallback: function(div) { + var url = new URL(parent.document.URL); + url.searchParams.append('parent_url', url.origin) + url.searchParams.append('local_uri_prefix', local_uri_prefix); + url.searchParams.append('KISMET_PROXY_PREFIX', KISMET_PROXY_PREFIX); + url.pathname = `${local_uri_prefix}${KISMET_PROXY_PREFIX}dot_map_panel.html`; + + div.append( + $('