Fixed login dialog so that it now submits when Enter pressed in password field. Fixed more button more button labels.

This commit is contained in:
chouseknecht
2013-05-24 09:55:52 -04:00
parent b4709c5138
commit fd25d68ffe
16 changed files with 41 additions and 33 deletions

View File

@@ -25,12 +25,19 @@ function Authenticate($scope, $rootScope, $location, Authorization, ToggleClass,
$scope.sessionExpired = Authorization.didSessionExpire(); //Display session timeout message $scope.sessionExpired = Authorization.didSessionExpire(); //Display session timeout message
$scope.sessionTimeout = ($AnsibleConfig.session_timeout / 60).toFixed(2) $scope.sessionTimeout = ($AnsibleConfig.session_timeout / 60).toFixed(2)
$('#login-password').bind('keypress', function(e) {
var code = (e.keyCode ? e.keyCode : e.which);
if (code == 13) {
$('#login-button').click();
}
});
// Display the login dialog // Display the login dialog
$('#login-modal').modal({ show: true, keyboard: false, backdrop: false }); $('#login-modal').modal({ show: true, keyboard: false, backdrop: false });
$scope.reset = function() { $scope.reset = function() {
$('#login-form input').each( function(index) { $(this).val(''); }); $('#login-form input').each( function(index) { $(this).val(''); });
}; };
// Call the API to get an auth token // Call the API to get an auth token
$scope.systemLogin = function(username, password) { $scope.systemLogin = function(username, password) {
@@ -70,5 +77,5 @@ function Authenticate($scope, $rootScope, $location, Authorization, ToggleClass,
$('#alert-modal').modal({ show: true, keyboard: true, backdrop: 'static' }); $('#alert-modal').modal({ show: true, keyboard: true, backdrop: 'static' });
} }
}); });
} }
} }

View File

@@ -21,7 +21,7 @@ angular.module('JobEventFormDefinition', [])
readonly: true, readonly: true,
class: 'span2' class: 'span2'
}, },
event: { event_display: {
label: 'Event', label: 'Event',
type: 'text', type: 'text',
readonly: true readonly: true

View File

@@ -154,7 +154,8 @@ angular.module('JobFormDefinition', [])
type: 'textarea', type: 'textarea',
readonly: true, readonly: true,
rows: 10, rows: 10,
class: 'span12' class: 'span12',
ngShow: "result_traceback != ''"
} }
}, },
@@ -169,7 +170,7 @@ angular.module('JobFormDefinition', [])
}, },
summary: { summary: {
label: 'Hosts', label: 'Hosts',
icon: 'icon-filter', icon: 'icon-th-large',
ngClick: "jobSummary()", ngClick: "jobSummary()",
class: 'btn-info btn-small', class: 'btn-info btn-small',
awToolTip: 'View host summary', awToolTip: 'View host summary',
@@ -180,7 +181,7 @@ angular.module('JobFormDefinition', [])
icon: 'icon-list-ul', icon: 'icon-list-ul',
ngClick: "jobEvents()", ngClick: "jobEvents()",
class: 'btn-info btn-small', class: 'btn-info btn-small',
awToolTip: 'View job events', awToolTip: 'Edit job events',
mode: 'all', mode: 'all',
} }
}, },

View File

@@ -58,7 +58,7 @@ angular.module('CredentialsListDefinition', [])
ngClick: "editCredential(\{\{ credential.id \}\})", ngClick: "editCredential(\{\{ credential.id \}\})",
icon: 'icon-edit', icon: 'icon-edit',
label: 'Edit', label: 'Edit',
class: 'btn-small', class: 'btn-small btn-success',
awToolTip: 'View/Edit credential' awToolTip: 'View/Edit credential'
}, },

View File

@@ -43,7 +43,7 @@ angular.module('GroupListDefinition', [])
label: 'Edit', label: 'Edit',
ngClick: "editGroup(\{\{ group.id \}\})", ngClick: "editGroup(\{\{ group.id \}\})",
icon: 'icon-edit', icon: 'icon-edit',
class: 'btn-small', class: 'btn-small btn-success',
awToolTip: 'View/Edit group' awToolTip: 'View/Edit group'
}, },

View File

@@ -42,7 +42,7 @@ angular.module('HostListDefinition', [])
edit: { edit: {
label: 'Edit', label: 'Edit',
ngClick: "editHost(\{\{ host.id \}\})", ngClick: "editHost(\{\{ host.id \}\})",
icon: 'icon-edit', icon: 'icon-edit btn-success',
class: 'btn-small', class: 'btn-small',
awToolTip: 'View/Edit host' awToolTip: 'View/Edit host'
}, },

View File

@@ -49,7 +49,7 @@ angular.module('InventoriesListDefinition', [])
label: 'Edit', label: 'Edit',
ngClick: "editInventory(\{\{ inventory.id \}\})", ngClick: "editInventory(\{\{ inventory.id \}\})",
icon: 'icon-edit', icon: 'icon-edit',
class: 'btn-small', class: 'btn-small btn-success',
awToolTip: 'View/Edit inventory' awToolTip: 'View/Edit inventory'
}, },

View File

@@ -23,7 +23,7 @@ angular.module('JobEventsListDefinition', [])
desc: true, desc: true,
searchType: 'int' searchType: 'int'
}, },
event: { event_display: {
label: 'Event', label: 'Event',
link: true link: true
}, },
@@ -57,16 +57,16 @@ angular.module('JobEventsListDefinition', [])
mode: 'all' mode: 'all'
}, },
edit: { edit: {
label: 'View', label: 'Edit',
ngClick: "jobDetails()", ngClick: "jobDetails()",
icon: 'icon-edit', icon: 'icon-edit',
class: 'btn-small btn-success', class: 'btn-small btn-success',
awToolTip: 'View/Edit detail', awToolTip: 'Edit job details',
mode: 'all' mode: 'all'
}, },
summary: { summary: {
label: 'Hosts', label: 'Hosts',
icon: 'icon-filter', icon: 'icon-th-large',
ngClick: "jobSummary()", ngClick: "jobSummary()",
class: 'btn-info btn-small', class: 'btn-info btn-small',
awToolTip: 'View host summary', awToolTip: 'View host summary',
@@ -78,9 +78,9 @@ angular.module('JobEventsListDefinition', [])
edit: { edit: {
label: 'View', label: 'View',
ngClick: "editJobEvent(\{\{ jobevent.id \}\})", ngClick: "editJobEvent(\{\{ jobevent.id \}\})",
icon: 'icon-edit', icon: 'icon-zoom-in',
class: 'btn-small', class: 'btn-small',
awToolTip: 'View event detail', awToolTip: 'View event details',
}, },
} }
}); });

View File

@@ -62,11 +62,11 @@ angular.module('JobHostDefinition', [])
mode: 'all' mode: 'all'
}, },
edit: { edit: {
label: 'View', label: 'Edit',
icon: 'icon-edit', icon: 'icon-edit',
ngClick: "jobDetails()", ngClick: "jobDetails()",
class: 'btn-success btn-small', class: 'btn-success btn-small',
awToolTip: 'View job detail', awToolTip: 'Edit job details',
mode: 'all' mode: 'all'
}, },
events: { events: {

View File

@@ -44,8 +44,8 @@ angular.module('JobTemplatesListDefinition', [])
label: 'Edit', label: 'Edit',
ngClick: "editJobTemplate(\{\{ job_template.id \}\})", ngClick: "editJobTemplate(\{\{ job_template.id \}\})",
icon: 'icon-edit', icon: 'icon-edit',
awToolTip: 'View/Edit template', awToolTip: 'Edit template',
class: 'btn-small' class: 'btn-small btn-success'
}, },
submit: { submit: {
label: 'Launch', label: 'Launch',
@@ -53,7 +53,7 @@ angular.module('JobTemplatesListDefinition', [])
mode: 'all', mode: 'all',
class: 'btn-small btn-success', class: 'btn-small btn-success',
ngClick: 'submitJob(\{\{ job_template.id \}\})', ngClick: 'submitJob(\{\{ job_template.id \}\})',
awToolTip: 'Create and run a job using this template' awToolTip: 'Start a job using this template'
}, },
delete: { delete: {
label: 'Delete', label: 'Delete',

View File

@@ -62,14 +62,14 @@ angular.module('JobsListDefinition', [])
fieldActions: { fieldActions: {
edit: { edit: {
icon: 'icon-edit', icon: 'icon-edit',
label: 'View', label: 'Edit',
ngClick: "editJob(\{\{ job.id \}\}, '\{\{ job.name \}\}')", ngClick: "editJob(\{\{ job.id \}\}, '\{\{ job.name \}\}')",
class: 'btn-success btn-small', class: 'btn-success btn-small',
awToolTip: 'View/Edit detail', awToolTip: 'Edit job details',
}, },
summary: { summary: {
label: 'Hosts', label: 'Hosts',
icon: 'icon-filter', icon: 'icon-th-large',
ngClick: "viewSummary(\{{ job.id \}\}, '\{\{ job.name \}\}')", ngClick: "viewSummary(\{{ job.id \}\}, '\{\{ job.name \}\}')",
class: 'btn-info btn-small', class: 'btn-info btn-small',
awToolTip: 'View host summary', awToolTip: 'View host summary',

View File

@@ -42,7 +42,7 @@ angular.module('OrganizationListDefinition', [])
label: 'Edit', label: 'Edit',
ngClick: "editOrganization(\{\{ organization.id \}\})", ngClick: "editOrganization(\{\{ organization.id \}\})",
icon: 'icon-edit', icon: 'icon-edit',
class: 'btn-small', class: 'btn-small btn-success',
awToolTip: 'View/Edit organization' awToolTip: 'View/Edit organization'
}, },

View File

@@ -43,7 +43,7 @@ angular.module('ProjectsListDefinition', [])
label: 'Edit', label: 'Edit',
ngClick: "editProject(\{\{ project.id \}\})", ngClick: "editProject(\{\{ project.id \}\})",
icon: 'icon-edit', icon: 'icon-edit',
class: 'btn-small', class: 'btn-small btn-success',
awToolTip: 'View/edit project' awToolTip: 'View/edit project'
}, },

View File

@@ -49,7 +49,7 @@ angular.module('TeamsListDefinition', [])
label: 'Edit', label: 'Edit',
ngClick: "editTeam(\{\{ team.id \}\})", ngClick: "editTeam(\{\{ team.id \}\})",
icon: 'icon-edit', icon: 'icon-edit',
class: 'btn-small', class: 'btn-small btn-success',
awToolTip: 'View/Edit team' awToolTip: 'View/Edit team'
}, },

View File

@@ -48,7 +48,7 @@ angular.module('UserListDefinition', [])
label: 'Edit', label: 'Edit',
ngClick: "editUser(\{\{ user.id \}\})", ngClick: "editUser(\{\{ user.id \}\})",
icon: 'icon-edit', icon: 'icon-edit',
class: 'btn-small', class: 'btn-small btn-success',
awToolTip: 'View/Edit user' awToolTip: 'View/Edit user'
}, },

View File

@@ -11,7 +11,7 @@
<div class="control-group"> <div class="control-group">
<label class="control-label">Username:</label> <label class="control-label">Username:</label>
<div class="controls"> <div class="controls">
<input type="text" name="username" ng-model="username" required><br /> <input type="text" name="username" ng-model="username" id="login-username" required><br />
<span class="error" ng-show="loginForm.username.$dirty && loginForm.username.$error.required">A value is required!</span> <span class="error" ng-show="loginForm.username.$dirty && loginForm.username.$error.required">A value is required!</span>
<span class="errora api-error" ng-bind="usernameError"></span> <span class="errora api-error" ng-bind="usernameError"></span>
</div> </div>
@@ -19,7 +19,7 @@
<div class="control-group"> <div class="control-group">
<label class="control-label">Password:</label> <label class="control-label">Password:</label>
<div class="controls"> <div class="controls">
<input type="password" name="password" ng-model="password" required><br /> <input type="password" name="password" id="login-password" ng-model="password"><br />
<span class="error" ng-show="loginForm.password.$dirty && loginForm.password.$error.required">A value is required!</span> <span class="error" ng-show="loginForm.password.$dirty && loginForm.password.$error.required">A value is required!</span>
<span class="error api-error" ng-bind="passwordError"></span> <span class="error api-error" ng-bind="passwordError"></span>
</div> </div>
@@ -29,7 +29,7 @@
<div class="modal-footer"> <div class="modal-footer">
<button ng-click="systemLogin(loginForm.username.$modelValue,loginForm.password.$modelValue)" <button ng-click="systemLogin(loginForm.username.$modelValue,loginForm.password.$modelValue)"
ng-disabled="loginForm.$invalid || $loginForm.$pristine" ng-disabled="loginForm.$invalid || $loginForm.$pristine"
class="btn btn-primary">Sign In</button> id="login-button" class="btn btn-primary">Sign In</button>
</div> </div>
</div><!-- modal --> </div><!-- modal -->