2014-08-25 21:55:38 +02:00
|
|
|
define([
|
|
|
|
'app',
|
|
|
|
'jquery',
|
|
|
|
'services/jobs',
|
|
|
|
'factories/job'
|
|
|
|
], function(app, $) {
|
|
|
|
app.registerController('JobsCtrl', ['$scope', 'jobs', function($scope, jobs) {
|
|
|
|
$scope.jobs = jobs;
|
|
|
|
|
|
|
|
jobs.get($scope.playbook, function () {
|
|
|
|
});
|
|
|
|
|
|
|
|
$scope.add = function () {
|
|
|
|
$('#addJob').modal('show');
|
|
|
|
}
|
|
|
|
|
|
|
|
$scope.deleteJob = function (job) {
|
|
|
|
job.delete($scope.playbook);
|
|
|
|
|
|
|
|
jobs.get($scope.playbook, function () {
|
|
|
|
});
|
|
|
|
}
|
2014-08-26 00:58:09 +02:00
|
|
|
|
|
|
|
$scope.runJob = function (job) {
|
|
|
|
job.run($scope.playbook);
|
|
|
|
}
|
2014-08-25 21:55:38 +02:00
|
|
|
}]);
|
|
|
|
|
|
|
|
app.registerController('AddJobCtrl', ['$scope', 'Job', 'jobs', function($scope, Job, jobs) {
|
|
|
|
$scope.job = new Job();
|
|
|
|
|
|
|
|
$scope.add = function () {
|
|
|
|
$('#addJob').modal('hide');
|
|
|
|
|
|
|
|
$scope.job.add($scope.playbook);
|
|
|
|
|
|
|
|
jobs.get($scope.playbook, function () {
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}]);
|
|
|
|
});
|