summaryrefslogtreecommitdiffstats
path: root/install/ui/details.js
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2012-06-06 17:52:15 +0200
committerPetr Vobornik <pvoborni@redhat.com>2012-06-13 16:44:30 +0200
commit961aeb80e9d74df6f6b036a6152fdc3f9a6f5b39 (patch)
treeffec7d6db12578e389d9c8460b3c9a15652b6570 /install/ui/details.js
parenta5fcfc2c7ea7f1014b6dc79c7784c2d0040386dc (diff)
downloadfreeipa-961aeb80e9d74df6f6b036a6152fdc3f9a6f5b39.tar.gz
freeipa-961aeb80e9d74df6f6b036a6152fdc3f9a6f5b39.tar.xz
freeipa-961aeb80e9d74df6f6b036a6152fdc3f9a6f5b39.zip
Action panel for host enrollment
Widgets in host enrollment sections were modified. They now serve only for displaying of has_key and has_password status. Functionality for setting otp and unprovisioning was moved to separate dialogs. Execution points for opening of these dialogs are items in new action panel in enrollment section. https://fedorahosted.org/freeipa/ticket/2251
Diffstat (limited to 'install/ui/details.js')
-rw-r--r--install/ui/details.js56
1 files changed, 56 insertions, 0 deletions
diff --git a/install/ui/details.js b/install/ui/details.js
index d5f6bfc80..48c8adb60 100644
--- a/install/ui/details.js
+++ b/install/ui/details.js
@@ -1008,6 +1008,62 @@ IPA.acl_state_evaluator = function(spec) {
return that;
};
+IPA.value_state_evaluator = function(spec) {
+
+ spec.name = spec.name || 'value_state_evaluator';
+ spec.event = spec.event || 'post_load';
+
+ var that = IPA.state_evaluator(spec);
+ that.attribute = spec.attribute;
+ that.value = spec.value;
+ that.representation = spec.representation;
+
+ that.on_event = function(data) {
+
+ var old_state, record, state, value, loaded_value;
+
+ old_state = that.state;
+ record = data.result.result;
+ value = that.normalize_value(that.value);
+ loaded_value = record[that.attribute];
+ loaded_value = that.normalize_value(loaded_value);
+
+ that.state = [];
+
+ if (!IPA.array_diff(value, loaded_value)) {
+ that.state.push(that.get_state_text());
+ }
+
+ that.notify_on_change(old_state);
+ };
+
+ that.normalize_value = function(original) {
+
+ var value = original;
+
+ if (!(value instanceof Array)) {
+ value = [value];
+ }
+ return value;
+ };
+
+ that.get_state_text = function() {
+
+ var representation, value;
+
+ representation = that.representation;
+
+ if (!representation) {
+ value = that.normalize_value(that.value);
+ representation = that.attribute + '_' + value[0];
+ }
+
+ return representation;
+ };
+
+ return that;
+};
+
IPA.object_action = function(spec) {
spec = spec || {};