mirror of https://github.com/gophish/gophish
Added auto complete for group selection (backend to be implemented soon)
parent
77ea41c2f9
commit
445bdd90a9
|
@ -20,7 +20,7 @@ app.factory('GroupService', function($resource) {
|
|||
});
|
||||
});
|
||||
|
||||
app.controller('CampaignCtrl', function($scope, CampaignService, ngTableParams) {
|
||||
app.controller('CampaignCtrl', function($scope, CampaignService, ngTableParams, $http) {
|
||||
$scope.flashes = []
|
||||
$scope.mainTableParams = new ngTableParams({
|
||||
page: 1, // show first page
|
||||
|
@ -76,14 +76,14 @@ app.controller('CampaignCtrl', function($scope, CampaignService, ngTableParams)
|
|||
});
|
||||
|
||||
$scope.getGroups = function(val) {
|
||||
return $http.get('/api/groups/lookup/', {
|
||||
return $http.get('/api/groups/?api_key=' + API_KEY, {
|
||||
params: {
|
||||
q: val
|
||||
}
|
||||
}).then(function(res) {
|
||||
var groups = [];
|
||||
angular.forEach(res.data.groups, function(item) {
|
||||
addresses.push(item.group);
|
||||
angular.forEach(res.data, function(item) {
|
||||
groups.push(item);
|
||||
});
|
||||
return groups;
|
||||
});
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -70,7 +70,7 @@
|
|||
<label class="control-label" for="users">Groups:</label>
|
||||
<form ng:submit="addGroup()">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" placeholder="Group Name" id="users" ng-model="group.name" />
|
||||
<input type="text" class="form-control" placeholder="Group Name" id="users" typeahead="group.name for group in getGroups($viewValue)" typeahead-editable="false" ng-model="group.name" />
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-primary"><i class="fa fa-plus"></i> Add</button>
|
||||
</span>
|
||||
|
|
Loading…
Reference in New Issue