diff options
author | Adam Young <ayoung@redhat.com> | 2011-05-27 11:32:17 -0400 |
---|---|---|
committer | Adam Young <ayoung@redhat.com> | 2011-06-01 22:15:11 -0400 |
commit | c0f155bbfe5c5448af1b38b9da9bb75e9cdac9b4 (patch) | |
tree | 6fb9f9f374bb8734b2cea37aa68688172d978f36 /install/ui/automount.js | |
parent | 6039fdd6b3002f65ecd0121b7ca6d31e49b9590e (diff) | |
download | freeipa.git-c0f155bbfe5c5448af1b38b9da9bb75e9cdac9b4.tar.gz freeipa.git-c0f155bbfe5c5448af1b38b9da9bb75e9cdac9b4.tar.xz freeipa.git-c0f155bbfe5c5448af1b38b9da9bb75e9cdac9b4.zip |
automount delete key
indirect automount maps
code review changes for automount:
Removed: fields for mount and parentmap in maps details since they are not present in show or mod
Hid undo link for adder dialog
set up click handler for checkboxes when row does not have primary key
removed add override in automountmap_adder_dialog
moved 'var input...' in automount.js line 158 to start of method.
changed logic in if statmenet ,dialog.js line 628 it if (!first) as suggested
Diffstat (limited to 'install/ui/automount.js')
-rw-r--r-- | install/ui/automount.js | 86 |
1 files changed, 84 insertions, 2 deletions
diff --git a/install/ui/automount.js b/install/ui/automount.js index f865fe73..d008c964 100644 --- a/install/ui/automount.js +++ b/install/ui/automount.js @@ -63,7 +63,8 @@ IPA.entity_factories.automountmap = function() { nested_entity : 'automountkey', label : IPA.metadata.objects.automountkey.label, name: 'keys', - columns:['description'] + get_values: IPA.get_option_values, + columns:['automountkey','automountinformation'] }). details_facet({ sections:[ @@ -75,7 +76,27 @@ IPA.entity_factories.automountmap = function() { ] }). adder_dialog({ - fields:['automountmapname','description'] + factory: IPA.automountmap_adder_dialog, + fields:[{factory:IPA.method_radio_widget, + name: 'method', + undo: false, + label:'Map Type', + options:[{value:'add',label:'Direct'}, + {value:'add_indirect',label:'Indirect'}] + }, + 'automountmapname','description', + { + name:'key', + label:'Mount Point', + conditional:true, + undo: false + }, + { + name:'parentmap', + label:'Parent Map', + conditional:true, + undo: false + }] }). build(); }; @@ -99,3 +120,64 @@ IPA.entity_factories.automountkey = function() { }). build(); }; + + +IPA.automountmap_adder_dialog = function(spec){ + var that = IPA.add_dialog(spec); + + that.super_setup = that.setup; + that.setup = function(container) { + that.super_setup(container); + that.disable_conditional_fields(); + }; + + return that; +}; + + +IPA.get_option_values = function(){ + + var values = []; + $('input[name="select"]:checked', this.table.tbody).each(function() { + var value = {}; + $('span',$(this).parent().parent()).each(function(){ + var name = this.attributes['name'].value; + + value[name] = $(this).text(); + }); + values.push (value); + }); + return values; +}; + +IPA.method_radio_widget = function(spec){ + var direct = true; + + var that = IPA.radio_widget(spec); + + that.setup = function(container) { + + var input = $('input[name="'+that.name+'"]', that.container); + input. + filter("[value="+ that.dialog.method+"]"). + attr('checked', true); + + + input.change(function() { + that.dialog.method = this.value; + + if (this.value === 'add_indirect'){ + that.dialog.enable_conditional_fields(); + }else{ + that.dialog.disable_conditional_fields(); + } + }); + }; + + that.reset = function(){ + var input = $('input[name="'+that.name+'"]', that.container); + input.filter("[value=add]").click(); + }; + + return that; +}; |