Download manager with live progress and notif when sucess

This commit is contained in:
Julien Duponchelle 2015-07-31 17:16:07 +02:00
parent 196e51179d
commit b06f83ac19
2 changed files with 12 additions and 0 deletions

View File

@ -7,9 +7,16 @@ $(function() {
for (var i in downloads) {
download_info = downloads[i];
var div = $("<div>");
div.attr("id", "download" + download_info.id);
div.text(download_info.url + " " + download_info.received + "/" + download_info.total);
downloads_div.append(div);
}
gns3.downloadProgress.connect(function(download_info) {
console.log("blu");
var div = $("#download" + download_info.id);
div.text(download_info.url + " " + download_info.received + "/" + download_info.total);
});
});
{% endblock %}

View File

@ -21,6 +21,11 @@
var notif = $("#notif")
notif.append("<div class=\"alert alert-danger alert-dismissible fade in\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button><h4>You got an error!</h4><p>" + msg + "</p></div>")
});
gns3.success.connect(function(msg) {
var notif = $("#notif")
notif.append("<div class=\"alert alert-success alert-dismissible fade in\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button>" + msg + "</div>")
});
</script>
<script>