Use document attribute for blocking firmware downloads, fixing #17
This commit is contained in:
parent
45fa971588
commit
e89dac03ea
1 changed files with 8 additions and 3 deletions
|
@ -13,11 +13,11 @@ function urlStatus(url, cb){
|
||||||
function checkDownload(url){
|
function checkDownload(url){
|
||||||
urlStatus(url, function(status) {
|
urlStatus(url, function(status) {
|
||||||
if (status === 200){
|
if (status === 200){
|
||||||
var working = false;
|
document.buildingfw = false;
|
||||||
document.getElementById("download").src=url;
|
document.getElementById("download").src=url;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var working = true;
|
document.buildingfw = true;
|
||||||
checkDownload(url);
|
checkDownload(url);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -101,10 +101,13 @@ function askreboot(device_id) {
|
||||||
};
|
};
|
||||||
|
|
||||||
function downloadnotice(device_id) {
|
function downloadnotice(device_id) {
|
||||||
if (!working) {
|
if (!document.buildingfw) {
|
||||||
alert("Your file is being prepared. This might take a minute or two, the download will start automatically when the file is ready. You may close this page and click the download button again later to pick the file up – we will store it for you.");
|
alert("Your file is being prepared. This might take a minute or two, the download will start automatically when the file is ready. You may close this page and click the download button again later to pick the file up – we will store it for you.");
|
||||||
checkDownload('/devices/' + device_id + '/download/');
|
checkDownload('/devices/' + device_id + '/download/');
|
||||||
};
|
};
|
||||||
|
else {
|
||||||
|
alert("You are currently building another firmware. Please wait for this to finish and try again.");
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
function showdevices() {
|
function showdevices() {
|
||||||
|
@ -223,3 +226,5 @@ $("div[id$='-indicator']").each(function() {
|
||||||
$("#orgaselect").on('change', function() {
|
$("#orgaselect").on('change', function() {
|
||||||
filtertables();
|
filtertables();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
document.buildingfw = false;
|
||||||
|
|
Loading…
Reference in a new issue