diff options
author | Anna Stakhova <anna@rspamd.com> | 2016-12-11 12:26:49 +0000 |
---|---|---|
committer | Anna Stakhova <anna@rspamd.com> | 2016-12-11 12:26:49 +0000 |
commit | e72365b0f47a5e1048fbc7d57170d07fe8457018 (patch) | |
tree | 01049528680358dd178c9caad3959726aea7e5f5 /interface/js/rspamd.js | |
parent | c36509bb0e1d7d733a60d60683f64bb0dd71c044 (diff) | |
download | rspamd-e72365b0f47a5e1048fbc7d57170d07fe8457018.tar.gz rspamd-e72365b0f47a5e1048fbc7d57170d07fe8457018.zip |
[WebUI] fix uptime
Add ajax to timer
Diffstat (limited to 'interface/js/rspamd.js')
-rw-r--r-- | interface/js/rspamd.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/interface/js/rspamd.js b/interface/js/rspamd.js index 9d5b46944..ec273f27f 100644 --- a/interface/js/rspamd.js +++ b/interface/js/rspamd.js @@ -309,6 +309,26 @@ } // @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; |