diff --git a/src/sunstone/etc/sunstone-views/admin.yaml b/src/sunstone/etc/sunstone-views/admin.yaml
index 890ef8083b..c4bd59e27d 100644
--- a/src/sunstone/etc/sunstone-views/admin.yaml
+++ b/src/sunstone/etc/sunstone-views/admin.yaml
@@ -20,6 +20,7 @@ enabled_tabs:
oneflow-services: true
oneflow-templates: true
zones-tab: true
+autorefresh: true
tabs:
dashboard-tab:
panel_tabs:
diff --git a/src/sunstone/etc/sunstone-views/cloud.yaml b/src/sunstone/etc/sunstone-views/cloud.yaml
index dba0fb8607..f8e44168f4 100644
--- a/src/sunstone/etc/sunstone-views/cloud.yaml
+++ b/src/sunstone/etc/sunstone-views/cloud.yaml
@@ -20,6 +20,7 @@ enabled_tabs:
oneflow-services: false
oneflow-templates: false
provision-tab: true
+autorefresh: false
tabs:
dashboard-tab:
panel_tabs:
diff --git a/src/sunstone/etc/sunstone-views/user.yaml b/src/sunstone/etc/sunstone-views/user.yaml
index c7337b7e0a..727b203022 100644
--- a/src/sunstone/etc/sunstone-views/user.yaml
+++ b/src/sunstone/etc/sunstone-views/user.yaml
@@ -19,6 +19,7 @@ enabled_tabs:
oneflow-dashboard: true
oneflow-services: true
oneflow-templates: true
+autorefresh: true
tabs:
dashboard-tab:
panel_tabs:
diff --git a/src/sunstone/etc/sunstone-views/vdcadmin.yaml b/src/sunstone/etc/sunstone-views/vdcadmin.yaml
index 39ea311d59..e74cb6bf45 100644
--- a/src/sunstone/etc/sunstone-views/vdcadmin.yaml
+++ b/src/sunstone/etc/sunstone-views/vdcadmin.yaml
@@ -19,6 +19,7 @@ enabled_tabs:
oneflow-dashboard: false
oneflow-services: false
oneflow-templates: false
+autorefresh: true
tabs:
dashboard-tab:
panel_tabs:
diff --git a/src/sunstone/public/js/plugins/acls-tab.js b/src/sunstone/public/js/plugins/acls-tab.js
index 9bed229341..b1ace8da58 100644
--- a/src/sunstone/public/js/plugins/acls-tab.js
+++ b/src/sunstone/public/js/plugins/acls-tab.js
@@ -235,11 +235,11 @@ var acl_buttons = {
layout: "refresh",
alwaysActive: true
},
- "Sunstone.toggle_top" : {
- type: "custom",
- layout: "top",
- alwaysActive: true
- },
+// "Sunstone.toggle_top" : {
+// type: "custom",
+// layout: "top",
+// alwaysActive: true
+// },
"Acl.create_dialog" : {
type: "create_dialog",
layout: "create"
diff --git a/src/sunstone/public/js/plugins/clusters-tab.js b/src/sunstone/public/js/plugins/clusters-tab.js
index ec0a8eb550..65d2dad60d 100644
--- a/src/sunstone/public/js/plugins/clusters-tab.js
+++ b/src/sunstone/public/js/plugins/clusters-tab.js
@@ -1053,11 +1053,11 @@ var cluster_buttons = {
layout: "refresh",
alwaysActive: true
},
- "Sunstone.toggle_top" : {
- type: "custom",
- layout: "top",
- alwaysActive: true
- },
+// "Sunstone.toggle_top" : {
+// type: "custom",
+// layout: "top",
+// alwaysActive: true
+// },
"Cluster.create_dialog" : {
type: "create_dialog",
layout: "create"
diff --git a/src/sunstone/public/js/plugins/datastores-tab.js b/src/sunstone/public/js/plugins/datastores-tab.js
index 63bee8529d..594d38e762 100644
--- a/src/sunstone/public/js/plugins/datastores-tab.js
+++ b/src/sunstone/public/js/plugins/datastores-tab.js
@@ -456,11 +456,11 @@ var datastore_buttons = {
layout: "refresh",
alwaysActive: true
},
- "Sunstone.toggle_top" : {
- type: "custom",
- layout: "top",
- alwaysActive: true
- },
+// "Sunstone.toggle_top" : {
+// type: "custom",
+// layout: "top",
+// alwaysActive: true
+// },
"Datastore.create_dialog" : {
type: "create_dialog",
layout: "create",
diff --git a/src/sunstone/public/js/plugins/files-tab.js b/src/sunstone/public/js/plugins/files-tab.js
index b30b625d89..fff1bc183d 100644
--- a/src/sunstone/public/js/plugins/files-tab.js
+++ b/src/sunstone/public/js/plugins/files-tab.js
@@ -299,11 +299,11 @@ var file_buttons = {
layout: "refresh",
alwaysActive: true
},
- "Sunstone.toggle_top" : {
- type: "custom",
- layout: "top",
- alwaysActive: true
- },
+// "Sunstone.toggle_top" : {
+// type: "custom",
+// layout: "top",
+// alwaysActive: true
+// },
"File.create_dialog" : {
type: "create_dialog",
layout: "create"
diff --git a/src/sunstone/public/js/plugins/groups-tab.js b/src/sunstone/public/js/plugins/groups-tab.js
index 35c996bc95..1813e34c33 100644
--- a/src/sunstone/public/js/plugins/groups-tab.js
+++ b/src/sunstone/public/js/plugins/groups-tab.js
@@ -196,7 +196,7 @@ var group_actions = {
notifyCustom(tr("Group created"), " ID: " + response.GROUP.ID, false);
},
error : onError
- },
+ },
"Group.create_dialog" : {
type: "custom",
@@ -248,7 +248,7 @@ var group_actions = {
"Group.update_dialog" : {
type: "single",
call: initUpdateGroupDialog
- },
+ },
"Group.show_to_update" : {
type: "single",
@@ -371,11 +371,11 @@ var group_buttons = {
layout: "refresh",
alwaysActive: true
},
- "Sunstone.toggle_top" : {
- type: "custom",
- layout: "top",
- alwaysActive: true
- },
+// "Sunstone.toggle_top" : {
+// type: "custom",
+// layout: "top",
+// alwaysActive: true
+// },
"Group.create_dialog" : {
type: "create_dialog",
layout: "create",
@@ -385,7 +385,7 @@ var group_buttons = {
type : "action",
layout: "main",
text : tr("Update")
- },
+ },
"Group.quotas_dialog" : {
type : "action",
text : tr("Quotas"),
diff --git a/src/sunstone/public/js/plugins/hosts-tab.js b/src/sunstone/public/js/plugins/hosts-tab.js
index 4487ce560d..f0d41b63a8 100644
--- a/src/sunstone/public/js/plugins/hosts-tab.js
+++ b/src/sunstone/public/js/plugins/hosts-tab.js
@@ -283,11 +283,11 @@ var host_buttons = {
layout: "refresh",
alwaysActive: true
},
- "Sunstone.toggle_top" : {
- type: "custom",
- layout: "top",
- alwaysActive: true
- },
+// "Sunstone.toggle_top" : {
+// type: "custom",
+// layout: "top",
+// alwaysActive: true
+// },
"Host.create_dialog" : {
type: "create_dialog",
layout: "create",
diff --git a/src/sunstone/public/js/plugins/images-tab.js b/src/sunstone/public/js/plugins/images-tab.js
index a96b0c1b12..7241c1fcb4 100644
--- a/src/sunstone/public/js/plugins/images-tab.js
+++ b/src/sunstone/public/js/plugins/images-tab.js
@@ -443,11 +443,11 @@ var image_buttons = {
layout: "refresh",
alwaysActive: true
},
- "Sunstone.toggle_top" : {
- type: "custom",
- layout: "top",
- alwaysActive: true
- },
+// "Sunstone.toggle_top" : {
+// type: "custom",
+// layout: "top",
+// alwaysActive: true
+// },
"Image.create_dialog" : {
type: "create_dialog",
layout: "create"
diff --git a/src/sunstone/public/js/plugins/oneflow-services.js b/src/sunstone/public/js/plugins/oneflow-services.js
index 7b46f0362f..e8fe672717 100644
--- a/src/sunstone/public/js/plugins/oneflow-services.js
+++ b/src/sunstone/public/js/plugins/oneflow-services.js
@@ -1000,11 +1000,11 @@ var service_buttons = {
layout: "refresh",
alwaysActive: true
},
- "Sunstone.toggle_top" : {
- type: "custom",
- layout: "top",
- alwaysActive: true
- },
+// "Sunstone.toggle_top" : {
+// type: "custom",
+// layout: "top",
+// alwaysActive: true
+// },
"Service.chown" : {
type: "confirm_with_select",
text: tr("Change owner"),
diff --git a/src/sunstone/public/js/plugins/oneflow-templates.js b/src/sunstone/public/js/plugins/oneflow-templates.js
index 64170dfd52..471e628d04 100644
--- a/src/sunstone/public/js/plugins/oneflow-templates.js
+++ b/src/sunstone/public/js/plugins/oneflow-templates.js
@@ -467,11 +467,11 @@ var service_template_buttons = {
layout: "refresh",
alwaysActive: true
},
- "Sunstone.toggle_top" : {
- type: "custom",
- layout: "top",
- alwaysActive: true
- },
+// "Sunstone.toggle_top" : {
+// type: "custom",
+// layout: "top",
+// alwaysActive: true
+// },
"ServiceTemplate.create_dialog" : {
type: "create_dialog",
layout: "create"
diff --git a/src/sunstone/public/js/plugins/templates-tab.js b/src/sunstone/public/js/plugins/templates-tab.js
index a25341ab36..4563b088b9 100644
--- a/src/sunstone/public/js/plugins/templates-tab.js
+++ b/src/sunstone/public/js/plugins/templates-tab.js
@@ -455,11 +455,11 @@ var template_buttons = {
layout: "refresh",
alwaysActive: true
},
- "Sunstone.toggle_top" : {
- type: "custom",
- layout: "top",
- alwaysActive: true
- },
+// "Sunstone.toggle_top" : {
+// type: "custom",
+// layout: "top",
+// alwaysActive: true
+// },
"Template.create_dialog" : {
type: "create_dialog",
layout: "create"
diff --git a/src/sunstone/public/js/plugins/users-tab.js b/src/sunstone/public/js/plugins/users-tab.js
index 609e12da64..66d0d3d015 100644
--- a/src/sunstone/public/js/plugins/users-tab.js
+++ b/src/sunstone/public/js/plugins/users-tab.js
@@ -434,11 +434,11 @@ var user_buttons = {
layout: "refresh",
alwaysActive: true
},
- "Sunstone.toggle_top" : {
- type: "custom",
- layout: "top",
- alwaysActive: true
- },
+// "Sunstone.toggle_top" : {
+// type: "custom",
+// layout: "top",
+// alwaysActive: true
+// },
"User.create_dialog" : {
type: "create_dialog",
layout: "create",
diff --git a/src/sunstone/public/js/plugins/vms-tab.js b/src/sunstone/public/js/plugins/vms-tab.js
index 76a7d11d39..54b48d0651 100644
--- a/src/sunstone/public/js/plugins/vms-tab.js
+++ b/src/sunstone/public/js/plugins/vms-tab.js
@@ -938,11 +938,11 @@ var vm_buttons = {
layout: "refresh",
alwaysActive: true
},
- "Sunstone.toggle_top" : {
- type: "custom",
- layout: "top",
- alwaysActive: true
- },
+// "Sunstone.toggle_top" : {
+// type: "custom",
+// layout: "top",
+// alwaysActive: true
+// },
"VM.create_dialog" : {
type: "action",
layout: "create",
diff --git a/src/sunstone/public/js/plugins/vnets-tab.js b/src/sunstone/public/js/plugins/vnets-tab.js
index 7aad20d6da..1b81e2f404 100644
--- a/src/sunstone/public/js/plugins/vnets-tab.js
+++ b/src/sunstone/public/js/plugins/vnets-tab.js
@@ -521,11 +521,11 @@ var vnet_buttons = {
alwaysActive: true
},
- "Sunstone.toggle_top" : {
- type: "custom",
- layout: "top",
- alwaysActive: true
- },
+// "Sunstone.toggle_top" : {
+// type: "custom",
+// layout: "top",
+// alwaysActive: true
+// },
"Network.create_dialog" : {
type: "create_dialog",
diff --git a/src/sunstone/public/js/plugins/zones-tab.js b/src/sunstone/public/js/plugins/zones-tab.js
index 862ee768d0..f521d4ac65 100644
--- a/src/sunstone/public/js/plugins/zones-tab.js
+++ b/src/sunstone/public/js/plugins/zones-tab.js
@@ -192,11 +192,11 @@ var zone_buttons = {
layout: "refresh",
alwaysActive: true
},
- "Sunstone.toggle_top" : {
- type: "custom",
- layout: "top",
- alwaysActive: true
- },
+// "Sunstone.toggle_top" : {
+// type: "custom",
+// layout: "top",
+// alwaysActive: true
+// },
"Zone.create_dialog" : {
type: "create_dialog",
layout: "create"
diff --git a/src/sunstone/public/js/sunstone.js b/src/sunstone/public/js/sunstone.js
index eb68ecb52b..94da626c5c 100644
--- a/src/sunstone/public/js/sunstone.js
+++ b/src/sunstone/public/js/sunstone.js
@@ -451,6 +451,17 @@ function insertTabs(){
var tab_info;
for (tab in SunstoneCfg["tabs"]){
insertTab(tab);
+
+ if (config['view']['autorefresh']) {
+ var tab_context = $("#" + tab);
+ var refresh_button = $(".fa-refresh", $(".action_blocks", tab_context).first());
+ setInterval(function(){
+ if(Sunstone.rightListVisible(tab_context)){
+ refresh_button.click();
+ }
+ //else {console.log("top not visible for "+custom_id);}
+ }, top_interval);
+ }
}
}
@@ -730,11 +741,11 @@ function insertButtonsInTab(tab_name, panel_name, panel_buttons, custom_context)
case "refresh":
context = $("#"+custom_id+"refresh_buttons", buttons_row);
text = ''+
- ''+
+ ''+
//''+
'';
str_class.push("white_button", "refresh", "secondary", "button", "small", "radius");
- button_code = ''+text+'';
+ button_code = ''+text+'';
break;
case "top":
context = $("#"+custom_id+"refresh_buttons", buttons_row);
@@ -3797,28 +3808,28 @@ $(document).ready(function(){
});
//Listen .toggle_top_buttons.
- $(".toggle_top_button").live("click", function(){
- var tab = $(this).parents(".tab");
- var custom_id = tab.attr('id');
-
- if(top_interval_ids[custom_id] == null){
- $(this).html('');
-
- var refresh_button = $(".fa-refresh", $(this).parents(".action_blocks"));
- top_interval_ids[custom_id] = setInterval(function(){
- if(Sunstone.rightListVisible(tab)){
- //console.log("top for "+custom_id);
- refresh_button.click();
- }
- //else {console.log("top not visible for "+custom_id);}
- }, top_interval);
- } else {
- clearInterval(top_interval_ids[custom_id]);
- top_interval_ids[custom_id] = null;
-
- $(this).html('');
- }
- });
+ //$(".toggle_top_button").live("click", function(){
+ // var tab = $(this).parents(".tab");
+ // var custom_id = tab.attr('id');
+//
+ // if(top_interval_ids[custom_id] == null){
+ // $(this).html('');
+//
+ // var refresh_button = $(".fa-refresh", $(this).parents(".action_blocks"));
+ // top_interval_ids[custom_id] = setInterval(function(){
+ // if(Sunstone.rightListVisible(tab)){
+ // //console.log("top for "+custom_id);
+ // refresh_button.click();
+ // }
+ // //else {console.log("top not visible for "+custom_id);}
+ // }, top_interval);
+ // } else {
+ // clearInterval(top_interval_ids[custom_id]);
+ // top_interval_ids[custom_id] = null;
+//
+ // $(this).html('');
+ // }
+ //});
//Listen .confirm_buttons. These buttons show a confirmation dialog
//before running the action.