1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-27 14:03:40 +03:00

feature #2166: Do not add tab if not enabled

This commit is contained in:
Daniel Molina 2013-07-11 20:07:00 +02:00
parent f514a9fb8a
commit 2b876c3d94
14 changed files with 345 additions and 317 deletions

View File

@ -599,35 +599,37 @@ function setAclAutorefresh(){
$(document).ready(function(){
var tab_name = 'acls-tab';
//if we are not oneadmin, our tab will not even be in the DOM.
dataTable_acls = $("#datatable_acls",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check",2,3,4,5,6] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
if (Config.isTabEnabled(tab_name)) {
//if we are not oneadmin, our tab will not even be in the DOM.
dataTable_acls = $("#datatable_acls",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check",2,3,4,5,6] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
$('#acl_search').keyup(function(){
dataTable_acls.fnFilter( $(this).val() );
})
$('#acl_search').keyup(function(){
dataTable_acls.fnFilter( $(this).val() );
})
dataTable_acls.on('draw', function(){
recountCheckboxes(dataTable_acls);
})
dataTable_acls.on('draw', function(){
recountCheckboxes(dataTable_acls);
})
Sunstone.runAction("Acl.list");
Sunstone.runAction("Acl.list");
setupCreateAclDialog();
setAclAutorefresh();
setupCreateAclDialog();
setAclAutorefresh();
initCheckAllBoxes(dataTable_acls);
tableCheckboxesListener(dataTable_acls);
//shortenedInfoFields('#datatable_acls');
initCheckAllBoxes(dataTable_acls);
tableCheckboxesListener(dataTable_acls);
//shortenedInfoFields('#datatable_acls');
infoListener(dataTable_acls);
infoListener(dataTable_acls);
$('div#acls_tab div.legend_div').hide();
$('div#acls_tab div.legend_div').hide();
}
})

View File

@ -1407,32 +1407,34 @@ function clusters_sel() {
$(document).ready(function(){
var tab_name = "clusters-tab"
//prepare host datatable
dataTable_clusters = $("#datatable_clusters",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check"] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
if (Config.isTabEnabled(tab_name)) {
//prepare host datatabl
dataTable_clusters = $("#datatable_clusters",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check"] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
$('#cluster_search').keyup(function(){
dataTable_clusters.fnFilter( $(this).val() );
})
$('#cluster_search').keyup(function(){
dataTable_clusters.fnFilter( $(this).val() );
})
dataTable_clusters.on('draw', function(){
recountCheckboxes(dataTable_clusters);
})
dataTable_clusters.on('draw', function(){
recountCheckboxes(dataTable_clusters);
})
Sunstone.runAction("Cluster.list");
Sunstone.runAction("Cluster.list");
dialogs_context.append('<div title=\"'+tr("Create cluster")+'\" id="create_cluster_dialog"></div>');
dialogs_context.append('<div title=\"'+tr("Create cluster")+'\" id="create_cluster_dialog"></div>');
setClusterAutorefresh();
clusterResourceViewListeners();
setClusterAutorefresh();
clusterResourceViewListeners();
initCheckAllBoxes(dataTable_clusters);
tableCheckboxesListener(dataTable_clusters);
infoListener(dataTable_clusters, "Cluster.showinfo");
initCheckAllBoxes(dataTable_clusters);
tableCheckboxesListener(dataTable_clusters);
infoListener(dataTable_clusters, "Cluster.showinfo");
}
});

View File

@ -34,7 +34,7 @@ setInterval(function(){
Config = {
"isTabEnabled": function(tab_name){
var enabled = config['view']['tabs'][tab_name]['enabled'];
var enabled = config['view']['enabled_tabs'][tab_name];
return enabled;
},
"isTabActionEnabled": function(tab_name, action_name, panel_name){

View File

@ -1082,38 +1082,41 @@ function setDatastoreAutorefresh(){
}
$(document).ready(function(){
var tab_name = 'datastores-tab';
dataTable_datastores = $("#datatable_datastores",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check"] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": config['view']['tabs']['datastores-tab']['table_columns']},
{ "bVisible": false, "aTargets": ['_all']}
]
});
if (Config.isTabEnabled(tab_name)) {
dataTable_datastores = $("#datatable_datastores",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check"] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
$('#datastore_search').keyup(function(){
dataTable_datastores.fnFilter( $(this).val() );
})
$('#datastore_search').keyup(function(){
dataTable_datastores.fnFilter( $(this).val() );
})
dataTable_datastores.on('draw', function(){
recountCheckboxes(dataTable_datastores);
})
dataTable_datastores.on('draw', function(){
recountCheckboxes(dataTable_datastores);
})
Sunstone.runAction("Datastore.list");
Sunstone.runAction("Datastore.list");
setupCreateDatastoreDialog();
setDatastoreAutorefresh();
setupCreateDatastoreDialog();
setDatastoreAutorefresh();
initCheckAllBoxes(dataTable_datastores);
tableCheckboxesListener(dataTable_datastores);
infoListener(dataTable_datastores,'Datastore.showinfo');
initCheckAllBoxes(dataTable_datastores);
tableCheckboxesListener(dataTable_datastores);
infoListener(dataTable_datastores,'Datastore.showinfo');
// Reset filter in case the view was filtered because it was accessed
// from a single cluster.
$('div#menu li#li_datastores_tab').live('click',function(){
dataTable_datastores.fnFilter('',5);
});
// Reset filter in case the view was filtered because it was accessed
// from a single cluster.
$('div#menu li#li_datastores_tab').live('click',function(){
dataTable_datastores.fnFilter('',5);
});
$('div#datastores_tab div.legend_div').hide();
$('div#datastores_tab div.legend_div').hide();
}
})

View File

@ -969,32 +969,34 @@ function is_persistent_file(id){
$(document).ready(function(){
var tab_name = 'files-tab';
dataTable_files = $("#datatable_files",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check"] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
if (Config.isTabEnabled(tab_name)) {
dataTable_files = $("#datatable_files",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check"] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
$('#file_search').keyup(function(){
dataTable_files.fnFilter( $(this).val() );
})
$('#file_search').keyup(function(){
dataTable_files.fnFilter( $(this).val() );
})
dataTable_files.on('draw', function(){
recountCheckboxes(dataTable_files);
})
dataTable_files.on('draw', function(){
recountCheckboxes(dataTable_files);
})
Sunstone.runAction("File.list");
Sunstone.runAction("File.list");
setupCreateFileDialog();
setupTips($create_file_dialog);
setFileAutorefresh();
setupCreateFileDialog();
setupTips($create_file_dialog);
setFileAutorefresh();
initCheckAllBoxes(dataTable_files);
tableCheckboxesListener(dataTable_files);
infoListener(dataTable_files,'File.showinfo');
initCheckAllBoxes(dataTable_files);
tableCheckboxesListener(dataTable_files);
infoListener(dataTable_files,'File.showinfo');
$('div#files_tab div.legend_div').hide();
$('div#files_tab div.legend_div').hide();
}
});

View File

@ -609,32 +609,34 @@ function setGroupAutorefresh(){
$(document).ready(function(){
var tab_name = 'groups-tab';
dataTable_groups = $("#datatable_groups",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check",4,5,6] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
if (Config.isTabEnabled(tab_name)) {
dataTable_groups = $("#datatable_groups",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check",4,5,6] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
$('#group_search').keyup(function(){
dataTable_groups.fnFilter( $(this).val() );
})
$('#group_search').keyup(function(){
dataTable_groups.fnFilter( $(this).val() );
})
dataTable_groups.on('draw', function(){
recountCheckboxes(dataTable_groups);
})
dataTable_groups.on('draw', function(){
recountCheckboxes(dataTable_groups);
})
Sunstone.runAction("Group.list");
setupCreateGroupDialog();
setupGroupQuotasDialog();
setGroupAutorefresh();
Sunstone.runAction("Group.list");
setupCreateGroupDialog();
setupGroupQuotasDialog();
setGroupAutorefresh();
initCheckAllBoxes(dataTable_groups);
tableCheckboxesListener(dataTable_groups);
infoListener(dataTable_groups, 'Group.showinfo');
initCheckAllBoxes(dataTable_groups);
tableCheckboxesListener(dataTable_groups);
infoListener(dataTable_groups, 'Group.showinfo');
$('div#groups_tab div.legend_div').hide();
$('div#groups_tab_non_admin div.legend_div').hide();
$('div#groups_tab div.legend_div').hide();
$('div#groups_tab_non_admin div.legend_div').hide();
}
})

View File

@ -968,42 +968,44 @@ function hostMonitorError(req,error_json){
$(document).ready(function(){
var tab_name = 'hosts-tab';
//prepare host datatable
dataTable_hosts = $("#datatable_hosts",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check",5,6,7,8] },
{ "sWidth": "35px", "aTargets": [0] }, //check, ID, RVMS, Status,
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
if (Config.isTabEnabled(tab_name)) {
//prepare host datatable
dataTable_hosts = $("#datatable_hosts",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check",5,6,7,8] },
{ "sWidth": "35px", "aTargets": [0] }, //check, ID, RVMS, Status,
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
$('#hosts_search').keyup(function(){
dataTable_hosts.fnFilter( $(this).val() );
})
$('#hosts_search').keyup(function(){
dataTable_hosts.fnFilter( $(this).val() );
})
dataTable_hosts.on('draw', function(){
recountCheckboxes(dataTable_hosts);
})
dataTable_hosts.on('draw', function(){
recountCheckboxes(dataTable_hosts);
})
Sunstone.runAction("Host.list");
Sunstone.runAction("Host.list");
setupCreateHostDialog();
setupCreateHostDialog();
setHostAutorefresh();
setHostAutorefresh();
initCheckAllBoxes(dataTable_hosts);
tableCheckboxesListener(dataTable_hosts);
infoListener(dataTable_hosts, "Host.showinfo");
initCheckAllBoxes(dataTable_hosts);
tableCheckboxesListener(dataTable_hosts);
infoListener(dataTable_hosts, "Host.showinfo");
// This listener removes any filter on hosts table when its menu item is
// selected. The cluster plugins will filter hosts when the hosts
// in a cluster are shown. So we have to make sure no filter has been
// left in place when we want to see all hosts.
$('div#menu li#li_hosts_tab').live('click',function(){
dataTable_hosts.fnFilter('',3);
});
// This listener removes any filter on hosts table when its menu item is
// selected. The cluster plugins will filter hosts when the hosts
// in a cluster are shown. So we have to make sure no filter has been
// left in place when we want to see all hosts.
$('div#menu li#li_hosts_tab').live('click',function(){
dataTable_hosts.fnFilter('',3);
});
// Hide help
$('div#hosts_tab div.legend_div',main_tabs_context).hide();
// Hide help
$('div#hosts_tab div.legend_div',main_tabs_context).hide();
}
});

View File

@ -16,6 +16,8 @@
/*Images tab plugin*/
size_images = 0;
var images_tab_content = '\
<form class="custom" id="image_form" action="">\
<div class="panel">\
@ -1349,32 +1351,34 @@ function popUpImageCloneDialog(){
$(document).ready(function(){
var tab_name = 'images-tab';
dataTable_images = $("#datatable_images",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check"] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
if (Config.isTabEnabled(tab_name)) {
dataTable_images = $("#datatable_images",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check"] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
$('#image_search').keyup(function(){
dataTable_images.fnFilter( $(this).val() );
})
$('#image_search').keyup(function(){
dataTable_images.fnFilter( $(this).val() );
})
dataTable_images.on('draw', function(){
recountCheckboxes(dataTable_images);
})
dataTable_images.on('draw', function(){
recountCheckboxes(dataTable_images);
})
Sunstone.runAction("Image.list");
Sunstone.runAction("Image.list");
setupCreateImageDialog();
setupImageCloneDialog();
setImageAutorefresh();
setupCreateImageDialog();
setupImageCloneDialog();
setImageAutorefresh();
initCheckAllBoxes(dataTable_images);
tableCheckboxesListener(dataTable_images);
infoListener(dataTable_images,'Image.showinfo');
initCheckAllBoxes(dataTable_images);
tableCheckboxesListener(dataTable_images);
infoListener(dataTable_images,'Image.showinfo');
$('div#images_tab div.legend_div').hide();
$('div#images_tab div.legend_div').hide();
}
});

View File

@ -292,46 +292,48 @@ function onlyOneCheckboxListener(dataTable) {
$(document).ready(function(){
var tab_name = 'marketplace-tab';
dataTable_marketplace = $("#datatable_marketplace", main_tabs_context).dataTable({
"bSortClasses": true,
"aoColumns": [
{ "bSortable": false,
"mData": function ( o, val, data ) {
//we render 1st column as a checkbox directly
return '<input class="check_item" type="checkbox" id="marketplace_'+
o['_id']['$oid']+
'" name="selected_items" value="'+
o['_id']['$oid']+'"/>'
if (Config.isTabEnabled(tab_name)) {
dataTable_marketplace = $("#datatable_marketplace", main_tabs_context).dataTable({
"bSortClasses": true,
"aoColumns": [
{ "bSortable": false,
"mData": function ( o, val, data ) {
//we render 1st column as a checkbox directly
return '<input class="check_item" type="checkbox" id="marketplace_'+
o['_id']['$oid']+
'" name="selected_items" value="'+
o['_id']['$oid']+'"/>'
},
"sWidth" : "60px"
},
"sWidth" : "60px"
},
{ "mDataProp": "_id.$oid", "sWidth" : "200px" },
{ "mDataProp": "name" },
{ "mDataProp": "publisher" },
{ "mDataProp": "files.0.hypervisor", "sWidth" : "100px"},
{ "mDataProp": "files.0.os-arch", "sWidth" : "100px"},
{ "mDataProp": "files.0.format", "sWidth" : "100px"},
{ "mDataProp": "tags"}
],
"aoColumnDefs": [
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
{ "mDataProp": "_id.$oid", "sWidth" : "200px" },
{ "mDataProp": "name" },
{ "mDataProp": "publisher" },
{ "mDataProp": "files.0.hypervisor", "sWidth" : "100px"},
{ "mDataProp": "files.0.os-arch", "sWidth" : "100px"},
{ "mDataProp": "files.0.format", "sWidth" : "100px"},
{ "mDataProp": "tags"}
],
"aoColumnDefs": [
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
$('#marketplace_search').keyup(function(){
dataTable_marketplace.fnFilter( $(this).val() );
})
$('#marketplace_search').keyup(function(){
dataTable_marketplace.fnFilter( $(this).val() );
})
dataTable_marketplace.on('draw', function(){
recountCheckboxes(dataTable_marketplace);
})
dataTable_marketplace.on('draw', function(){
recountCheckboxes(dataTable_marketplace);
})
tableCheckboxesListener(dataTable_marketplace);
onlyOneCheckboxListener(dataTable_marketplace);
tableCheckboxesListener(dataTable_marketplace);
onlyOneCheckboxListener(dataTable_marketplace);
infoListenerMarket(dataTable_marketplace);
infoListenerMarket(dataTable_marketplace);
Sunstone.runAction('Marketplace.list');
Sunstone.runAction('Marketplace.list');
}
});

View File

@ -4882,33 +4882,34 @@ function popUpInstantiateVMTemplateDialog(easy_provision){
$(document).ready(function(){
var tab_name = 'templates-tab';
dataTable_templates = $("#datatable_templates",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check"] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
if (Config.isTabEnabled(tab_name)) {
dataTable_templates = $("#datatable_templates",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check"] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
$('#template_search').keyup(function(){
dataTable_templates.fnFilter( $(this).val() );
})
$('#template_search').keyup(function(){
dataTable_templates.fnFilter( $(this).val() );
})
dataTable_templates.on('draw', function(){
recountCheckboxes(dataTable_templates);
})
dataTable_templates.on('draw', function(){
recountCheckboxes(dataTable_templates);
})
Sunstone.runAction("Template.list");
setupCreateTemplateDialog();
setupTemplateCloneDialog();
setTemplateAutorefresh();
Sunstone.runAction("Template.list");
setupCreateTemplateDialog();
setupTemplateCloneDialog();
setTemplateAutorefresh();
initCheckAllBoxes(dataTable_templates);
tableCheckboxesListener(dataTable_templates);
infoListener(dataTable_templates,'Template.showinfo');
$('div#templates_tab div.legend_div').hide();
initCheckAllBoxes(dataTable_templates);
tableCheckboxesListener(dataTable_templates);
infoListener(dataTable_templates,'Template.showinfo');
$('div#templates_tab div.legend_div').hide();
}
});

View File

@ -913,40 +913,42 @@ function setUserAutorefresh(){
$(document).ready(function(){
var tab_name = 'users-tab';
//if we are not oneadmin, our tab will not even be in the DOM.
dataTable_users = $("#datatable_users",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check",5,6,7] },
{ "sWidth": "35px", "aTargets": [0] },
{ "sWidth": "150px", "aTargets": [5,6,7] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
if (Config.isTabEnabled(tab_name)) {
//if we are not oneadmin, our tab will not even be in the DOM.
dataTable_users = $("#datatable_users",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check",5,6,7] },
{ "sWidth": "35px", "aTargets": [0] },
{ "sWidth": "150px", "aTargets": [5,6,7] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
$('#user_search').keyup(function(){
dataTable_users.fnFilter( $(this).val() );
})
$('#user_search').keyup(function(){
dataTable_users.fnFilter( $(this).val() );
})
dataTable_users.on('draw', function(){
recountCheckboxes(dataTable_users);
})
dataTable_users.on('draw', function(){
recountCheckboxes(dataTable_users);
})
Sunstone.runAction("User.list");
Sunstone.runAction("User.list");
setupCreateUserDialog();
setupUpdatePasswordDialog();
setupChangeAuthenticationDialog();
setupUserQuotasDialog();
setUserAutorefresh();
//Setup quota icons
//Also for group tab
setupQuotaIcons();
setupCreateUserDialog();
setupUpdatePasswordDialog();
setupChangeAuthenticationDialog();
setupUserQuotasDialog();
setUserAutorefresh();
//Setup quota icons
//Also for group tab
setupQuotaIcons();
initCheckAllBoxes(dataTable_users);
tableCheckboxesListener(dataTable_users);
infoListener(dataTable_users,'User.showinfo');
initCheckAllBoxes(dataTable_users);
tableCheckboxesListener(dataTable_users);
infoListener(dataTable_users,'User.showinfo');
$('div#users_tab div.legend_div').hide();
$('div#users_tab_non_admin div.legend_div').hide();
$('div#users_tab div.legend_div').hide();
$('div#users_tab_non_admin div.legend_div').hide();
}
});

View File

@ -3241,41 +3241,43 @@ function vmMonitorError(req,error_json){
$(document).ready(function(){
var tab_name = 'vms-tab';
dataTable_vMachines = $("#datatable_vmachines",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check",6,7,9,11] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
if (Config.isTabEnabled(tab_name)) {
dataTable_vMachines = $("#datatable_vmachines",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check",6,7,9,11] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
$('#vms_search').keyup(function(){
dataTable_vMachines.fnFilter( $(this).val() );
})
$('#vms_search').keyup(function(){
dataTable_vMachines.fnFilter( $(this).val() );
})
dataTable_vMachines.on('draw', function(){
recountCheckboxes(dataTable_vMachines);
})
dataTable_vMachines.on('draw', function(){
recountCheckboxes(dataTable_vMachines);
})
//addElement([
// spinner,
// '','','','','','','','','','',''],dataTable_vMachines);
Sunstone.runAction("VM.list");
//addElement([
// spinner,
// '','','','','','','','','','',''],dataTable_vMachines);
Sunstone.runAction("VM.list");
setupCreateVMDialog();
setVMAutorefresh();
setupVNC();
hotpluggingOps();
setup_vm_network_tab();
setup_vm_capacity_tab();
setup_vm_snapshot_tab();
//setupCreateVMDialog();
setVMAutorefresh();
setupVNC();
hotpluggingOps();
setup_vm_network_tab();
setup_vm_capacity_tab();
setup_vm_snapshot_tab();
initCheckAllBoxes(dataTable_vMachines);
tableCheckboxesListener(dataTable_vMachines);
infoListener(dataTable_vMachines,'VM.showinfo');
initCheckAllBoxes(dataTable_vMachines);
tableCheckboxesListener(dataTable_vMachines);
infoListener(dataTable_vMachines,'VM.showinfo');
$('div#vms_tab div.legend_div').hide();
$('div#vms_tab div.legend_div').hide();
}
})

View File

@ -1563,38 +1563,40 @@ function setVNetAutorefresh() {
$(document).ready(function(){
var tab_name = 'vnets-tab';
dataTable_vNetworks = $("#datatable_vnetworks",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check"] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
if (Config.isTabEnabled(tab_name)) {
dataTable_vNetworks = $("#datatable_vnetworks",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check"] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
$('#vnet_search').keyup(function(){
dataTable_vNetworks.fnFilter( $(this).val() );
})
$('#vnet_search').keyup(function(){
dataTable_vNetworks.fnFilter( $(this).val() );
})
dataTable_vNetworks.on('draw', function(){
recountCheckboxes(dataTable_vNetworks);
})
dataTable_vNetworks.on('draw', function(){
recountCheckboxes(dataTable_vNetworks);
})
Sunstone.runAction("Network.list");
Sunstone.runAction("Network.list");
setupCreateVNetDialog();
setupLeasesOps();
setVNetAutorefresh();
setupCreateVNetDialog();
setupLeasesOps();
setVNetAutorefresh();
initCheckAllBoxes(dataTable_vNetworks);
tableCheckboxesListener(dataTable_vNetworks);
infoListener(dataTable_vNetworks,'Network.showinfo');
initCheckAllBoxes(dataTable_vNetworks);
tableCheckboxesListener(dataTable_vNetworks);
infoListener(dataTable_vNetworks,'Network.showinfo');
// Reset list filter in case it was set because we were lookin
// at a single cluster view
$('div#menu li#li_vnets_tab').live('click',function(){
dataTable_vNetworks.fnFilter('',5);
});
// Reset list filter in case it was set because we were lookin
// at a single cluster view
$('div#menu li#li_vnets_tab').live('click',function(){
dataTable_vNetworks.fnFilter('',5);
});
$('div#vnets_tab div.legend_div').hide();
$('div#vnets_tab div.legend_div').hide();
}
});

View File

@ -64,10 +64,12 @@ var Sunstone = {
//Adds a new main tab. Refreshes the dom if wanted.
"addMainTab" : function(tab_id,tab_obj,refresh) {
SunstoneCfg["tabs"][tab_id] = tab_obj;
if (refresh){
insertTab(tab_id);
//$(document).foundationCustomForms();
if (Config.isTabEnabled(tab_id)) {
SunstoneCfg["tabs"][tab_id] = tab_obj;
if (refresh){
insertTab(tab_id);
//$(document).foundationCustomForms();
}
}
},