summaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2010-12-01 20:25:44 -0600
committerAdam Young <ayoung@redhat.com>2010-12-02 13:42:40 -0500
commitfb9ba5bb5cc385e7ffd7f030058c316c5c4facf9 (patch)
tree615cd886f07e7550b8b39475c4794faf291a70ab /install
parent6c2391b6b3f993c095564f6b76d99cb72ecc07b0 (diff)
downloadfreeipa-fb9ba5bb5cc385e7ffd7f030058c316c5c4facf9.tar.gz
freeipa-fb9ba5bb5cc385e7ffd7f030058c316c5c4facf9.tar.xz
freeipa-fb9ba5bb5cc385e7ffd7f030058c316c5c4facf9.zip
UI for host managedby
A custom facet has been added to manage the host's managedby attribute. The facet defines the add and remove methods, the columns for the association table and enrollment dialog, and the link for the primary key column.
Diffstat (limited to 'install')
-rw-r--r--install/static/host.js66
1 files changed, 66 insertions, 0 deletions
diff --git a/install/static/host.js b/install/static/host.js
index 5cfceba5c..4f3a636eb 100644
--- a/install/static/host.js
+++ b/install/static/host.js
@@ -58,6 +58,13 @@ function ipa_host() {
});
that.add_facet(facet);
+ facet = ipa_host_managedby_host_facet({
+ 'name': 'managedby_host',
+ 'label': 'Managed by Hosts',
+ 'other_entity': 'host'
+ });
+ that.add_facet(facet);
+
that.create_association_facets();
that.entity_init();
@@ -412,3 +419,62 @@ function host_certificate_status_widget(spec) {
return that;
}
+
+function ipa_host_managedby_host_facet(spec) {
+
+ spec = spec || {};
+
+ var that = ipa_association_facet(spec);
+
+ that.add_method = 'add_managedby';
+ that.delete_method = 'remove_managedby';
+
+ that.init = function() {
+
+ var column = that.create_column({
+ name: 'fqdn',
+ label: 'Name',
+ primary_key: true
+ });
+
+ column.setup = function(container, record) {
+ container.empty();
+
+ var value = record[column.name];
+ value = value ? value.toString() : '';
+
+ $('<a/>', {
+ 'href': '#'+value,
+ 'html': value,
+ 'click': function (value) {
+ return function() {
+ var state = IPA.tab_state(that.other_entity);
+ state[that.other_entity + '-facet'] = 'details';
+ state[that.other_entity + '-pkey'] = value;
+ $.bbq.pushState(state);
+ return false;
+ }
+ }(value)
+ }).appendTo(container);
+ };
+
+ that.create_column({name: 'description', label: 'Description'});
+
+ that.create_adder_column({
+ name: 'fqdn',
+ label: 'Name',
+ primary_key: true,
+ width: '100px'
+ });
+
+ that.create_adder_column({
+ name: 'description',
+ label: 'Description',
+ width: '100px'
+ });
+
+ that.association_facet_init();
+ };
+
+ return that;
+} \ No newline at end of file