Latest UI changes, fixes and enhancements.

This commit is contained in:
chouseknecht
2013-10-10 03:40:30 -04:00
parent 2f135f99d4
commit 43aca1972a
23 changed files with 180 additions and 146 deletions

View File

@@ -125,6 +125,7 @@ function InventoryGroups ($scope, $rootScope, $compile, $location, $log, $routeP
// Respond to user clicking on a tree node
var node = $('li[id="' + n.attr.id + '"]');
var parent = node.parent().parent();
var type = node.attr('type');
var url;
@@ -153,6 +154,18 @@ function InventoryGroups ($scope, $rootScope, $compile, $location, $log, $routeP
scope.createButtonShow = true;
scope.group_id = node.attr('group_id');
scope.addGroupHelp = "Copy an existing group into " + node.attr('name');
scope.createGroupHelp = "Create a new group, adding it to " + node.attr('name');
scope.updateGroupHelp = "Start the inventory update process, refreshing " + node.attr('name');
if (parent.attr('id') == 'inventory-node') {
scope.deleteGroupHelp = "Remove " + node.attr('name') + " from " + parent.attr('name') +
" Inventory. Any hosts will still be available in All Hosts.";
}
else {
scope.deleteGroupHelp = "Remove " + node.attr('name') + " from " + parent.attr('name') +
". Any hosts will still be available in " + parent.attr('name') + " and All Hosts.";
}
// Load the form
GroupsEdit({ "inventory_id": id, group_id: scope.group_id });

View File

@@ -187,7 +187,8 @@ function JobEventsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
.success( function(data, status, headers, config) {
scope.job_status = data.status;
scope.job_name = data.summary_fields.job_template.name;
LoadBreadCrumbs({ path: '/jobs/' + scope.job_id, title: scope.job_name });
//LoadBreadCrumbs({ path: '/jobs/' + scope.job_id, title: scope.job_name });
LoadBreadCrumbs({ path: '/jobs/' + scope.job_id, title: scope.job_id + ' - ' + data.summary_fields.job_template.name });
if (!(data.status == 'pending' || data.status == 'waiting' || data.status == 'running')) {
if ($rootScope.timer) {
clearInterval($rootScope.timer);

View File

@@ -97,7 +97,8 @@ function JobHostSummaryList ($scope, $rootScope, $location, $log, $routeParams,
LoadBreadCrumbs({ path: '/hosts/' + scope['host_id'], title: $routeParams['host_name'] });
}
else {
LoadBreadCrumbs();
LoadBreadCrumbs({ path: '/jobs/' + scope.job_id, title: scope.job_id + ' - ' +
scope.jobhosts[0].summary_fields.job.job_template_name });
}
});

View File

@@ -11,14 +11,57 @@ angular.module('GroupFormDefinition', [])
'GroupForm', {
addTitle: 'Create Group', //Legend in add mode
editTitle: 'Group Properties: {{ name }}', //Legend in edit mode
editTitle: '{{ name }}', //Legend in edit mode
showTitle: true,
cancelButton: false,
name: 'group', //Form name attribute
well: false, //Wrap the form with TB well
well: true, //Wrap the form with TB well
formLabelSize: 'col-lg-3',
formFieldSize: 'col-lg-9',
titleActions: {
copy_action: {
'class': 'btn-success btn-xs',
ngClick: "addGroup()",
ngHide: "groupAddHide",
awToolTip: "\{\{ addGroupHelp \}\}",
dataPlacement: 'top',
ngDisabled: "grpBtnDisable",
icon: "icon-check",
label: 'Copy'
},
create_action: {
'class': 'btn-success btn-xs',
ngClick: "createGroup()",
ngHide: "groupCreateHide",
awToolTip: "\{\{ createGroupHelp \}\}",
dataPlacement: "top",
ngDisabled: "grpBtnDisable",
icon: "icon-plus",
label: "Create New"
},
update_action: {
'class': 'btn-success btn-xs',
ngClick: "updateGroup()",
ngHide: "groupUpdateHide",
awToolTip: "\{\{ updateGroupHelp \}\}",
dataPlacement: "top",
ngDisabled: "grpBtnDisable",
icon: "icon-cloud-download",
label: 'Update'
},
delete_action: {
'class': "btn-danger btn-xs",
ngClick: "deleteGroup()",
ngHide: "groupDeleteHide",
awToolTip: "\{\{ deleteGroupHelp \}\}",
dataPlacement: "top",
ngDisabled: "grpBtnDisable",
icon: "icon-trash",
label: "Delete"
}
},
fields: {
name: {
label: 'Name',

View File

@@ -77,7 +77,7 @@ angular.module('InventoryHostsFormDefinition', [])
ngHide: "hostAddHide",
awToolTip: "Copy an existing host to the selected group",
dataPlacement: 'bottom',
'class': 'btn-sm btn-success',
'class': 'btn-xs btn-success',
icon: 'icon-check'
},
create: {
@@ -86,7 +86,7 @@ angular.module('InventoryHostsFormDefinition', [])
ngHide: 'hostCreateHide',
awToolTip: 'Create a new host and add it to the selected group',
dataPlacement: 'bottom',
'class': 'btn-sm btn-success',
'class': 'btn-xs btn-success',
icon: 'icon-plus'
}
},

View File

@@ -189,8 +189,8 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
}
scope.PostRefreshRemove = scope.$on('PostRefresh', function() {
for (var i=0; i < scope.groups.length; i++) {
var last_update = null
//(scope.groups[i].last_updated == null) ? '' : FormatDate(new Date(scope.groups[i].last_updated));
var last_update = (scope.groups[i].summary_fields.inventory_source.last_updated == null) ? null :
FormatDate(new Date(scope.groups[i].summary_fields.inventory_source.last_updated));
var stat, stat_class, status_tip;
@@ -639,7 +639,7 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
})
.error( function(data, status, headers, config) {
ProcessErrors(scope, data, status, form,
{ hdr: 'Error!', msg: 'Failed to retrieve group: ' + id + '. GET status: ' + status });
{ hdr: 'Error!', msg: 'Failed to retrieve group: ' + defaultUrl + '. GET status: ' + status });
});
if (!scope.$$phase) {

View File

@@ -59,7 +59,7 @@ angular.module('JobSubmissionHelper', [ 'RestServices', 'Utilities', 'Credential
cancel();
}
else {
scope.$emit('UpdateSubmitted');
scope.$emit('UpdateSubmitted','canceled');
}
}
@@ -77,7 +77,7 @@ angular.module('JobSubmissionHelper', [ 'RestServices', 'Utilities', 'Credential
Rest.setUrl(start_url);
Rest.post(pswd)
.success( function(data, status, headers, config) {
scope.$emit('UpdateSubmitted');
scope.$emit('UpdateSubmitted','started');
if (form.name == 'credential') {
navigate(false);
}
@@ -292,7 +292,7 @@ angular.module('JobSubmissionHelper', [ 'RestServices', 'Utilities', 'Credential
if (scope.removeUpdateSubmitted) {
scope.removeUpdateSubmitted();
}
scope.removeUpdateSubmitted = scope.$on('UpdateSubmitted', function() {
scope.removeUpdateSubmitted = scope.$on('UpdateSubmitted', function(e, action) {
// Refresh the project list after update request submitted
scope.refresh();
});
@@ -376,17 +376,19 @@ angular.module('JobSubmissionHelper', [ 'RestServices', 'Utilities', 'Credential
if (scope.removeUpdateSubmitted) {
scope.removeUpdateSubmitted();
}
scope.removeUpdateSubmitted = scope.$on('UpdateSubmitted', function() {
// Refresh the project list after update request submitted
Alert('Update Started', 'The request to start the inventory process was submitted. Monitor progress from the inventory summary screen. ' +
'The screen will refresh every 10 seconds, or refresh manually by clicking the <em>Refresh</em> button.', 'alert-info');
var node = $('#inventory-node')
var selected = $('#tree-view').jstree('get_selected');
scope['inventorySummaryGroup'] = group_name;
selected.each(function(idx) {
$('#tree-view').jstree('deselect_node', $(this));
});
$('#tree-view').jstree('select_node', node);
scope.removeUpdateSubmitted = scope.$on('UpdateSubmitted', function(e, action) {
if (action == 'started') {
// Refresh the project list after update request submitted
Alert('Update Started', 'The request to start the inventory process was submitted. Monitor progress from the inventory summary screen. ' +
'The screen will refresh every 10 seconds, or refresh manually by clicking the <em>Refresh</em> button.', 'alert-info');
var node = $('#inventory-node')
var selected = $('#tree-view').jstree('get_selected');
scope['inventorySummaryGroup'] = group_name;
selected.each(function(idx) {
$('#tree-view').jstree('deselect_node', $(this));
});
$('#tree-view').jstree('select_node', node);
}
});
if (scope.removeInventorySubmit) {
@@ -408,8 +410,8 @@ angular.module('JobSubmissionHelper', [ 'RestServices', 'Utilities', 'Credential
Rest.get()
.success( function(data, status, headers, config) {
if (data.can_update) {
var extra_html = "<div class=\"inventory-passwd-msg\">Starting inventory update for the <em>" + group_name +
"</em> group. Please provide the " + group_source + " credentials:</div>\n";
var extra_html = "<div class=\"inventory-passwd-msg\">Starting inventory update for <em>" + group_name +
"</em>. Please provide the " + group_source + " credentials:</div>\n";
scope.$emit('InventorySubmit', data.passwords_needed_to_update, extra_html);
}
else {

View File

@@ -50,7 +50,7 @@ angular.module('CredentialsListDefinition', [])
mode: 'all', // One of: edit, select, all
ngClick: 'addCredential()',
basePaths: ['teams','users'], // base path must be in list, or action not available
"class": 'btn-success btn-sm',
"class": 'btn-success btn-xs',
awToolTip: 'Create a new credential'
}
},

View File

@@ -31,7 +31,7 @@ angular.module('GroupListDefinition', [])
help: {
awPopOver: "Choose groups by clicking on each group you wish to add. Click the <em>Select</em> button to add the groups to " +
"the selected inventory group.",
dataPlacement: 'left',
dataPlacement: 'top',
dataContainer: '#form-modal .modal-content',
icon: "icon-question-sign",
mode: 'all',

View File

@@ -31,7 +31,7 @@ angular.module('HostListDefinition', [])
actions: {
help: {
awPopOver: "Select hosts by clicking on each host you wish to add. Add the selected hosts to the group by clicking the <em>Select</em> button.",
dataPlacement: 'left',
dataPlacement: 'top',
dataContainer: '#form-modal .modal-content',
icon: "icon-question-sign",
mode: 'all',

View File

@@ -79,7 +79,7 @@ angular.module('InventoriesListDefinition', [])
icon: 'icon-plus',
mode: 'all', // One of: edit, select, all
ngClick: 'addInventory()',
"class": 'btn-sm btn-success',
"class": 'btn-xs btn-success',
awToolTip: 'Create a new inventory'
}
},

View File

@@ -14,7 +14,7 @@ angular.module('InventorySummaryDefinition', [])
iterator: 'group',
editTitle: 'Inventory Summary: {{ inventory_name }}',
showTitle: true,
well: false,
well: true,
index: false,
hover: true,
@@ -32,7 +32,7 @@ angular.module('InventorySummaryDefinition', [])
awToolTip: '# of hosts with job failures. Click to view hosts.',
dataPlacement: 'top',
searchable: false,
nosort: true
nosort: false
},
status: {
label: 'Update<br>Status',
@@ -55,8 +55,10 @@ angular.module('InventorySummaryDefinition', [])
},
last_updated: {
label: 'Last<br>Updated',
sourceModel: 'inventory_source',
sourceField: 'last_updated',
searchable: false,
nosort: true
nosort: false
},
source: {
label: 'Source',
@@ -95,9 +97,16 @@ angular.module('InventorySummaryDefinition', [])
},
actions: {
refresh: {
awRefresh: true,
mode: 'all'
create: {
label: 'Create New',
mode: 'all',
icon: 'icon-plus',
'class': "btn-success btn-xs",
ngClick: "createGroup()",
ngHide: "groupCreateHide",
ngDisabled: 'grpBtnDisabled',
awToolTip: "Create a new top-level group",
dataPlacement: 'top'
},
help: {
awPopOver:
@@ -108,14 +117,18 @@ angular.module('InventorySummaryDefinition', [])
"<dt>successful</dt><dd>The most recent inventory update ran to completion without incident.</dd>\n" +
"<dt>updating</dt><dd>The inventory update is currently running.</dd>\n" +
"</dl>\n",
dataPlacement: 'left',
dataPlacement: 'top',
dataContainer: 'body',
icon: "icon-question-sign",
mode: 'all',
'class': 'btn-xs btn-info btn-help pull-right',
'class': 'btn-xs btn-info btn-help',
awToolTip: 'Click for help',
dataTitle: 'Update Status',
iconSize: 'large'
},
refresh: {
awRefresh: true,
mode: 'all'
}
},

View File

@@ -102,11 +102,6 @@ angular.module('JobHostDefinition', [])
},
actions: {
refresh: {
awRefresh: true,
ngShow: "host_id == null && (job_status == 'pending' || job_status == 'waiting' || job_status == 'running')",
mode: 'all'
},
help: {
awPopOver: "<dl>\n<dt>Success</dt><dd>Tasks successfully executed on the host.</dd>\n" +
"<dt>Changed</dt><dd>Actions taken on the host.</dd>\n" +
@@ -114,15 +109,20 @@ angular.module('JobHostDefinition', [])
"<dt>Unreachable</dt><dd>Times the ansible server could not reach the host.</dd>\n" +
"<dt>Skipped</dt><dd>Tasks bypassed and not performed on the host due to prior task failure or the host being unreachable.</dd>\n" +
"</dl>\n",
dataPlacement: 'left',
dataPlacement: 'top',
dataContainer: "body",
icon: "icon-question-sign",
mode: 'all',
'class': 'btn-info btn-xs btn-help pull-right',
'class': 'btn-info btn-xs btn-help',
awToolTip: 'Click for help',
dataTitle: 'Job Host Summary',
id: 'jobhost-help-button',
iconSize: 'large'
},
refresh: {
awRefresh: true,
ngShow: "host_id == null && (job_status == 'pending' || job_status == 'waiting' || job_status == 'running')",
mode: 'all'
}
},

View File

@@ -34,7 +34,7 @@ angular.module('JobTemplatesListDefinition', [])
icon: 'icon-plus',
mode: 'all', // One of: edit, select, all
ngClick: 'addJobTemplate()',
"class": 'btn-success btn-sm',
"class": 'btn-success btn-xs',
basePaths: ['job_templates'],
awToolTip: 'Create a new template'
}

View File

@@ -33,7 +33,7 @@ angular.module('OrganizationListDefinition', [])
icon: 'icon-plus',
mode: 'all', // One of: edit, select, all
ngClick: 'addOrganization()',
"class": 'btn-success btn-sm',
"class": 'btn-success btn-xs',
awToolTip: 'Create a new organization'
}
},

View File

@@ -47,7 +47,7 @@ angular.module('PermissionListDefinition', [])
label: 'Create New',
mode: 'all', // One of: edit, select, all
ngClick: 'addPermission()',
"class": 'btn-success btn-sm',
"class": 'btn-success btn-xs',
awToolTip: 'Add a new permission',
ngShow: 'PermissionAddAllowed'
}

View File

@@ -49,13 +49,9 @@ angular.module('ProjectsListDefinition', [])
icon: 'icon-plus',
mode: 'all', // One of: edit, select, all
ngClick: 'addProject()',
"class": 'btn-success btn-sm',
"class": 'btn-success btn-xs',
awToolTip: 'Create a new project'
},
refresh: {
awRefresh: true,
mode: 'all'
},
help: {
awPopOver: "<dl>\n<dt>Updating</dt><dd>An SCM update is in progress.</dd>\n" +
"<dt>Never Updated</dt><dd>No SCM update has ever run for the project.</dd>\n" +
@@ -64,14 +60,18 @@ angular.module('ProjectsListDefinition', [])
"<dt>Missing</dt><dd>The local project directory is missing.</dd>\n" +
"<dt>N/A</dt><dd>The project does not use SCM, so an update status is not available.</dd>\n" +
"</dl>\n",
dataPlacement: 'left',
dataPlacement: 'top',
dataContainer: 'body',
icon: "icon-question-sign",
mode: 'all',
'class': 'btn-xs btn-info btn-help pull-right',
'class': 'btn-xs btn-info btn-help',
awToolTip: 'Click for help',
dataTitle: 'Project Status',
iconSize: 'large'
},
refresh: {
awRefresh: true,
mode: 'all'
}
},

View File

@@ -40,7 +40,7 @@ angular.module('TeamsListDefinition', [])
icon: 'icon-plus',
mode: 'all', // One of: edit, select, all
ngClick: 'addTeam()',
"class": 'btn-sm btn-success',
"class": 'btn-xs btn-success',
awToolTip: 'Create a new team'
}
},

View File

@@ -40,7 +40,7 @@ angular.module('UserListDefinition', [])
mode: 'all', // One of: edit, select, all
ngClick: 'addUser()',
basePaths: ['organizations','users'], // base path must be in list, or action not available
"class": 'btn-success btn-sm',
"class": 'btn-success btn-xs',
awToolTip: 'Create a new user'
}
},