mirror of
https://github.com/GNS3/gns3-registry.git
synced 2025-04-25 13:29:42 +00:00
Download manager with live progress and notif when sucess
This commit is contained in:
parent
196e51179d
commit
b06f83ac19
@ -7,9 +7,16 @@ $(function() {
|
|||||||
for (var i in downloads) {
|
for (var i in downloads) {
|
||||||
download_info = downloads[i];
|
download_info = downloads[i];
|
||||||
var div = $("<div>");
|
var div = $("<div>");
|
||||||
|
div.attr("id", "download" + download_info.id);
|
||||||
div.text(download_info.url + " " + download_info.received + "/" + download_info.total);
|
div.text(download_info.url + " " + download_info.received + "/" + download_info.total);
|
||||||
downloads_div.append(div);
|
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 %}
|
{% endblock %}
|
||||||
|
@ -21,6 +21,11 @@
|
|||||||
var notif = $("#notif")
|
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>")
|
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>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user