summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2014-11-26 15:06:47 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-12-18 10:24:07 +0000
commit7d5cd68a7d043b9db475099c86b8b4eb6bc1c1b2 (patch)
tree036d2e3e97be8ca7824605f3efe52e7a05685e3e /bitbake
parentd5fc4f7f131c21768c6f9bc004715e76dc6fbe2a (diff)
downloadpoky-7d5cd68a7d043b9db475099c86b8b4eb6bc1c1b2.tar.gz
bitbake: toaster: libtoaster Add editProject and getLayerDepsForProject
Add two utility functions for editing project settings and returning the layer "dependencies" for a specified layer. (Bitbake rev: 5f98f245bdd381a141a018a7f9953a5510fbb4df) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/libtoaster.js49
1 files changed, 49 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js
index b691a3bee8..15815b333e 100644
--- a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js
+++ b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js
@@ -114,11 +114,60 @@ var libtoaster = (function (){
114 }); 114 });
115 }; 115 };
116 116
117 /* Properties for data can be:
118 * layerDel (csv)
119 * layerAdd (csv)
120 * projectName
121 * projectVersion
122 * machineName
123 */
124 function _editProject(url, projectId, data, onSuccess, onFail){
125 $.ajax({
126 type: "POST",
127 url: url,
128 data: data,
129 headers: { 'X-CSRFToken' : $.cookie('csrftoken')},
130 success: function (data) {
131 if (data.error != "ok") {
132 console.log(data.error);
133 if (onFail != undefined)
134 onFail(data);
135 } else {
136 if (onSuccess != undefined)
137 onSuccess(data);
138 }
139 },
140 error: function (data) {
141 console.log("Call failed");
142 console.log(data);
143 }
144 });
145 };
146
147 function _getLayerDepsForProject(xhrDataTypeaheadUrl, projectId, layerId, onSuccess, onFail){
148 /* Check for dependencies not in the current project */
149 $.getJSON(xhrDataTypeaheadUrl,
150 { type: 'layerdeps', 'value': layerId , project_id: projectId },
151 function(data) {
152 if (data.error != "ok") {
153 console.log(data.error);
154 if (onFail != undefined)
155 onFail(data);
156 } else {
157 onSuccess(data);
158 }
159 }, function() {
160 console.log("E: Failed to make request");
161 });
162 };
163
117 return { 164 return {
118 reload_params : reload_params, 165 reload_params : reload_params,
119 startABuild : _startABuild, 166 startABuild : _startABuild,
120 makeTypeahead : _makeTypeahead, 167 makeTypeahead : _makeTypeahead,
121 getProjectInfo: _getProjectInfo, 168 getProjectInfo: _getProjectInfo,
169 getLayerDepsForProject : _getLayerDepsForProject,
170 editProject : _editProject,
122 } 171 }
123})(); 172})();
124 173