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.flashes = []
|
||||||
$scope.mainTableParams = new ngTableParams({
|
$scope.mainTableParams = new ngTableParams({
|
||||||
page: 1, // show first page
|
page: 1, // show first page
|
||||||
|
@ -76,14 +76,14 @@ app.controller('CampaignCtrl', function($scope, CampaignService, ngTableParams)
|
||||||
});
|
});
|
||||||
|
|
||||||
$scope.getGroups = function(val) {
|
$scope.getGroups = function(val) {
|
||||||
return $http.get('/api/groups/lookup/', {
|
return $http.get('/api/groups/?api_key=' + API_KEY, {
|
||||||
params: {
|
params: {
|
||||||
q: val
|
q: val
|
||||||
}
|
}
|
||||||
}).then(function(res) {
|
}).then(function(res) {
|
||||||
var groups = [];
|
var groups = [];
|
||||||
angular.forEach(res.data.groups, function(item) {
|
angular.forEach(res.data, function(item) {
|
||||||
addresses.push(item.group);
|
groups.push(item);
|
||||||
});
|
});
|
||||||
return groups;
|
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>
|
<label class="control-label" for="users">Groups:</label>
|
||||||
<form ng:submit="addGroup()">
|
<form ng:submit="addGroup()">
|
||||||
<div class="input-group">
|
<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">
|
<span class="input-group-btn">
|
||||||
<button class="btn btn-primary"><i class="fa fa-plus"></i> Add</button>
|
<button class="btn btn-primary"><i class="fa fa-plus"></i> Add</button>
|
||||||
</span>
|
</span>
|
||||||
|
|
Loading…
Reference in New Issue