This repository has been archived on 2020-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
quay/static/directives/repo-view/repo-panel-builds.html
Joseph Schorr 7a8850289e Hide "Start Build" button in builds tab if not accessible
While the build cannot be started, and, in fact, the only way to see the button is to *manually* set the `tab=` query param, better to hide it

Fixes https://jira.coreos.com/browse/QS-67
2017-11-27 12:02:07 +02:00

202 lines
8.3 KiB
HTML

<div class="repo-panel-builds-element">
<div class="feedback-bar" feedback="feedback"></div>
<div class="tab-header-controls">
<button class="btn btn-primary" ng-click="showNewBuildDialog()" ng-if="!repository.tag_operations_disabled"
quay-show="repository.can_write && Features.BUILD_SUPPORT">
<i class="fa fa-play"></i> Start New Build
</button>
</div>
<h3 class="tab-header">Repository Builds</h3>
<div class="co-alert co-alert-info" ng-if="repository.tag_operations_disabled">
Builds cannot be performed on this repository because Quay Trust is
enabled, which requires that all operations be signed by a user.
</div>
<!-- Builds -->
<div class="co-panel" id="repoBuilds">
<!-- Builds header controls -->
<div class="co-panel-heading">
<div class="heading-controls hidden-sm hidden-xs">
<span class="filter-control" filter="options.filter" value="recent">Recent Builds</span>
<span class="filter-control" filter="options.filter" value="48hour">Last 48 Hours</span>
<span class="filter-control" filter="options.filter" value="30day">Last 30 days</span>
</div>
<div class="heading-title">
<i class="fa fa-tasks"></i>
Build History
</div>
</div>
<!-- Builds list content -->
<div class="panel-body">
<div class="resource-view" resource="buildsResource" error-message="'Could not load build information'">
<!-- No builds found -->
<div class="empty" ng-if="!fullBuilds.length">
<div class="empty-primary-msg">No matching builds found</div>
<div class="empty-secondary-msg">
Please change the filter above to search for more builds.
</div>
</div>
<!-- Builds list table -->
<table class="co-table" ng-if="fullBuilds.length">
<thead>
<td class="status-col"></td>
<td ng-class="tablePredicateClass('id', options.predicate, options.reverse)"
style="min-width: 85px;">
<a ng-click="orderBy('id')">Build ID</a>
</td>
<td class="hidden-xs"
ng-class="tablePredicateClass('commit_sha', options.predicate, options.reverse)"
style="min-width: 115px">
<a ng-click="orderBy('commit_sha')">Triggered By</a>
</td>
<td ng-class="tablePredicateClass('started_datetime', options.predicate, options.reverse)" style="min-width: 120px;">
<a ng-click="orderBy('started_datetime')">Date Started</a>
</td>
<td class="hidden-xs"
ng-class="tablePredicateClass('tags', options.predicate, options.reverse)"
style="min-width: 66px;">
<a ng-click="orderBy('tags')">Tags</a>
</td>
</thead>
<tr ng-repeat="build in fullBuilds">
<td><span class="build-state-icon" build="build"></span></td>
<td>
<a href="/repository/{{ repository.namespace }}/{{ repository.name }}/build/{{ build.id }}">{{ build.id.substr(0, 8) }}</a>
</td>
<td class="hidden-xs">
<div class="triggered-build-description" build="build"></div>
</td>
<td>{{ build.started | amCalendar }}</td>
<td class="hidden-xs">
<span class="building-tag" ng-repeat="tag in build.building_tags">
<span class="tag-span"><i class="fa fa-tag"></i>{{ tag }}</span>
</span>
</td>
</tr>
</table>
</div>
</div>
</div> <!-- /Builds -->
<!-- Build Triggers -->
<div class="co-panel" ng-if="repository.can_admin && TriggerService.getTypes().length && !repository.tag_operations_disabled" id="repoBuildTriggers">
<!-- Builds header controls -->
<div class="co-panel-heading">
<i class="fa fa-flash"></i>
Build Triggers
<div class="heading-controls hidden-xs">
<!-- Add Build Trigger -->
<div class="dropdown" id="addBuildTrigger">
<button class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
Create Build Trigger
<b class="caret"></b>
</button>
<ul class="dropdown-menu dropdown-menu-right pull-right">
<li ng-repeat="type in TriggerService.getTypes()" ng-if="TriggerService.isEnabled(type)">
<a href="{{ TriggerService.getRedirectUrl(type, repository.namespace, repository.name) }}" target="{{ TriggerService.getMetadata(type).is_external ? '' : '_self' }}">
<i class="fa fa-lg" ng-class="TriggerService.getMetadata(type).icon"></i>
{{ TriggerService.getTitle(type) }}
</a>
</li>
</ul>
</div>
</div>
</div>
<!-- Builds list content -->
<div class="panel-body">
<div class="resource-view" resource="triggersResource" error-message="'Could not load build triggers'">
<!-- No Triggers defined -->
<div class="empty" ng-if="!triggers.length">
<div class="empty-primary-msg">No build triggers defined</div>
<div class="empty-secondary-msg">
Build triggers invoke builds whenever the triggered condition is met (source control push, webhook, etc)
</div>
</div>
<!-- Triggers list -->
<table class="cor-table" ng-if="triggers.length">
<thead>
<td>Trigger Name</td>
<td>Dockerfile Location</td>
<td>Context Location</td>
<td>Branches/Tags</td>
<td>Pull Robot</td>
<td class="options-col"></td>
</thead>
<tr ng-repeat="trigger in triggers | filter:{'is_active':false}">
<td colspan="5" style="text-align: center">
This build trigger has not had its setup completed:
<a ng-click="deleteTrigger(trigger)">Delete Trigger</a>
</td>
</tr>
<tr ng-repeat="trigger in triggers | filter:{'is_active':true}">
<td><trigger-description trigger="trigger"></trigger-description></td>
<td>{{ trigger.config.dockerfile_path || '/Dockerfile' }}</td>
<td>{{ trigger.config.context || '/' }}</td>
<td>{{ trigger.config.branchtag_regex || 'All' }}</td>
<td>
<span class="entity-reference" entity="trigger.pull_robot" ng-if="trigger.pull_robot"></span>
<span class="empty" ng-if="!trigger.pull_robot">(None)</span>
</td>
<td>
<span class="cor-options-menu">
<span ng-if="trigger.config.credentials" class="cor-option" option-click="showTriggerCredentialsModal(trigger)">
<i class="fa fa-unlock-alt"></i> View Credentials
</span>
<span class="cor-option" option-click="askRunTrigger(trigger)"
ng-class="trigger.can_invoke ? '' : 'disabled'">
<i class="fa fa-chevron-right"></i> Run Trigger Now
</span>
<span class="cor-option" option-click="askDeleteTrigger(trigger)">
<i class="fa fa-times"></i> Delete Trigger
</span>
</span>
</td>
</tr>
</table>
</div>
</div>
</div> <!-- /Build Triggers -->
<!-- Dialogs -->
<!-- Trigger Credentials dialog -->
<div class="trigger-credentials-dialog" trigger="triggerCredentialsModalTrigger" counter="triggerCredentialsModalCounter"></div>
<!-- Delete Tag Confirm -->
<div class="cor-confirm-dialog"
dialog-context="deleteTriggerInfo"
dialog-action="deleteTrigger(info.trigger, callback)"
dialog-title="Delete Build Trigger"
dialog-action-title="Delete Trigger">
Are you sure you want to delete this build trigger? No further builds will be automatically
started.
</div>
<!-- Dockerfile build dialog -->
<div class="dockerfile-build-dialog"
show-now="showBuildDialogCounter"
repository="repository"
build-started="handleBuildStarted(build)">
</div>
<!-- Manual trigger dialog -->
<div class="manual-trigger-build-dialog"
repository="repository"
trigger="currentStartTrigger"
counter="showTriggerStartDialogCounter"
build-started="handleBuildStarted(build)"></div>
<!-- /Dialogs -->
</div>