mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-20 10:50:08 +03:00
feature #3328: Add option to disable show back
This commit is contained in:
parent
ded633b813
commit
8d7f8f7f22
@ -26,6 +26,8 @@ enabled_tabs:
|
||||
enterprise-tab: true
|
||||
zones-tab: true
|
||||
autorefresh: true
|
||||
features:
|
||||
showback: true
|
||||
tabs:
|
||||
dashboard-tab:
|
||||
panel_tabs:
|
||||
|
@ -1,6 +1,8 @@
|
||||
provision_logo: images/one_small_logo.png
|
||||
enabled_tabs:
|
||||
provision-tab: true
|
||||
features:
|
||||
showback: true
|
||||
tabs:
|
||||
provision-tab:
|
||||
panel_tabs:
|
||||
|
@ -25,6 +25,8 @@ enabled_tabs:
|
||||
community-tab: false
|
||||
enterprise-tab: false
|
||||
autorefresh: true
|
||||
features:
|
||||
showback: true
|
||||
tabs:
|
||||
dashboard-tab:
|
||||
panel_tabs:
|
||||
|
@ -26,6 +26,8 @@ enabled_tabs:
|
||||
enterprise-tab: true
|
||||
zones-tab: true
|
||||
autorefresh: true
|
||||
features:
|
||||
showback: true
|
||||
tabs:
|
||||
dashboard-tab:
|
||||
panel_tabs:
|
||||
|
@ -1,6 +1,8 @@
|
||||
provision_logo: images/one_small_logo.png
|
||||
enabled_tabs:
|
||||
provision-tab: true
|
||||
features:
|
||||
showback: true
|
||||
tabs:
|
||||
provision-tab:
|
||||
panel_tabs:
|
||||
|
@ -31,6 +31,7 @@ Config = {
|
||||
var enabled = config['view']['enabled_tabs'][tab_name];
|
||||
return enabled;
|
||||
},
|
||||
|
||||
"isTabActionEnabled": function(tab_name, action_name, panel_name){
|
||||
var enabled;
|
||||
if (panel_name) {
|
||||
@ -51,6 +52,14 @@ Config = {
|
||||
}
|
||||
},
|
||||
|
||||
"isFeatureEnabled": function(feature_name){
|
||||
if (config['features'] && config['features'][feature_name]) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
"tabTableColumns": function(tab_name){
|
||||
var columns = config['view']['tabs'][tab_name]['table_columns'];
|
||||
|
||||
|
@ -734,17 +734,26 @@ function updateGroupInfo(request,group){
|
||||
content: '<div id="group_accounting"></div>'
|
||||
};
|
||||
|
||||
var showback_tab = {
|
||||
title: tr("Showback"),
|
||||
icon: "fa-money",
|
||||
content: '<div id="group_showback"></div>'
|
||||
};
|
||||
|
||||
Sunstone.updateInfoPanelTab("group_info_panel","group_info_tab",info_tab);
|
||||
Sunstone.updateInfoPanelTab("group_info_panel","group_quotas_tab",quotas_tab);
|
||||
Sunstone.updateInfoPanelTab("group_info_panel","group_providers_tab",providers_tab);
|
||||
Sunstone.updateInfoPanelTab("group_info_panel","group_accounting_tab",accounting_tab);
|
||||
Sunstone.updateInfoPanelTab("group_info_panel","group_showback_tab",showback_tab);
|
||||
|
||||
if (Config.isFeatureEnabled("showback")) {
|
||||
var showback_tab = {
|
||||
title: tr("Showback"),
|
||||
icon: "fa-money",
|
||||
content: '<div id="group_showback"></div>'
|
||||
};
|
||||
|
||||
Sunstone.updateInfoPanelTab("group_info_panel","group_showback_tab",showback_tab);
|
||||
|
||||
showbackGraphs(
|
||||
$("#group_showback","#group_info_panel"),
|
||||
{ fixed_group: info.ID });
|
||||
}
|
||||
|
||||
Sunstone.popUpInfoPanel("group_info_panel", 'groups-tab');
|
||||
|
||||
$("#add_rp_button", $("#group_info_panel")).click(function(){
|
||||
@ -760,10 +769,6 @@ function updateGroupInfo(request,group){
|
||||
{ fixed_group: info.ID,
|
||||
init_group_by: "user" });
|
||||
|
||||
showbackGraphs(
|
||||
$("#group_showback","#group_info_panel"),
|
||||
{ fixed_group: info.ID });
|
||||
|
||||
setupQuotasPanel(info,
|
||||
"#group_info_panel",
|
||||
Config.isTabActionEnabled("groups-tab", "Group.quotas_dialog"),
|
||||
|
@ -825,10 +825,10 @@ var provision_user_info = '<div id="provision_user_info" class="hidden section_c
|
||||
'<div class="row">'+
|
||||
'<div class="large-12 large-centered columns">'+
|
||||
'<dl class="tabs text-center" data-tab style="width: 100%">'+
|
||||
'<dd class="active" style="width: 25%;"><a href="#provision_info_settings"><i class="fa fa-fw fa-lg fa-cogs"/> '+ tr("Settings") +'</a></dd>'+
|
||||
'<dd style="width: 25%;"><a href="#provision_info_showback"><i class="fa fa-fw fa-lg fa-money"/> '+ tr("Showback") +'</a></dd>'+
|
||||
'<dd style="width: 25%;"><a href="#provision_info_acct"><i class="fa fa-fw fa-lg fa-bar-chart-o"/> '+ tr("Accounting") +'</a></dd>'+
|
||||
'<dd style="width: 25%;"><a href="#provision_info_quotas"><i class="fa fa-fw fa-lg fa-align-left"/> '+ tr("Quotas") +'</a></dd>'+
|
||||
'<dd class="active" style="width: '+ (Config.isFeatureEnabled("showback") ? '25%' : '33%')+';"><a href="#provision_info_settings"><i class="fa fa-fw fa-lg fa-cogs"/> '+ tr("Settings") +'</a></dd>'+
|
||||
(Config.isFeatureEnabled("showback") ? '<dd style="width: 25%;"><a href="#provision_info_showback"><i class="fa fa-fw fa-lg fa-money"/> '+ tr("Showback") +'</a></dd>' : '') +
|
||||
'<dd style="width: '+ (Config.isFeatureEnabled("showback") ? '25%' : '33%')+';"><a href="#provision_info_acct"><i class="fa fa-fw fa-lg fa-bar-chart-o"/> '+ tr("Accounting") +'</a></dd>'+
|
||||
'<dd style="width: '+ (Config.isFeatureEnabled("showback") ? '25%' : '33%')+';"><a href="#provision_info_quotas"><i class="fa fa-fw fa-lg fa-align-left"/> '+ tr("Quotas") +'</a></dd>'+
|
||||
'</dl>'+
|
||||
'<br>'+
|
||||
'</div>'+
|
||||
@ -840,12 +840,12 @@ var provision_user_info = '<div id="provision_user_info" class="hidden section_c
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'<div class="content" id="provision_info_showback">'+
|
||||
(Config.isFeatureEnabled("showback") ? '<div class="content" id="provision_info_showback">'+
|
||||
'<div class="row">'+
|
||||
'<div id="provision_user_info_showback_div" class="large-12 large-centered columns">'+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'</div>' : '')+
|
||||
'<div class="content" id="provision_info_quotas">'+
|
||||
'<div class="row">'+
|
||||
'<div id="provision_user_info_quotas_div" class="large-9 large-centered columns quotas">'+
|
||||
@ -1206,7 +1206,7 @@ var provision_manage_vdc = '<div id="provision_manage_vdc" class="hidden section
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'<br>'+
|
||||
'<div class="row">'+
|
||||
(Config.isFeatureEnabled("showback") ? '<div class="row">'+
|
||||
'<div class="large-11 large-centered columns">'+
|
||||
'<h3 class="subheader text-right">'+
|
||||
'<span class="left">'+
|
||||
@ -1220,7 +1220,7 @@ var provision_manage_vdc = '<div id="provision_manage_vdc" class="hidden section
|
||||
'<div id="provision_info_vdc_group_showback" class="large-10 large-centered columns">'+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'<br>'+
|
||||
'<br>' : '') +
|
||||
'<div class="row">'+
|
||||
'<div class="large-11 large-centered columns">'+
|
||||
'<h3 class="subheader text-right">'+
|
||||
@ -2082,7 +2082,7 @@ function generate_provision_instance_type_accordion(context, capacity) {
|
||||
'<br>');
|
||||
|
||||
var cost = 0;
|
||||
if (capacity.CPU_COST || capacity.MEMORY_COST) {
|
||||
if (capacity.CPU_COST || capacity.MEMORY_COST && Config.isFeatureEnabled("showback")) {
|
||||
$(".provision_create_template_cost_div").show();
|
||||
|
||||
if (capacity.CPU && capacity.CPU_COST) {
|
||||
@ -2192,18 +2192,20 @@ function generate_provision_instance_type_accordion(context, capacity) {
|
||||
$(".memory_value", context).html(memory_value);
|
||||
$(".memory_unit", context).html(memory_unit);
|
||||
|
||||
var cost = 0;
|
||||
if (Config.isFeatureEnabled("showback")) {
|
||||
var cost = 0;
|
||||
|
||||
if ($(".cost_value").data("CPU_COST")) {
|
||||
cost += $(this).attr("cpu") * $(".cost_value").data("CPU_COST")
|
||||
if ($(".cost_value").data("CPU_COST")) {
|
||||
cost += $(this).attr("cpu") * $(".cost_value").data("CPU_COST")
|
||||
}
|
||||
|
||||
if ($(".cost_value").data("MEMORY_COST")) {
|
||||
cost += $(this).attr("memory") * $(".cost_value").data("MEMORY_COST")
|
||||
}
|
||||
|
||||
$(".cost_value").html(cost);
|
||||
}
|
||||
|
||||
if ($(".cost_value").data("MEMORY_COST")) {
|
||||
cost += $(this).attr("memory") * $(".cost_value").data("MEMORY_COST")
|
||||
}
|
||||
|
||||
$(".cost_value").html(cost);
|
||||
|
||||
$('.accordion a', context).first().trigger("click");
|
||||
})
|
||||
|
||||
@ -2774,9 +2776,12 @@ function show_provision_user_info_callback(request, response) {
|
||||
{ fixed_user: info.ID,
|
||||
fixed_group_by: "vm" });
|
||||
|
||||
showbackGraphs(
|
||||
$("#provision_user_info_showback_div"),
|
||||
{ fixed_user: info.ID});
|
||||
|
||||
if (Config.isFeatureEnabled("showback")) {
|
||||
showbackGraphs(
|
||||
$("#provision_user_info_showback_div"),
|
||||
{ fixed_user: info.ID});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2827,9 +2832,11 @@ function show_provision_group_info_callback(request, response) {
|
||||
{ fixed_group: info.ID,
|
||||
init_group_by: "user" });
|
||||
|
||||
showbackGraphs(
|
||||
$("#provision_info_vdc_group_showback", context),
|
||||
{ fixed_group: info.ID });
|
||||
if (Config.isFeatureEnabled("showback")) {
|
||||
showbackGraphs(
|
||||
$("#provision_info_vdc_group_showback", context),
|
||||
{ fixed_group: info.ID });
|
||||
}
|
||||
|
||||
$("#acct_placeholder", context).hide();
|
||||
}
|
||||
@ -5136,9 +5143,9 @@ function setup_provision_user_info(context) {
|
||||
'<span class="provision_vdc_user_info_show_acct button medium radius" data-tooltip title="'+tr("User Accounting")+'" style="margin-right: 10px">'+
|
||||
'<i class="fa fa-bar-chart-o fa-lg"></i>'+
|
||||
'</span>'+
|
||||
'<span class="provision_vdc_user_info_show_showback button medium radius" data-tooltip title="'+tr("User Showback")+'" style="margin-right: 10px">'+
|
||||
(Config.isFeatureEnabled("showback") ? '<span class="provision_vdc_user_info_show_showback button medium radius" data-tooltip title="'+tr("User Showback")+'" style="margin-right: 10px">'+
|
||||
'<i class="fa fa-money fa-lg"></i>'+
|
||||
'</span>'+
|
||||
'</span>' : '') +
|
||||
'</li>'+
|
||||
'<li class="provision-bullet-item text-left">'+
|
||||
'</li>')
|
||||
@ -5275,18 +5282,20 @@ function setup_provision_user_info(context) {
|
||||
'</h2>')
|
||||
})
|
||||
|
||||
context.on("click", ".provision_vdc_user_info_show_showback", function(){
|
||||
$(".provision_vdc_info_container", context).html("");
|
||||
if (Config.isFeatureEnabled("showback")) {
|
||||
context.on("click", ".provision_vdc_user_info_show_showback", function(){
|
||||
$(".provision_vdc_info_container", context).html("");
|
||||
|
||||
showbackGraphs(
|
||||
$(".provision_vdc_info_container", context),
|
||||
{ fixed_user: $(".provision_info_vdc_user", context).attr("opennebula_id")});
|
||||
showbackGraphs(
|
||||
$(".provision_vdc_info_container", context),
|
||||
{ fixed_user: $(".provision_info_vdc_user", context).attr("opennebula_id")});
|
||||
|
||||
$(".provision_vdc_info_container", context).prepend(
|
||||
'<h2 class="subheader">'+
|
||||
$(".provision_info_vdc_user", context).attr("uname") + ' ' + tr("Showback")+
|
||||
'</h2>')
|
||||
})
|
||||
$(".provision_vdc_info_container", context).prepend(
|
||||
'<h2 class="subheader">'+
|
||||
$(".provision_info_vdc_user", context).attr("uname") + ' ' + tr("Showback")+
|
||||
'</h2>')
|
||||
})
|
||||
};
|
||||
|
||||
context.on("click", ".provision_vdc_user_delete_confirm_button", function(){
|
||||
$(".provision_vdc_user_confirm_action", context).html(
|
||||
|
@ -856,14 +856,17 @@ function generate_capacity_inputs() {
|
||||
'</select>'+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'<div class="large-2 columns vm_param">'+
|
||||
'<label for="MEMORY_COST">'+tr("Cost")+'\
|
||||
<span class="tip">'+tr("Cost of each MB per hour")+'</span>\
|
||||
</label>'+
|
||||
'<input type="text" id="MEMORY_COST" name="name"/>'+
|
||||
'</div>'+
|
||||
'<div class="large-3 columns">'+
|
||||
'</div>'+
|
||||
(Config.isFeatureEnabled("showback") ?
|
||||
'<div class="large-2 columns vm_param">'+
|
||||
'<label for="MEMORY_COST">'+tr("Cost")+'\
|
||||
<span class="tip">'+tr("Cost of each MB per hour")+'</span>\
|
||||
</label>'+
|
||||
'<input type="text" id="MEMORY_COST" name="name"/>'+
|
||||
'</div>'+
|
||||
'<div class="large-3 columns">'+
|
||||
'</div>' :
|
||||
'<div class="large-5 columns">'+
|
||||
'</div>' ) +
|
||||
'</div>'+
|
||||
'<div class="row">'+
|
||||
'<div class="large-7 columns">'+
|
||||
@ -878,14 +881,17 @@ function generate_capacity_inputs() {
|
||||
'<input type="text" id="CPU" name="cpu"/>'+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'<div class="large-2 columns vm_param">'+
|
||||
'<label for="CPU_COST">'+tr("Cost")+'\
|
||||
<span class="tip">'+tr("Cost of each CPU per hour")+'</span>\
|
||||
</label>'+
|
||||
'<input type="text" id="CPU_COST" name="name"/>'+
|
||||
'</div>'+
|
||||
'<div class="large-3 columns">'+
|
||||
'</div>'+
|
||||
(Config.isFeatureEnabled("showback") ?
|
||||
'<div class="large-2 columns vm_param">'+
|
||||
'<label for="CPU_COST">'+tr("Cost")+'\
|
||||
<span class="tip">'+tr("Cost of each CPU per hour")+'</span>\
|
||||
</label>'+
|
||||
'<input type="text" id="CPU_COST" name="name"/>'+
|
||||
'</div>'+
|
||||
'<div class="large-3 columns">'+
|
||||
'</div>' :
|
||||
'<div class="large-5 columns">'+
|
||||
'</div>' ) +
|
||||
'</div>'+
|
||||
'<div class="row">' +
|
||||
'<div class="large-7 columns">'+
|
||||
|
@ -607,16 +607,24 @@ function updateUserInfo(request,user){
|
||||
content: '<div id="user_accounting"></div>'
|
||||
};
|
||||
|
||||
var showback_tab = {
|
||||
title: tr("Showback"),
|
||||
icon: "fa-money",
|
||||
content: '<div id="user_showback"></div>'
|
||||
};
|
||||
|
||||
Sunstone.updateInfoPanelTab("user_info_panel","user_info_tab",info_tab);
|
||||
Sunstone.updateInfoPanelTab("user_info_panel","user_quotas_tab",quotas_tab);
|
||||
Sunstone.updateInfoPanelTab("user_info_panel","user_accounting_tab",accounting_tab);
|
||||
Sunstone.updateInfoPanelTab("user_info_panel","user_showback_tab",showback_tab);
|
||||
|
||||
if (Config.isFeatureEnabled("showback")) {
|
||||
var showback_tab = {
|
||||
title: tr("Showback"),
|
||||
icon: "fa-money",
|
||||
content: '<div id="user_showback"></div>'
|
||||
};
|
||||
|
||||
Sunstone.updateInfoPanelTab("user_info_panel","user_showback_tab",showback_tab);
|
||||
|
||||
showbackGraphs(
|
||||
$("#user_showback","#user_info_panel"),
|
||||
{ fixed_user: info.ID });
|
||||
}
|
||||
//Sunstone.updateInfoPanelTab("user_info_panel","user_acct_tab",acct_tab);
|
||||
Sunstone.popUpInfoPanel("user_info_panel", 'users-tab');
|
||||
|
||||
@ -625,10 +633,6 @@ function updateUserInfo(request,user){
|
||||
{ fixed_user: info.ID,
|
||||
init_group_by: "vm" });
|
||||
|
||||
showbackGraphs(
|
||||
$("#user_showback","#user_info_panel"),
|
||||
{ fixed_user: info.ID });
|
||||
|
||||
setupQuotasPanel(info,
|
||||
"#user_info_panel",
|
||||
Config.isTabActionEnabled("users-tab", "User.quotas_dialog"),
|
||||
|
Loading…
x
Reference in New Issue
Block a user