|
@@ -118,6 +118,11 @@ class BatcaveHttpRequestHandler(BaseHTTPRequestHandler):
|
|
|
self.__respond_nodedetail(nodeid, cmd[1:])
|
|
|
return
|
|
|
|
|
|
+ # /status - overall status (incl. node and client count)
|
|
|
+ if path == 'status':
|
|
|
+ self.__respond_status()
|
|
|
+ return
|
|
|
+
|
|
|
# /status/<id> - node's status
|
|
|
match = REGEX_URL_NODESTATUS.match(path)
|
|
|
if match is not None:
|
|
@@ -315,6 +320,12 @@ class BatcaveHttpRequestHandler(BaseHTTPRequestHandler):
|
|
|
extra={'Content-Disposition': 'inline'})
|
|
|
self.wfile.write(value if no_json else json.dumps(value))
|
|
|
|
|
|
+ def __respond_status(self):
|
|
|
+ status = self.server.storage.status
|
|
|
+ self.__send_headers('application/json',
|
|
|
+ extra={'Content-Disposition': 'inline'})
|
|
|
+ self.wfile.write(json.dumps(status, indent=2))
|
|
|
+
|
|
|
def __respond_vpn(self, query):
|
|
|
storage = self.server.storage
|
|
|
peername = query.get('peer')
|