mirror of
https://github.com/ansible/awx.git
synced 2026-05-06 00:47:37 -02:30
Key column on a list view is now clickable -taking you to the detail page. Moved action buttons to top of page next to search widget. Added finishing touches to job submission on job_templates list view.
This commit is contained in:
@@ -231,4 +231,15 @@
|
|||||||
.no-padding {
|
.no-padding {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.search-widget {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-actions {
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: top;
|
||||||
|
margin-left: 15px;
|
||||||
|
margin-top: 3px;
|
||||||
|
}
|
||||||
|
|||||||
@@ -128,6 +128,7 @@ function JobTemplatesList ($scope, $rootScope, $location, $log, $routeParams, Re
|
|||||||
function postJob(data) {
|
function postJob(data) {
|
||||||
// Once we have a credential and all required passwords, use this
|
// Once we have a credential and all required passwords, use this
|
||||||
// to create and start a job
|
// to create and start a job
|
||||||
|
(scope.credentialWatchRemove) ? scope.credentialWatchRemove() : null;
|
||||||
var dt = new Date().toISOString();
|
var dt = new Date().toISOString();
|
||||||
Rest.setUrl(data.related.jobs);
|
Rest.setUrl(data.related.jobs);
|
||||||
Rest.post({
|
Rest.post({
|
||||||
@@ -165,13 +166,17 @@ function JobTemplatesList ($scope, $rootScope, $location, $log, $routeParams, Re
|
|||||||
// Create a job record
|
// Create a job record
|
||||||
if (data.credential == '' || data.credential == null) {
|
if (data.credential == '' || data.credential == null) {
|
||||||
// Template does not have credential, prompt for one
|
// Template does not have credential, prompt for one
|
||||||
scope.$watch('credential', function(newVal, oldVal) {
|
if (scope.credentialWatchRemove) {
|
||||||
|
scope.credentialWatchRemove();
|
||||||
|
}
|
||||||
|
scope.credentialWatchRemove = scope.$watch('credential', function(newVal, oldVal) {
|
||||||
if (newVal !== oldVal) {
|
if (newVal !== oldVal) {
|
||||||
console.log('credential is: ' + scope.credential);
|
|
||||||
// After user selects a credential from the modal,
|
// After user selects a credential from the modal,
|
||||||
// submit the job
|
// submit the job
|
||||||
data.credential = scope.credential;
|
if (scope.credential != '' && scope.credential !== null && scope.credential !== undefined) {
|
||||||
postJob(data);
|
data.credential = scope.credential;
|
||||||
|
postJob(data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
LookUpInit({
|
LookUpInit({
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ angular.module('AdminListDefinition', [])
|
|||||||
selectTitle: 'Add Administrators',
|
selectTitle: 'Add Administrators',
|
||||||
editTitle: 'Admins',
|
editTitle: 'Admins',
|
||||||
selectInstructions: 'Click the Select checkbox next to each user to be added. Click the Finished button when done.',
|
selectInstructions: 'Click the Select checkbox next to each user to be added. Click the Finished button when done.',
|
||||||
|
base: 'users',
|
||||||
|
|
||||||
fields: {
|
fields: {
|
||||||
username: {
|
username: {
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ angular.module('CredentialsListDefinition', [])
|
|||||||
mode: 'all', // One of: edit, select, all
|
mode: 'all', // One of: edit, select, all
|
||||||
ngClick: 'addCredential()',
|
ngClick: 'addCredential()',
|
||||||
basePaths: ['credentials'], // base path must be in list, or action not available
|
basePaths: ['credentials'], // base path must be in list, or action not available
|
||||||
class: 'btn btn-mini btn-success',
|
class: 'btn btn-success',
|
||||||
awToolTip: 'Create a new credential'
|
awToolTip: 'Create a new credential'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ angular.module('GroupListDefinition', [])
|
|||||||
icon: 'icon-plus',
|
icon: 'icon-plus',
|
||||||
mode: 'all', // One of: edit, select, all
|
mode: 'all', // One of: edit, select, all
|
||||||
ngClick: 'addGroup()',
|
ngClick: 'addGroup()',
|
||||||
class: 'btn btn-mini btn-success',
|
class: 'btn btn-success',
|
||||||
awToolTip: 'Create a new group'
|
awToolTip: 'Create a new group'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ angular.module('HostListDefinition', [])
|
|||||||
icon: 'icon-plus',
|
icon: 'icon-plus',
|
||||||
mode: 'all', // One of: edit, select, all
|
mode: 'all', // One of: edit, select, all
|
||||||
ngClick: 'addHost()',
|
ngClick: 'addHost()',
|
||||||
class: 'btn btn-mini btn-success',
|
class: 'btn btn-success',
|
||||||
awToolTip: 'Create a new host'
|
awToolTip: 'Create a new host'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ angular.module('InventoriesListDefinition', [])
|
|||||||
icon: 'icon-plus',
|
icon: 'icon-plus',
|
||||||
mode: 'all', // One of: edit, select, all
|
mode: 'all', // One of: edit, select, all
|
||||||
ngClick: 'addInventory()',
|
ngClick: 'addInventory()',
|
||||||
class: 'btn btn-mini btn-success',
|
class: 'btn btn-success',
|
||||||
awToolTip: 'Create a new row'
|
awToolTip: 'Create a new row'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ angular.module('JobTemplatesListDefinition', [])
|
|||||||
icon: 'icon-plus',
|
icon: 'icon-plus',
|
||||||
mode: 'all', // One of: edit, select, all
|
mode: 'all', // One of: edit, select, all
|
||||||
ngClick: 'addJobTemplate()',
|
ngClick: 'addJobTemplate()',
|
||||||
class: 'btn btn-mini btn-success',
|
class: 'btn btn-success',
|
||||||
basePaths: ['job_templates'],
|
basePaths: ['job_templates'],
|
||||||
awToolTip: 'Create a new template'
|
awToolTip: 'Create a new template'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ angular.module('OrganizationListDefinition', [])
|
|||||||
icon: 'icon-plus',
|
icon: 'icon-plus',
|
||||||
mode: 'all', // One of: edit, select, all
|
mode: 'all', // One of: edit, select, all
|
||||||
ngClick: 'addOrganization()',
|
ngClick: 'addOrganization()',
|
||||||
class: 'btn btn-mini btn-success',
|
class: 'btn btn-success',
|
||||||
awToolTip: 'Create a new row'
|
awToolTip: 'Create a new row'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ angular.module('ProjectsListDefinition', [])
|
|||||||
icon: 'icon-plus',
|
icon: 'icon-plus',
|
||||||
mode: 'all', // One of: edit, select, all
|
mode: 'all', // One of: edit, select, all
|
||||||
ngClick: 'addProject()',
|
ngClick: 'addProject()',
|
||||||
class: 'btn btn-mini btn-success',
|
class: 'btn btn-success',
|
||||||
awToolTip: 'Create a new project'
|
awToolTip: 'Create a new project'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ angular.module('TeamsListDefinition', [])
|
|||||||
icon: 'icon-plus',
|
icon: 'icon-plus',
|
||||||
mode: 'all', // One of: edit, select, all
|
mode: 'all', // One of: edit, select, all
|
||||||
ngClick: 'addTeam()',
|
ngClick: 'addTeam()',
|
||||||
class: 'btn btn-mini btn-success',
|
class: 'btn btn-success',
|
||||||
awToolTip: 'Create a new team'
|
awToolTip: 'Create a new team'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ angular.module('UserListDefinition', [])
|
|||||||
selectTitle: 'Add Users',
|
selectTitle: 'Add Users',
|
||||||
editTitle: 'Users',
|
editTitle: 'Users',
|
||||||
selectInstructions: 'Check the Select checkbox next to each user to be added, and click Finished when done. Use the green <i class=\"icon-plus\"></i> button to create a new user.',
|
selectInstructions: 'Check the Select checkbox next to each user to be added, and click Finished when done. Use the green <i class=\"icon-plus\"></i> button to create a new user.',
|
||||||
editInstructions: 'Create new users from the Organizations tab. Each Organizaton has an associated list of Users.',
|
editInstructions: 'Create new users from the Organizations tab. Each Organization has an associated list of Users.',
|
||||||
|
|
||||||
fields: {
|
fields: {
|
||||||
username: {
|
username: {
|
||||||
@@ -36,7 +36,7 @@ angular.module('UserListDefinition', [])
|
|||||||
mode: 'select', // One of: edit, select, all
|
mode: 'select', // One of: edit, select, all
|
||||||
ngClick: 'addUser()',
|
ngClick: 'addUser()',
|
||||||
basePaths: ['organizations'], // base path must be in list, or action not available
|
basePaths: ['organizations'], // base path must be in list, or action not available
|
||||||
class: 'btn btn-mini btn-success',
|
class: 'btn btn-success',
|
||||||
awToolTip: 'Create a new user'
|
awToolTip: 'Create a new user'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -129,19 +129,20 @@ angular.module('ListGenerator', ['GeneratorHelpers',])
|
|||||||
if (options.mode != 'lookup') {
|
if (options.mode != 'lookup') {
|
||||||
//actions
|
//actions
|
||||||
base = $location.path().replace(/^\//,'').split('/')[0];
|
base = $location.path().replace(/^\//,'').split('/')[0];
|
||||||
html += "<div class=\"text-right\">\n";
|
html += "<div class=\"list-actions\">\n";
|
||||||
for (action in list.actions) {
|
for (action in list.actions) {
|
||||||
if (list.actions[action].mode == 'all' || list.actions[action].mode == options.mode) {
|
if (list.actions[action].mode == 'all' || list.actions[action].mode == options.mode) {
|
||||||
if ( (list.basePaths == undefined) || (list.basePaths && list.basePaths.indexOf(base) > -1) ) {
|
if ( (list.basePaths == undefined) || (list.basePaths && list.basePaths.indexOf(base) > -1) ) {
|
||||||
html += "<button " + this.attr(list.actions[action], 'ngClick') +
|
html += "<button " + this.attr(list.actions[action], 'ngClick') +
|
||||||
this.attr(list.actions[action], 'class');
|
"class=\"btn-small " + list.actions[action].class + "\" ";
|
||||||
html += (list.actions[action].awToolTip) ? this.attr(list.actions[action],'awToolTip') : "";
|
html += (list.actions[action].awToolTip) ? this.attr(list.actions[action],'awToolTip') : "";
|
||||||
html += " >" + this.icon(list.actions[action].icon) + "</button> ";
|
html += " >" + this.icon(list.actions[action].icon) + "</button> ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (options.mode == 'select') {
|
if (options.mode == 'select') {
|
||||||
html += " <button class=\"btn btn-mini btn-success\" ng-click=\"finishSelection()\"><i class=\"icon-ok\"></i> Finished</button>\n";
|
html += " <button class=\"btn btn-small btn-success\" aw-tool-tip=\"Complete your selection\" " +
|
||||||
|
"ng-click=\"finishSelection()\"><i class=\"icon-ok\"></i> Finished</button>\n";
|
||||||
}
|
}
|
||||||
html += "</div>\n";
|
html += "</div>\n";
|
||||||
}
|
}
|
||||||
@@ -174,14 +175,27 @@ angular.module('ListGenerator', ['GeneratorHelpers',])
|
|||||||
html += ">\n";
|
html += ">\n";
|
||||||
html += "<td class=\"index-column\">{{ $index + (" + list.iterator + "Page * " + list.iterator + "PageSize) + 1 }}.</td>\n";
|
html += "<td class=\"index-column\">{{ $index + (" + list.iterator + "Page * " + list.iterator + "PageSize) + 1 }}.</td>\n";
|
||||||
var cnt = 2;
|
var cnt = 2;
|
||||||
|
var base = (list.base) ? list.base : list.name;
|
||||||
for (fld in list.fields) {
|
for (fld in list.fields) {
|
||||||
cnt++;
|
cnt++;
|
||||||
if (! list.fields[fld].ngBind) {
|
if (! list.fields[fld].ngBind) {
|
||||||
html += "<td class=\"" + fld + "-column\">{{" + list.iterator + "." + fld + "}}</td>\n";
|
html += "<td class=\"" + fld + "-column\">";
|
||||||
|
if (list.fields[fld].key) {
|
||||||
|
html += "<a href=\"#/" + base + "/{{" + list.iterator + ".id }}\">";
|
||||||
|
}
|
||||||
|
html += "{{" + list.iterator + "." + fld + "}}";
|
||||||
|
html += (list.fields[fld].key) ? "</a>" : "";
|
||||||
|
html += "</td>\n";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
html += "<td class=\"" + fld + "-column\">{{ " + list.fields[fld].ngBind + " }}</td>\n";
|
html += "<td class=\"" + fld + "-column\">";
|
||||||
}
|
if (list.fields[fld].key) {
|
||||||
|
html += "<a href=\"#/" + base + "/{{" + list.iterator + ".id }}\">";
|
||||||
|
}
|
||||||
|
html += "{{ " + list.fields[fld].ngBind + " }}";
|
||||||
|
html += (list.fields[fld].key) ? "</a>" : "";
|
||||||
|
html += "</td>\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.mode == 'select' ) {
|
if (options.mode == 'select' ) {
|
||||||
@@ -226,6 +240,7 @@ angular.module('ListGenerator', ['GeneratorHelpers',])
|
|||||||
else {
|
else {
|
||||||
html += PaginateWidget({ set: list.name, iterator: list.iterator, mini: true });
|
html += PaginateWidget({ set: list.name, iterator: list.iterator, mini: true });
|
||||||
}
|
}
|
||||||
|
console.log(html);
|
||||||
return html;
|
return html;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user