summaryrefslogtreecommitdiffstats
path: root/install/static/ipa.js
diff options
context:
space:
mode:
authorAdam Young <ayoung@redhat.com>2010-11-17 22:15:09 -0500
committerEndi Sukma Dewata <edewata@redhat.com>2010-11-18 20:02:45 -0500
commit775fc23738d8a882bdd9cff9064b50594901e518 (patch)
tree35f841fa75bae9f4aef72ce80791aa49e2e62053 /install/static/ipa.js
parent5da8313b668340494f06afe6d3459f368948588f (diff)
downloadfreeipa-775fc23738d8a882bdd9cff9064b50594901e518.tar.gz
freeipa-775fc23738d8a882bdd9cff9064b50594901e518.tar.xz
freeipa-775fc23738d8a882bdd9cff9064b50594901e518.zip
batch init this batches together the calls to json_metadata, i18n_messages, and user-find [whoami] tostreamline the init process, and also allow us to add a call to enumerate the plugins.
Diffstat (limited to 'install/static/ipa.js')
-rw-r--r--install/static/ipa.js22
1 files changed, 16 insertions, 6 deletions
diff --git a/install/static/ipa.js b/install/static/ipa.js
index 6ba8b67e..9b0106b9 100644
--- a/install/static/ipa.js
+++ b/install/static/ipa.js
@@ -21,7 +21,6 @@
/*global $:true, location:true */
-/*Forward defined due to circular dependency with IPA.*/
var IPA = ( function () {
var that = {
@@ -34,8 +33,6 @@ var IPA = ( function () {
that.json_url = 'test/data'
}
-
-
that.ajax_options = {
type: 'POST',
contentType: 'application/json',
@@ -46,6 +43,8 @@ var IPA = ( function () {
that.messages = {};
that.metadata = {};
+ that.whoami = {};
+
that.entities = [];
that.entities_by_name = {};
@@ -76,10 +75,21 @@ var IPA = ( function () {
$.ajaxSetup(that.ajax_options);
- ipa_cmd('json_metadata', [], {},
+
+ var startup_batch =
+ [
+ {"method":"json_metadata","params":[[],{}]},
+ {"method":"i18n_messages","params":[[],{}]},
+ {"method":"user_find","params":[[],{
+ "whoami":"true","all":"true"}]}
+ ];
+
+
+ ipa_cmd('batch', startup_batch, {},
function (data, text_status, xhr) {
- that.metadata = data.result.metadata;
- that.messages = data.result.messages;
+ that.metadata = data.result.results[0].metadata;
+ that.messages = data.result.results[1].messages;
+ that.whoami = data.result.results[2].result[0];
if (on_success) {
on_success(data, text_status, xhr);
}