diff --git a/gns3server/handlers/file_upload_handler.py b/gns3server/handlers/file_upload_handler.py index 194b6b6d..41ac5682 100644 --- a/gns3server/handlers/file_upload_handler.py +++ b/gns3server/handlers/file_upload_handler.py @@ -23,6 +23,7 @@ Simple file upload & listing handler. import os import stat import tornado.web +from ..version import __version__ from ..config import Config import logging @@ -44,6 +45,7 @@ class FileUploadHandler(tornado.web.RequestHandler): server_config = config.get_default_section() # default projects directory is "~/Documents/GNS3/images" self._upload_dir = os.path.expandvars(os.path.expanduser(server_config.get("upload_directory", "~/Documents/GNS3/images"))) + self._host = request.host try: os.makedirs(self._upload_dir) @@ -65,7 +67,11 @@ class FileUploadHandler(tornado.web.RequestHandler): for filename in os.listdir(path): items.append(filename) - self.render("upload.html", path=path, items=items) + self.render("upload.html", + version=__version__, + host=self._host, + path=path, + items=items) def post(self): """ diff --git a/gns3server/templates/upload.html b/gns3server/templates/upload.html index f170e3dd..e8310dc0 100644 --- a/gns3server/templates/upload.html +++ b/gns3server/templates/upload.html @@ -1,10 +1,10 @@ -Upload Form +Upload Form for GNS3 server {{version}} -

Select & Upload

+

Select & Upload (v{{version}})

File:
@@ -12,7 +12,7 @@ File:
{%if items%} -

Files

+

Files on {{host}}