Merge remote-tracking branch 'origin/redalert'
Conflicts: app.py
This commit is contained in:
commit
0372013f70
46 changed files with 2432 additions and 432 deletions
129
static/directives/create-external-notification-dialog.html
Normal file
129
static/directives/create-external-notification-dialog.html
Normal file
|
@ -0,0 +1,129 @@
|
|||
<!-- Modal message dialog -->
|
||||
<div class="modal fade" id="createNotificationModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<form id="createForm" name="createForm" ng-submit="createNotification()">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-disabled="creating">×</button>
|
||||
<h4 class="modal-title">
|
||||
Create Repository Notification
|
||||
</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- Creating spinner -->
|
||||
<div class="quay-spinner" ng-show="status == 'creating' || status == 'authorizing-email'"></div>
|
||||
|
||||
<!-- Authorize e-mail view -->
|
||||
<div ng-show="status == 'authorizing-email-sent'">
|
||||
An e-mail has been sent to <code>{{ currentConfig.email }}</code>. Please click the link contained
|
||||
in the e-mail.
|
||||
<br><br>
|
||||
Waiting... <span class="quay-spinner"></span>
|
||||
</div>
|
||||
|
||||
<!-- Authorize e-mail view -->
|
||||
<div ng-show="status == 'unauthorized-email'">
|
||||
The e-mail address <code>{{ currentConfig.email }}</code> has not been authorized to receive
|
||||
notifications from this repository. Please click "Send Authorization E-mail" below to start
|
||||
the authorization process.
|
||||
</div>
|
||||
|
||||
<!-- Create View -->
|
||||
<table style="width: 100%" ng-show="status == ''">
|
||||
<tr>
|
||||
<td style="width: 120px">When this occurs:</td>
|
||||
<td>
|
||||
<div class="dropdown-select" placeholder="'(Notification Event)'" selected-item="currentEvent.title"
|
||||
handle-item-selected="handleEventSelected(datum)" clear-value="clearCounter">
|
||||
<!-- Icons -->
|
||||
<i class="dropdown-select-icon fa fa-lg" ng-class="currentEvent.icon"></i>
|
||||
|
||||
<!-- Dropdown menu -->
|
||||
<ul class="dropdown-select-menu pull-right" role="menu">
|
||||
<li ng-repeat="event in events">
|
||||
<a href="javascript:void(0)" ng-click="setEvent(event)">
|
||||
<i class="fa fa-lg" ng-class="event.icon"></i> {{ event.title }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Then issue a:</td>
|
||||
<td>
|
||||
<div class="dropdown-select" placeholder="'(Notification Action)'" selected-item="currentMethod.title"
|
||||
handle-item-selected="handleMethodSelected(datum)" clear-value="clearCounter">
|
||||
<!-- Icons -->
|
||||
<i class="dropdown-select-icon fa fa-lg" ng-class="currentMethod.icon"></i>
|
||||
|
||||
<!-- Dropdown menu -->
|
||||
<ul class="dropdown-select-menu pull-right" role="menu">
|
||||
<li ng-repeat="method in methods">
|
||||
<a href="javascript:void(0)" ng-click="setMethod(method)">
|
||||
<i class="fa fa-lg" ng-class="method.icon"></i> {{ method.title }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr ng-if="currentMethod.fields.length"><td colspan="2"><hr></td></tr>
|
||||
|
||||
<tr ng-repeat="field in currentMethod.fields">
|
||||
<td>{{ field.title }}:</td>
|
||||
<td>
|
||||
<div ng-switch on="field.type">
|
||||
<span ng-switch-when="email">
|
||||
<input type="email" class="form-control" ng-model="currentConfig[field.name]" required>
|
||||
</span>
|
||||
<input type="url" class="form-control" ng-model="currentConfig[field.name]" ng-switch-when="url" required>
|
||||
<input type="text" class="form-control" ng-model="currentConfig[field.name]" ng-switch-when="string" required>
|
||||
<div class="entity-search" namespace="repository.namespace"
|
||||
placeholder="''"
|
||||
current-entity="currentConfig[field.name]"
|
||||
ng-model="currentConfig[field.name]"
|
||||
allowed-entities="['user', 'team', 'org']"
|
||||
ng-switch-when="entity">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr ng-if="currentMethod.id == 'webhook'">
|
||||
<td colspan="2">
|
||||
<div class="alert alert-info" style="margin-top: 20px; margin-bottom: 0px">
|
||||
JSON metadata representing the event will be <b>POST</b>ed to the URL.
|
||||
<br><br>
|
||||
The contents for each event can be found in the user guide:
|
||||
<a href="http://docs.quay.io/guides/notifications.html#webhook{{ currentEvent.id ? '_' + currentEvent.id : '' }}"
|
||||
target="_blank">
|
||||
http://docs.quay.io/guides/notifications.html
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- Auth e-mail button bar -->
|
||||
<div class="modal-footer" ng-if="status == 'unauthorized-email'">
|
||||
<button type="button" class="btn btn-success" ng-click="sendAuthEmail()">
|
||||
Send Authorization E-mail
|
||||
</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal" ng-disabled="creating">Cancel</button>
|
||||
</div>
|
||||
|
||||
<!-- Normal button bar -->
|
||||
<div class="modal-footer" ng-if="status == '' || status == 'creating'">
|
||||
<button type="submit" class="btn btn-primary"
|
||||
ng-disabled="createForm.$invalid || !currentMethod.id || !currentEvent.id || creating">
|
||||
Create Notification
|
||||
</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal" ng-disabled="creating">Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
|
@ -1,7 +1,8 @@
|
|||
<div class="dropdown-select-element" ng-class="selectedItem ? 'has-item' : ''">
|
||||
<div class="current-item">
|
||||
<div class="dropdown-select-icon-transclude"></div>
|
||||
<input type="text" class="lookahead-input form-control" placeholder="{{ placeholder }}"></input>
|
||||
<input type="text" class="lookahead-input form-control" placeholder="{{ placeholder }}"
|
||||
ng-readonly="!lookaheadItems || !lookaheadItems.length"></input>
|
||||
</div>
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown">
|
||||
|
|
|
@ -6,7 +6,14 @@
|
|||
<span ng-if="getIsAdmin(namespace)"><a href="/organization/{{ namespace }}/teams/{{ entity.name }}">{{entity.name}}</a></span>
|
||||
</span>
|
||||
</span>
|
||||
<span ng-if="entity.kind != 'team'">
|
||||
<span ng-if="entity.kind == 'org'">
|
||||
<img src="//www.gravatar.com/avatar/{{ entity.gravatar }}?s=16&d=identicon">
|
||||
<span class="entity-name">
|
||||
<span ng-if="!getIsAdmin(entity.name)">{{entity.name}}</span>
|
||||
<span ng-if="getIsAdmin(entity.name)"><a href="/organization/{{ entity.name }}">{{entity.name}}</a></span>
|
||||
</span>
|
||||
</span>
|
||||
<span ng-if="entity.kind != 'team' && entity.kind != 'org'">
|
||||
<i class="fa fa-user" ng-show="!entity.is_robot" data-title="User" bs-tooltip="tooltip.title" data-container="body"></i>
|
||||
<i class="fa fa-wrench" ng-show="entity.is_robot" data-title="Robot Account" bs-tooltip="tooltip.title" data-container="body"></i>
|
||||
<span class="entity-name" ng-if="entity.is_robot">
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<span class="entity-search-element" ng-class="isPersistent ? 'persistent' : ''"><input class="entity-search-control form-control">
|
||||
<span class="entity-reference block-reference" ng-show="isPersistent && currentEntityInternal" entity="currentEntityInternal"></span>
|
||||
<span class="entity-search-element" ng-class="autoClear ? '' : 'persistent'"><input class="entity-search-control form-control">
|
||||
<span class="entity-reference block-reference" ng-show="!autoClear && currentEntityInternal" entity="currentEntityInternal"></span>
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-default dropdown-toggle" type="button" id="entityDropdownMenu" data-toggle="dropdown"
|
||||
ng-click="lazyLoad()">
|
||||
|
@ -11,6 +11,29 @@
|
|||
<li role="presentation" class="dropdown-header" ng-show="!lazyLoading && !robots && !isAdmin && !teams">
|
||||
You do not have permission to manage teams and robots for this organization
|
||||
</li>
|
||||
|
||||
<li role="presentation" class="dropdown-header"
|
||||
ng-show="!lazyLoading && !teams.length && !robots.length && !((includeTeams && isOrganization && isAdmin) || (includeRobots && isAdmin))">
|
||||
<span ng-if="includeRobots && includeTeams && isOrganization">
|
||||
No robot accounts or teams found
|
||||
</span>
|
||||
<span ng-if="!includeRobots && includeTeams && isOrganization">
|
||||
No teams found
|
||||
</span>
|
||||
<span ng-if="includeRobots && !includeTeams && isOrganization">
|
||||
No robot accounts found
|
||||
</span>
|
||||
<span ng-if="!includeRobots && !includeTeams && isOrganization">
|
||||
Robot accounts and teams are not permitted
|
||||
</span>
|
||||
|
||||
<span ng-if="includeRobots && !isOrganization">
|
||||
No robot accounts found
|
||||
</span>
|
||||
<span ng-if="!includeRobots && !isOrganization">
|
||||
Robot accounts are not permitted
|
||||
</span>
|
||||
</li>
|
||||
|
||||
<li role="presentation" ng-repeat="team in teams" ng-show="!lazyLoading"
|
||||
ng-click="setEntity(team.name, 'team', false)">
|
||||
|
@ -34,7 +57,7 @@
|
|||
<i class="fa fa-group"></i> Create team
|
||||
</a>
|
||||
</li>
|
||||
<li role="presentation" ng-show="!lazyLoading && isAdmin">
|
||||
<li role="presentation" ng-show="includeRobots && !lazyLoading && isAdmin">
|
||||
<a role="menuitem" class="new-action" tabindex="-1" href="javascript:void(0)" ng-click="createRobot()">
|
||||
<i class="fa fa-wrench"></i>
|
||||
Create robot account
|
||||
|
|
62
static/directives/external-notification-view.html
Normal file
62
static/directives/external-notification-view.html
Normal file
|
@ -0,0 +1,62 @@
|
|||
<div class="external-notification-view-element">
|
||||
<div class="side-controls">
|
||||
<div class="dropdown" style="display: inline-block">
|
||||
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-cog"></i>
|
||||
<b class="caret"></b>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-right pull-right">
|
||||
<li ng-if="methodInfo.id == 'webhook'">
|
||||
<a href="http://docs.quay.io/guides/notifications.html#webhook_{{ eventInfo.id }}"
|
||||
target="_blank">
|
||||
<i class="fa fa-book"></i>
|
||||
Webhook Documentation</a>
|
||||
</li>
|
||||
<li class="divider" ng-if="methodInfo.id == 'webhook'"></li>
|
||||
<li><a href="javascript:void(0)" ng-click="testNotification()">
|
||||
<i class="fa fa-send"></i>
|
||||
Issue Test Notification</a>
|
||||
</li>
|
||||
<li><a href="javascript:void(0)" ng-click="deleteNotification()">
|
||||
<i class="fa fa-times"></i>
|
||||
Delete</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="view-row">
|
||||
<span class="flow-text">On</span>
|
||||
<span class="notification-event">
|
||||
<i class="fa fa-lg" ng-class="eventInfo.icon"></i>
|
||||
{{ eventInfo.title }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="view-row">
|
||||
<span class="flow-text">Issue A</span>
|
||||
<span class="notification-method">
|
||||
<i class="fa fa-lg" ng-class="methodInfo.icon"></i>
|
||||
{{ methodInfo.title }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="view-row">
|
||||
<span ng-switch on="methodInfo.id">
|
||||
<span ng-switch-when="email">
|
||||
<span class="flow-text">To</span>
|
||||
<code>{{ config.email }}</code>
|
||||
</span>
|
||||
|
||||
<span ng-switch-when="webhook">
|
||||
<span class="flow-text">To</span>
|
||||
<code>{{ config.url }}</code>
|
||||
</span>
|
||||
|
||||
<span ng-switch-when="quay_notification">
|
||||
<span class="flow-text">To</span>
|
||||
<span class="entity-reference" entity="config.target" namespace="repository.namespace"></span>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
|
@ -6,6 +6,11 @@
|
|||
<img src="//www.gravatar.com/avatar/{{ getGravatar(notification.organization) }}?s=24&d=identicon" />
|
||||
<span class="orgname">{{ notification.organization }}</span>
|
||||
</div>
|
||||
<div class="datetime">{{ parseDate(notification.created) | date:'medium'}}</div>
|
||||
</div>
|
||||
<div class="datetime">{{ parseDate(notification.created) | date:'medium'}}</div>
|
||||
<div class="right-controls">
|
||||
<a href="javascript:void(0)" ng-if="canDismiss(notification)" ng-click="dismissNotification(notification)">
|
||||
Dismiss Notification
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -83,9 +83,11 @@
|
|||
<tr ng-show="!newForWholeOrg">
|
||||
<td>Repository Creator:</td>
|
||||
<td>
|
||||
<span class="entity-search" namespace="organization.name" input-title="'User/Robot'"
|
||||
is-organization="true" include-teams="false" current-entity="activatingForNew" is-persistent="true"
|
||||
clear-now="clearCounter">
|
||||
<span class="entity-search" namespace="organization.name"
|
||||
placeholder="'User/Robot'"
|
||||
allowed-entities="['user', 'robot']"
|
||||
current-entity="activatingForNew"
|
||||
clear-value="clearCounter">
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -98,9 +100,9 @@
|
|||
<tr>
|
||||
<td>Applied To:</td>
|
||||
<td>
|
||||
<span class="entity-search" namespace="organization.name" input-title="'User/Robot/Team'"
|
||||
is-organization="true" include-teams="true" current-entity="delegateForNew" is-persistent="true"
|
||||
clear-now="clearCounter">
|
||||
<span class="entity-search" namespace="organization.name" placeholder="'User/Robot/Team'"
|
||||
current-entity="delegateForNew"
|
||||
clear-value="clearCounter">
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -71,12 +71,10 @@
|
|||
<td>
|
||||
</td>
|
||||
<td>
|
||||
<div class="entity-search" namespace="repository.namespace" include-teams="false"
|
||||
input-title="'Select robot account for pulling...'"
|
||||
is-organization="repository.is_organization"
|
||||
is-persistent="true"
|
||||
<div class="entity-search" namespace="repository.namespace"
|
||||
placeholder="'Select robot account for pulling...'"
|
||||
current-entity="pullEntity"
|
||||
filter="['robot']"></div>
|
||||
allowed-entities="['robot']"></div>
|
||||
|
||||
<div class="alert alert-info" ng-if="pullRequirements.robots.length" style="margin-top: 20px; margin-bottom: 0px;">
|
||||
Note: We've automatically selected robot account <span class="entity-reference" entity="pullRequirements.robots[0]"></span>, since it has access to the Quay.io repository.
|
||||
|
|
Reference in a new issue