mirror of https://github.com/gophish/gophish
Use GroupsSummary to create and copy campaign (#1838)
The Groups (get all groups and associated targets) call is used while loading the modal for creating and copying a campaign. As the Groups API gets all the associated targets for a groups as well, it slows the system considerably if there are large number of groups and targets (~200 groups each with ~100-10000 targets). As targets are not really needed in this workflow, this call can be replaced by the GroupsSummary call.pull/1791/head
parent
726e3c96ac
commit
353639e168
|
@ -162,15 +162,16 @@ function deleteCampaign(idx) {
|
|||
}
|
||||
|
||||
function setupOptions() {
|
||||
api.groups.get()
|
||||
.success(function (groups) {
|
||||
api.groups.summary()
|
||||
.success(function (summaries) {
|
||||
groups = summaries.groups
|
||||
if (groups.length == 0) {
|
||||
modalError("No groups found!")
|
||||
return false;
|
||||
} else {
|
||||
var group_s2 = $.map(groups, function (obj) {
|
||||
obj.text = obj.name
|
||||
obj.title = obj.targets.length + " targets"
|
||||
obj.title = obj.num_targets + " targets"
|
||||
return obj
|
||||
});
|
||||
console.log(group_s2)
|
||||
|
|
Loading…
Reference in New Issue