Guess WebSocket port based on HTTP port; read dashboard.html on each request
parent
f155cbc4ed
commit
933d293305
|
@ -1453,7 +1453,12 @@ var Dashboard = function() {
|
|||
JobsRenderer.prototype._renderDownloadLine = JobsRenderer.prototype._moreDomRenderDownloadLine;
|
||||
}
|
||||
|
||||
this.host = args["host"] ? args["host"] : location.host;
|
||||
if(args["host"]) {
|
||||
this.host = args["host"];
|
||||
} else {
|
||||
// Guess that the WebSocket port is one above the HTTP port
|
||||
this.host = location.hostname + ':' + (Number(location.port) + 1);
|
||||
}
|
||||
this.dumpTraffic = args["dumpMax"] && Number(args["dumpMax"]) > 0;
|
||||
if(this.dumpTraffic) {
|
||||
this.dumpMax = Number(args["dumpMax"]);
|
||||
|
|
|
@ -54,11 +54,11 @@ class MyServerFactory(WebSocketServerFactory):
|
|||
self.clients = set()
|
||||
|
||||
|
||||
dashboardHtml = open(os.path.join(os.path.dirname(__file__), "dashboard.html"), "rb").read()
|
||||
|
||||
@asyncio.coroutine
|
||||
def dashboard(request):
|
||||
return aiohttp.web.Response(body=dashboardHtml)
|
||||
with open(os.path.join(os.path.dirname(__file__), "dashboard.html"), "rb") as f:
|
||||
dashboardHtml = f.read()
|
||||
return aiohttp.web.Response(body=dashboardHtml)
|
||||
|
||||
|
||||
@asyncio.coroutine
|
||||
|
|
Loading…
Reference in New Issue