1
0
Fork 0
mirror of https://github.com/mmumshad/ansible-playable.git synced 2025-03-09 23:38:54 +00:00

Initial Commit

This commit is contained in:
Mumshad Mannambeth 2017-06-07 13:36:44 -04:00
commit c92f737237
273 changed files with 16964 additions and 0 deletions

View file

@ -0,0 +1,35 @@
'use strict';
const angular = require('angular');
/*@ngInject*/
export function newPlaybookController($scope,$uibModalInstance,ansible) {
$scope.newPlaybook = {name:null};
$scope.createPlaybookLoading = false;
$scope.createPlaybook = function(){
$scope.createPlaybookLoading = true;
ansible.createPlaybook($scope.newPlaybook.name + '.yml',"",
function(response){
$scope.createPlaybookLoading = false;
$scope.ok();
},
function(response){
$scope.createPlaybookLoading = false;
$scope.err_msg = response.data;
})
};
$scope.ok = function () {
$uibModalInstance.close(null);
};
$scope.cancel = function () {
$uibModalInstance.dismiss('cancel');
};
}
export default angular.module('webAppApp.new_playbook', [])
.controller('NewPlaybookController', newPlaybookController)
.name;

View file

@ -0,0 +1,17 @@
'use strict';
describe('Controller: NewPlaybookCtrl', function() {
// load the controller's module
beforeEach(module('webAppApp.new_playbook'));
var NewPlaybookCtrl;
// Initialize the controller and a mock scope
beforeEach(inject(function($controller) {
NewPlaybookCtrl = $controller('NewPlaybookCtrl', {});
}));
it('should ...', function() {
expect(1).to.equal(1);
});
});

View file

@ -0,0 +1,19 @@
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">New Playbook</h4>
</div>
<div class="modal-body">
<p class="form-group">
<label>Playbook Name</label>
<input type="text" ng-model="newPlaybook.name" class="form-control">
</p>
</div>
<div class="alert alert-danger" ng-if="err_msg">{{err_msg}}</div>
<div class="modal-footer">
<button class="btn btn-primary" ng-disabled="!newPlaybook.name" ng-click="createPlaybook()">Create <span ng-if="createPlaybookLoading" class="fa fa-spinner fa-spin"></span></button>
<button class="btn btn-default" type="button" ng-click="cancel()">Close</button>
</div>
</div>