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,58 @@
'use strict';
const angular = require('angular');
/*@ngInject*/
export function newFileController($scope,$uibModalInstance,ansible,selectedDirectory,copyFile,selectedFileName) {
$scope.newFile = {name:null};
$scope.createFileLoading = false;
$scope.title = 'New File';
var parentDirectory = selectedDirectory;
// If copyFile use selectedFileName to create new role from
// else nullify selectedFileName
if(!copyFile){
selectedFileName = null;
}
else {
$scope.title = 'Copy File';
$scope.newFile.name = 'Copy of ' + selectedFileName;
}
/**
* Create/Copy File - Either a new role or copy an existing role
*/
$scope.createFile = function(){
$scope.createFileLoading = true;
ansible.createFile(parentDirectory + '/' + $scope.newFile.name,
function(response){
$scope.createFileLoading = false;
$scope.ok();
},
function(response){
$scope.createFileLoading = false;
$scope.err_msg = response.data;
},
selectedFileName
)
};
/**
* Close create/copy modal
*/
$scope.ok = function () {
$uibModalInstance.close(null);
};
/**
* Cancel modal
*/
$scope.cancel = function () {
$uibModalInstance.dismiss('cancel');
};
}
export default angular.module('webAppApp.new_file', [])
.controller('NewFileController', newFileController)
.name;