mirror of
https://github.com/OpenNebula/one.git
synced 2025-08-24 17:49:28 +03:00
Add option to enable/disable auto refresh in the views files
This commit is contained in:
@ -20,6 +20,7 @@ enabled_tabs:
|
|||||||
oneflow-services: true
|
oneflow-services: true
|
||||||
oneflow-templates: true
|
oneflow-templates: true
|
||||||
zones-tab: true
|
zones-tab: true
|
||||||
|
autorefresh: true
|
||||||
tabs:
|
tabs:
|
||||||
dashboard-tab:
|
dashboard-tab:
|
||||||
panel_tabs:
|
panel_tabs:
|
||||||
|
@ -20,6 +20,7 @@ enabled_tabs:
|
|||||||
oneflow-services: false
|
oneflow-services: false
|
||||||
oneflow-templates: false
|
oneflow-templates: false
|
||||||
provision-tab: true
|
provision-tab: true
|
||||||
|
autorefresh: false
|
||||||
tabs:
|
tabs:
|
||||||
dashboard-tab:
|
dashboard-tab:
|
||||||
panel_tabs:
|
panel_tabs:
|
||||||
|
@ -19,6 +19,7 @@ enabled_tabs:
|
|||||||
oneflow-dashboard: true
|
oneflow-dashboard: true
|
||||||
oneflow-services: true
|
oneflow-services: true
|
||||||
oneflow-templates: true
|
oneflow-templates: true
|
||||||
|
autorefresh: true
|
||||||
tabs:
|
tabs:
|
||||||
dashboard-tab:
|
dashboard-tab:
|
||||||
panel_tabs:
|
panel_tabs:
|
||||||
|
@ -19,6 +19,7 @@ enabled_tabs:
|
|||||||
oneflow-dashboard: false
|
oneflow-dashboard: false
|
||||||
oneflow-services: false
|
oneflow-services: false
|
||||||
oneflow-templates: false
|
oneflow-templates: false
|
||||||
|
autorefresh: true
|
||||||
tabs:
|
tabs:
|
||||||
dashboard-tab:
|
dashboard-tab:
|
||||||
panel_tabs:
|
panel_tabs:
|
||||||
|
@ -235,11 +235,11 @@ var acl_buttons = {
|
|||||||
layout: "refresh",
|
layout: "refresh",
|
||||||
alwaysActive: true
|
alwaysActive: true
|
||||||
},
|
},
|
||||||
"Sunstone.toggle_top" : {
|
// "Sunstone.toggle_top" : {
|
||||||
type: "custom",
|
// type: "custom",
|
||||||
layout: "top",
|
// layout: "top",
|
||||||
alwaysActive: true
|
// alwaysActive: true
|
||||||
},
|
// },
|
||||||
"Acl.create_dialog" : {
|
"Acl.create_dialog" : {
|
||||||
type: "create_dialog",
|
type: "create_dialog",
|
||||||
layout: "create"
|
layout: "create"
|
||||||
|
@ -1053,11 +1053,11 @@ var cluster_buttons = {
|
|||||||
layout: "refresh",
|
layout: "refresh",
|
||||||
alwaysActive: true
|
alwaysActive: true
|
||||||
},
|
},
|
||||||
"Sunstone.toggle_top" : {
|
// "Sunstone.toggle_top" : {
|
||||||
type: "custom",
|
// type: "custom",
|
||||||
layout: "top",
|
// layout: "top",
|
||||||
alwaysActive: true
|
// alwaysActive: true
|
||||||
},
|
// },
|
||||||
"Cluster.create_dialog" : {
|
"Cluster.create_dialog" : {
|
||||||
type: "create_dialog",
|
type: "create_dialog",
|
||||||
layout: "create"
|
layout: "create"
|
||||||
|
@ -456,11 +456,11 @@ var datastore_buttons = {
|
|||||||
layout: "refresh",
|
layout: "refresh",
|
||||||
alwaysActive: true
|
alwaysActive: true
|
||||||
},
|
},
|
||||||
"Sunstone.toggle_top" : {
|
// "Sunstone.toggle_top" : {
|
||||||
type: "custom",
|
// type: "custom",
|
||||||
layout: "top",
|
// layout: "top",
|
||||||
alwaysActive: true
|
// alwaysActive: true
|
||||||
},
|
// },
|
||||||
"Datastore.create_dialog" : {
|
"Datastore.create_dialog" : {
|
||||||
type: "create_dialog",
|
type: "create_dialog",
|
||||||
layout: "create",
|
layout: "create",
|
||||||
|
@ -299,11 +299,11 @@ var file_buttons = {
|
|||||||
layout: "refresh",
|
layout: "refresh",
|
||||||
alwaysActive: true
|
alwaysActive: true
|
||||||
},
|
},
|
||||||
"Sunstone.toggle_top" : {
|
// "Sunstone.toggle_top" : {
|
||||||
type: "custom",
|
// type: "custom",
|
||||||
layout: "top",
|
// layout: "top",
|
||||||
alwaysActive: true
|
// alwaysActive: true
|
||||||
},
|
// },
|
||||||
"File.create_dialog" : {
|
"File.create_dialog" : {
|
||||||
type: "create_dialog",
|
type: "create_dialog",
|
||||||
layout: "create"
|
layout: "create"
|
||||||
|
@ -196,7 +196,7 @@ var group_actions = {
|
|||||||
notifyCustom(tr("Group created"), " ID: " + response.GROUP.ID, false);
|
notifyCustom(tr("Group created"), " ID: " + response.GROUP.ID, false);
|
||||||
},
|
},
|
||||||
error : onError
|
error : onError
|
||||||
},
|
},
|
||||||
|
|
||||||
"Group.create_dialog" : {
|
"Group.create_dialog" : {
|
||||||
type: "custom",
|
type: "custom",
|
||||||
@ -248,7 +248,7 @@ var group_actions = {
|
|||||||
"Group.update_dialog" : {
|
"Group.update_dialog" : {
|
||||||
type: "single",
|
type: "single",
|
||||||
call: initUpdateGroupDialog
|
call: initUpdateGroupDialog
|
||||||
},
|
},
|
||||||
|
|
||||||
"Group.show_to_update" : {
|
"Group.show_to_update" : {
|
||||||
type: "single",
|
type: "single",
|
||||||
@ -371,11 +371,11 @@ var group_buttons = {
|
|||||||
layout: "refresh",
|
layout: "refresh",
|
||||||
alwaysActive: true
|
alwaysActive: true
|
||||||
},
|
},
|
||||||
"Sunstone.toggle_top" : {
|
// "Sunstone.toggle_top" : {
|
||||||
type: "custom",
|
// type: "custom",
|
||||||
layout: "top",
|
// layout: "top",
|
||||||
alwaysActive: true
|
// alwaysActive: true
|
||||||
},
|
// },
|
||||||
"Group.create_dialog" : {
|
"Group.create_dialog" : {
|
||||||
type: "create_dialog",
|
type: "create_dialog",
|
||||||
layout: "create",
|
layout: "create",
|
||||||
@ -385,7 +385,7 @@ var group_buttons = {
|
|||||||
type : "action",
|
type : "action",
|
||||||
layout: "main",
|
layout: "main",
|
||||||
text : tr("Update")
|
text : tr("Update")
|
||||||
},
|
},
|
||||||
"Group.quotas_dialog" : {
|
"Group.quotas_dialog" : {
|
||||||
type : "action",
|
type : "action",
|
||||||
text : tr("Quotas"),
|
text : tr("Quotas"),
|
||||||
|
@ -283,11 +283,11 @@ var host_buttons = {
|
|||||||
layout: "refresh",
|
layout: "refresh",
|
||||||
alwaysActive: true
|
alwaysActive: true
|
||||||
},
|
},
|
||||||
"Sunstone.toggle_top" : {
|
// "Sunstone.toggle_top" : {
|
||||||
type: "custom",
|
// type: "custom",
|
||||||
layout: "top",
|
// layout: "top",
|
||||||
alwaysActive: true
|
// alwaysActive: true
|
||||||
},
|
// },
|
||||||
"Host.create_dialog" : {
|
"Host.create_dialog" : {
|
||||||
type: "create_dialog",
|
type: "create_dialog",
|
||||||
layout: "create",
|
layout: "create",
|
||||||
|
@ -443,11 +443,11 @@ var image_buttons = {
|
|||||||
layout: "refresh",
|
layout: "refresh",
|
||||||
alwaysActive: true
|
alwaysActive: true
|
||||||
},
|
},
|
||||||
"Sunstone.toggle_top" : {
|
// "Sunstone.toggle_top" : {
|
||||||
type: "custom",
|
// type: "custom",
|
||||||
layout: "top",
|
// layout: "top",
|
||||||
alwaysActive: true
|
// alwaysActive: true
|
||||||
},
|
// },
|
||||||
"Image.create_dialog" : {
|
"Image.create_dialog" : {
|
||||||
type: "create_dialog",
|
type: "create_dialog",
|
||||||
layout: "create"
|
layout: "create"
|
||||||
|
@ -1000,11 +1000,11 @@ var service_buttons = {
|
|||||||
layout: "refresh",
|
layout: "refresh",
|
||||||
alwaysActive: true
|
alwaysActive: true
|
||||||
},
|
},
|
||||||
"Sunstone.toggle_top" : {
|
// "Sunstone.toggle_top" : {
|
||||||
type: "custom",
|
// type: "custom",
|
||||||
layout: "top",
|
// layout: "top",
|
||||||
alwaysActive: true
|
// alwaysActive: true
|
||||||
},
|
// },
|
||||||
"Service.chown" : {
|
"Service.chown" : {
|
||||||
type: "confirm_with_select",
|
type: "confirm_with_select",
|
||||||
text: tr("Change owner"),
|
text: tr("Change owner"),
|
||||||
|
@ -467,11 +467,11 @@ var service_template_buttons = {
|
|||||||
layout: "refresh",
|
layout: "refresh",
|
||||||
alwaysActive: true
|
alwaysActive: true
|
||||||
},
|
},
|
||||||
"Sunstone.toggle_top" : {
|
// "Sunstone.toggle_top" : {
|
||||||
type: "custom",
|
// type: "custom",
|
||||||
layout: "top",
|
// layout: "top",
|
||||||
alwaysActive: true
|
// alwaysActive: true
|
||||||
},
|
// },
|
||||||
"ServiceTemplate.create_dialog" : {
|
"ServiceTemplate.create_dialog" : {
|
||||||
type: "create_dialog",
|
type: "create_dialog",
|
||||||
layout: "create"
|
layout: "create"
|
||||||
|
@ -455,11 +455,11 @@ var template_buttons = {
|
|||||||
layout: "refresh",
|
layout: "refresh",
|
||||||
alwaysActive: true
|
alwaysActive: true
|
||||||
},
|
},
|
||||||
"Sunstone.toggle_top" : {
|
// "Sunstone.toggle_top" : {
|
||||||
type: "custom",
|
// type: "custom",
|
||||||
layout: "top",
|
// layout: "top",
|
||||||
alwaysActive: true
|
// alwaysActive: true
|
||||||
},
|
// },
|
||||||
"Template.create_dialog" : {
|
"Template.create_dialog" : {
|
||||||
type: "create_dialog",
|
type: "create_dialog",
|
||||||
layout: "create"
|
layout: "create"
|
||||||
|
@ -434,11 +434,11 @@ var user_buttons = {
|
|||||||
layout: "refresh",
|
layout: "refresh",
|
||||||
alwaysActive: true
|
alwaysActive: true
|
||||||
},
|
},
|
||||||
"Sunstone.toggle_top" : {
|
// "Sunstone.toggle_top" : {
|
||||||
type: "custom",
|
// type: "custom",
|
||||||
layout: "top",
|
// layout: "top",
|
||||||
alwaysActive: true
|
// alwaysActive: true
|
||||||
},
|
// },
|
||||||
"User.create_dialog" : {
|
"User.create_dialog" : {
|
||||||
type: "create_dialog",
|
type: "create_dialog",
|
||||||
layout: "create",
|
layout: "create",
|
||||||
|
@ -938,11 +938,11 @@ var vm_buttons = {
|
|||||||
layout: "refresh",
|
layout: "refresh",
|
||||||
alwaysActive: true
|
alwaysActive: true
|
||||||
},
|
},
|
||||||
"Sunstone.toggle_top" : {
|
// "Sunstone.toggle_top" : {
|
||||||
type: "custom",
|
// type: "custom",
|
||||||
layout: "top",
|
// layout: "top",
|
||||||
alwaysActive: true
|
// alwaysActive: true
|
||||||
},
|
// },
|
||||||
"VM.create_dialog" : {
|
"VM.create_dialog" : {
|
||||||
type: "action",
|
type: "action",
|
||||||
layout: "create",
|
layout: "create",
|
||||||
|
@ -521,11 +521,11 @@ var vnet_buttons = {
|
|||||||
alwaysActive: true
|
alwaysActive: true
|
||||||
},
|
},
|
||||||
|
|
||||||
"Sunstone.toggle_top" : {
|
// "Sunstone.toggle_top" : {
|
||||||
type: "custom",
|
// type: "custom",
|
||||||
layout: "top",
|
// layout: "top",
|
||||||
alwaysActive: true
|
// alwaysActive: true
|
||||||
},
|
// },
|
||||||
|
|
||||||
"Network.create_dialog" : {
|
"Network.create_dialog" : {
|
||||||
type: "create_dialog",
|
type: "create_dialog",
|
||||||
|
@ -192,11 +192,11 @@ var zone_buttons = {
|
|||||||
layout: "refresh",
|
layout: "refresh",
|
||||||
alwaysActive: true
|
alwaysActive: true
|
||||||
},
|
},
|
||||||
"Sunstone.toggle_top" : {
|
// "Sunstone.toggle_top" : {
|
||||||
type: "custom",
|
// type: "custom",
|
||||||
layout: "top",
|
// layout: "top",
|
||||||
alwaysActive: true
|
// alwaysActive: true
|
||||||
},
|
// },
|
||||||
"Zone.create_dialog" : {
|
"Zone.create_dialog" : {
|
||||||
type: "create_dialog",
|
type: "create_dialog",
|
||||||
layout: "create"
|
layout: "create"
|
||||||
|
@ -451,6 +451,17 @@ function insertTabs(){
|
|||||||
var tab_info;
|
var tab_info;
|
||||||
for (tab in SunstoneCfg["tabs"]){
|
for (tab in SunstoneCfg["tabs"]){
|
||||||
insertTab(tab);
|
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":
|
case "refresh":
|
||||||
context = $("#"+custom_id+"refresh_buttons", buttons_row);
|
context = $("#"+custom_id+"refresh_buttons", buttons_row);
|
||||||
text = '<span class="fa-stack">'+
|
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>'+
|
//'<i class="fa fa-play fa-stack-1x"></i>'+
|
||||||
'</span>';
|
'</span>';
|
||||||
str_class.push("white_button", "refresh", "secondary", "button", "small", "radius");
|
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;
|
break;
|
||||||
case "top":
|
case "top":
|
||||||
context = $("#"+custom_id+"refresh_buttons", buttons_row);
|
context = $("#"+custom_id+"refresh_buttons", buttons_row);
|
||||||
@ -3797,28 +3808,28 @@ $(document).ready(function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
//Listen .toggle_top_buttons.
|
//Listen .toggle_top_buttons.
|
||||||
$(".toggle_top_button").live("click", function(){
|
//$(".toggle_top_button").live("click", function(){
|
||||||
var tab = $(this).parents(".tab");
|
// var tab = $(this).parents(".tab");
|
||||||
var custom_id = tab.attr('id');
|
// var custom_id = tab.attr('id');
|
||||||
|
//
|
||||||
if(top_interval_ids[custom_id] == null){
|
// if(top_interval_ids[custom_id] == null){
|
||||||
$(this).html('<i class="fa fa-eye-slash"/>');
|
// $(this).html('<i class="fa fa-eye-slash"/>');
|
||||||
|
//
|
||||||
var refresh_button = $(".fa-refresh", $(this).parents(".action_blocks"));
|
// var refresh_button = $(".fa-refresh", $(this).parents(".action_blocks"));
|
||||||
top_interval_ids[custom_id] = setInterval(function(){
|
// top_interval_ids[custom_id] = setInterval(function(){
|
||||||
if(Sunstone.rightListVisible(tab)){
|
// if(Sunstone.rightListVisible(tab)){
|
||||||
//console.log("top for "+custom_id);
|
// //console.log("top for "+custom_id);
|
||||||
refresh_button.click();
|
// refresh_button.click();
|
||||||
}
|
// }
|
||||||
//else {console.log("top not visible for "+custom_id);}
|
// //else {console.log("top not visible for "+custom_id);}
|
||||||
}, top_interval);
|
// }, top_interval);
|
||||||
} else {
|
// } else {
|
||||||
clearInterval(top_interval_ids[custom_id]);
|
// clearInterval(top_interval_ids[custom_id]);
|
||||||
top_interval_ids[custom_id] = null;
|
// top_interval_ids[custom_id] = null;
|
||||||
|
//
|
||||||
$(this).html('<i class="fa fa-eye"/>');
|
// $(this).html('<i class="fa fa-eye"/>');
|
||||||
}
|
// }
|
||||||
});
|
//});
|
||||||
|
|
||||||
//Listen .confirm_buttons. These buttons show a confirmation dialog
|
//Listen .confirm_buttons. These buttons show a confirmation dialog
|
||||||
//before running the action.
|
//before running the action.
|
||||||
|
Reference in New Issue
Block a user