2014-07-17 17:32:39 +00:00
|
|
|
<!-- Modal message dialog -->
|
2015-10-13 22:14:52 +00:00
|
|
|
<div class="co-dialog modal fade" id="createNotificationModal">
|
2014-07-17 17:32:39 +00:00
|
|
|
<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">
|
2015-10-13 22:14:52 +00:00
|
|
|
<i class="fa fa-bell"></i> Create Repository Notification
|
2014-07-17 17:32:39 +00:00
|
|
|
</h4>
|
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
2014-07-28 18:58:12 +00:00
|
|
|
<!-- Creating spinner -->
|
2015-08-17 20:30:15 +00:00
|
|
|
<div class="cor-loader" ng-show="status == 'creating' || status == 'authorizing-email'"></div>
|
2014-07-17 17:32:39 +00:00
|
|
|
|
2014-07-28 18:58:12 +00:00
|
|
|
<!-- 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>
|
2015-08-17 20:30:15 +00:00
|
|
|
<span class="cor-loader-inline"></span>
|
2014-07-28 18:58:12 +00:00
|
|
|
</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 -->
|
2015-10-13 22:14:52 +00:00
|
|
|
<div class="options-table-wrapper">
|
|
|
|
<table class="options-table" ng-show="status == ''">
|
|
|
|
<tr>
|
|
|
|
<td class="name">Notification title:</td>
|
|
|
|
<td>
|
|
|
|
<input class="form-control" type="text" placeholder="(Optional Title)" ng-model="currentTitle">
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
2015-08-17 20:30:15 +00:00
|
|
|
|
2015-10-13 22:14:52 +00:00
|
|
|
<table class="options-table" ng-show="status == ''">
|
|
|
|
<tr>
|
|
|
|
<td class="name">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>
|
2014-11-24 21:07:38 +00:00
|
|
|
|
2015-10-13 22:14:52 +00:00
|
|
|
<!-- Dropdown menu -->
|
|
|
|
<ul class="dropdown-select-menu pull-right" role="menu">
|
|
|
|
<li ng-repeat="event in events">
|
2016-03-22 18:15:54 +00:00
|
|
|
<a ng-click="setEvent(event)">
|
2015-10-13 22:14:52 +00:00
|
|
|
<i class="fa fa-lg" ng-class="event.icon"></i> {{ event.title }}
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2014-07-17 17:32:39 +00:00
|
|
|
|
2015-10-13 22:14:52 +00:00
|
|
|
<tr ng-repeat="field in currentEvent.fields">
|
|
|
|
<td class="name" valign="top">With {{ field.title }} of:</td>
|
|
|
|
<td>
|
|
|
|
<div ng-switch on="field.type">
|
|
|
|
<select class="form-control" ng-if="field.type == 'enum'"
|
|
|
|
ng-model="currentEventConfig[field.name]" required>
|
|
|
|
<option ng-repeat="(key, info) in field.values | orderObjectBy: 'index'" value="{{key}}">{{ info.title }}</option>
|
|
|
|
</select>
|
2014-11-24 21:07:38 +00:00
|
|
|
|
2015-10-13 22:14:52 +00:00
|
|
|
<div class="co-alert co-alert-info"
|
|
|
|
style="margin-top: 6px; margin-bottom: 10px;"
|
|
|
|
ng-if="field.values[currentEventConfig[field.name]].description">
|
|
|
|
{{ field.values[currentEventConfig[field.name]].description }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<table class="options-table" ng-show="status == ''">
|
|
|
|
<tr>
|
|
|
|
<td class="name">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">
|
2016-03-22 18:15:54 +00:00
|
|
|
<a ng-click="setMethod(method)">
|
2015-10-13 22:14:52 +00:00
|
|
|
<i class="fa fa-lg" ng-class="method.icon"></i> {{ method.title }}
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2014-07-17 17:32:39 +00:00
|
|
|
|
2015-10-13 22:14:52 +00:00
|
|
|
<tr ng-repeat="field in currentMethod.fields">
|
|
|
|
<td valign="top" class="name">{{ 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>
|
|
|
|
<!-- TODO(jschorr): unify the ability to create an input box with all the usual features -->
|
|
|
|
<div ng-switch-when="regex">
|
|
|
|
<input type="text" class="form-control" ng-model="currentConfig[field.name]"
|
|
|
|
ng-pattern="getPattern(field)"
|
|
|
|
placeholder="{{ field.placeholder }}"
|
|
|
|
ng-name="field.name"
|
|
|
|
id="{{ field.name }}"
|
|
|
|
required>
|
2014-07-17 17:32:39 +00:00
|
|
|
|
2015-10-13 22:14:52 +00:00
|
|
|
<div class="alert alert-warning" style="margin-top: 10px; margin-bottom: 10px"
|
|
|
|
ng-if="field.regex_fail_message && hasRegexMismatch(createForm.$error, field.name)">
|
|
|
|
<span ng-bind-html="field.regex_fail_message"></span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<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>
|
2015-02-26 17:35:28 +00:00
|
|
|
|
2015-10-13 22:14:52 +00:00
|
|
|
<div ng-if="getHelpUrl(field, currentConfig)"
|
|
|
|
style="margin-top: 10px; margin-bottom: 10px">
|
|
|
|
See: <a href="{{ getHelpUrl(field, currentConfig) }}" target="_blank">{{ getHelpUrl(field, currentConfig) }}</a>
|
2015-02-26 17:35:28 +00:00
|
|
|
</div>
|
2014-08-19 18:33:33 +00:00
|
|
|
|
2015-10-13 22:14:52 +00:00
|
|
|
<div class="co-alert co-alert-info" ng-if="currentMethod.id == 'webhook'"
|
|
|
|
style="margin-top: 6px; 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>
|
2014-08-19 18:33:33 +00:00
|
|
|
</div>
|
2015-10-13 22:14:52 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</div>
|
2014-07-28 18:58:12 +00:00
|
|
|
</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>
|
2014-07-17 17:32:39 +00:00
|
|
|
</div>
|
2014-11-24 21:07:38 +00:00
|
|
|
|
2014-07-28 18:58:12 +00:00
|
|
|
<!-- Normal button bar -->
|
|
|
|
<div class="modal-footer" ng-if="status == '' || status == 'creating'">
|
2014-07-17 17:32:39 +00:00
|
|
|
<button type="submit" class="btn btn-primary"
|
2014-07-22 17:39:41 +00:00
|
|
|
ng-disabled="createForm.$invalid || !currentMethod.id || !currentEvent.id || creating">
|
2014-07-17 17:32:39 +00:00
|
|
|
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 -->
|