1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

Feature #2332:Sunstone configurable table order

This commit is contained in:
Tino Vazquez 2013-09-20 19:22:40 +02:00
parent 55cd5cbe07
commit d2b1ed5193
13 changed files with 48 additions and 2 deletions

View File

@ -90,6 +90,9 @@
# Default language setting
:lang: en_US
# Default table order
:table_order: desc
################################################################################
# Marketplace
################################################################################

View File

@ -631,5 +631,7 @@ $(document).ready(function(){
infoListener(dataTable_acls);
$('div#acls_tab div.legend_div').hide();
dataTable_acls.fnSort( [ [1,config['user_config']['table_order']] ] );
}
})

View File

@ -1474,5 +1474,6 @@ $(document).ready(function(){
initCheckAllBoxes(dataTable_clusters);
tableCheckboxesListener(dataTable_clusters);
infoListener(dataTable_clusters, "Cluster.showinfo");
dataTable_clusters.fnSort( [ [1,config['user_config']['table_order']] ] );
}
});

View File

@ -78,6 +78,10 @@ Config = {
else {
return [];
}
},
"tableOrder": function(){
return config['user_config']["table_order"];
}
}
@ -138,6 +142,17 @@ var config_tab_content =
</select>\
</div>\
</div>\
<div class="row">\
<div class="six columns">\
<label class="right inline" for="table_order" >' + tr("Default Table order") + ':</label>\
</div>\
<div class="six columns">\
<select id="table_order">\
<option value="asc">ascending</option>\
<option value="desc">descending</option>\
</select>\
</div>\
</div>\
<div class="row">\
<div class="six columns">\
<label class="right inline" for="wss_checkbox" >' + tr("VNC Secure websockets") + ':</label>\
@ -268,6 +283,8 @@ function setupConfigDialog() {
$('input#wss_checkbox').attr('checked','checked');
};
$('#table_order option[value="'+config['user_config']["table_order"]+'"]', dialog).attr('selected','selected');
$('#lang_sel option[value="'+config['user_config']["lang"]+'"]', dialog).attr('selected','selected');
$.each( config['available_views'], function(id, view) {
@ -279,7 +296,8 @@ function setupConfigDialog() {
$('#config_submit', dialog).live('click',function(){
var lang = $('#lang_sel', dialog).val();
var vnc_wss = $('input#wss_checkbox', dialog).is(':checked') ? "yes" : "no";
var default_view = $('#view_sel', dialog).val()
var table_order = $('#table_order', dialog).val();
var default_view = $('#view_sel', dialog).val();
OpenNebula.User.show({
data : {
@ -290,6 +308,7 @@ function setupConfigDialog() {
template["LANG"] = lang;
template['VNC_WSS'] = vnc_wss;
template['TABLE_ORDER'] = table_order;
template["DEFAULT_VIEW"] = default_view;
template_str = "";

View File

@ -1177,5 +1177,6 @@ $(document).ready(function(){
});
$('div#datastores_tab div.legend_div').hide();
dataTable_datastores.fnSort( [ [1,config['user_config']['table_order']] ] );
}
})

View File

@ -980,5 +980,6 @@ $(document).ready(function(){
infoListener(dataTable_files,'File.showinfo');
$('div#files_tab div.legend_div').hide();
dataTable_files.fnSort( [ [1,config['user_config']['table_order']] ] );
}
});

View File

@ -639,5 +639,7 @@ $(document).ready(function(){
$('div#groups_tab div.legend_div').hide();
$('div#groups_tab_non_admin div.legend_div').hide();
dataTable_groups.fnSort( [ [1,config['user_config']['table_order']] ] );
}
})

View File

@ -1034,5 +1034,7 @@ $(document).ready(function(){
// Hide help
$('div#hosts_tab div.legend_div',main_tabs_context).hide();
dataTable_hosts.fnSort( [ [1,config['user_config']['table_order']] ] );
}
});

View File

@ -5152,5 +5152,7 @@ $(document).ready(function(){
infoListener(dataTable_templates,'Template.showinfo');
$('div#templates_tab div.legend_div').hide();
dataTable_templates.fnSort( [ [1,config['user_config']['table_order']] ] );
}
});

View File

@ -984,5 +984,7 @@ $(document).ready(function(){
$('div#users_tab div.legend_div').hide();
$('div#users_tab_non_admin div.legend_div').hide();
dataTable_users.fnSort( [ [1,config['user_config']['table_order']] ] );
}
});

View File

@ -3178,7 +3178,7 @@ $(document).ready(function(){
{ "bSortable": false, "aTargets": ["check",6,7,9,11] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
{ "bVisible": false, "aTargets": ['_all']},
]
});
@ -3205,5 +3205,8 @@ $(document).ready(function(){
infoListener(dataTable_vMachines,'VM.showinfo');
$('div#vms_tab div.legend_div').hide();
dataTable_vMachines.fnSort( [ [1,config['user_config']['table_order']] ] );
}
})

View File

@ -170,6 +170,7 @@ helpers do
#Load options either from user settings or default config.
# - LANG
# - WSS CONECTION
# - TABLE ORDER
if user['TEMPLATE/LANG']
session[:lang] = user['TEMPLATE/LANG']
@ -186,6 +187,12 @@ helpers do
"yes" : "no")
end
if user['TEMPLATE/TABLE_ORDER']
session[:table_order] = user['TEMPLATE/TABLE_ORDER']
else
session[:table_order] = $conf[:table_order]
end
if user['TEMPLATE/DEFAULT_VIEW']
session[:default_view] = user['TEMPLATE/DEFAULT_VIEW']
else

View File

@ -48,6 +48,7 @@
'user_config' : {
'lang' : '<%= session[:lang] %>',
'vnc_wss' : '<%= session[:vnc_wss] %>',
'table_order' : '<%= session[:table_order] %>',
'default_view' : '<%= session[:default_view] %>'
},
'system_config' : {