1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-11 05:17:41 +03:00

Use new ResourceSelect in panels

This commit is contained in:
Daniel Molina 2016-01-20 19:00:51 +01:00
parent f8c1da1604
commit 6628719c96
5 changed files with 47 additions and 23 deletions

View File

@ -111,7 +111,11 @@ define(function(require) {
if (button.custom_select) {
$('div#confirm_select', dialog).html(button.custom_select);
} else {
ResourceSelect.insert('#confirm_select', dialog, button.select, null, true);
ResourceSelect.insert({
context: $('#confirm_select', dialog),
resourceName: button.select,
emptyValue: true
});
}
$('#confirm_with_select_tip', dialog).text(tip);

View File

@ -48,7 +48,12 @@ define(function(require) {
context.off("click", "#div_edit_chg_cluster_link");
context.on("click", "#div_edit_chg_cluster_link", function() {
var tr_context = $(this).parents("tr");
ResourceSelect.insert(".value_td_cluster", context, "Cluster", clusterId, false);
ResourceSelect.insert({
context: $('.value_td_cluster', context),
resourceName: 'Cluster',
initValue: clusterId,
includeDefaultCluster: true
});
});
context.off("change", ".value_td_cluster .resource_list_select");

View File

@ -85,8 +85,11 @@ define(function(require) {
if (Config.isTabActionEnabled(tabName, resourceType + '.chown')) {
context.off("click", "#div_edit_chg_owner_link");
context.on("click", "#div_edit_chg_owner_link", function() {
var tr_context = $(this).parents("tr");
ResourceSelect.insert("#value_td_owner", context, "User", element.UID, false);
ResourceSelect.insert({
context: $('#value_td_owner', context),
resourceName: 'User',
initValue: element.UID
});
});
context.off("change", "#value_td_owner .resource_list_select");
@ -101,7 +104,11 @@ define(function(require) {
if (Config.isTabActionEnabled(tabName, resourceType + '.chgrp')) {
context.off("click", "#div_edit_chg_group_link");
context.on("click", "#div_edit_chg_group_link", function() {
ResourceSelect.insert("#value_td_group", context, "Group", element.GID, false);
ResourceSelect.insert({
context: $('#value_td_group', context),
resourceName: 'Group',
initValue: element.GID
});
});
context.off("change", "#value_td_group .resource_list_select");

View File

@ -344,11 +344,11 @@ define(function(require) {
<td class="rvms_bar"></td>\
</tr>');
ResourceSelect.insert(
'td.image_select',
$(".image_quota_table tbody tr", context).last(),
"Image",
null, true);
ResourceSelect.insert({
context: $('.image_select', $(".image_quota_table tbody tr", context).last()),
resourceName: 'Image',
emptyValue: true
});
$(".image_quota_table tbody tr", context).last().off(
"change", ".resource_list_select");
@ -499,11 +499,11 @@ define(function(require) {
<td class="size_bar"></td>\
</tr>');
ResourceSelect.insert(
'td.ds_select',
$(".ds_quota_table tbody tr", context).last(),
"Datastore",
null, true);
ResourceSelect.insert({
context: $('.ds_select', $(".ds_quota_table tbody tr", context).last()),
resourceName: 'Datastore',
emptyValue: true
});
$(".ds_quota_table tbody tr", context).last().off(
"change", ".resource_list_select");
@ -651,11 +651,11 @@ define(function(require) {
<td class="leases_bar"></td>\
</tr>');
ResourceSelect.insert(
'td.network_select',
$(".network_quota_table tbody tr", context).last(),
"Network",
null, true);
ResourceSelect.insert({
context: $('.network_select', $(".network_quota_table tbody tr", context).last()),
resourceName: 'Network',
emptyValue: true
});
$(".network_quota_table tbody tr", context).last().off(
"change", ".resource_list_select");

View File

@ -50,14 +50,22 @@ define(function(require) {
if (opt.fixed_user != undefined){
$("#showback_user_container", context).hide();
} else {
ResourceSelect.insert("#showback_user_select", context, "User", -1, false,
'<option value="-1">'+Locale.tr("<< me >>")+'</option>');
ResourceSelect.insert({
context: $('#showback_user_select', context),
resourceName: 'User',
initValue: -1,
extraOptions: '<option value="-1">' + Locale.tr("<< me >>") + '</option>'
});
}
if (opt.fixed_group != undefined){
$("#showback_group_container", context).hide();
} else {
ResourceSelect.insert("#showback_group_select", context, "Group", "", true);
ResourceSelect.insert({
context: $('#showback_group_select', context),
resourceName: 'Group',
emptyValue: true
});
}
showback_dataTable = $("#showback_datatable",context).dataTable({