remove old status urls

This commit is contained in:
Jakob Ketterl 2020-06-01 16:03:22 +02:00
parent ebd1e04414
commit c87cfed525
2 changed files with 2 additions and 25 deletions

View File

@ -9,26 +9,6 @@ import pkg_resources
class StatusController(Controller):
def indexAction(self):
pm = Config.get()
# convert to old format
gps = (pm["receiver_gps"]["lat"], pm["receiver_gps"]["lon"])
avatar_path = pkg_resources.resource_filename("htdocs", "gfx/openwebrx-avatar.png")
# TODO keys that have been left out since they are no longer simple strings: sdr_hw, bands, antenna
vars = {
"status": "active",
"name": pm["receiver_name"],
"op_email": pm["receiver_admin"],
"users": ClientRegistry.getSharedInstance().clientCount(),
"users_max": pm["max_clients"],
"gps": gps,
"asl": pm["receiver_asl"],
"loc": pm["receiver_location"],
"sw_version": openwebrx_version,
"avatar_ctime": os.path.getctime(avatar_path),
}
self.send_response("\n".join(["{key}={value}".format(key=key, value=value) for key, value in vars.items()]))
def getProfileStats(self, profile):
return {
"name": profile["name"],
@ -45,7 +25,7 @@ class StatusController(Controller):
}
return stats
def jsonAction(self):
def indexAction(self):
pm = Config.get()
status = {

View File

@ -89,15 +89,12 @@ class Router(object):
def __init__(self):
self.routes = [
StaticRoute("/", IndexController),
StaticRoute("/status", StatusController),
StaticRoute("/status.json", StatusController, options={"action": "jsonAction"}),
StaticRoute("/status.json", StatusController),
RegexRoute("/static/(.+)", OwrxAssetsController),
RegexRoute("/compiled/(.+)", CompiledAssetsController),
RegexRoute("/aprs-symbols/(.+)", AprsSymbolsController),
StaticRoute("/ws/", WebSocketController),
RegexRoute("(/favicon.ico)", OwrxAssetsController),
# backwards compatibility for the sdr.hu portal
RegexRoute("(/gfx/openwebrx-avatar.png)", OwrxAssetsController),
StaticRoute("/map", MapController),
StaticRoute("/features", FeatureController),
StaticRoute("/api/features", ApiController),