summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/static/js
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2014-11-14 18:12:20 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-11-21 11:49:23 +0000
commit5b8a62dad7d429034c52290385da570c5ca1da34 (patch)
tree7102d4169f81f41aa64abd591084efe09c00528d /bitbake/lib/toaster/toastergui/static/js
parentfa9206e42710772b8aac918b7aba01e126e993ce (diff)
downloadpoky-5b8a62dad7d429034c52290385da570c5ca1da34.tar.gz
bitbake: toaster: libtoaster: Add getProjectInfo utility function
Add a utility function to return a specified project's info/config This re-uses the existing server code path for the project edit except that it allows any project id to be used as a parameter (Bitbake rev: af42ea5f006c5cf55a7c57a42904f412639d261f) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/static/js')
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/libtoaster.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js
index b899b8de4d..4983ef6f6d 100644
--- a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js
+++ b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js
@@ -88,10 +88,32 @@ var libtoaster = (function (){
88 } }); 88 } });
89 }; 89 };
90 90
91 /* Get a project's configuration info */
92 function _getProjectInfo(url, projectId, onsuccess, onfail){
93 $.ajax({
94 type: "POST",
95 url: url,
96 data: { project_id : projectId },
97 headers: { 'X-CSRFToken' : $.cookie('csrftoken')},
98 success: function (_data) {
99 if (_data.error != "ok") {
100 console.log(_data.error);
101 } else {
102 if (onsuccess != undefined) onsuccess(_data);
103 }
104 },
105 error: function (_data) {
106 console.log(_data);
107 if (onfail) onfail(data);
108 }
109 });
110 };
111
91 return { 112 return {
92 reload_params : reload_params, 113 reload_params : reload_params,
93 startABuild : _startABuild, 114 startABuild : _startABuild,
94 makeTypeahead : _makeTypeahead, 115 makeTypeahead : _makeTypeahead,
116 getProjectInfo: _getProjectInfo,
95 } 117 }
96})(); 118})();
97 119