Job detail page re-refactor

Fixed host link on event viewer and tooltip on dialog.
Tightened up job tab page row calculation. It now assumes rows will not hit 47px height until width drops to below 1350px.
This commit is contained in:
Chris Houseknecht 2014-07-10 13:15:07 -04:00
parent 3f53fc97b2
commit bfc8f89205
4 changed files with 18 additions and 13 deletions

View File

@ -10,7 +10,7 @@
'use strict';
function JobsListController ($scope, $compile, $routeParams, ClearScope, Breadcrumbs, LoadBreadCrumbs, LoadSchedulesScope, LoadJobsScope, RunningJobsList, CompletedJobsList, QueuedJobsList,
function JobsListController ($log, $scope, $compile, $routeParams, ClearScope, Breadcrumbs, LoadBreadCrumbs, LoadSchedulesScope, LoadJobsScope, RunningJobsList, CompletedJobsList, QueuedJobsList,
ScheduledJobsList, GetChoices, GetBasePath, Wait, Socket) {
ClearScope();
@ -234,9 +234,11 @@ function JobsListController ($scope, $compile, $routeParams, ClearScope, Breadcr
//doch = $(window).height(),
available_height,
search_row, page_row, height, header, row_height;
$log.debug('docw: ' + docw);
if (docw > 1200) {
// customize the container height and # of rows based on available viewport height
available_height = $(window).height() - $('#main-menu-container .navbar').outerHeight() - 80;
$log.debug('available_height: ' + available_height);
$('.jobs-list-container').each(function() {
$(this).height(Math.floor(available_height / 2));
});
@ -244,7 +246,7 @@ function JobsListController ($scope, $compile, $routeParams, ClearScope, Breadcr
page_row = Math.max($('.page-row:eq(0)').outerHeight(), 33);
header = Math.max($('#completed_jobs_table thead').height(), 24);
height = Math.floor(available_height / 2) - header - page_row - search_row - 30;
row_height = (docw < 1415) ? 47 : 27;
row_height = (docw < 1350) ? 47 : 27;
max_rows = Math.floor(height / row_height);
}
else {
@ -254,6 +256,7 @@ function JobsListController ($scope, $compile, $routeParams, ClearScope, Breadcr
});
max_rows = 5;
}
$log.debug('max_rows: ' + max_rows);
}
// Set container height and return the number of allowed rows
@ -270,7 +273,7 @@ function JobsListController ($scope, $compile, $routeParams, ClearScope, Breadcr
}
}
JobsListController.$inject = [ '$scope', '$compile', '$routeParams', 'ClearScope', 'Breadcrumbs', 'LoadBreadCrumbs', 'LoadSchedulesScope', 'LoadJobsScope', 'RunningJobsList', 'CompletedJobsList',
JobsListController.$inject = [ '$log', '$scope', '$compile', '$routeParams', 'ClearScope', 'Breadcrumbs', 'LoadBreadCrumbs', 'LoadSchedulesScope', 'LoadJobsScope', 'RunningJobsList', 'CompletedJobsList',
'QueuedJobsList', 'ScheduledJobsList', 'GetChoices', 'GetBasePath', 'Wait', 'Socket' ];
function JobsEdit($scope, $rootScope, $compile, $location, $log, $routeParams, JobForm, JobTemplateForm, GenerateForm, Rest,

View File

@ -7,7 +7,7 @@
'use strict';
angular.module('EventViewerHelper', ['ModalDialog', 'Utilities', 'EventsViewerFormDefinition'])
angular.module('EventViewerHelper', ['ModalDialog', 'Utilities', 'EventsViewerFormDefinition', 'HostsHelper'])
.factory('EventViewer', ['$compile', 'CreateDialog', 'GetEvent', 'Wait', 'EventAddTable', 'GetBasePath', 'LookUpName', 'Empty', 'EventAddPreFormattedText',
function($compile, CreateDialog, GetEvent, Wait, EventAddTable, GetBasePath, LookUpName, Empty, EventAddPreFormattedText) {
@ -225,10 +225,10 @@ angular.module('EventViewerHelper', ['ModalDialog', 'Utilities', 'EventsViewerFo
html += $filter('date')(obj[key], 'MM/dd/yy HH:mm:ss');
}
}
else if (key === "host_name") {
html += "<a href=\"#/home/hosts/?id=" + obj.host_id + "\" target=\"_blank\" " +
"aw-tool-tip=\"Click to edit host.\" data-placement=\"right\" " +
"ng-click=\"modalOK()\">" + obj[key] + "</a>";
else if (key === "host_name" && obj.host_id) {
html += "<a href=\"/#/home/hosts/?id=" + obj.host_id + "\" target=\"_blank\" " +
"aw-tool-tip=\"View host. Opens in new tab or window.\" data-placement=\"top\" " +
">" + obj[key] + "</a>";
}
else {
html += obj[key];

View File

@ -38,7 +38,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'Utilities', 'ListGenerator
// Returns scope of form.
//
var element, fld, set, show;
var element, fld, set, show, self = this;
if (options.modal) {
if (options.modal_body_id) {
@ -190,13 +190,15 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'Utilities', 'ListGenerator
});
}
if (!this.scope.$$phase) {
if (self.scope && !self.scope.$$phase) {
setTimeout(function() {
this.scope.$digest();
if (self.scope) {
self.scope.$digest();
}
}, 100);
}
return this.scope;
return self.scope;
},

View File

@ -311,7 +311,7 @@
<a href="" ng-click="hostEventsViewer(host.id, host.name, 'changed')" aw-tool-tip="Changed" data-placement="top" ng-hide="host.changed == 0"><span class="badge changed-hosts">{{ host.changed }}</span></a>
<a href="" ng-click="hostEventsViewer(host.id, host.name, 'unreachable')" aw-tool-tip="Unreachable" data-placement="top" ng-hide="host.unreachable == 0"><span class="badge unreachable-hosts">{{ host.unreachable }}</span></a>
<a href="" ng-click="hostEventsViewer(host.id, host.name, 'failed')" aw-tool-tip="Failed" data-placement="top" ng-hide="host.failed == 0"><span class="badge failed-hosts">{{ host.failed }}</span></a></td>
<td class="col-lg-1 col-md-1 col-sm-1 col-xs-1"><a href="" ng-click="editHost(host.id)" aw-tool-tip="Edit host" data-placement="top"><i class="fa fa-pencil"></i></a></td>
<td class="col-lg-1 col-md-1 col-sm-1 col-xs-1"><a ng-show="host.id" href="" ng-click="editHost(host.id)" aw-tool-tip="Edit host" data-placement="top"><i class="fa fa-pencil"></i></a></td>
</tr>
<tr ng-show="summaryList.length === 0">
<td colspan="2" class="col-lg-12 loading-info">No matching hosts</td>