add some map basics

This commit is contained in:
Jakob Ketterl
2019-07-01 16:49:39 +02:00
parent f283a1ad68
commit a4a306374d
4 changed files with 49 additions and 2 deletions

View File

@ -79,6 +79,10 @@ class IndexController(AssetsController):
def handle_request(self):
self.serve_file("index.html", content_type = "text/html")
class MapController(AssetsController):
def handle_request(self):
self.serve_file("map.html", content_type = "text/html")
class WebSocketController(Controller):
def handle_request(self):
conn = WebSocketConnection(self.handler, WebSocketMessageHandler())

View File

@ -1,4 +1,4 @@
from owrx.controllers import StatusController, IndexController, AssetsController, WebSocketController
from owrx.controllers import StatusController, IndexController, AssetsController, WebSocketController, MapController
from http.server import BaseHTTPRequestHandler
import re
@ -20,7 +20,8 @@ class Router(object):
{"route": "/ws/", "controller": WebSocketController},
{"regex": "(/favicon.ico)", "controller": AssetsController},
# backwards compatibility for the sdr.hu portal
{"regex": "/(gfx/openwebrx-avatar.png)", "controller": AssetsController}
{"regex": "/(gfx/openwebrx-avatar.png)", "controller": AssetsController},
{"route": "/map", "controller": MapController}
]
def find_controller(self, path):
for m in Router.mappings: