mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Moved add dialog into search facet.
Previously the add dialog is added into entity. The dialog is only used by the search facet, so it's now moved into the search facet.
This commit is contained in:
committed by
Adam Young
parent
25abf07360
commit
8d597dcbb0
@@ -523,26 +523,26 @@ IPA.entity_factories.permission = function() {
|
||||
|
||||
return IPA.entity({
|
||||
'name': 'permission'
|
||||
}).add_dialog(
|
||||
IPA.add_dialog({
|
||||
name: 'add',
|
||||
title: 'Add New Permission',
|
||||
width: '700px'
|
||||
}).
|
||||
field(IPA.text_widget({
|
||||
name: 'cn',
|
||||
undo: false
|
||||
})).
|
||||
field(IPA.rights_widget({name: 'permissions', label: 'Permissions', join: true, undo: false})).
|
||||
section(IPA.target_section({name: 'target', label: 'Target', undo: false}))).
|
||||
facet(IPA.search_facet().
|
||||
column({name:'cn'})).
|
||||
facet(IPA.permission_details_facet({ name: 'details' }).
|
||||
section(
|
||||
IPA.stanza({name:'identity', label:'Identity'}).
|
||||
input({name: 'cn', 'read_only': true})).
|
||||
section(IPA.rights_section()).
|
||||
section(IPA.target_section({name: 'target', label: 'Target'})));
|
||||
}).
|
||||
facet(
|
||||
IPA.search_facet().
|
||||
column({name:'cn'}).
|
||||
dialog(
|
||||
IPA.add_dialog({
|
||||
name: 'add',
|
||||
title: 'Add New Permission',
|
||||
width: '700px'
|
||||
}).
|
||||
field(IPA.text_widget({name: 'cn', undo: false})).
|
||||
field(IPA.rights_widget({name: 'permissions', label: 'Permissions', join: true, undo: false})).
|
||||
section(IPA.target_section({name: 'target', label: 'Target', undo: false})))).
|
||||
facet(
|
||||
IPA.permission_details_facet({ name: 'details' }).
|
||||
section(
|
||||
IPA.stanza({name:'identity', label:'Identity'}).
|
||||
input({name: 'cn', 'read_only': true})).
|
||||
section(IPA.rights_section()).
|
||||
section(IPA.target_section({name: 'target', label: 'Target'})));
|
||||
|
||||
};
|
||||
|
||||
@@ -554,19 +554,20 @@ IPA.entity_factories.privilege = function() {
|
||||
facet(
|
||||
IPA.search_facet().
|
||||
column({name:'cn'}).
|
||||
column({name:'description'})).
|
||||
column({name:'description'}).
|
||||
dialog(
|
||||
IPA.add_dialog({
|
||||
name: 'add',
|
||||
title: 'Add Privilege'
|
||||
}).
|
||||
field(IPA.text_widget({ name: 'cn', undo: false})).
|
||||
field(IPA.text_widget({ name: 'description', undo: false})))).
|
||||
facet(
|
||||
IPA.details_facet({name:'details'}).
|
||||
section(
|
||||
IPA.stanza({name:'identity', label:'Privilege Settings'}).
|
||||
input({name:'cn'}).
|
||||
input({name: 'description'}))).
|
||||
add_dialog(
|
||||
IPA.add_dialog({
|
||||
name: 'add',
|
||||
title: 'Add Privilege'}).
|
||||
field(IPA.text_widget({ name: 'cn', undo: false})).
|
||||
field(IPA.text_widget({ name: 'description', undo: false}))).
|
||||
association({
|
||||
name: 'permission',
|
||||
other_entity: 'privilege',
|
||||
@@ -585,22 +586,23 @@ IPA.entity_factories.role = function() {
|
||||
return IPA.entity({
|
||||
'name': 'role'
|
||||
}).
|
||||
facet(IPA.search_facet().
|
||||
column({name:'cn'}).
|
||||
column({name:'description'})).
|
||||
facet(
|
||||
IPA.search_facet().
|
||||
column({name:'cn'}).
|
||||
column({name:'description'}).
|
||||
dialog(
|
||||
IPA.add_dialog({
|
||||
name: 'add',
|
||||
title: 'Add Role'
|
||||
}).
|
||||
field(IPA.text_widget({ name: 'cn', undo: false})).
|
||||
field(IPA.text_widget({ name: 'description', undo: false})))).
|
||||
facet(
|
||||
IPA.details_facet({name:'details'}).
|
||||
section(
|
||||
IPA.stanza({name:'identity', label:'Role Settings'}).
|
||||
input({name:'cn'}).
|
||||
input({name: 'description'}))).
|
||||
add_dialog(
|
||||
IPA.add_dialog({
|
||||
name: 'add',
|
||||
title: 'Add Role'
|
||||
}).
|
||||
field(IPA.text_widget({ name: 'cn', undo: false})).
|
||||
field(IPA.text_widget({ name: 'description', undo: false}))).
|
||||
association({
|
||||
name: 'privilege',
|
||||
add_method: 'add_privilege',
|
||||
@@ -614,8 +616,19 @@ IPA.entity_factories.selfservice = function() {
|
||||
return IPA.entity({
|
||||
'name': 'selfservice'
|
||||
}).
|
||||
facet(IPA.search_facet().
|
||||
column({name:'aciname'})).
|
||||
facet(
|
||||
IPA.search_facet().
|
||||
column({name:'aciname'}).
|
||||
dialog(
|
||||
IPA.add_dialog({
|
||||
name: 'add',
|
||||
title: 'Add Self Service Definition'
|
||||
}).
|
||||
field(IPA.text_widget({ name: 'aciname', undo: false})).
|
||||
field(IPA.attributes_widget({
|
||||
object_type:'user',
|
||||
name:'attrs'
|
||||
})))).
|
||||
facet(
|
||||
IPA.details_facet({'name':'details'}).
|
||||
section(
|
||||
@@ -624,26 +637,30 @@ IPA.entity_factories.selfservice = function() {
|
||||
custom_input(IPA.attributes_widget({
|
||||
object_type:'user',
|
||||
name:'attrs'
|
||||
})))).
|
||||
add_dialog(
|
||||
IPA.add_dialog({
|
||||
name: 'add',
|
||||
title: 'Add Self Service Definition'
|
||||
}).
|
||||
field(IPA.text_widget({ name: 'aciname', undo: false})).
|
||||
field(IPA.attributes_widget({
|
||||
object_type:'user',
|
||||
name:'attrs'
|
||||
})));
|
||||
}))));
|
||||
};
|
||||
|
||||
|
||||
IPA.entity_factories.delegation = function() {
|
||||
var that = IPA.entity({
|
||||
'name': 'delegation'
|
||||
}).facet(
|
||||
IPA.search_facet().
|
||||
column({name:'aciname'})).
|
||||
}).
|
||||
facet(
|
||||
IPA.search_facet().
|
||||
column({name:'aciname'}).
|
||||
dialog(
|
||||
IPA.add_dialog({
|
||||
name: 'add',
|
||||
title: 'Add Delegation',
|
||||
width: '700px'
|
||||
}).
|
||||
field(IPA.text_widget({name: 'aciname', undo: false})).
|
||||
field(IPA.entity_select_widget({name: 'group',
|
||||
entity: 'group', undo: false})).
|
||||
field(IPA.entity_select_widget({name: 'memberof', entity: 'group',
|
||||
join: true, undo: false})).
|
||||
field(IPA.attributes_widget({name: 'attrs', object_type: 'user',
|
||||
join: true, undo: false})))).
|
||||
facet(
|
||||
IPA.details_facet().
|
||||
section(
|
||||
@@ -660,18 +677,6 @@ IPA.entity_factories.delegation = function() {
|
||||
custom_input(
|
||||
IPA.attributes_widget({
|
||||
name:'attrs', object_type:'user', join: true})))).
|
||||
add_dialog(IPA.add_dialog({
|
||||
name: 'add',
|
||||
title: 'Add Delegation',
|
||||
width: '700px'
|
||||
}).
|
||||
field(IPA.text_widget({ name: 'aciname', undo: false})).
|
||||
field(IPA.entity_select_widget({name:'group',
|
||||
entity:'group', undo: false})).
|
||||
field(IPA.entity_select_widget({name:'memberof', entity:'group',
|
||||
join: true, undo: false})).
|
||||
field(IPA.attributes_widget({ name: 'attrs', object_type:'user',
|
||||
join: true, undo: false}))).
|
||||
standard_associations();
|
||||
return that;
|
||||
|
||||
|
||||
@@ -330,6 +330,9 @@ IPA.details_facet = function(spec) {
|
||||
};
|
||||
|
||||
that.init = function() {
|
||||
|
||||
that.facet_init();
|
||||
|
||||
for (var i=0; i<that.sections.length; i++) {
|
||||
var section = that.sections[i];
|
||||
section.init();
|
||||
|
||||
@@ -40,17 +40,35 @@ IPA.facet = function (spec) {
|
||||
that.setup = spec.setup || setup;
|
||||
that.load = spec.load || load;
|
||||
|
||||
that.__defineGetter__("entity_name", function(){
|
||||
that.dialogs = [];
|
||||
that.dialogs_by_name = {};
|
||||
|
||||
that.__defineGetter__('entity_name', function() {
|
||||
return that._entity_name;
|
||||
});
|
||||
|
||||
that.__defineSetter__("entity_name", function(entity_name){
|
||||
that.__defineSetter__('entity_name', function(entity_name) {
|
||||
that._entity_name = entity_name;
|
||||
});
|
||||
|
||||
that.create_action_panel = IPA.facet_create_action_panel;
|
||||
|
||||
that.get_dialog = function(name) {
|
||||
return that.dialogs_by_name[name];
|
||||
};
|
||||
|
||||
that.dialog = function(dialog) {
|
||||
that.dialogs.push(dialog);
|
||||
that.dialogs_by_name[dialog.name] = dialog;
|
||||
return that;
|
||||
};
|
||||
|
||||
function init() {
|
||||
for (var i=0; i<that.dialogs.length; i++){
|
||||
var dialog = that.dialogs[i];
|
||||
dialog.entity_name = that._entity_name;
|
||||
dialog.init();
|
||||
}
|
||||
}
|
||||
|
||||
function create(container) {
|
||||
@@ -75,6 +93,7 @@ IPA.facet = function (spec) {
|
||||
return $('.action-panel', that.container);
|
||||
};
|
||||
|
||||
// methods that should be invoked by subclasses
|
||||
that.facet_init = that.init;
|
||||
that.facet_create = that.create;
|
||||
that.facet_setup = that.setup;
|
||||
|
||||
@@ -29,21 +29,38 @@ IPA.entity_factories.group = function () {
|
||||
return IPA.entity({
|
||||
'name': 'group'
|
||||
}).
|
||||
facet(IPA.search_facet().
|
||||
column({name:'cn'}).
|
||||
column({name:'gidnumber'}).
|
||||
column({name:'description'})).
|
||||
facet(
|
||||
IPA.details_facet().section(
|
||||
IPA.stanza({label: 'Group Settings' }).
|
||||
input({name: 'cn' }).
|
||||
input({name: 'description'}).
|
||||
input({name: 'gidnumber' }))).
|
||||
facet( IPA.group_member_user_facet({
|
||||
'name': 'member_user',
|
||||
'label': 'Users',
|
||||
'other_entity': 'user'
|
||||
})).
|
||||
IPA.search_facet().
|
||||
column({name: 'cn'}).
|
||||
column({name: 'gidnumber'}).
|
||||
column({name: 'description'}).
|
||||
dialog(
|
||||
IPA.add_dialog({
|
||||
'name': 'add',
|
||||
'title': 'Add New Group'
|
||||
}).
|
||||
field(IPA.text_widget({name: 'cn', undo: false})).
|
||||
field(IPA.text_widget({name: 'description', undo: false})).
|
||||
// TODO: Replace with i18n label
|
||||
field(IPA.checkbox_widget({
|
||||
name: 'posix',
|
||||
label: 'Is this a POSIX group?',
|
||||
undo: false,
|
||||
checked: 'checked'})).
|
||||
field(IPA.text_widget({name: 'gidnumber', undo: false})))).
|
||||
facet(
|
||||
IPA.details_facet().
|
||||
section(
|
||||
IPA.stanza({label: 'Group Settings' }).
|
||||
input({name: 'cn' }).
|
||||
input({name: 'description'}).
|
||||
input({name: 'gidnumber' }))).
|
||||
facet(
|
||||
IPA.group_member_user_facet({
|
||||
'name': 'member_user',
|
||||
'label': 'Users',
|
||||
'other_entity': 'user'
|
||||
})).
|
||||
association({
|
||||
name: 'netgroup',
|
||||
associator: 'serial'
|
||||
@@ -56,20 +73,6 @@ IPA.entity_factories.group = function () {
|
||||
name: 'taskgroup',
|
||||
associator: 'serial'
|
||||
}).
|
||||
add_dialog(
|
||||
IPA.add_dialog({
|
||||
'name': 'add',
|
||||
'title': 'Add New Group'
|
||||
}).
|
||||
field(IPA.text_widget({name:'cn', undo: false})).
|
||||
field(IPA.text_widget({name:'description', undo: false})).
|
||||
// TODO: Replace with i18n label
|
||||
field(IPA.checkbox_widget({
|
||||
name:'posix',
|
||||
label:'Is this a POSIX group?',
|
||||
undo: false,
|
||||
checked:'checked'})).
|
||||
field(IPA.text_widget({name:'gidnumber', undo: false}))).
|
||||
standard_associations();
|
||||
};
|
||||
|
||||
|
||||
@@ -30,17 +30,17 @@ IPA.entity_factories.hbacrule = function () {
|
||||
|
||||
that.init = function() {
|
||||
|
||||
var dialog = IPA.hbacrule_add_dialog({
|
||||
'name': 'add',
|
||||
'title': 'Add New Rule'
|
||||
});
|
||||
that.add_dialog(dialog);
|
||||
|
||||
|
||||
var facet = IPA.hbacrule_search_facet({
|
||||
'name': 'search',
|
||||
'label': 'Search'
|
||||
});
|
||||
|
||||
var dialog = IPA.hbacrule_add_dialog({
|
||||
'name': 'add',
|
||||
'title': 'Add New Rule'
|
||||
});
|
||||
facet.dialog(dialog);
|
||||
|
||||
that.add_facet(facet);
|
||||
|
||||
facet = IPA.hbacrule_details_facet({
|
||||
|
||||
@@ -30,16 +30,17 @@ IPA.entity_factories.hbacsvc = function () {
|
||||
|
||||
that.init = function() {
|
||||
|
||||
var dialog = IPA.hbacsvc_add_dialog({
|
||||
'name': 'add',
|
||||
'title': 'Add New HBAC Service'
|
||||
});
|
||||
that.add_dialog(dialog);
|
||||
|
||||
var facet = IPA.hbacsvc_search_facet({
|
||||
'name': 'search',
|
||||
'label': 'Search'
|
||||
});
|
||||
|
||||
var dialog = IPA.hbacsvc_add_dialog({
|
||||
'name': 'add',
|
||||
'title': 'Add New HBAC Service'
|
||||
});
|
||||
facet.dialog(dialog);
|
||||
|
||||
that.add_facet(facet);
|
||||
|
||||
facet = IPA.hbacsvc_details_facet({
|
||||
|
||||
@@ -36,16 +36,17 @@ IPA.entity_factories.hbacsvcgroup = function () {
|
||||
'remove_method': 'remove_member'
|
||||
});
|
||||
|
||||
var dialog = IPA.hbacsvcgroup_add_dialog({
|
||||
'name': 'add',
|
||||
'title': 'Add New HBAC Service Group'
|
||||
});
|
||||
that.add_dialog(dialog);
|
||||
|
||||
var facet = IPA.hbacsvcgroup_search_facet({
|
||||
'name': 'search',
|
||||
'label': 'Search'
|
||||
});
|
||||
|
||||
var dialog = IPA.hbacsvcgroup_add_dialog({
|
||||
'name': 'add',
|
||||
'title': 'Add New HBAC Service Group'
|
||||
});
|
||||
facet.dialog(dialog);
|
||||
|
||||
that.add_facet(facet);
|
||||
|
||||
facet = IPA.hbacsvcgroup_details_facet({
|
||||
|
||||
@@ -42,18 +42,18 @@ IPA.entity_factories.host = function () {
|
||||
'associator': 'serial'
|
||||
});
|
||||
|
||||
var dialog = IPA.host_add_dialog({
|
||||
'name': 'add',
|
||||
'title': 'Add New Host'
|
||||
});
|
||||
that.add_dialog(dialog);
|
||||
|
||||
var facet = IPA.host_search_facet({
|
||||
'name': 'search',
|
||||
'label': 'Search'
|
||||
});
|
||||
that.add_facet(facet);
|
||||
|
||||
var dialog = IPA.host_add_dialog({
|
||||
'name': 'add',
|
||||
'title': 'Add New Host'
|
||||
});
|
||||
facet.dialog(dialog);
|
||||
|
||||
facet = IPA.host_details_facet({
|
||||
'name': 'details'
|
||||
});
|
||||
|
||||
@@ -23,41 +23,41 @@
|
||||
/* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */
|
||||
|
||||
|
||||
IPA.entity_factories.hostgroup = function() {
|
||||
IPA.entity_factories.hostgroup = function() {
|
||||
|
||||
var that = IPA.entity({
|
||||
'name': 'hostgroup'
|
||||
});
|
||||
|
||||
that.init = function() {
|
||||
var search_facet = IPA.search_facet({
|
||||
name: 'search',
|
||||
label: 'Search',
|
||||
entity_name: that.name
|
||||
});
|
||||
search_facet.create_column({name:'cn'});
|
||||
search_facet.create_column({name:'description'});
|
||||
that.add_facet(search_facet);
|
||||
|
||||
that.add_facet(function() {
|
||||
var that = IPA.details_facet({name:'details'});
|
||||
that.add_section(
|
||||
IPA.stanza({name:'identity', label:'Hostgroup Settings'}).
|
||||
input({name:'cn'}).
|
||||
input({name: 'description'}));
|
||||
return that;
|
||||
}());
|
||||
that.facet(
|
||||
IPA.search_facet({
|
||||
name: 'search',
|
||||
label: 'Search',
|
||||
entity_name: that.name
|
||||
}).
|
||||
column({name:'cn'}).
|
||||
column({name:'description'}).
|
||||
dialog(
|
||||
IPA.add_dialog({
|
||||
name: 'add',
|
||||
title: 'Add Hostgroup'
|
||||
}).
|
||||
field(IPA.text_widget({name: 'cn', undo: false})).
|
||||
field(IPA.text_widget({name: 'description', undo: false}))));
|
||||
|
||||
that.facet(
|
||||
IPA.details_facet({name:'details'}).
|
||||
section(
|
||||
IPA.stanza({name:'identity', label:'Hostgroup Settings'}).
|
||||
input({name:'cn'}).
|
||||
input({name: 'description'})));
|
||||
|
||||
var dialog = IPA.add_dialog({
|
||||
name: 'add',
|
||||
title: 'Add Hostgroup'
|
||||
});
|
||||
that.add_dialog(dialog);
|
||||
|
||||
dialog.add_field(IPA.text_widget({name: 'cn', undo: false}));
|
||||
dialog.add_field(IPA.text_widget({name: 'description', undo: false}));
|
||||
that.create_association_facets();
|
||||
that.entity_init();
|
||||
};
|
||||
|
||||
return that;
|
||||
};
|
||||
|
||||
|
||||
@@ -23,42 +23,41 @@
|
||||
/* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */
|
||||
|
||||
IPA.entity_factories.netgroup = function() {
|
||||
|
||||
var that = IPA.entity({
|
||||
'name': 'netgroup'
|
||||
});
|
||||
|
||||
that.init = function() {
|
||||
var search_facet = IPA.search_facet({
|
||||
name: 'search',
|
||||
label: 'Search',
|
||||
entity_name: that.name
|
||||
});
|
||||
search_facet.create_column({name:'cn'});
|
||||
search_facet.create_column({name:'description'});
|
||||
that.add_facet(search_facet);
|
||||
|
||||
that.add_facet(function() {
|
||||
var that = IPA.details_facet({name:'details'});
|
||||
that.add_section(
|
||||
IPA.stanza({name:'identity', label:'Netgroup Settings'}).
|
||||
input({name:'cn'}).
|
||||
input({name: 'description'}).
|
||||
input({name:'nisdomainname'}));
|
||||
return that;
|
||||
}());
|
||||
that.facet(
|
||||
IPA.search_facet({
|
||||
name: 'search',
|
||||
label: 'Search',
|
||||
entity_name: that.name
|
||||
}).
|
||||
column({name:'cn'}).
|
||||
column({name:'description'}).
|
||||
dialog(
|
||||
IPA.add_dialog({
|
||||
name: 'add',
|
||||
title: 'Add Netgroup'
|
||||
}).
|
||||
field(IPA.text_widget({ name: 'cn', undo: false})).
|
||||
field(IPA.text_widget({ name: 'description', undo: false}))));
|
||||
|
||||
|
||||
var dialog = IPA.add_dialog({
|
||||
name: 'add',
|
||||
title: 'Add Netgroup'
|
||||
});
|
||||
that.add_dialog(dialog);
|
||||
|
||||
dialog.add_field(IPA.text_widget({ name: 'cn', undo: false}));
|
||||
dialog.add_field(IPA.text_widget({ name: 'description', undo: false}));
|
||||
that.facet(
|
||||
IPA.details_facet({name: 'details'}).
|
||||
section(
|
||||
IPA.stanza({name: 'identity', label: 'Netgroup Settings'}).
|
||||
input({name: 'cn'}).
|
||||
input({name: 'description'}).
|
||||
input({name: 'nisdomainname'})));
|
||||
|
||||
that.create_association_facets();
|
||||
that.entity_init();
|
||||
};
|
||||
|
||||
return that;
|
||||
};
|
||||
|
||||
|
||||
@@ -25,55 +25,52 @@
|
||||
|
||||
/* DNS */
|
||||
IPA.entity_factories.dnszone = function() {
|
||||
|
||||
var that = IPA.entity({
|
||||
name: 'dnszone'
|
||||
});
|
||||
|
||||
that.init = function() {
|
||||
var search_facet = IPA.search_facet({
|
||||
name: 'search',
|
||||
label: 'Search',
|
||||
entity_name: that.name
|
||||
});
|
||||
search_facet.create_column({name:'idnsname'});
|
||||
that.add_facet(search_facet);
|
||||
|
||||
that.add_facet(function() {
|
||||
var that = IPA.details_facet({name:'details'});
|
||||
that.add_section(
|
||||
IPA.stanza({name:'identity', label:'DNS Zone Settings'}).
|
||||
input({name:'idnsname'}).
|
||||
input({name:'idnszoneactive'}).
|
||||
input({name:'idnssoamname'}).
|
||||
input({name:'idnssoarname'}).
|
||||
input({name:'idnssoaserial'}).
|
||||
input({name:'idnssoarefresh'}).
|
||||
input({name:'idnssoaretry'}).
|
||||
input({name:'idnssoaexpire'}).
|
||||
input({name:'idnssoaminimum'}).
|
||||
input({name:'dnsttl'}).
|
||||
input({name:'dnsclass'}).
|
||||
input({name:'idnsallowdynupdate'}).
|
||||
input({name:'idnsupdatepolicy'}));
|
||||
that.facet(
|
||||
IPA.search_facet({
|
||||
name: 'search',
|
||||
label: 'Search',
|
||||
entity_name: that.name
|
||||
}).
|
||||
column({name:'idnsname'}).
|
||||
dialog(
|
||||
IPA.add_dialog({
|
||||
name: 'add',
|
||||
title: 'Add DNS Zone'
|
||||
}).
|
||||
field(IPA.text_widget({ name: 'idnsname', undo: false})).
|
||||
field(IPA.text_widget({ name: 'idnssoamname', undo: false})).
|
||||
field(IPA.text_widget({ name: 'idnssoarname', undo: false}))));
|
||||
|
||||
return that;
|
||||
}());
|
||||
|
||||
that.add_facet( IPA.records_facet({
|
||||
'name': 'records',
|
||||
'label': IPA.metadata.dnsrecord.label
|
||||
}));
|
||||
|
||||
var dialog = IPA.add_dialog({
|
||||
name: 'add',
|
||||
title: 'Add DNS Zone'
|
||||
});
|
||||
that.add_dialog(dialog);
|
||||
|
||||
dialog.add_field(IPA.text_widget({ name: 'idnsname', undo: false}));
|
||||
dialog.add_field(IPA.text_widget({ name: 'idnssoamname', undo: false}));
|
||||
dialog.add_field(IPA.text_widget({ name: 'idnssoarname', undo: false}));
|
||||
that.facet(
|
||||
IPA.details_facet({name:'details'}).
|
||||
section(
|
||||
IPA.stanza({name:'identity', label:'DNS Zone Settings'}).
|
||||
input({name:'idnsname'}).
|
||||
input({name:'idnszoneactive'}).
|
||||
input({name:'idnssoamname'}).
|
||||
input({name:'idnssoarname'}).
|
||||
input({name:'idnssoaserial'}).
|
||||
input({name:'idnssoarefresh'}).
|
||||
input({name:'idnssoaretry'}).
|
||||
input({name:'idnssoaexpire'}).
|
||||
input({name:'idnssoaminimum'}).
|
||||
input({name:'dnsttl'}).
|
||||
input({name:'dnsclass'}).
|
||||
input({name:'idnsallowdynupdate'}).
|
||||
input({name:'idnsupdatepolicy'})));
|
||||
|
||||
that.facet(
|
||||
IPA.records_facet({
|
||||
'name': 'records',
|
||||
'label': IPA.metadata.dnsrecord.label
|
||||
}));
|
||||
|
||||
that.create_association_facets();
|
||||
that.entity_init();
|
||||
@@ -496,42 +493,38 @@ IPA.records_facet = function (spec){
|
||||
|
||||
/**Automount*/
|
||||
|
||||
IPA.entity_factories.automountlocation = function (){
|
||||
IPA.entity_factories.automountlocation = function() {
|
||||
|
||||
var that = IPA.entity({
|
||||
name: 'automountlocation'
|
||||
});
|
||||
|
||||
|
||||
var search_facet = IPA.search_facet({
|
||||
name: 'search',
|
||||
label: 'Search',
|
||||
entity_name: that.name
|
||||
});
|
||||
that.init = function() {
|
||||
search_facet.create_column({name:'cn'});
|
||||
that.add_facet(search_facet);
|
||||
|
||||
that.facet(
|
||||
IPA.search_facet({
|
||||
name: 'search',
|
||||
label: 'Search',
|
||||
entity_name: that.name
|
||||
}).
|
||||
column({name:'cn'}).
|
||||
dialog(
|
||||
IPA.add_dialog({
|
||||
name: 'add',
|
||||
title: 'Add Automount Location'
|
||||
}).
|
||||
field(IPA.text_widget({ name: 'cn', undo: false}))));
|
||||
|
||||
that.add_facet(function() {
|
||||
var that = IPA.details_facet({name:'details'});
|
||||
that.add_section(
|
||||
IPA.stanza({name:'identity', label:'Automount Location Settings'}).
|
||||
input({name:'cn'}));
|
||||
return that;
|
||||
}());
|
||||
|
||||
var dialog = IPA.add_dialog({
|
||||
name: 'add',
|
||||
title: 'Add Automount Location'
|
||||
});
|
||||
that.add_dialog(dialog);
|
||||
|
||||
dialog.add_field(IPA.text_widget({ name: 'cn', undo: false}));
|
||||
that.facet(
|
||||
IPA.details_facet({name:'details'}).
|
||||
section(
|
||||
IPA.stanza({name:'identity', label:'Automount Location Settings'}).
|
||||
input({name:'cn'})));
|
||||
|
||||
that.create_association_facets();
|
||||
that.entity_init();
|
||||
|
||||
};
|
||||
|
||||
return that;
|
||||
};
|
||||
|
||||
@@ -540,47 +533,43 @@ IPA.entity_factories.automountlocation = function (){
|
||||
|
||||
|
||||
IPA.entity_factories.pwpolicy = function() {
|
||||
|
||||
var that = IPA.entity({
|
||||
name: 'pwpolicy'
|
||||
});
|
||||
|
||||
|
||||
var search_facet = IPA.search_facet({
|
||||
name: 'search',
|
||||
label: 'Search',
|
||||
entity_name: that.name
|
||||
});
|
||||
that.init = function() {
|
||||
search_facet.create_column({name:'cn'});
|
||||
that.add_facet(search_facet);
|
||||
|
||||
that.facet(
|
||||
IPA.search_facet({
|
||||
name: 'search',
|
||||
label: 'Search',
|
||||
entity_name: that.name
|
||||
}).
|
||||
column({name:'cn'}).
|
||||
dialog(
|
||||
IPA.add_dialog({
|
||||
name: 'add',
|
||||
title: 'Add Password Policy',
|
||||
entity_name:'pwpolicy'
|
||||
}).
|
||||
field(IPA.text_widget({name: 'cn', undo: false}))));
|
||||
|
||||
that.add_facet(function() {
|
||||
var that = IPA.details_facet({name:'details'});
|
||||
that.add_section(
|
||||
|
||||
IPA.stanza({name:'identity', label:'Password Policy'}).
|
||||
input({name:'krbmaxpwdlife'}).
|
||||
input({name:'krbminpwdlife'}).
|
||||
input({name:'krbpwdhistorylength'}).
|
||||
input({name:'krbpwdmindiffchars'}).
|
||||
input({name:'krbpwdminlength'}));
|
||||
return that;
|
||||
}());
|
||||
|
||||
var dialog = IPA.add_dialog({
|
||||
name: 'add',
|
||||
title: 'Add Password Policy',
|
||||
entity_name:'pwpolicy'
|
||||
});
|
||||
that.add_dialog(dialog);
|
||||
|
||||
dialog.add_field(IPA.text_widget({ name: 'cn', undo: false}));
|
||||
that.facet(
|
||||
IPA.details_facet({name:'details'}).
|
||||
section(
|
||||
IPA.stanza({name:'identity', label:'Password Policy'}).
|
||||
input({name:'krbmaxpwdlife'}).
|
||||
input({name:'krbminpwdlife'}).
|
||||
input({name:'krbpwdhistorylength'}).
|
||||
input({name:'krbpwdmindiffchars'}).
|
||||
input({name:'krbpwdminlength'})));
|
||||
|
||||
that.create_association_facets();
|
||||
that.entity_init();
|
||||
|
||||
};
|
||||
|
||||
return that;
|
||||
};
|
||||
|
||||
@@ -591,18 +580,20 @@ IPA.entity_factories.pwpolicy = function() {
|
||||
Does not have search
|
||||
*/
|
||||
IPA.entity_factories.krbtpolicy = function() {
|
||||
|
||||
var that = IPA.entity({
|
||||
name: 'krbtpolicy'
|
||||
});
|
||||
|
||||
var details = IPA.details_facet({
|
||||
'name': 'details'
|
||||
});
|
||||
details.add_section(
|
||||
IPA.stanza({name:'identity', label:'Kerberos ticket policy'}).
|
||||
//input({name:'uid',label:' '}).
|
||||
input({name:'krbmaxrenewableage'}).
|
||||
input({name:'krbmaxticketlife'}));
|
||||
that.add_facet(details);
|
||||
that.facet(
|
||||
IPA.details_facet({
|
||||
name: 'details'
|
||||
}).
|
||||
section(
|
||||
IPA.stanza({name: 'identity', label: 'Kerberos ticket policy'}).
|
||||
//input({name: 'uid',label:' '}).
|
||||
input({name: 'krbmaxrenewableage'}).
|
||||
input({name: 'krbmaxticketlife'})));
|
||||
|
||||
return that;
|
||||
};
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
/* REQUIRES: ipa.js */
|
||||
|
||||
IPA.search_widget = function (spec) {
|
||||
IPA.search_widget = function (spec) {
|
||||
|
||||
spec = spec || {};
|
||||
|
||||
@@ -92,7 +92,7 @@ IPA.search_widget = function (spec) {
|
||||
that.find_button = IPA.button({
|
||||
'label': IPA.messages.button.find,
|
||||
'icon': 'ui-icon-search',
|
||||
'click': function() { that.find(that.container); }
|
||||
'click': function() { that.find(); }
|
||||
});
|
||||
button.replaceWith(that.find_button);
|
||||
|
||||
@@ -113,7 +113,7 @@ IPA.search_widget = function (spec) {
|
||||
that.add_button = IPA.action_button({
|
||||
'label': IPA.messages.button.add,
|
||||
'icon': 'ui-icon-plus',
|
||||
'click': function() { that.add(that.container); }
|
||||
'click': function() { that.add(); }
|
||||
});
|
||||
button.replaceWith(that.add_button);
|
||||
|
||||
@@ -121,18 +121,16 @@ IPA.search_widget = function (spec) {
|
||||
this.filter.val(filter);
|
||||
};
|
||||
|
||||
that.find = function(container) {
|
||||
that.find = function() {
|
||||
var filter = this.filter.val();
|
||||
var state = {};
|
||||
state[that.entity_name + '-filter'] = filter;
|
||||
$.bbq.pushState(state);
|
||||
};
|
||||
|
||||
that.add = function(container) {
|
||||
that.add = function() {
|
||||
|
||||
var entity = IPA.get_entity(that.entity_name);
|
||||
|
||||
var dialog = entity.get_dialog('add');
|
||||
var dialog = that.facet.get_dialog('add');
|
||||
dialog.open(that.container);
|
||||
|
||||
return false;
|
||||
@@ -264,31 +262,25 @@ IPA.search_widget = function (spec) {
|
||||
return that;
|
||||
};
|
||||
|
||||
IPA.search_facet = function (spec) {
|
||||
IPA.search_facet = function(spec) {
|
||||
|
||||
spec = spec || {};
|
||||
|
||||
spec.name = spec.name || 'search';
|
||||
spec.label = spec.label || IPA.messages.facets.search;
|
||||
|
||||
|
||||
spec.display_class = 'search-facet';
|
||||
|
||||
var that = IPA.facet(spec);
|
||||
|
||||
that.init = spec.init || init;
|
||||
that.create = spec.create || create;
|
||||
that.setup = spec.setup || setup;
|
||||
that.refresh = spec.refresh || refresh;
|
||||
|
||||
that.columns = [];
|
||||
that.columns_by_name = {};
|
||||
|
||||
that.__defineGetter__("entity_name", function(){
|
||||
that.__defineGetter__('entity_name', function() {
|
||||
return that._entity_name;
|
||||
});
|
||||
|
||||
that.__defineSetter__("entity_name", function(entity_name){
|
||||
that.__defineSetter__('entity_name', function(entity_name) {
|
||||
that._entity_name = entity_name;
|
||||
|
||||
for (var i=0; i<that.columns.length; i++) {
|
||||
@@ -344,7 +336,7 @@ IPA.search_facet = function (spec) {
|
||||
};
|
||||
};
|
||||
|
||||
function init() {
|
||||
that.init = function() {
|
||||
|
||||
that.facet_init();
|
||||
|
||||
@@ -369,42 +361,34 @@ IPA.search_facet = function (spec) {
|
||||
}
|
||||
|
||||
that.table.init();
|
||||
}
|
||||
};
|
||||
|
||||
that.is_dirty = function() {
|
||||
var filter = $.bbq.getState(that.entity_name + '-filter', true) || '';
|
||||
return filter != that.filter;
|
||||
};
|
||||
|
||||
function create(container) {
|
||||
that.create = function(container) {
|
||||
|
||||
container.attr('title', that.entity_name);
|
||||
|
||||
var span = $('<span/>', { 'name': 'search' }).appendTo(container);
|
||||
|
||||
that.table.create(span);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
function setup(container) {
|
||||
that.setup = function(container) {
|
||||
that.facet_setup(container);
|
||||
var span = $('span[name=search]', that.container);
|
||||
that.table.setup(span);
|
||||
}
|
||||
};
|
||||
|
||||
function refresh() {
|
||||
that.refresh = function() {
|
||||
that.filter = $.bbq.getState(that.entity_name + '-filter', true) || '';
|
||||
that.table.refresh();
|
||||
}
|
||||
|
||||
if (spec.columns) {
|
||||
for (var i=0; i<spec.columns.length; i++) {
|
||||
var column = spec.columns[i];
|
||||
column.facet = that;
|
||||
that.add_column(column);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// methods that should be invoked by subclasses
|
||||
that.search_facet_init = that.init;
|
||||
that.search_facet_create = that.create;
|
||||
that.search_facet_setup = that.setup;
|
||||
|
||||
@@ -33,13 +33,14 @@ IPA.entity_factories.service = function () {
|
||||
'add_method': 'add_host',
|
||||
'remove_method': 'remove_host'
|
||||
}).
|
||||
dialog(
|
||||
IPA.service_add_dialog({
|
||||
'name': 'add',
|
||||
'title': 'Add New Service'
|
||||
})).
|
||||
facet( IPA.search_facet().
|
||||
column({name:'krbprincipalname'})).
|
||||
facet(
|
||||
IPA.search_facet().
|
||||
column({name: 'krbprincipalname'}).
|
||||
dialog(
|
||||
IPA.service_add_dialog({
|
||||
'name': 'add',
|
||||
'title': 'Add New Service'
|
||||
}))).
|
||||
facet( IPA.service_details_facet()).
|
||||
facet( IPA.service_managedby_host_facet({
|
||||
'name': 'managedby_host',
|
||||
|
||||
@@ -30,16 +30,17 @@ IPA.entity_factories.sudocmd = function () {
|
||||
|
||||
that.init = function() {
|
||||
|
||||
var dialog = IPA.sudocmd_add_dialog({
|
||||
'name': 'add',
|
||||
'title': 'Add New SUDO Command'
|
||||
});
|
||||
that.add_dialog(dialog);
|
||||
|
||||
var facet = IPA.sudocmd_search_facet({
|
||||
'name': 'search',
|
||||
'label': 'Search'
|
||||
});
|
||||
|
||||
var dialog = IPA.sudocmd_add_dialog({
|
||||
'name': 'add',
|
||||
'title': 'Add New SUDO Command'
|
||||
});
|
||||
facet.dialog(dialog);
|
||||
|
||||
that.add_facet(facet);
|
||||
|
||||
facet = IPA.sudocmd_details_facet({
|
||||
|
||||
@@ -36,16 +36,17 @@ IPA.entity_factories.sudocmdgroup = function () {
|
||||
'remove_method': 'remove_member'
|
||||
});
|
||||
|
||||
var dialog = IPA.sudocmdgroup_add_dialog({
|
||||
'name': 'add',
|
||||
'title': 'Add New SUDO Command Group'
|
||||
});
|
||||
that.add_dialog(dialog);
|
||||
|
||||
var facet = IPA.sudocmdgroup_search_facet({
|
||||
'name': 'search',
|
||||
'label': 'Search'
|
||||
});
|
||||
|
||||
var dialog = IPA.sudocmdgroup_add_dialog({
|
||||
'name': 'add',
|
||||
'title': 'Add New SUDO Command Group'
|
||||
});
|
||||
facet.dialog(dialog);
|
||||
|
||||
that.add_facet(facet);
|
||||
|
||||
facet = IPA.sudocmdgroup_details_facet({
|
||||
|
||||
@@ -30,16 +30,17 @@ IPA.entity_factories.sudorule = function () {
|
||||
|
||||
that.init = function() {
|
||||
|
||||
var dialog = IPA.sudorule_add_dialog({
|
||||
'name': 'add',
|
||||
'title': 'Add New Rule'
|
||||
});
|
||||
that.add_dialog(dialog);
|
||||
|
||||
var facet = IPA.sudorule_search_facet({
|
||||
'name': 'search',
|
||||
'label': 'Search'
|
||||
});
|
||||
|
||||
var dialog = IPA.sudorule_add_dialog({
|
||||
'name': 'add',
|
||||
'title': 'Add New Rule'
|
||||
});
|
||||
facet.dialog(dialog);
|
||||
|
||||
that.add_facet(facet);
|
||||
|
||||
facet = IPA.sudorule_details_facet({
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
/* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */
|
||||
|
||||
IPA.entity_factories.user = function (){
|
||||
IPA.entity_factories.user = function() {
|
||||
|
||||
return IPA.entity({
|
||||
name: 'user'
|
||||
@@ -43,7 +43,15 @@ IPA.entity_factories.user = function (){
|
||||
column({name:'uidnumber'}).
|
||||
column({name:'mail'}).
|
||||
column({name:'telephonenumber'}).
|
||||
column({name:'title'})).
|
||||
column({name:'title'}).
|
||||
dialog(
|
||||
IPA.add_dialog({
|
||||
'name': 'add',
|
||||
'title': 'Add User'
|
||||
}).
|
||||
field(IPA.text_widget({ name: 'uid', undo: false })).
|
||||
field(IPA.text_widget({ name: 'givenname', undo: false })).
|
||||
field(IPA.text_widget({ name: 'sn', undo: false })))).
|
||||
facet(IPA.details_facet().
|
||||
section(
|
||||
IPA.stanza({name: 'identity', label: IPA.messages.details.identity}).
|
||||
@@ -82,15 +90,7 @@ IPA.entity_factories.user = function (){
|
||||
section(
|
||||
IPA.stanza({name: 'misc', label: IPA.messages.details.misc}).
|
||||
input({name:'carlicense'}))).
|
||||
standard_associations().
|
||||
add_dialog(
|
||||
IPA.add_dialog({
|
||||
'name': 'add',
|
||||
'title': 'Add User'
|
||||
}).
|
||||
field(IPA.text_widget({ name: 'uid', undo: false })).
|
||||
field(IPA.text_widget({ name: 'givenname', undo: false })).
|
||||
field(IPA.text_widget({ name: 'sn', undo: false })));
|
||||
standard_associations();
|
||||
};
|
||||
|
||||
/* ATTRIBUTE CALLBACKS */
|
||||
|
||||
Reference in New Issue
Block a user