diff --git a/src/octoprint/plugins/softwareupdate/static/js/softwareupdate.js b/src/octoprint/plugins/softwareupdate/static/js/softwareupdate.js index 8747c25e..c047bb85 100644 --- a/src/octoprint/plugins/softwareupdate/static/js/softwareupdate.js +++ b/src/octoprint/plugins/softwareupdate/static/js/softwareupdate.js @@ -73,6 +73,8 @@ $(function() { {"key": "git_commit", "name": gettext("Commit")} ]; + self.reloadOverlay = $("#reloadui_overlay"); + self.versions = new ItemListHelper( "plugin.softwareupdate.versions", { @@ -407,18 +409,10 @@ $(function() { self.onDataUpdaterReconnect = function() { if (self.waitingForRestart) { self.waitingForRestart = false; - - var options = { - title: gettext("Restart successful!"), - text: gettext("The server was restarted successfully. The page will now reload automatically."), - type: "success", - hide: false - }; - self._showPopup(options); self.updateInProgress = false; - - var delay = 5 + Math.floor(Math.random() * 5) + 1; - setTimeout(function() {location.reload(true);}, delay * 1000); + if (!self.reloadOverlay.is(":visible")) { + self.reloadOverlay.show(); + } } }; diff --git a/src/octoprint/static/js/app/viewmodels/control.js b/src/octoprint/static/js/app/viewmodels/control.js index a8680e87..70865873 100644 --- a/src/octoprint/static/js/app/viewmodels/control.js +++ b/src/octoprint/static/js/app/viewmodels/control.js @@ -293,7 +293,7 @@ $(function() { if (command.hasOwnProperty("command") || command.hasOwnProperty("commands")) { var commands = command.commands || [command.command]; - if (commands.hasOwnProperty("input")) { + if (command.hasOwnProperty("input")) { var parameters = {}; _.each(command.input, function(input) { if (!input.hasOwnProperty("parameter") || !input.hasOwnProperty("value")) { diff --git a/src/octoprint/static/js/app/viewmodels/files.js b/src/octoprint/static/js/app/viewmodels/files.js index f13a13ed..b7462335 100644 --- a/src/octoprint/static/js/app/viewmodels/files.js +++ b/src/octoprint/static/js/app/viewmodels/files.js @@ -525,6 +525,9 @@ $(function() { var drop = (dropzone == "local") ? localTarget : sdTarget; var url = API_BASEURL + "files/" + dropzone; + if (button === undefined) + return; + button.fileupload({ url: url, dataType: "json",