From 2ebac2f20a483ed078bdd214c2c3352d47c2fab6 Mon Sep 17 00:00:00 2001
From: grossmj
Date: Sat, 19 Apr 2014 18:37:10 -0600
Subject: [PATCH] Update upload template.
---
gns3server/handlers/file_upload_handler.py | 8 +++++++-
gns3server/templates/upload.html | 6 +++---
gns3server/version.py | 2 +-
3 files changed, 11 insertions(+), 5 deletions(-)
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}})
{%if items%}
-Files
+Files on {{host}}
{%for item in items%}
- {{path}}/{{item}}
diff --git a/gns3server/version.py b/gns3server/version.py
index 2be9d154..df08e796 100644
--- a/gns3server/version.py
+++ b/gns3server/version.py
@@ -23,5 +23,5 @@
# or negative for a release candidate or beta (after the base version
# number has been incremented)
-__version__ = "1.0-alpha2"
+__version__ = "1.0a3.dev1"
__version_info__ = (1, 0, 0, -99)