mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
Add option to enable/disable auto refresh in the views files
This commit is contained in:
parent
0892231927
commit
b9d7d199bd
@ -20,6 +20,7 @@ enabled_tabs:
|
||||
oneflow-services: true
|
||||
oneflow-templates: true
|
||||
zones-tab: true
|
||||
autorefresh: true
|
||||
tabs:
|
||||
dashboard-tab:
|
||||
panel_tabs:
|
||||
|
@ -20,6 +20,7 @@ enabled_tabs:
|
||||
oneflow-services: false
|
||||
oneflow-templates: false
|
||||
provision-tab: true
|
||||
autorefresh: false
|
||||
tabs:
|
||||
dashboard-tab:
|
||||
panel_tabs:
|
||||
|
@ -19,6 +19,7 @@ enabled_tabs:
|
||||
oneflow-dashboard: true
|
||||
oneflow-services: true
|
||||
oneflow-templates: true
|
||||
autorefresh: true
|
||||
tabs:
|
||||
dashboard-tab:
|
||||
panel_tabs:
|
||||
|
@ -19,6 +19,7 @@ enabled_tabs:
|
||||
oneflow-dashboard: false
|
||||
oneflow-services: false
|
||||
oneflow-templates: false
|
||||
autorefresh: true
|
||||
tabs:
|
||||
dashboard-tab:
|
||||
panel_tabs:
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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",
|
||||
|
@ -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"
|
||||
|
@ -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"),
|
||||
|
@ -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",
|
||||
|
@ -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"
|
||||
|
@ -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"),
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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",
|
||||
|
@ -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",
|
||||
|
@ -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",
|
||||
|
@ -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"
|
||||
|
@ -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 = '<span class="fa-stack">'+
|
||||
'<i class="fa fa-refresh fa-stack-2x"></i>'+
|
||||
'<i class="fa fa-refresh fa-stack-lg" style="font-size: 1.5em"></i>'+
|
||||
//'<i class="fa fa-play fa-stack-1x"></i>'+
|
||||
'</span>';
|
||||
str_class.push("white_button", "refresh", "secondary", "button", "small", "radius");
|
||||
button_code = '<a class="'+str_class.join(' ')+'" href="'+button_name+'">'+text+'</a>';
|
||||
button_code = '<a class="'+str_class.join(' ')+'" href="'+button_name+'" style="padding-left: 5px">'+text+'</a>';
|
||||
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('<i class="fa fa-eye-slash"/>');
|
||||
|
||||
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('<i class="fa fa-eye"/>');
|
||||
}
|
||||
});
|
||||
//$(".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('<i class="fa fa-eye-slash"/>');
|
||||
//
|
||||
// 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('<i class="fa fa-eye"/>');
|
||||
// }
|
||||
//});
|
||||
|
||||
//Listen .confirm_buttons. These buttons show a confirmation dialog
|
||||
//before running the action.
|
||||
|
Loading…
x
Reference in New Issue
Block a user