mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-17 22:08:35 +00:00
Make the Web UI the default page. Ref https://github.com/GNS3/gns3-server/issues/1737
This commit is contained in:
parent
6c322bbdde
commit
3626bd5adb
@ -31,7 +31,24 @@ class IndexHandler:
|
||||
r"/",
|
||||
description="Home page of the GNS3 server"
|
||||
)
|
||||
def index(request, response):
|
||||
async def index(request, response):
|
||||
|
||||
#FIXME: this could probably be handled in a better way
|
||||
static = get_resource(os.path.join('static', 'web-ui', 'bundled'))
|
||||
|
||||
# guesstype prefers to have text/html type than application/javascript
|
||||
# which results with warnings in Firefox 66 on Windows
|
||||
# Ref. gns3-server#1559
|
||||
_, ext = os.path.splitext(static)
|
||||
mimetype = ext == '.js' and 'application/javascript' or None
|
||||
|
||||
await response.stream_file(static, status=200, set_content_type=mimetype)
|
||||
|
||||
@Route.get(
|
||||
r"/debug",
|
||||
description="Old index page"
|
||||
)
|
||||
def upload(request, response):
|
||||
response.template("index.html")
|
||||
|
||||
@Route.get(
|
||||
|
Loading…
Reference in New Issue
Block a user