diff options
Diffstat (limited to 'bitbake/lib/toaster/toastergui/templates/targets.html')
| -rw-r--r-- | bitbake/lib/toaster/toastergui/templates/targets.html | 340 |
1 files changed, 207 insertions, 133 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/targets.html b/bitbake/lib/toaster/toastergui/templates/targets.html index 3afdf0a5e9..32a644a743 100644 --- a/bitbake/lib/toaster/toastergui/templates/targets.html +++ b/bitbake/lib/toaster/toastergui/templates/targets.html | |||
| @@ -9,55 +9,74 @@ | |||
| 9 | {% block projectinfomain %} | 9 | {% block projectinfomain %} |
| 10 | <div class="page-header"> | 10 | <div class="page-header"> |
| 11 | <h1> | 11 | <h1> |
| 12 | All targets | 12 | {% if request.GET.filter and objects.paginator.count > 0 or request.GET.search and objects.paginator.count > 0 %} |
| 13 | <i class="icon-question-sign get-help heading-help" title="This page lists all the targets compatible with Yocto Project 1.7 'Dxxxx' that Toaster knows about. They include community-created targets suitable for use on top of OpenEmbedded Core and any targets you have imported"></i> | 13 | {{objects.paginator.count}} target{{objects.paginator.count|pluralize}} found |
| 14 | {% elif request.GET.filter and objects.paginator.count == 0 or request.GET.search and objects.paginator.count == 0 %} | ||
| 15 | No targets found | ||
| 16 | {%else%} | ||
| 17 | All targets | ||
| 18 | {%endif%} | ||
| 19 | <i class="icon-question-sign get-help heading-help" title="This page lists all the targets compatible with " + {{project.release.name}} + " that Toaster knows about."></i> | ||
| 14 | </h1> | 20 | </h1> |
| 15 | </div> | 21 | </div> |
| 16 | <!--div class="alert"> | ||
| 17 | <div class="input-append" style="margin-bottom:0px;"> | ||
| 18 | <input class="input-xxlarge" type="text" placeholder="Search targets" value="browser" /> | ||
| 19 | <a class="add-on btn"> | ||
| 20 | <i class="icon-remove"></i> | ||
| 21 | </a> | ||
| 22 | <button class="btn" type="button">Search</button> | ||
| 23 | <a class="btn btn-link" href="#">Show all targets</a> | ||
| 24 | </div> | ||
| 25 | </div--> | ||
| 26 | <div id="target-added" class="alert alert-info lead" style="display:none;"></div> | ||
| 27 | <div id="target-removed" class="alert alert-info lead" style="display:none;"> | ||
| 28 | <button type="button" class="close" data-dismiss="alert">×</button> | ||
| 29 | <strong>1</strong> target deleted from <a href="project-with-targets.html">your project</a>: <a href="#">meta-aarch64</a> | ||
| 30 | </div> | ||
| 31 | 22 | ||
| 23 | <div id="zone1alerts"> | ||
| 24 | |||
| 25 | </div> | ||
| 26 | |||
| 27 | {% if objects.paginator.count == 0 %} | ||
| 28 | <div class="row-fluid"> | ||
| 29 | <div class="alert"> | ||
| 30 | <form class="no-results input-append" id="searchform"> | ||
| 31 | <input id="search" name="search" class="input-xxlarge" type="text" value="{{request.GET.search}}"/>{% if request.GET.search %}<a href="javascript:$('#search').val('');searchform.submit()" class="add-on btn" tabindex="-1"><i class="icon-remove"></i></a>{% endif %} | ||
| 32 | <button class="btn" type="submit" value="Search">Search</button> | ||
| 33 | <button class="btn btn-link" onclick="javascript:$('#search').val('');searchform.submit()">Show all targets</button> | ||
| 34 | </form> | ||
| 35 | </div> | ||
| 36 | </div> | ||
| 37 | |||
| 38 | {% else %} | ||
| 32 | 39 | ||
| 33 | {% include "basetable_top.html" %} | 40 | {% include "basetable_top.html" %} |
| 34 | {% for o in objects %} | 41 | {% for o in objects %} |
| 35 | <tr class="data"> | 42 | <tr class="data"> |
| 36 | <td class="target"> | 43 | <td class="target"> |
| 37 | {{o.name}} ({{o.id}}, {{o.up_id}}) | 44 | {{o.name}} |
| 38 | <a target="_blank" href="{{o.get_layersource_view_url}}"><i class="icon-share get-info"></i></a> | 45 | <a target="_blank" href="{{o.get_layersource_view_url}}"><i class="icon-share get-info"></i></a> |
| 39 | </td> | 46 | </td> |
| 40 | <td class="version">{{o.version}}</td> | 47 | <td class="version">{{o.version}}</td> |
| 41 | <td class="description">{{o.description}}</td> | 48 | <td class="description">{% if o.description %}{{o.description}}{% else %}{{o.summary}}{%endif%}</td> |
| 42 | <td class="recipe-file"> | 49 | <td class="recipe-file"> |
| 43 | <code>{{o.file_path}}</code> | 50 | <code>{{o.file_path}}</code> |
| 44 | <a href="{{o.get_vcs_link_url}}" target="_blank"><i class="icon-share get-info"></i></a> | 51 | <a href="{{o.get_vcs_link_url}}{{o.file_path}}" target="_blank"><i class="icon-share get-info"></i></a> |
| 45 | </td> | 52 | </td> |
| 46 | <td class="target-section">{{o.section}}</td> | 53 | <td class="target-section">{{o.section}}</td> |
| 47 | <td class="license">{{o.license}}</td> | 54 | <td class="license">{{o.license}}</td> |
| 48 | <td class="layer"><a href="#">{{o.layer_version.layer.name}}</a></td> | 55 | <td class="layer"><a href="{% url 'layerdetails' o.layer_version.id%}">{{o.layer_version.layer.name}}</a></td> |
| 49 | <td class="source">{{o.layer_source.name}}</td> | 56 | <td class="source">{{o.layer_source.name}}</td> |
| 50 | <td class="branch">{{o.layer_version.commit}}</td> | 57 | <td class="branch"> |
| 51 | <td class="build"> | 58 | {% if o.layer_version.up_branch %} |
| 52 | <a id="build-target" href="project-with-targets.html?target=3g-router-image" class="btn btn-block" style="display:none;"> | 59 | {{o.layer_version.up_branch.name}} |
| 53 | Build target | 60 | {% else %} |
| 54 | </a> | 61 | <a class="btn" |
| 55 | <a id="add-layer" href="#" class="btn btn-block nopop" title="1 layer added"> | 62 | data-content="<ul class='unstyled'> |
| 56 | <i class="icon-plus"></i> | 63 | <li>{{o.layer_version.commit}}</li> |
| 57 | Add layer | 64 | </ul>"> |
| 58 | <i class="icon-question-sign get-help" title="To build this target, you must first add the meta-embeddedgeeks layer to your project"></i> | 65 | {{o.layer_version.commit|truncatechars:13}} |
| 59 | </a> | 66 | </a> |
| 60 | </td> | 67 | {% endif %} |
| 68 | </td> | ||
| 69 | <td class="add-layer" value="{{o.pk}}" layerversion_id="{{o.layer_version.pk}}"> | ||
| 70 | <div id="layer-tooltip-{{o.pk}}" style="display: none; font-size: 11px; line-height: 1.3;" class="tooltip-inner">layer was modified</div> | ||
| 71 | <a href="{% url 'project' project.id %}#/targetbuild={{o.name}}" id="target-build-{{o.pk}}" class="btn btn-block remove-layer" style="display:none;" > | ||
| 72 | Build target | ||
| 73 | </a> | ||
| 74 | <a id="layer-add-{{o.pk}}" class="btn btn-block" style="display:none;" href="javascript:layerAdd({{o.layer_version.pk}}, '{{o.layer_version.layer.name}}', '{%url 'layerdetails' o.layer_version.pk%}', {{o.pk}})" > | ||
| 75 | <i class="icon-plus"></i> | ||
| 76 | Add layer | ||
| 77 | <i title="" class="icon-question-sign get-help" data-original-title="To build this target, you must first add the {{o.layer_version.layer.name}} layer to your project"></i> | ||
| 78 | </a> | ||
| 79 | </td> | ||
| 61 | </tr> | 80 | </tr> |
| 62 | {% endfor %} | 81 | {% endfor %} |
| 63 | {% include "basetable_bottom.html" %} | 82 | {% include "basetable_bottom.html" %} |
| @@ -65,122 +84,177 @@ | |||
| 65 | <!-- Modals --> | 84 | <!-- Modals --> |
| 66 | 85 | ||
| 67 | <!-- 'Layer dependencies modal' --> | 86 | <!-- 'Layer dependencies modal' --> |
| 68 | <div id="dependencies-message" class="modal hide fade" tabindex="-1" role="dialog" aria-hidden="true"> | 87 | <div id="dependencies_modal" class="modal hide fade" tabindex="-1" role="dialog" aria-hidden="true"> |
| 88 | <form id="dependencies_modal_form"> | ||
| 69 | <div class="modal-header"> | 89 | <div class="modal-header"> |
| 70 | <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button> | 90 | <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button> |
| 71 | <h3>meta-acer dependencies</h3> | 91 | <h3><span class="layer-name"></span> dependencies</h3> |
| 72 | </div> | 92 | </div> |
| 73 | <div class="modal-body"> | 93 | <div class="modal-body"> |
| 74 | <p><strong>meta-acer</strong> depends on some targets that are not added to your project. Select the ones you want to add:</p> | 94 | <p><strong class="layer-name"></strong> depends on some layers that are not added to your project. Select the ones you want to add:</p> |
| 75 | <ul class="unstyled"> | 95 | <ul class="unstyled" id="dependencies_list"> |
| 76 | <li> | ||
| 77 | <label class="checkbox"> | ||
| 78 | <input type="checkbox" checked="checked"> | ||
| 79 | meta-android | ||
| 80 | </label> | ||
| 81 | </li> | ||
| 82 | <li> | ||
| 83 | <label class="checkbox"> | ||
| 84 | <input type="checkbox" checked="checked"> | ||
| 85 | meta-oe | ||
| 86 | </label> | ||
| 87 | </li> | ||
| 88 | </ul> | 96 | </ul> |
| 89 | </div> | 97 | </div> |
| 90 | <div class="modal-footer"> | 98 | <div class="modal-footer"> |
| 91 | <button id="add-target-dependencies" type="submit" class="btn btn-primary" data-dismiss="modal" >Add targets</button> | 99 | <button class="btn btn-primary" type="submit">Add layers</button> |
| 92 | <button class="btn" data-dismiss="modal">Cancel</button> | 100 | <button class="btn" type="reset" data-dismiss="modal">Cancel</button> |
| 93 | </div> | 101 | </div> |
| 102 | </form> | ||
| 94 | </div> | 103 | </div> |
| 95 | 104 | ||
| 96 | <script src="assets/js/jquery-1.9.1.min.js" type='text/javascript'></script> | 105 | {% endif %} |
| 97 | <script src="assets/js/jquery.tablesorter.min.js" type='text/javascript'></script> | 106 | |
| 98 | <script src="assets/js/jquery-ui-1.10.3.custom.min.js"></script> | 107 | {% if project %} |
| 99 | <script src="assets/js/bootstrap.min.js" type='text/javascript'></script> | 108 | <script> |
| 100 | <script src="assets/js/prettify.js" type='text/javascript'></script> | 109 | |
| 101 | <script src="assets/js/jit.js" type='text/javascript'></script> | 110 | var tooltipUpdateText; |
| 102 | <script src="assets/js/main.js" type='text/javascript'></script> | 111 | |
| 103 | 112 | function _makeXHREditCall(data, onsuccess, onfail) { | |
| 104 | <script> | 113 | $.ajax( { |
| 105 | $(document).ready(function() { | 114 | type: "POST", |
| 106 | 115 | url: "{% url 'xhr_projectedit' project.id %}", | |
| 107 | //show or hide selected columns on load | 116 | data: data, |
| 108 | $("input:checkbox").each(function(){ | 117 | headers: { 'X-CSRFToken' : $.cookie('csrftoken')}, |
| 109 | var selectedType = $(this).val(); | 118 | success: function (_data) { |
| 110 | if($(this).is(":checked")){ | 119 | if (_data.error != "ok") { |
| 111 | $("."+selectedType).show(); | 120 | alert(_data.error); |
| 121 | } else { | ||
| 122 | updateButtons(_data.layers.map(function (e) {return e.id})); | ||
| 123 | if (onsuccess != undefined) onsuccess(_data); | ||
| 112 | } | 124 | } |
| 113 | else{ | 125 | }, |
| 114 | $("."+selectedType).hide(); | 126 | error: function (_data) { |
| 127 | alert("Call failed"); | ||
| 128 | console.log(_data); | ||
| 129 | } | ||
| 130 | }); | ||
| 131 | } | ||
| 132 | |||
| 133 | function show_alert(text, cls) { | ||
| 134 | $("#zone1alerts").html("<div class=\"alert alert-info lead\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>" + text + "</div>"); | ||
| 135 | } | ||
| 136 | |||
| 137 | |||
| 138 | function show_dependencies_modal(layerId, layerName, layerURL, dependencies) { | ||
| 139 | // update layer name | ||
| 140 | $('.layer-name').text(layerName); | ||
| 141 | var deplistHtml = ""; | ||
| 142 | for (var i = 0; i < dependencies.length; i++) { | ||
| 143 | deplistHtml += "<li><label class=\"checkbox\"><input name=\"dependencies\" value=\"" | ||
| 144 | deplistHtml += dependencies[i].id; | ||
| 145 | deplistHtml +="\" type=\"checkbox\" checked=\"checked\"/>"; | ||
| 146 | deplistHtml += dependencies[i].name; | ||
| 147 | deplistHtml += "</label></li>"; | ||
| 148 | } | ||
| 149 | $('#dependencies_list').html(deplistHtml); | ||
| 150 | |||
| 151 | var selected = [layerId]; | ||
| 152 | var layer_link_list = undefined; | ||
| 153 | |||
| 154 | $("#dependencies_modal_form").submit(function (e) { | ||
| 155 | e.preventDefault(); | ||
| 156 | $("input[name='dependencies']:checked").map(function () { selected.push(parseInt($(this).val()))}); | ||
| 157 | layer_link_list = "<a href='"+layerURL+"'>"+layerName+"</a>"; | ||
| 158 | if (selected.length > 1) { | ||
| 159 | tooltipUpdateText = "" + selected.length + " layers added"; | ||
| 160 | } else { | ||
| 161 | tooltipUpdateText = "1 layer added"; | ||
| 162 | } | ||
| 163 | |||
| 164 | for (var i = 0; i < selected.length; i++) { | ||
| 165 | for (var j = 0; j < dependencies.length; j++) { | ||
| 166 | if (dependencies[j].id == selected[i]) { | ||
| 167 | layer_link_list+= ", <a href='"+dependencies[j].layerdetailurl+"'>"+dependencies[j].name+"</a>" | ||
| 168 | break; | ||
| 169 | } | ||
| 115 | } | 170 | } |
| 171 | } | ||
| 172 | |||
| 173 | $('#dependencies_modal').modal('hide'); | ||
| 174 | |||
| 175 | {% if project %} | ||
| 176 | _makeXHREditCall({ 'layerAdd': selected.join(",") }, function onXHRSuccess() { | ||
| 177 | show_alert("You have added <strong>"+selected.length+"</strong> layer(s) to <a href=\"{% url 'project' project.id%}\">{{project.name}}</a>:" + layer_link_list); | ||
| 116 | }); | 178 | }); |
| 179 | {% endif %} | ||
| 117 | 180 | ||
| 118 | // enable add target button | 181 | }); |
| 119 | $('#add-target-with-deps').removeAttr('disabled'); | 182 | $('#dependencies_modal').modal('show'); |
| 183 | } | ||
| 120 | 184 | ||
| 121 | //edit columns functionality (show / hide table columns) | ||
| 122 | $("input:checkbox").change(); | ||
| 123 | $("input:checkbox").change(function(){ | ||
| 124 | var selectedType = $(this).val(); | ||
| 125 | if($(this).is(":checked")){ | ||
| 126 | $("."+selectedType).show(); | ||
| 127 | } | ||
| 128 | else{ | ||
| 129 | $("."+selectedType).hide(); | ||
| 130 | } | ||
| 131 | }); | ||
| 132 | 185 | ||
| 133 | //turn edit columns dropdown into a multi-select menu | 186 | var pressedButton = undefined; |
| 134 | $('.dropdown-menu input, .dropdown-menu label').click(function(e) { | ||
| 135 | e.stopPropagation(); | ||
| 136 | }); | ||
| 137 | 187 | ||
| 138 | //show tooltip with applied filter | 188 | function layerAdd(layerId, layerName, layerURL, pressedButtonId) { |
| 139 | $('#filtered').tooltip({container:'table', placement:'bottom', delay:{hide:1500}, html:true}); | 189 | pressedButton = pressedButtonId; |
| 190 | $.ajax({ | ||
| 191 | url: '{% url "xhr_datatypeahead" %}', | ||
| 192 | data: {'type': 'layerdeps','value':layerId}, | ||
| 193 | success: function(_data) { | ||
| 194 | if (_data.error != "ok") { | ||
| 195 | alert(_data.error); | ||
| 196 | } else { | ||
| 197 | if (_data.list.length > 0) { | ||
| 198 | show_dependencies_modal(layerId, layerName, layerURL, _data.list); | ||
| 199 | } | ||
| 200 | else { | ||
| 201 | tooltipUpdateText = "1 layer added"; | ||
| 202 | _makeXHREditCall({ 'layerAdd': layerId }, function () { | ||
| 203 | show_alert("You have added <strong>1</strong> layer to <a href=\"{% url 'project' project.id%}\">{{project.name}}</a>: <a href=\""+layerURL+"\">" + layerName +"</a>"); | ||
| 204 | }); | ||
| 205 | } | ||
| 206 | } | ||
| 207 | } | ||
| 208 | }) | ||
| 209 | } | ||
| 140 | 210 | ||
| 141 | $('#filtered').click(function() { | 211 | function buttonSet(id, state) { |
| 142 | $(this).tooltip('hide'); | 212 | var tohide, toshow; |
| 143 | }); | 213 | if (state == "add") |
| 214 | { | ||
| 215 | toshow = "#layer-add-"; | ||
| 216 | tohide = "#target-build-"; | ||
| 217 | } | ||
| 218 | else if (state == "build") | ||
| 219 | { | ||
| 220 | tohide = "#layer-add-"; | ||
| 221 | toshow = "#target-build-"; | ||
| 222 | } | ||
| 144 | 223 | ||
| 145 | //show target added tooltip | 224 | var previouslyvisible = $(tohide + id).is(":visible"); |
| 146 | $("#remove-target, #add-target, #add-target-with-deps2").tooltip({ trigger: 'manual' }); | 225 | if (previouslyvisible && id == pressedButton) { |
| 147 | 226 | $(tohide + id).fadeOut( function() { | |
| 148 | // add target without dependencies | 227 | $("#layer-tooltip-" + id).text(tooltipUpdateText); |
| 149 | $("#add-target").click(function(){ | 228 | $("#layer-tooltip-" + id).fadeIn().delay(2000).fadeOut(function(){ |
| 150 | $('#target-removed').hide(); | 229 | $(toshow + id).delay(300).fadeIn(); |
| 151 | $('#target-added').html('<button type="button" class="close" data-dismiss="alert">×</button><strong>1</strong> target added to <a href="project-with-targets.html">your project</a>: <a href="#">meta-aarch64</a>').fadeIn(); | ||
| 152 | $('#add-target').tooltip('show'); | ||
| 153 | $("#add-target").hide(); | ||
| 154 | $(".add-targets .tooltip").delay(2000).fadeOut(function(){ | ||
| 155 | $("#remove-target").delay(300).fadeIn(); | ||
| 156 | }); | 230 | }); |
| 157 | }); | 231 | }); |
| 232 | } else { | ||
| 233 | $(tohide + id).hide(); | ||
| 234 | $("#layer-tooltip-" + id).hide(); | ||
| 235 | $(toshow + id).show(); | ||
| 236 | } | ||
| 237 | }; | ||
| 158 | 238 | ||
| 159 | // add target with dependencies | ||
| 160 | $(document).on("click", "#add-target-dependencies", function() { | ||
| 161 | $('#target-removed').hide(); | ||
| 162 | $('#target-added').html('<button type="button" class="close" data-dismiss="alert">×</button><strong>3</strong> targets added to <a href="project-with-targets.html">your project</a>: <a href="#">meta-acer</a> and its dependencies <a href="#">meta-android</a> and <a href="#">meta-oe</a>').delay(400).fadeIn(function(){ | ||
| 163 | $('#add-target-with-deps').tooltip('show'); | ||
| 164 | $("#add-target-with-deps, #add-target-with-deps").hide(); | ||
| 165 | $(".add-targets .tooltip").delay(2000).fadeOut(function(){ | ||
| 166 | $("#remove-target-with-deps").delay(300).fadeIn(); | ||
| 167 | }); | ||
| 168 | }); | ||
| 169 | }); | ||
| 170 | 239 | ||
| 171 | // delete target | 240 | function updateButtons(projectLayers) { |
| 172 | $("#remove-target").click(function(){ | 241 | var displayedLayers = []; |
| 173 | $('#target-added').hide(); | 242 | $(".add-layer").map(function () { displayedLayers.push( { "l": parseInt($(this).attr('layerversion_id')), "i": parseInt($(this).attr('value'))})}); |
| 174 | $('#target-removed').show(); | 243 | for (var i=0; i < displayedLayers.length; i++) { |
| 175 | $('#remove-target').tooltip('show'); | 244 | if (projectLayers.indexOf(displayedLayers[i].l) > -1) { |
| 176 | $("#remove-target").hide(); | 245 | buttonSet(displayedLayers[i].i, "build"); |
| 177 | $(".add-targets .tooltip").delay(2000).fadeOut(function(){ | 246 | } |
| 178 | $("#add-target").delay(300).fadeIn(); | 247 | else { |
| 179 | }); | 248 | buttonSet(displayedLayers[i].i, "add"); |
| 180 | }); | 249 | } |
| 250 | } | ||
| 251 | } | ||
| 181 | 252 | ||
| 182 | }); | 253 | $(document).ready(function (){ |
| 254 | updateButtons({{projectlayerset}}); | ||
| 255 | }); | ||
| 183 | 256 | ||
| 184 | </script> | 257 | </script> |
| 258 | {%endif%} | ||
| 185 | 259 | ||
| 186 | {% endblock %} | 260 | {% endblock %} |
