Commit be3727e7 by Őry Máté

dashboard: refresh activity on tab click

parent 38f7bc54
...@@ -3,6 +3,10 @@ $(function() { ...@@ -3,6 +3,10 @@ $(function() {
if(decideActivityRefresh()) { if(decideActivityRefresh()) {
checkNewActivity(false, 1); checkNewActivity(false, 1);
} }
$('a[href="#activity"]').click(function(){
$('a[href="#activity"] i').addClass('icon-spin');
checkNewActivity(false,0);
});
/* save resources */ /* save resources */
$('#vm-details-resources-save').click(function() { $('#vm-details-resources-save').click(function() {
...@@ -211,13 +215,13 @@ function checkNewActivity(only_state, runs) { ...@@ -211,13 +215,13 @@ function checkNewActivity(only_state, runs) {
$("[data-target=#_console]").attr("data-toggle", "_pill").attr("href", "#").parent("li").addClass("disabled"); $("[data-target=#_console]").attr("data-toggle", "_pill").attr("href", "#").parent("li").addClass("disabled");
} }
if(decideActivityRefresh()) { if(runs > 0 && decideActivityRefresh()) {
console.log("szia");
setTimeout( setTimeout(
function() {checkNewActivity(only_state, runs + 1)}, function() {checkNewActivity(only_state, runs + 1)},
1000 + runs * 250 1000 + Math.exp(runs * 0.05)
); );
} }
$('a[href="#activity"] i').removeClass('icon-spin');
}, },
error: function() { error: function() {
......
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 sign in to comment