mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-12 08:58:17 +03:00
feature #2909: Improve filter select layout
This commit is contained in:
parent
51d4e76f88
commit
b8e961f975
@ -4008,18 +4008,6 @@ function setup_provision_vms_list(context, opts) {
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
insertSelectOptions(
|
||||
".provision_list_vms_filter",
|
||||
context,
|
||||
"User",
|
||||
(opts.filter_expression ? opts.filter_expression : "-2"),
|
||||
false,
|
||||
'<option value="-2">'+tr("ALL")+'</option>',
|
||||
null,
|
||||
null,
|
||||
true);
|
||||
|
||||
$(".provision_list_vms_filter", context).on("change", ".resource_list_select", function(){
|
||||
var filter;
|
||||
if ($(this).val() == "-2"){
|
||||
@ -4031,6 +4019,18 @@ function setup_provision_vms_list(context, opts) {
|
||||
provision_vms_datatable.fnFilter( filter, 2 );
|
||||
})
|
||||
|
||||
insertSelectOptions(
|
||||
".provision_list_vms_filter",
|
||||
context,
|
||||
"User",
|
||||
(opts.filter_expression ? opts.filter_expression : "-2"),
|
||||
false,
|
||||
'<option value="-2">'+tr("ALL")+'</option>',
|
||||
null,
|
||||
null,
|
||||
true,
|
||||
true);
|
||||
|
||||
context.on("click", ".provision_vms_list_filter_button", function(){
|
||||
$(".provision_list_vms_filter", context).fadeIn();
|
||||
return false;
|
||||
@ -4179,6 +4179,7 @@ function setup_provision_templates_list(context, opts) {
|
||||
'<option value="-2">'+tr("ALL")+'</option>',
|
||||
null,
|
||||
null,
|
||||
true,
|
||||
true);
|
||||
|
||||
context.on("click", ".provision_templates_list_filter_button", function(){
|
||||
@ -4532,7 +4533,7 @@ function setup_info_flow(context) {
|
||||
{
|
||||
title: role.name + ' ' + tr("VMs"),
|
||||
active: true,
|
||||
refresh: false,
|
||||
refresh: true,
|
||||
create: false,
|
||||
filter: true,
|
||||
data: vms
|
||||
@ -4662,6 +4663,8 @@ function setup_info_flow(context) {
|
||||
});
|
||||
|
||||
context.on("click", ".provision_delete_button", function(){
|
||||
var button = $(this);
|
||||
button.attr("disabled", "disabled");
|
||||
var flow_id = $(".provision_info_flow", context).attr("flow_id");
|
||||
|
||||
OpenNebula.Service.del({
|
||||
@ -4829,17 +4832,6 @@ function setup_provision_flows_list(context, opts){
|
||||
$(".provision_list_flows_search", context).fadeIn();
|
||||
});
|
||||
|
||||
insertSelectOptions(
|
||||
".provision_list_flows_filter",
|
||||
context,
|
||||
"User",
|
||||
(opts.filter_expression ? opts.filter_expression : "-2"),
|
||||
false,
|
||||
'<option value="-2">'+tr("ALL")+'</option>',
|
||||
null,
|
||||
null,
|
||||
true);
|
||||
|
||||
$(".provision_list_flows_filter", context).on("change", ".resource_list_select", function(){
|
||||
var filter;
|
||||
if ($(this).val() == "-2"){
|
||||
@ -4851,6 +4843,18 @@ function setup_provision_flows_list(context, opts){
|
||||
provision_flows_datatable.fnFilter( filter, 2 );
|
||||
})
|
||||
|
||||
insertSelectOptions(
|
||||
".provision_list_flows_filter",
|
||||
context,
|
||||
"User",
|
||||
(opts.filter_expression ? opts.filter_expression : "-2"),
|
||||
false,
|
||||
'<option value="-2">'+tr("ALL")+'</option>',
|
||||
null,
|
||||
null,
|
||||
true,
|
||||
true);
|
||||
|
||||
context.on("click", ".provision_flows_list_filter_button", function(){
|
||||
$(".provision_list_flows_filter", context).fadeIn();
|
||||
return false;
|
||||
@ -5017,7 +5021,7 @@ function setup_provision_user_info(context) {
|
||||
{
|
||||
title: data.NAME + ' ' + tr("VMs"),
|
||||
active: true,
|
||||
refresh: false,
|
||||
refresh: true,
|
||||
create: false,
|
||||
filter: true,
|
||||
filter_expression: data.ID
|
||||
@ -5041,7 +5045,7 @@ function setup_provision_user_info(context) {
|
||||
{
|
||||
title: data.NAME + ' ' + tr("Templates"),
|
||||
active: true,
|
||||
refresh: false,
|
||||
refresh: true,
|
||||
create: false,
|
||||
filter: true,
|
||||
filter_expression: data.ID
|
||||
@ -5065,7 +5069,7 @@ function setup_provision_user_info(context) {
|
||||
{
|
||||
title: data.NAME + ' ' + tr("Flows"),
|
||||
active: true,
|
||||
refresh: false,
|
||||
refresh: true,
|
||||
create: false,
|
||||
filter: true,
|
||||
filter_expression: data.ID
|
||||
|
@ -1742,7 +1742,7 @@ function getSelectedNodes(dataTable, force_datatable){
|
||||
|
||||
// TODO: Too many arguments. Change to use a params object
|
||||
function insertSelectOptions(id, context, resource, init_val, empty_value,
|
||||
extra_options, filter_att, filter_val, trigger_change_init_val){
|
||||
extra_options, filter_att, filter_val, trigger_change_init_val, only_name){
|
||||
|
||||
$(id, context).html('<i class="fa fa-spinner fa-spin"></i>');
|
||||
|
||||
@ -1786,8 +1786,11 @@ function insertSelectOptions(id, context, resource, init_val, empty_value,
|
||||
}
|
||||
|
||||
if (add){
|
||||
select_str +='<option elem_id="'+id+'" value="'+id+'">'+
|
||||
id+': '+name+'</option>';
|
||||
select_str +='<option elem_id="'+id+'" value="'+id+'">'
|
||||
if (!only_name) {
|
||||
select_str += id+': '
|
||||
}
|
||||
select_str += name+'</option>';
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user