Commit 9b757dd1 authored by Nicolas Wavrant's avatar Nicolas Wavrant

runner: minishell warns user when command couldn't be sent correctly

parent c20be5fb
...@@ -34,11 +34,14 @@ $(document).ready(function () { ...@@ -34,11 +34,14 @@ $(document).ready(function () {
var old_shell_btn_background = $(".shell_btn").css("background"); var old_shell_btn_background = $(".shell_btn").css("background");
$(".shell_btn").css("background", "url(/static/css/images/loading-min.gif) center right no-repeat") $(".shell_btn").css("background", "url(/static/css/images/loading-min.gif) center right no-repeat")
$.post("/runCommand", data, function (data) { $.post("/runCommand", data, function (data) {
data = ">>> " + command + "\n\n" + data; var data = ">>> " + command + "\n\n" + data;
$("#shell-result").val(data); $("#shell-result").val(data);
$("#shell-input").val(""); $("#shell-input").val("");
updateHistory(); updateHistory();
}) })
.fail( function(xhr, status, error) {
$("#error").Popup("Error while sending command. Server answered with :\n" + xhr.statusCode().status + " : " + error, {type: 'error', duration: 3000})
})
.always( function() { .always( function() {
$(".shell_btn").css("background", old_shell_btn_background); $(".shell_btn").css("background", old_shell_btn_background);
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment