Skip to content

Commit

Permalink
#870 Add alert id copy link
Browse files Browse the repository at this point in the history
  • Loading branch information
nadouani committed Feb 13, 2019
1 parent e179b6e commit 639558f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 5 additions & 1 deletion ui/app/scripts/controllers/alert/AlertEventCtrl.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(function() {
'use strict';
angular.module('theHiveControllers')
.controller('AlertEventCtrl', function($scope, $rootScope, $state, $uibModal, $uibModalInstance, CustomFieldsCacheSrv, CaseResolutionStatus, AlertingSrv, NotificationSrv, event, templates) {
.controller('AlertEventCtrl', function($scope, $rootScope, $state, $uibModal, $uibModalInstance, CustomFieldsCacheSrv, CaseResolutionStatus, AlertingSrv, NotificationSrv, clipboard, event, templates) {
var self = this;
var eventId = event.id;

Expand Down Expand Up @@ -254,6 +254,10 @@
}
};

self.copyId = function(id) {
clipboard.copyText(id);
};

self.load();
});
})();
8 changes: 7 additions & 1 deletion ui/app/views/partials/alert/event.dialog.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<div class="modal-header bg-primary">
<h3 class="modal-title">Alert Preview <span class="label label-default" ng-class="{'label-danger': dialog.event.status==='New', 'label-warning': dialog.event.status === 'Updated'}">{{dialog.event.status}}</span></h3>
<h3 class="modal-title">
Alert Preview <span class="label label-default" ng-class="{'label-danger': dialog.event.status==='New', 'label-warning': dialog.event.status === 'Updated'}">{{dialog.event.status}}</span>
</h3>
</div>
<div class="modal-body">
<div class="row text-center" ng-show="dialog.loading">
Expand All @@ -17,6 +19,10 @@ <h4 class="text-primary">
</h4>
<div class="mt-xxs">
<span>
<strong><i class="fa fa-copy"></i> ID: </strong>
<span><a href ng-click="dialog.copyId(dialog.event.id)">{{dialog.event.id}}</a></span>
</span>
<span class="ml-xxs">
<strong><i class="fa fa-calendar"></i> Date: </strong>
<span>{{dialog.event.date | showDate}}</span>
</span>
Expand Down

0 comments on commit 639558f

Please sign in to comment.