summaryrefslogtreecommitdiff
path: root/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/basebuildpage.html
diff options
context:
space:
mode:
Diffstat (limited to 'import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/basebuildpage.html')
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/basebuildpage.html283
1 files changed, 180 insertions, 103 deletions
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/basebuildpage.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/basebuildpage.html
index 0d8c8820da..f5eee96516 100644
--- a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/basebuildpage.html
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/basebuildpage.html
@@ -3,9 +3,95 @@
{% load project_url_tag %}
{% load objects_to_dictionaries_filter %}
{% load humanize %}
+{% load field_values_filter %}
{% block pagecontent %}
+
+ <script>
+ var configVarUrl = "{% url 'configvars' build.id %}";
+
+ $(document).ready(function(){
+
+ $("#delete-build-confirm").click(function(){
+ libtoaster.disableAjaxLoadingTimer();
+ $(this).find('[data-role="submit-state"]').hide();
+ $(this).find('[data-role="loading-state"]').show();
+ $(this).attr("disabled", "disabled");
+
+ /* Make the modal non cancelable while delete is in progress */
+ $('#delete-build-modal button[data-dismiss="modal"]').hide();
+
+ $.ajax({
+ type: 'DELETE',
+ url: "{% url 'xhr_build' build.id %}",
+ headers: { 'X-CSRFToken' : $.cookie('csrftoken')},
+ success: function (data) {
+ if (data.error !== "ok") {
+ console.warn(data.error);
+ } else {
+ libtoaster.setNotification("build-deleted",
+ $("#deleted-build-message").html());
+ window.location.replace(data.gotoUrl);
+ }
+ },
+ error: function (data) {
+ console.warn(data);
+ }
+ });
+ });
+
+
+ $('#breadcrumb > li').append('<span class="divider">&rarr;</span>');
+ $('#breadcrumb > li:last').addClass("active");
+ $('#breadcrumb > li:last > span').remove();
+
+ $("#build-menu li a").each(function(){
+ /* Set the page active state in the Build menu */
+ var currentUrl = window.location.href.split('?')[0];
+ if (currentUrl === $(this).prop("href")){
+ $(this).parent().addClass("active");
+ } else {
+ /* Special case the configvar as this is part of configuration
+ * page but is a separate url
+ */
+ if (window.location.pathname === configVarUrl){
+ $("#menu-configuration").addClass("active");
+ } else {
+ $(this).parent().removeClass("active");
+ }
+ }
+ });
+ });
+ </script>
+
+<span style="display:none" id="deleted-build-message">
+ You have deleted 1 build: <strong>{{build.get_sorted_target_list|field_values:"target"|join:", "}} {{build.machine}}</strong> completed on <strong>{{build.completed_on|date:"d/m/y H:i"}}</strong>
+</span>
+
+<div class="modal fade" tabindex="-1" role="dialog" id="delete-build-modal" style="display: none;" data-backdrop="static" data-keyboard="false">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-body">
+ <p>Are you sure you want to delete the build <strong>{{build.get_sorted_target_list|field_values:"target"|join:", "}} {{build.machine}}</strong> completed on <strong>{{build.completed_on|date:"d/m/y H:i"}}</strong>?</p>
+ </div>
+ <div class="modal-footer">
+ <button id="delete-build-confirm" class="btn btn-primary btn-large">
+ <span data-role="submit-state">Delete build</span>
+ <span data-role="loading-state" style="display:none">
+ <span class="fa-pulse">
+ <i class="icon-spinner"></i>
+ </span>
+ &nbsp;Deleting build...
+ </span>
+ </button>
+ <button type="button" class="btn btn-link" data-dismiss="modal">Cancel</button>
+ </div>
+ </div><!-- /.modal-content -->
+ </div><!-- /.modal-dialog -->
+</div> <!-- / modal -->
+
+<div class="row">
<!-- breadcrumbs -->
- <div class="section">
+ <div class="col-md-12">
<ul class="breadcrumb" id="breadcrumb">
<li><a href="{% project_url build.project %}">{{build.project.name}}</a></li>
{% if not build.project.is_default %}
@@ -20,73 +106,56 @@
</li>
{% block localbreadcrumb %}{% endblock %}
</ul>
- <script>
- $( function () {
- $('#breadcrumb > li').append('<span class="divider">&rarr;</span>');
- $('#breadcrumb > li:last').addClass("active");
- $('#breadcrumb > li:last > span').remove();
- });
- </script>
</div>
+</div>
- <div class="row-fluid">
- <!-- begin left sidebar container -->
- <div id="nav" class="span2">
- <ul class="nav nav-list well">
- <li
- {% if request.resolver_match.url_name == 'builddashboard' %}
- class="active"
- {% endif %} >
- <a class="nav-parent" href="{% url 'builddashboard' build.pk %}">Build summary</a>
- </li>
- {% if build.target_set.all.0.is_image and build.outcome == 0 %}
- <li class="nav-header">Images</li>
- {% block nav-target %}
- {% for t in build.get_sorted_target_list %}
- <li><a href="{% url 'target' build.pk t.pk %}">{{t.target}}</a><li>
- {% endfor %}
- {% endblock %}
- {% endif %}
- <li class="nav-header">Build</li>
- {% block nav-configuration %}
- <li><a href="{% url 'configuration' build.pk %}">Configuration</a></li>
- {% endblock %}
- {% block nav-tasks %}
- <li><a href="{% url 'tasks' build.pk %}">Tasks</a></li>
- {% endblock %}
- {% block nav-recipes %}
- <li><a href="{% url 'recipes' build.pk %}">Recipes</a></li>
- {% endblock %}
- {% block nav-packages %}
- <li><a href="{% url 'packages' build.pk %}">Packages</a></li>
- {% endblock %}
- <li class="nav-header">Performance</li>
- {% block nav-buildtime %}
- <li><a href="{% url 'buildtime' build.pk %}">Time</a></li>
- {% endblock %}
- {% block nav-cputime %}
- <li><a href="{% url 'cputime' build.pk %}">CPU usage</a></li>
- {% endblock %}
- {% block nav-diskio %}
- <li><a href="{% url 'diskio' build.pk %}">Disk I/O</a></li>
- {% endblock %}
-
- <li class="divider"></li>
+ <!-- begin left sidebar container for builds which started properly -->
+ {% if build.started %}
+ <div class="row">
+ <div id="nav" class="col-md-2">
+ <ul class="nav nav-pills nav-stacked" id="build-menu">
+ <li id="menu-dashboard"
+ {% if request.resolver_match.url_name == 'builddashboard' %}
+ class="active"
+ {% endif %} >
+ <a href="{% url 'builddashboard' build.pk %}">Build summary</a>
+ </li>
+ {% if build.has_images and build.outcome == build.SUCCEEDED %}
+ <li class="nav-header" data-menu-heading="images">Images</li>
+ {% block nav-target %}
+ {% for t in build.get_sorted_target_list %}
+ {% if t.has_images %}
+ <li id="menu-{{t.target}}"><a href="{% url 'target' build.pk t.pk %}">{{t.target}}</a><li>
+ {% endif %}
+ {% endfor %}
+ {% endblock %}
+ {% endif %}
+ <li class="nav-header">Build</li>
+ <li id="menu-configuration"><a href="{% url 'configuration' build.pk %}">Configuration</a></li>
+ <li><a href="{% url 'tasks' build.pk %}">Tasks</a></li>
+ <li><a href="{% url 'recipes' build.pk %}">Recipes</a></li>
+ <li><a href="{% url 'packages' build.pk %}">Packages</a></li>
+ <li class="nav-header">Performance</li>
+ <li><a href="{% url 'buildtime' build.pk %}">Time</a></li>
+ <li><a href="{% url 'cputime' build.pk %}">CPU usage</a></li>
+ <li><a href="{% url 'diskio' build.pk %}">Disk I/O</a></li>
- <li>
- <p class="navbar-btn">
- <a class="btn btn-block" href="{% url 'build_artifact' build.id 'cookerlog' build.id %}">
- Download build log
+ <li class="nav-header">Actions</li>
+ <li>
+ <a href="{% url 'build_artifact' build.id 'cookerlog' build.id %}">
+ <span class="glyphicon glyphicon-download-alt"></span>
+ Download build log
</a>
- </p>
- </li>
+ </li>
- {% with build.get_custom_image_recipes as custom_image_recipes %}
- {% if custom_image_recipes.count > 0 %}
- <!-- edit custom image built during this build -->
- <li>
- <p class="navbar-btn" data-role="edit-custom-image-trigger">
- <button class="btn btn-block">Edit custom image</button>
+ {% with build.get_custom_image_recipes as custom_image_recipes %}
+ {% if custom_image_recipes.count > 0 %}
+ <!-- edit custom image built during this build -->
+ <li>
+ <a href="#" data-role="edit-custom-image-trigger">
+ <span class="glyphicon glyphicon-edit"></span>
+ Edit custom image
+ </a>
{% include 'editcustomimage_modal.html' %}
<script>
var editableCustomImageRecipes = {{ custom_image_recipes | objects_to_dictionaries:"id,name" | json }};
@@ -111,47 +180,55 @@
});
});
</script>
- </p>
- </li>
- {% endif %}
- {% endwith %}
-
- <li>
- <!-- new custom image from image recipe in this build -->
- <p class="navbar-btn" data-role="new-custom-image-trigger">
- <button class="btn btn-block">New custom image</button>
- </p>
- {% include 'newcustomimage_modal.html' %}
- <script>
- // imageRecipes includes both custom image recipes and built-in
- // image recipes, any of which can be used as the basis for a
- // new custom image
- var imageRecipes = {{ build.get_image_recipes | objects_to_dictionaries:"id,name" | json }};
-
- $(document).ready(function () {
- var newCustomImageModal = $('#new-custom-image-modal');
- var newCustomImageTrigger = $('[data-role="new-custom-image-trigger"]');
-
- // show create new custom image modal to select an image built
- // during this build as the basis for the custom recipe
- newCustomImageTrigger.click(function () {
- if (!imageRecipes.length) {
- return;
- }
-
- newCustomImageModalSetRecipes(imageRecipes);
- newCustomImageModal.modal('show');
- });
- });
- </script>
- </li>
- </ul>
+ </li>
+ {% endif %}
+ {% endwith %}
- </div>
- <!-- end left sidebar container -->
+ <!-- new custom image from image recipe in this build -->
+ {% if build.has_image_recipes %}
+ <li>
+ <a href="#" data-role="new-custom-image-trigger">
+ <span class="glyphicon glyphicon-plus"></span>
+ New custom image
+ </a>
+ {% include 'newcustomimage_modal.html' %}
+ <script>
+ // imageRecipes includes both custom image recipes and built-in
+ // image recipes, any of which can be used as the basis for a
+ // new custom image
+ var imageRecipes = {{ build.get_image_recipes | objects_to_dictionaries:"id,name" | json }};
- <!-- begin right container -->
- {% block buildinfomain %}{% endblock %}
- <!-- end right container -->
+ $(document).ready(function () {
+ var newCustomImageModal = $('#new-custom-image-modal');
+ var newCustomImageTrigger = $('[data-role="new-custom-image-trigger"]');
+
+ // show create new custom image modal to select an image built
+ // during this build as the basis for the custom recipe
+ newCustomImageTrigger.click(function () {
+ if (!imageRecipes.length) {
+ return;
+ }
+
+ newCustomImageModalSetRecipes(imageRecipes);
+ newCustomImageModal.modal('show');
+ });
+ });
+ </script>
+ {% endif %}
+
+ <li>
+ <a href="#delete-build-modal" id="delete-build" data-toggle="modal" data-target="#delete-build-modal" class="text-danger">
+ <span class="glyphicon glyphicon-trash"></span>
+ Delete build
+ </a>
+ </ul>
+ </div>
+ <!-- end left sidebar container -->
+ {% endif %}
+
+ <!-- right container; need class="row" for builds without left-hand menu -->
+ <div{% if not build.started %} class="row"{% endif %}>
+ {% block buildinfomain %}{% endblock %}
+ </div>
</div>
{% endblock %}