Merge pull request #4122 from jaredevantabor/host-event-modal

Changing the codemirror on the host event modal for custom stdout
This commit is contained in:
Jared Tabor 2016-11-28 09:05:36 -08:00 committed by GitHub
commit f4f589ce19
6 changed files with 79 additions and 10 deletions

View File

@ -34,13 +34,23 @@
</div>
<!-- end of details-->
<div class="HostEvent-nav">
<!-- view navigation buttons -->
<button ui-sref="jobDetail.host-event.json" type="button" class="btn btn-sm btn-default HostEvent-tab" ng-class="{'HostEvent-tab--selected' : isActiveState('jobDetail.host-event.json')}">JSON</button>
<button ng-if="stdout" ui-sref="jobDetail.host-event.stdout" type="button" class="btn btn-sm btn-default HostEvent-tab" ng-class="{'HostEvent-tab--selected' : isActiveState('jobDetail.host-event.stdout')}">Standard Out</button>
<button ng-if="stderr" ui-sref="jobDetail.host-event.stderr" type="button" class="btn btn-sm btn-default HostEvent-tab" ng-class="{'HostEvent-tab--selected' : isActiveState('jobDetail.host-event.stderr')}">Standard Error</button>
<button ng-if="stdout" ui-sref="jobDetail.host-event.stdout"
type="button" class="btn btn-sm btn-default HostEvent-tab"
ng-class="{'HostEvent-tab--selected' : isActiveState('jobDetail.host-event.stdout')}">
Standard Out
</button>
<button ng-if="stderr" ui-sref="jobDetail.host-event.stderr"
type="button" class="btn btn-sm btn-default HostEvent-tab"
ng-class="{'HostEvent-tab--selected' : isActiveState('jobDetail.host-event.stderr')}">
Standard Error
</button>
<button ui-sref="jobDetail.host-event.json" type="button"
class="btn btn-sm btn-default HostEvent-tab"
ng-class="{'HostEvent-tab--selected' : isActiveState('jobDetail.host-event.json')}">
JSON
</button>
</div>
<div class="HostEvent-body">
<!-- views -->

View File

@ -0,0 +1,12 @@
<div class="HostEvent-stdout">
<div class="HostEvent-stdoutContainer">
<div class="HostEvent-numberColumnPreload"></div>
<div class="HostEvent-numberColumn">1</div>
<div class="HostEvent-stdoutColumn" ng-bind-html="stdout"></div>
<div class="HostEvent-numberColumn HostEvent-numberColumn--second">
2
</div>
</div>
</div>
</div>

View File

@ -105,8 +105,9 @@
margin-bottom: 8px;
}
.HostEvent .modal-body{
height: 480px;
max-height: 500px;
padding: 20px;
overflow-y: auto;
}
.HostEvent-nav{
padding-top: 12px;
@ -150,3 +151,48 @@
.HostEvent-button:disabled {
pointer-events: all!important;
}
.HostEvent-stdout{
height:200px;
width:100%
}
.HostEvent-stdoutContainer {
height:200px;
overflow-y: scroll;
overflow-x: hidden;
border-radius: 5px;
border: 1px solid #ccc;
font-style: normal;
}
.HostEvent-numberColumnPreload {
background-color: @default-no-items-bord;
height: 198px;
border-right: 1px solid #ccc;
width: 30px;
position: fixed;
}
.HostEvent-numberColumn {
background-color: @default-no-items-bord;
border-right: 1px solid #ccc;
border-bottom-left-radius: 5px;
color: #999;
font-family: monospace;
position: fixed;
padding: 4px 3px 0 5px;
text-align: right;
white-space: nowrap;
width: 30px;
}
.HostEvent-numberColumn--second{
padding-top:0px;
}
.HostEvent-stdoutColumn{
margin-left: 46px;
padding-top: 4px;
font-family: monospace;
}

View File

@ -45,13 +45,14 @@
};
var init = function(){
hostEvent.event_name = hostEvent.event;
$scope.event = _.cloneDeep(hostEvent);
$scope.hostResults = hostResults;
$scope.json = JobDetailService.processJson(hostEvent);
// grab standard out & standard error if present, and remove from the results displayed in the details panel
if (hostEvent.stdout){
$scope.stdout = parseStdoutService.prettify(hostEvent.stdout, "unstyled");
$scope.stdout = parseStdoutService.prettify(hostEvent.stdout);
delete $scope.event.stdout;
}
if (hostEvent.stderr){

View File

@ -44,14 +44,14 @@ var hostEventStdout = {
name: 'jobDetail.host-event.stdout',
url: '/stdout',
controller: 'HostEventController',
templateUrl: templateUrl('job-results/host-event/host-event-codemirror')
templateUrl: templateUrl('job-results/host-event/host-event-stdout')
};
var hostEventStderr = {
name: 'jobDetail.host-event.stderr',
url: '/stderr',
controller: 'HostEventController',
templateUrl: templateUrl('job-results/host-event/host-event-codemirror')
templateUrl: templateUrl('job-results/host-event/host-event-stdout')
};

View File

@ -69,7 +69,7 @@ export default ['$log', 'moment', function($log, moment){
return line;
}
else{
return `<a ui-sref="jobDetail.host-event.json({eventId: ${event.id}, taskId: ${event.parent} })" aw-tool-tip="Event ID: ${event.id} <br>Status: ${event.event_display} <br>Click for details" data-placement="top">${line}</a>`;
return `<a ui-sref="jobDetail.host-event.stdout({eventId: ${event.id}, taskId: ${event.parent} })" aw-tool-tip="Event ID: ${event.id} <br>Status: ${event.event_display} <br>Click for details" data-placement="top">${line}</a>`;
}
},