Range web UI was implemented.

It consist of:
  * new menu item - 'ranges' in 'IPA Server' tab
  * new search page
  * new details page

https://fedorahosted.org/freeipa/ticket/2894


Some comments/questions:
1) I'm not sure about options in adder dialog. Should they all be there or should I remove some? And also labels seems to long.

2) FreeIPA creates default range. This range doesn't have required attribute 'First RID of the corresponding RID range'. It prevents from editing the range in Web UI until a some value is set. Not sure if even should be edited though.
--
Petr Vobornik


From 5b26938dc559cec8ac9bfd852a61d6cddf34e637 Mon Sep 17 00:00:00 2001
From: Petr Vobornik <pvobo...@redhat.com>
Date: Fri, 3 Aug 2012 16:18:27 +0200
Subject: [PATCH] Range Web UI

Range web UI was implemented.

It consist of:
 * new menu item - 'ranges' in 'IPA Server' tab
 * new search page
 * new details page

https://fedorahosted.org/freeipa/ticket/2894
---
 install/ui/Makefile.am                      |    5 +-
 install/ui/index.html                       |    1 +
 install/ui/jsl.conf                         |    1 +
 install/ui/range.js                         |   74 +++++++++++++++++++++++++++
 install/ui/test/data/ipa_init.json          |    3 ++
 install/ui/test/data/range_add.json         |   34 ++++++++++++
 install/ui/test/data/range_find.json        |   32 ++++++++++++
 install/ui/test/data/range_find_pkeys.json  |   17 ++++++
 install/ui/test/data/range_get_records.json |   40 +++++++++++++++
 install/ui/test/data/range_mod.json         |   43 ++++++++++++++++
 install/ui/test/data/range_show.json        |   44 ++++++++++++++++
 install/ui/webui.js                         |    1 +
 ipalib/plugins/internal.py                  |    3 ++
 13 files changed, 296 insertions(+), 2 deletions(-)
 create mode 100644 install/ui/range.js
 create mode 100644 install/ui/test/data/range_add.json
 create mode 100644 install/ui/test/data/range_find.json
 create mode 100644 install/ui/test/data/range_find_pkeys.json
 create mode 100644 install/ui/test/data/range_get_records.json
 create mode 100644 install/ui/test/data/range_mod.json
 create mode 100644 install/ui/test/data/range_show.json

diff --git a/install/ui/Makefile.am b/install/ui/Makefile.am
index 73f746a39de974b0e94e81d562f88ea87767bcc9..841e210e27e209d8a2117aa29a27c77359d6c01b 100644
--- a/install/ui/Makefile.am
+++ b/install/ui/Makefile.am
@@ -54,8 +54,9 @@ app_DATA =				\
 	overpass_regular-web.ttf	\
 	overpass_regular-web.woff	\
 	policy.js			\
-	reset_password.js			\
-	reset_password.html			\
+	range.js			\
+	reset_password.js		\
+	reset_password.html		\
 	rule.js 			\
 	search.js 			\
 	selinux.js 			\
diff --git a/install/ui/index.html b/install/ui/index.html
index 24e8cac3668cd81fb064f6a8ad2b1685c847f5c8..ab51b6d57b66158d0738697ef774f28b6efcab4a 100644
--- a/install/ui/index.html
+++ b/install/ui/index.html
@@ -53,6 +53,7 @@
     <script type="text/javascript" src="aci.js"></script>
     <script type="text/javascript" src="entitle.js"></script>
     <script type="text/javascript" src="trust.js"></script>
+    <script type="text/javascript" src="range.js"></script>
 
     <script type="text/javascript" src="ext/extension.js"></script>
     <script type="text/javascript" src="webui.js"></script>
diff --git a/install/ui/jsl.conf b/install/ui/jsl.conf
index bec553fe7d757f445805dd99d1ec70180b8da17f..5faeed9329de13729c75a97b23fcaa3ba62a1a6e 100644
--- a/install/ui/jsl.conf
+++ b/install/ui/jsl.conf
@@ -157,6 +157,7 @@
 +process dns.js
 +process automount.js
 +process automember.js
++process range.js
 +process trust.js
 +process webui.js
 +process login.js
diff --git a/install/ui/range.js b/install/ui/range.js
new file mode 100644
index 0000000000000000000000000000000000000000..79e07d6653cfb4eaf3fc755a2b40acc35ac94a6c
--- /dev/null
+++ b/install/ui/range.js
@@ -0,0 +1,74 @@
+/*jsl:import ipa.js */
+
+/*  Authors:
+ *    Petr Vobornik <pvobo...@redhat.com>
+ *
+ * Copyright (C) 2010 Red Hat
+ * see file 'COPYING' for use and warranty information
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
+
+IPA.range = {};
+
+IPA.range.entity = function(spec) {
+
+    var that = IPA.entity(spec);
+
+    that.init = function() {
+        that.entity_init();
+
+        that.builder.search_facet({
+            columns: [
+                'cn',
+                'ipabaseid',
+                'ipaidrangesize',
+                'iparangetype'
+            ]
+        }).
+        details_facet({
+            sections: [
+                {
+                    name: 'details',
+                    fields: [
+                        'cn',
+                        'ipabaseid',
+                        'ipaidrangesize',
+                        'ipabaserid',
+                        'ipasecondarybaserid',
+                        'ipanttrusteddomainsid',
+                        'iparangetype'
+                    ]
+                }
+            ]
+        }).
+        adder_dialog({
+            fields: [
+                'cn',
+                'ipabaseid',
+                'ipaidrangesize',
+                'ipabaserid',
+                'ipasecondarybaserid',
+                'ipanttrusteddomainsid',
+                'iparangetype'
+            ]
+        });
+    };
+
+    return that;
+};
+
+IPA.register('range', IPA.range.entity);
diff --git a/install/ui/test/data/ipa_init.json b/install/ui/test/data/ipa_init.json
index 4325a5552e1205a3839e5830c59af73448785789..46c2e15903f3cbe7d4b201ae6da2c4d63cefbbbb 100644
--- a/install/ui/test/data/ipa_init.json
+++ b/install/ui/test/data/ipa_init.json
@@ -356,6 +356,9 @@
                         "pwpolicy": {
                             "identity": "Password Policy"
                         },
+                        "range": {
+                            "details": "Range Settings"
+                        },
                         "role": {
                             "identity": "Role Settings"
                         },
diff --git a/install/ui/test/data/range_add.json b/install/ui/test/data/range_add.json
new file mode 100644
index 0000000000000000000000000000000000000000..bccb88e786866cb455ec188573d08dbfb43a8cca
--- /dev/null
+++ b/install/ui/test/data/range_add.json
@@ -0,0 +1,34 @@
+{
+    "error": null,
+    "id": null,
+    "result": {
+        "result": {
+            "cn": [
+                "DEV.EXAMPLE.COM_id_range"
+            ],
+            "dn": "cn=foo_range,cn=ranges,cn=etc,dc=idm,dc=lab,dc=bos,dc=redhat,dc=com",
+            "ipabaseid": [
+                "107400000"
+            ],
+            "ipabaserid": [
+                "1000"
+            ],
+            "ipaidrangesize": [
+                "200000"
+            ],
+            "iparangetype": [
+                "local domain range"
+            ],
+            "ipasecondarybaserid": [
+                "100000000"
+            ],
+            "objectclass": [
+                "top",
+                "ipaIDrange",
+                "ipaDomainIDRange"
+            ]
+        },
+        "summary": "Added ID range \"DEV.EXAMPLE.COM_id_range\"",
+        "value": "DEV.EXAMPLE.COM_id_range"
+    }
+}
\ No newline at end of file
diff --git a/install/ui/test/data/range_find.json b/install/ui/test/data/range_find.json
new file mode 100644
index 0000000000000000000000000000000000000000..9d47a94fc2807820290a94bd9d1d24b552914a93
--- /dev/null
+++ b/install/ui/test/data/range_find.json
@@ -0,0 +1,32 @@
+{
+    "error": null,
+    "id": null,
+    "result": {
+        "count": 1,
+        "result": [
+            {
+                "cn": [
+                    "DEV.EXAMPLE.COM_id_range"
+                ],
+                "dn": "cn=example.com_id_range,cn=ranges,cn=etc,dc=dev,dc=example,dc=com",
+                "ipabaseid": [
+                    "107400000"
+                ],
+                "ipabaserid": [
+                    "1001"
+                ],
+                "ipaidrangesize": [
+                    "200000"
+                ],
+                "iparangetype": [
+                    "local domain range"
+                ],
+                "ipasecondarybaserid": [
+                    "100000000"
+                ]
+            }
+        ],
+        "summary": "1 range matched",
+        "truncated": false
+    }
+}
\ No newline at end of file
diff --git a/install/ui/test/data/range_find_pkeys.json b/install/ui/test/data/range_find_pkeys.json
new file mode 100644
index 0000000000000000000000000000000000000000..21f91cdbd990739920947b3041aaddaf2264334a
--- /dev/null
+++ b/install/ui/test/data/range_find_pkeys.json
@@ -0,0 +1,17 @@
+{
+    "error": null,
+    "id": null,
+    "result": {
+        "count": 1,
+        "result": [
+            {
+                "cn": [
+                    "DEV.EXAMPLE.COM_id_range"
+                ],
+                "dn": "cn=example.com_id_range,cn=ranges,cn=etc,dc=dev,dc=example,dc=com"
+            }
+        ],
+        "summary": "1 range matched",
+        "truncated": false
+    }
+}
\ No newline at end of file
diff --git a/install/ui/test/data/range_get_records.json b/install/ui/test/data/range_get_records.json
new file mode 100644
index 0000000000000000000000000000000000000000..5f17c26bd9627831534614da6a4ab841f0797d91
--- /dev/null
+++ b/install/ui/test/data/range_get_records.json
@@ -0,0 +1,40 @@
+{
+    "error": null,
+    "id": null,
+    "result": {
+        "count": 1,
+        "results": [
+            {
+                "error": null,
+                "result": {
+                    "cn": [
+                        "DEV.EXAMPLE.COM_id_range"
+                    ],
+                    "dn": "cn=example.com_id_range,cn=ranges,cn=etc,dc=dev,dc=example,dc=com",
+                    "ipabaseid": [
+                        "107400000"
+                    ],
+                    "ipabaserid": [
+                        "1001"
+                    ],
+                    "ipaidrangesize": [
+                        "200000"
+                    ],
+                    "iparangetype": [
+                        "local domain range"
+                    ],
+                    "ipasecondarybaserid": [
+                        "100000000"
+                    ],
+                    "objectclass": [
+                        "top",
+                        "ipaIDrange",
+                        "ipaDomainIDRange"
+                    ]
+                },
+                "summary": null,
+                "value": "DEV.EXAMPLE.COM_id_range"
+            }
+        ]
+    }
+}
\ No newline at end of file
diff --git a/install/ui/test/data/range_mod.json b/install/ui/test/data/range_mod.json
new file mode 100644
index 0000000000000000000000000000000000000000..47c72d05338f0273b7f16da71ec399148fd4162e
--- /dev/null
+++ b/install/ui/test/data/range_mod.json
@@ -0,0 +1,43 @@
+{
+    "error": null,
+    "id": null,
+    "result": {
+        "result": {
+            "attributelevelrights": {
+                "aci": "rscwo",
+                "cn": "rscwo",
+                "ipabaseid": "rscwo",
+                "ipabaserid": "rscwo",
+                "ipaidrangesize": "rscwo",
+                "ipasecondarybaserid": "rscwo",
+                "nsaccountlock": "rscwo",
+                "objectclass": "rscwo"
+            },
+            "cn": [
+                "DEV.EXAMPLE.COM_id_range"
+            ],
+            "ipabaseid": [
+                "107400000"
+            ],
+            "ipabaserid": [
+                "1001"
+            ],
+            "ipaidrangesize": [
+                "200000"
+            ],
+            "iparangetype": [
+                "local domain range"
+            ],
+            "ipasecondarybaserid": [
+                "100000000"
+            ],
+            "objectclass": [
+                "top",
+                "ipaIDrange",
+                "ipaDomainIDRange"
+            ]
+        },
+        "summary": "Modified ID range \"DEV.EXAMPLE.COM_id_range\"",
+        "value": "DEV.EXAMPLE.COM_id_range"
+    }
+}
\ No newline at end of file
diff --git a/install/ui/test/data/range_show.json b/install/ui/test/data/range_show.json
new file mode 100644
index 0000000000000000000000000000000000000000..0bf544fedeaeed8c73ed3877dd864b08b9c66861
--- /dev/null
+++ b/install/ui/test/data/range_show.json
@@ -0,0 +1,44 @@
+{
+    "error": null,
+    "id": null,
+    "result": {
+        "result": {
+            "attributelevelrights": {
+                "aci": "rscwo",
+                "cn": "rscwo",
+                "ipabaseid": "rscwo",
+                "ipabaserid": "rscwo",
+                "ipaidrangesize": "rscwo",
+                "ipasecondarybaserid": "rscwo",
+                "nsaccountlock": "rscwo",
+                "objectclass": "rscwo"
+            },
+            "cn": [
+                "DEV.EXAMPLE.COM_id_range"
+            ],
+            "dn": "cn=example.com_id_range,cn=ranges,cn=etc,dc=dev,dc=example,dc=com",
+            "ipabaseid": [
+                "107400000"
+            ],
+            "ipabaserid": [
+                "1000"
+            ],
+            "ipaidrangesize": [
+                "200000"
+            ],
+            "iparangetype": [
+                "local domain range"
+            ],
+            "ipasecondarybaserid": [
+                "100000000"
+            ],
+            "objectclass": [
+                "top",
+                "ipaIDrange",
+                "ipaDomainIDRange"
+            ]
+        },
+        "summary": null,
+        "value": "DEV.EXAMPLE.COM_id_range"
+    }
+}
\ No newline at end of file
diff --git a/install/ui/webui.js b/install/ui/webui.js
index 9df6f76f1b728bdee83206afc3771ca98ab141c8..e91946011deb503bcd3cc3bd901f9ae35f927945 100644
--- a/install/ui/webui.js
+++ b/install/ui/webui.js
@@ -84,6 +84,7 @@ IPA.admin_navigation = function(spec) {
              ]},
             {entity: 'selfservice'},
             {entity: 'delegation'},
+            {entity: 'range'},
             {entity: 'trust'},
             {entity: 'config'}
         ]}];
diff --git a/ipalib/plugins/internal.py b/ipalib/plugins/internal.py
index 08d7a255f322e8391ee81aeaced660363d8078c4..9099ab23a60a263b443f1294540902b43bda3b8c 100644
--- a/ipalib/plugins/internal.py
+++ b/ipalib/plugins/internal.py
@@ -494,6 +494,9 @@ class i18n_messages(Command):
             "pwpolicy": {
                 "identity": _("Password Policy"),
             },
+            "range": {
+                "details": _("Range Settings"),
+            },
             "role": {
                 "identity": _("Role Settings"),
             },
-- 
1.7.10.4

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to