summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/static/js/table.js
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2015-06-08 11:01:43 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-06-12 00:01:48 +0100
commit58600cf8e76f270969ded6ec63ac0908f39dae09 (patch)
treef87738a1ce5857a576c236f43b85b3ec83089c88 /bitbake/lib/toaster/toastergui/static/js/table.js
parent4a2a057130e877eae96d726bc86c6b9f48ed1ca3 (diff)
downloadpoky-58600cf8e76f270969ded6ec63ac0908f39dae09.tar.gz
bitbake: toaster: toaster table add raw data
We add in a JSON response both the raw data and the rendered version for display. The rendered fields start with "static:" to mark a different "namespace". The toaster.js is updated to always display the "static:" version of a field, if it exists (and ignore the raw data unless the static rendering is missing). (Bitbake rev: 928ee3fd4b52ea14b7eb704f1f27351362a9d27a) 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/table.js')
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/table.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/table.js b/bitbake/lib/toaster/toastergui/static/js/table.js
index 7588a4ab9a..80e9ec2392 100644
--- a/bitbake/lib/toaster/toastergui/static/js/table.js
+++ b/bitbake/lib/toaster/toastergui/static/js/table.js
@@ -113,8 +113,20 @@ function tableInit(ctx){
113 for (var i in tableData.rows){ 113 for (var i in tableData.rows){
114 var row = $("<tr></tr>"); 114 var row = $("<tr></tr>");
115 for (var key_j in tableData.rows[i]){ 115 for (var key_j in tableData.rows[i]){
116 /* if we have a static: version of a key, prefer the static: version for rendering */
117 var orig_key_j = key_j;
118
119 if (key_j.indexOf("static:") === 0) {
120 if (key_j.substr("static:".length) in tableData.rows[i]) {
121 continue;
122 }
123 orig_key_j = key_j.substr("static:".length)
124 } else if (("static:" + key_j) in tableData.rows[i]) {
125 key_j = "static:" + key_j;
126 }
127
116 var td = $("<td></td>"); 128 var td = $("<td></td>");
117 td.prop("class", key_j); 129 td.prop("class", orig_key_j);
118 if (tableData.rows[i][key_j]){ 130 if (tableData.rows[i][key_j]){
119 td.html(tableData.rows[i][key_j]); 131 td.html(tableData.rows[i][key_j]);
120 } 132 }