From 196e51179d6fde4b26d6a62d3dfd20d12e638b5c Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Thu, 30 Jul 2015 17:51:34 +0200 Subject: [PATCH] Show a page with current downloads --- build.py | 1 + templates/downloads.html | 20 ++++++++++++++++++++ templates/layout/default.html | 1 + 3 files changed, 22 insertions(+) create mode 100644 templates/downloads.html diff --git a/build.py b/build.py index 6f80605..0499454 100644 --- a/build.py +++ b/build.py @@ -54,6 +54,7 @@ def render(template_file, out, **kwargs): render('index.html', 'index.html') render('chat.html', 'chat.html') +render('downloads.html', 'downloads.html') devices = [] diff --git a/templates/downloads.html b/templates/downloads.html new file mode 100644 index 0000000..89855db --- /dev/null +++ b/templates/downloads.html @@ -0,0 +1,20 @@ +{% extends "layout/default.html" %} +{% block script %} + +$(function() { + var downloads_div = $("#downloads"); + var downloads = gns3.downloads() + for (var i in downloads) { + download_info = downloads[i]; + var div = $("
"); + div.text(download_info.url + " " + download_info.received + "/" + download_info.total); + downloads_div.append(div); + } +}); + +{% endblock %} +{% block body %} +
+
+ +{% endblock %} diff --git a/templates/layout/default.html b/templates/layout/default.html index 5760ada..8cac960 100644 --- a/templates/layout/default.html +++ b/templates/layout/default.html @@ -44,6 +44,7 @@