mirror of
				https://github.com/mmumshad/ansible-playable.git
				synced 2025-03-09 23:38:54 +00:00 
			
		
		
		
	Append project owner id to project folder names
This commit is contained in:
		
							parent
							
								
									c21aebbf49
								
							
						
					
					
						commit
						a71d1109a8
					
				
					 4 changed files with 58 additions and 9 deletions
				
			
		|  | @ -7,7 +7,7 @@ import routes from './project.routes'; | |||
| 
 | ||||
| export class ProjectComponent { | ||||
|   /*@ngInject*/ | ||||
|   constructor($scope, Projects) { | ||||
|   constructor($scope, Projects, Auth) { | ||||
|     'ngInject'; | ||||
|     var default_project_folder = '/opt/ehc-ansible-projects/'; | ||||
| 
 | ||||
|  | @ -104,8 +104,11 @@ export class ProjectComponent { | |||
| 
 | ||||
|     $scope.$watch('newProject.name', function(newValue, oldValue){ | ||||
|       console.log("Changed"); | ||||
|       $scope.newProject.ansibleEngine.projectFolder = '/opt/ansible-projects/' + newValue; | ||||
|       $scope.newProject.ansibleEngine.customModules = '/opt/ansible-projects/' + newValue + '/library'; | ||||
|       // Project folders cannot be edited once created
 | ||||
|       var user_id = Auth.getCurrentUserSync()._id; | ||||
|       if($scope.editProjectFlag)return; | ||||
|       $scope.newProject.ansibleEngine.projectFolder = '/opt/ansible-projects/' + user_id + '_' + newValue; | ||||
|       $scope.newProject.ansibleEngine.customModules = '/opt/ansible-projects/' + user_id + '_' + newValue + '/library'; | ||||
|     }); | ||||
| 
 | ||||
|   } | ||||
|  |  | |||
|  | @ -28,14 +28,14 @@ | |||
| 
 | ||||
|         <p class="form-group" ng-if="newProject.ansibleEngine.ansibleHost"> | ||||
|           <label>Project Folder</label> | ||||
|           <input ng-model="newProject.ansibleEngine.projectFolder" class="form-control"> | ||||
|           <div ng-if="newProject.ansibleEngine.ansibleHost" class="hint">A directory path to store files of this project </div> | ||||
|           <input ng-readonly="editProjectFlag" ng-model="newProject.ansibleEngine.projectFolder" class="form-control"> | ||||
|           <div ng-if="newProject.ansibleEngine.ansibleHost" class="hint">A directory path on the Ansible Host to store files of this project </div> | ||||
|         </p> | ||||
| 
 | ||||
|         <p class="form-group" ng-if="newProject.ansibleEngine.ansibleHost"> | ||||
|           <label>Custom Modules Location</label> | ||||
|           <input ng-model="newProject.ansibleEngine.customModules" class="form-control"> | ||||
|           <div ng-if="newProject.ansibleEngine.ansibleHost" class="hint">A directory path to store custom modules for this project </div> | ||||
|           <input ng-readonly="editProjectFlag" ng-model="newProject.ansibleEngine.customModules" class="form-control"> | ||||
|           <div ng-if="newProject.ansibleEngine.ansibleHost" class="hint">A directory path on the Ansible Host to store custom modules for this project </div> | ||||
|         </p> | ||||
| 
 | ||||
|         <button class="btn btn-success" ng-disabled="!newProject.name" ng-click="createProject()"> Save <span class="fa {{saveButtonIcon}}"></span></button> | ||||
|  | @ -57,6 +57,7 @@ | |||
|         <th>Name</th> | ||||
|         <th>Ansible Host</th> | ||||
|         <th>Ansible Version</th> | ||||
|         <th>Owner</th> | ||||
|         <th>Time</th> | ||||
|         <th>Actions</th> | ||||
|       </tr> | ||||
|  | @ -66,6 +67,7 @@ | |||
|         <td>{{project.name}}</td> | ||||
|         <td>{{project.ansibleEngine.ansibleHost}}</td> | ||||
|         <td>{{project.ansibleVersion}}</td> | ||||
|         <td>{{project.owner_name}}</td> | ||||
|         <td>{{project.creationTime | date : 'medium'}}</td> | ||||
|         <td> | ||||
|           <div class="btn-group"> | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue