parent
3f6f5162e8
commit
84276ee945
10 changed files with 89 additions and 12 deletions
|
@ -11,14 +11,14 @@
|
|||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- Creating spinner -->
|
||||
<div class="quay-spinner" ng-show="status == 'creating' || status == 'authorizing-email'"></div>
|
||||
<div class="cor-loader" 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>
|
||||
<span class="cor-loader-inline"></span>
|
||||
</div>
|
||||
|
||||
<!-- Authorize e-mail view -->
|
||||
|
@ -30,6 +30,14 @@
|
|||
|
||||
<!-- Create View -->
|
||||
<table style="width: 100%" ng-show="status == ''">
|
||||
<tr>
|
||||
<td style="width: 120px">Notification title:</td>
|
||||
<td style="padding-right: 21px;">
|
||||
<input class="form-control" type="text" placeholder="(Optional Title)" ng-model="currentTitle"
|
||||
style="margin: 10px;">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="width: 120px">When this occurs:</td>
|
||||
<td>
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
<table class="co-table permissions" ng-if="notifications.length">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Title</td>
|
||||
<td>Event</td>
|
||||
<td>Notification</td>
|
||||
<td class="options-col"></td>
|
||||
|
@ -34,6 +35,10 @@
|
|||
|
||||
<tbody>
|
||||
<tr class="notification-row" ng-repeat="notification in notifications">
|
||||
<td>
|
||||
{{ notification.title || '(Untitled)' }}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<span class="notification-event">
|
||||
<i class="fa fa-lg" ng-class="getEventInfo(notification).icon"></i>
|
||||
|
@ -53,6 +58,16 @@
|
|||
<span class="cor-option" option-click="testNotification(notification)">
|
||||
<i class="fa fa-send"></i> Test Notification
|
||||
</span>
|
||||
<span class="cor-option" option-click="showNotifyInfo(notification, 'url')"
|
||||
ng-if="getMethodInfo(notification).id == 'webhook'">
|
||||
<i class="fa fa-link"></i>
|
||||
View Webhook URL
|
||||
</span>
|
||||
<span class="cor-option" option-click="showNotifyInfo(notification, 'email')"
|
||||
ng-if="getMethodInfo(notification).id == 'email'">
|
||||
<i class="fa fa-envelope"></i>
|
||||
View E-mail Address
|
||||
</span>
|
||||
<span class="cor-option" option-click="showWebhookInfo(notification)"
|
||||
ng-if="getMethodInfo(notification).id == 'webhook'">
|
||||
<i class="fa fa-book"></i>
|
||||
|
|
|
@ -88,7 +88,8 @@ angular.module('quay').directive('createExternalNotificationDialog', function ()
|
|||
var data = {
|
||||
'event': $scope.currentEvent.id,
|
||||
'method': $scope.currentMethod.id,
|
||||
'config': $scope.currentConfig
|
||||
'config': $scope.currentConfig,
|
||||
'title': $scope.currentTitle
|
||||
};
|
||||
|
||||
ApiService.createRepoNotification(data, params).then(function(resp) {
|
||||
|
|
|
@ -64,6 +64,25 @@ angular.module('quay').directive('repositoryEventsTable', function () {
|
|||
}, ApiService.errorDisplay('Cannot delete notification'));
|
||||
};
|
||||
|
||||
$scope.showNotifyInfo = function(notification, field) {
|
||||
var dom = document.createElement('input');
|
||||
dom.setAttribute('type', 'text');
|
||||
dom.setAttribute('class', 'form-control');
|
||||
dom.setAttribute('value', notification.config[field]);
|
||||
dom.setAttribute('readonly', 'readonly');
|
||||
|
||||
bootbox.dialog({
|
||||
'title': (notification.title || 'Notification') + ' ' + field,
|
||||
'message': dom.outerHTML,
|
||||
'buttons': {
|
||||
"Done": {
|
||||
className: "btn-primary",
|
||||
callback: function() {}
|
||||
},
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$scope.showWebhookInfo = function(notification) {
|
||||
var eventId = notification.event;
|
||||
document.location = 'http://docs.quay.io/guides/notifications.html#webhook_' + eventId;
|
||||
|
|
Reference in a new issue