]> source.dussan.org Git - rspamd.git/commitdiff
[WebUI] fix uptime 1250/head
authorAnna Stakhova <anna@rspamd.com>
Sun, 11 Dec 2016 12:26:49 +0000 (12:26 +0000)
committerAnna Stakhova <anna@rspamd.com>
Sun, 11 Dec 2016 12:26:49 +0000 (12:26 +0000)
Add ajax to timer

interface/js/rspamd.js

index 9d5b469441cf1984a0fcf8ba39242ccf56eed0e0..ec273f27f92ba40cee33577e38602623375fe8b9 100644 (file)
         }
         // @show widgets
         function statWidgets() {
+            $.ajax({
+                dataType: 'json',
+                type: 'GET',
+                url: 'auth',
+                jsonp: false,
+                beforeSend: function (xhr) {
+                    xhr.setRequestHeader('Password', getPassword());
+                },
+                success: function (data) {
+                  if (!supportsSessionStorage()) {
+                      $.cookie('rspamdsession', data, {
+                          expires: 1
+                      }, {
+                          path: '/'
+                      });
+                      } else {
+                          sessionStorage.setItem('Credentials', JSON.stringify(data));
+                      }
+                  }
+            });
             var widgets = $('#statWidgets');
             $(widgets).empty().hide();
             var data;