4951: Incorporate review feedback. Always show the request button, along with the...
[arvados.git] / apps / workbench / app / assets / javascripts / request_shell_access.js
index 9378c6b0bf3f3b125ba5a4272533517f71b3c0b1..a40334b8a23f8d224a91edb9adf9bf3a69dbf985 100644 (file)
@@ -1,8 +1,9 @@
 $(document).ready(function(){
     var $noShellAccessDiv = $('#no_shell_access');
     if ($noShellAccessDiv.length) {
-      if (getLocalStorageValue('request_shell_access') == 'sent') {
-        $('div').remove('.no_shell_access_msg');
+      requestSent = localStorage.getItem('request_shell_access');
+      if (requestSent != null) {
+        $("#shell_access_requested_msg").html(requestSent)
       } else {
         $('div').remove('.shell_access_requested');
       }
@@ -18,8 +19,13 @@ $(document).
     $.ajax('/').
       success(function(data, status, jqxhr) {
         $('div').remove('.no_shell_access_msg');
-        $('.no_shell_access').append('<div class="alert alert-success"><p class="contain-align-left">Request sent for shell access.</p></div>');
-        localStorage.setItem("request_shell_access", "sent");
+        $('div').remove('.shell_access_requested');
+
+        $('.no_shell_access').append('<div class="alert alert-success"><p class="contain-align-left">A request for shell access was sent.</p></div>');
+        var timestamp = new Date();
+        localStorage.setItem("request_shell_access", "A request for shell access was sent on " +
+                                                      timestamp.toLocaleDateString() +
+                                                      " at " + timestamp.toLocaleTimeString());
       }).
       fail(function(jqxhr, status, error) {
         var $sendButton = $('#request_shell_submit');