mirror of https://github.com/gophish/gophish
Fixed indentation in controllers.js
parent
32ffe46363
commit
6ec45ab927
|
@ -103,15 +103,27 @@ app.controller('CampaignCtrl', function($scope, $modal, CampaignService, GroupSe
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.errorFlash = function(message) {
|
$scope.errorFlash = function(message) {
|
||||||
$scope.flashes.push({"type" : "danger", "message" : message, "icon" : "fa-exclamation-circle"})
|
$scope.flashes.push({
|
||||||
|
"type": "danger",
|
||||||
|
"message": message,
|
||||||
|
"icon": "fa-exclamation-circle"
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.successFlash = function(message) {
|
$scope.successFlash = function(message) {
|
||||||
$scope.flashes.push({"type" : "success", "message" : message, "icon" : "fa-check-circle"})
|
$scope.flashes.push({
|
||||||
|
"type": "success",
|
||||||
|
"message": message,
|
||||||
|
"icon": "fa-check-circle"
|
||||||
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var CampaignModalCtrl = function($scope, $modalInstance){};
|
var CampaignModalCtrl = function($scope, $modalInstance) {
|
||||||
|
$scope.cancel = function() {
|
||||||
|
$modalInstance.dismiss('cancel');
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
app.controller('CampaignResultsCtrl', function($scope, CampaignService, GroupService, ngTableParams, $http, $window) {
|
app.controller('CampaignResultsCtrl', function($scope, CampaignService, GroupService, ngTableParams, $http, $window) {
|
||||||
id = $window.location.hash.split('/')[2];
|
id = $window.location.hash.split('/')[2];
|
||||||
|
@ -125,7 +137,9 @@ app.controller('CampaignResultsCtrl', function($scope, CampaignService, GroupSer
|
||||||
}, {
|
}, {
|
||||||
total: 0, // length of data
|
total: 0, // length of data
|
||||||
getData: function($defer, params) {
|
getData: function($defer, params) {
|
||||||
CampaignService.get({"id" : id}, function(campaign) {
|
CampaignService.get({
|
||||||
|
"id": id
|
||||||
|
}, function(campaign) {
|
||||||
$scope.campaign = campaign
|
$scope.campaign = campaign
|
||||||
params.total(campaign.results.length)
|
params.total(campaign.results.length)
|
||||||
$defer.resolve(campaign.results.slice((params.page() - 1) * params.count(), params.page() * params.count()));
|
$defer.resolve(campaign.results.slice((params.page() - 1) * params.count(), params.page() * params.count()));
|
||||||
|
@ -134,7 +148,11 @@ app.controller('CampaignResultsCtrl', function($scope, CampaignService, GroupSer
|
||||||
});
|
});
|
||||||
|
|
||||||
$scope.errorFlash = function(message) {
|
$scope.errorFlash = function(message) {
|
||||||
$scope.flashes.push({"type" : "danger", "message" : message, "icon" : "fa-exclamation-circle"})
|
$scope.flashes.push({
|
||||||
|
"type": "danger",
|
||||||
|
"message": message,
|
||||||
|
"icon": "fa-exclamation-circle"
|
||||||
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -298,19 +316,31 @@ app.controller('TemplateCtrl', function($scope, $modal, TemplateService, ngTable
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
var TemplateModalCtrl = function($scope, $modalInstance){};
|
var TemplateModalCtrl = function($scope, $modalInstance) {
|
||||||
|
$scope.cancel = function() {
|
||||||
|
$modalInstance.dismiss('cancel');
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
app.controller('SettingsCtrl', function($scope, $http) {
|
app.controller('SettingsCtrl', function($scope, $http) {
|
||||||
$scope.flashes = [];
|
$scope.flashes = [];
|
||||||
$scope.user = user;
|
$scope.user = user;
|
||||||
$scope.errorFlash = function(message) {
|
$scope.errorFlash = function(message) {
|
||||||
$scope.flashes = [];
|
$scope.flashes = [];
|
||||||
$scope.flashes.push({"type" : "danger", "message" : message, "icon" : "fa-exclamation-circle"})
|
$scope.flashes.push({
|
||||||
|
"type": "danger",
|
||||||
|
"message": message,
|
||||||
|
"icon": "fa-exclamation-circle"
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.successFlash = function(message) {
|
$scope.successFlash = function(message) {
|
||||||
$scope.flashes = [];
|
$scope.flashes = [];
|
||||||
$scope.flashes.push({"type" : "success", "message" : message, "icon" : "fa-check-circle"})
|
$scope.flashes.push({
|
||||||
|
"type": "success",
|
||||||
|
"message": message,
|
||||||
|
"icon": "fa-check-circle"
|
||||||
|
})
|
||||||
}
|
}
|
||||||
$scope.form_data = {
|
$scope.form_data = {
|
||||||
csrf_token: csrf_token
|
csrf_token: csrf_token
|
||||||
|
@ -320,10 +350,13 @@ app.controller('SettingsCtrl', function($scope, $http) {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: '/api/reset',
|
url: '/api/reset',
|
||||||
data: $.param($scope.form_data), // pass in data as strings
|
data: $.param($scope.form_data), // pass in data as strings
|
||||||
headers : { 'Content-Type': 'application/x-www-form-urlencoded' } // set the headers so angular passing info as form data (not request payload)
|
headers: {
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded'
|
||||||
|
} // set the headers so angular passing info as form data (not request payload)
|
||||||
})
|
})
|
||||||
.success(function(data) {
|
.success(function(data) {
|
||||||
$scope.user.api_key = data
|
$scope.user.api_key = data;
|
||||||
|
user.api_key = data;
|
||||||
$scope.successFlash("API Key Successfully Reset")
|
$scope.successFlash("API Key Successfully Reset")
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue