Skip to content

Commit

Permalink
Merge pull request #6157 from rundeck/nu-execution-viewer
Browse files Browse the repository at this point in the history
New Execution viewer release work
  • Loading branch information
gschueler committed Jun 23, 2020
2 parents c8566cf + 1c4006a commit e7ba195
Show file tree
Hide file tree
Showing 381 changed files with 74,854 additions and 15,428 deletions.
10 changes: 8 additions & 2 deletions rundeckapp/grails-app/assets/javascripts/executionStateKO.js
Expand Up @@ -928,8 +928,8 @@ function NodeFlowViewModel(workflow, outputUrl, nodeStateUpdateUrl, multiworkflo
{id: 'output', title: 'Log Output'},
];

if (window._rundeck.feature.betaExecOutputViewer.enabled === true) {
tabs.push({id: 'output-beta', title: 'Log Output Beta'});
if (window._rundeck.feature.legacyExecOutputViewer.enabled === true) {
tabs.push({id: 'output-legacy', title: 'Log Output Legacy'});
}

self.tabs = ko.observableArray(data.tabs || tabs)
Expand Down Expand Up @@ -1127,6 +1127,12 @@ function NodeFlowViewModel(workflow, outputUrl, nodeStateUpdateUrl, multiworkflo
}
};
self.showOutput= function (nodestep) {
if (!window._rundeck.feature?.legacyExecOutputViewer?.enabled) {
/** Kick the event out to Vue Land and let the new viewer handle display */
window._rundeck.eventBus.$emit('ko-exec-show-output', nodestep)
return
}

var node=nodestep.node.name;
var stepctx=nodestep.stepctx;
var sel = '.wfnodeoutput[data-node="' + node + '"]';
Expand Down
15 changes: 13 additions & 2 deletions rundeckapp/grails-app/assets/javascripts/framework/adhoc.js
Expand Up @@ -110,6 +110,8 @@ function startRunFollow(data) {
mode: 'tail'
}), function (resp, status, jqxhr) {
if (status == 'success') {
/** Kick this event into Vue Land */
window._rundeck.eventBus.$emit('ko-adhoc-running', data)
Element.show('runcontent');
_initAffix();
var nodeflowvm=continueRunFollow(data);
Expand Down Expand Up @@ -154,7 +156,6 @@ function continueRunFollow(data) {
//truncateToTail: false,
execData: {},
appLinks: appLinks,
onComplete: onRunComplete,
// dobind: true
});
var nodeflowvm=new NodeFlowViewModel(
Expand Down Expand Up @@ -184,15 +185,25 @@ function continueRunFollow(data) {
reloadInterval:1500
});
nodeflowvm.followFlowState(flowState);
nodeflowvm.logoutput().beginFollowingOutput(data.id);
if (window._rundeck.feature?.legacyExecOutputViewer?.enabled)
nodeflowvm.logoutput().beginFollowingOutput(data.id);

flowState.beginFollowing();
/** Base the complete event on the flow view instead of the "log"
* so it will kick if the legacy log viewer is disabled */
nodeflowvm.completed.subscribe(onCompletedChange)
var oldControl=adhocCommand.followControl;
adhocCommand.followControl=followControl;
if(oldControl){
oldControl.stopFollowingOutput();
}
return nodeflowvm;
}

function onCompletedChange(val) {
if (val == true)
onRunComplete()
}
function onRunComplete() {
adhocCommand.running(false);
afterRun();
Expand Down
12 changes: 6 additions & 6 deletions rundeckapp/grails-app/assets/scss/paper/_select.scss
Expand Up @@ -84,9 +84,9 @@
border-radius:10px;
}

@include select('default', $default-color)
@include select('info', $info-color)
@include select('primary', $primary-color)
@include select('success', $success-color)
@include select('warning', $warning-color)
@include select('danger', $danger-color)
@include select('default', $default-color);
@include select('info', $info-color);
@include select('primary', $primary-color);
@include select('success', $success-color);
@include select('warning', $warning-color);
@include select('danger', $danger-color);
10 changes: 5 additions & 5 deletions rundeckapp/grails-app/assets/scss/paper/_slider.scss
Expand Up @@ -22,8 +22,8 @@
}
}

@include slider('info', $info-color)
@include slider('primary', $primary-color)
@include slider('success', $success-color)
@include slider('warning', $warning-color)
@include slider('danger', $danger-color)
@include slider('info', $info-color);
@include slider('primary', $primary-color);
@include slider('success', $success-color);
@include slider('warning', $warning-color);
@include slider('danger', $danger-color);
Expand Up @@ -256,8 +256,8 @@
}
}

@include pagination($primary-color, 'primary')
@include pagination($info-color, 'info')
@include pagination($success-color, 'success')
@include pagination($warning-color, 'warning')
@include pagination($danger-color, 'danger')
@include pagination($primary-color, 'primary');
@include pagination($info-color, 'info');
@include pagination($success-color, 'success');
@include pagination($warning-color, 'warning');
@include pagination($danger-color, 'danger');
10 changes: 5 additions & 5 deletions rundeckapp/grails-app/assets/scss/paper/_tags.scss
Expand Up @@ -31,8 +31,8 @@

}

@include tag('info', $info-color)
@include tag('primary', $primary-color)
@include tag('success', $success-color)
@include tag('warning', $warning-color)
@include tag('danger', $danger-color)
@include tag('info', $info-color);
@include tag('primary', $primary-color);
@include tag('success', $success-color);
@include tag('warning', $warning-color);
@include tag('danger', $danger-color);
2 changes: 1 addition & 1 deletion rundeckapp/grails-app/conf/application.groovy
Expand Up @@ -26,7 +26,7 @@ environments {
rundeck.feature.workflowDynamicStepSummaryGUI.enabled = true
rundeck.feature.cleanExecutionsHistoryJob.enabled = true
rundeck.feature.executionLifecyclePlugin.enabled = true
rundeck.feature.betaExecOutputViewer.enabled = true
rundeck.feature.legacyExecOutputViewer.enabled = false
dataSource {
dbCreate = "create-drop" // one of 'create', 'create-drop','update'
url = "jdbc:h2:file:./db/devDb"
Expand Down
2 changes: 1 addition & 1 deletion rundeckapp/grails-app/i18n/messages.properties
Expand Up @@ -354,7 +354,7 @@ execution.show.mode.Annotated.desc=View all output in grouped contexts sequentia
execution.show.mode.Compact.desc=View all output collated by node
execution.show.mode.Compact.title=Lines Grouped by Node
execution.show.mode.Log.title=Log Output
execution.show.mode.LogBeta.title=Log Output Beta
execution.show.mode.LogLegacy.title=Log Output Legacy
execution.show.mode.Tail.title=Tail Output

execution.log.storage.state.PENDING_REMOTE=Waiting for log output to become available...
Expand Down
2 changes: 1 addition & 1 deletion rundeckapp/grails-app/i18n/messages_es_419.properties
Expand Up @@ -346,7 +346,7 @@ execution.show.mode.Annotated.desc=Ver todas las salidas en contextos agrupados
execution.show.mode.Compact.desc=Ver todas las salidas reunidas por nodos
execution.show.mode.Compact.title=Por Nodo
execution.show.mode.Log.title=Salida de registo
execution.show.mode.LogBeta.title=Salida de registo beta
execution.show.mode.LogLegacy.title=Salida de registo legado
execution.show.mode.Tail.title=Salida de Cola

execution.log.storage.state.PENDING_REMOTE=Esperando que la salida del registro esté disponible...
Expand Down
39 changes: 18 additions & 21 deletions rundeckapp/grails-app/views/execution/show.gsp
Expand Up @@ -65,7 +65,7 @@
<asset:javascript src="workflow.test.js"/>
<asset:javascript src="util/compactMapList.test.js"/>
</g:if>
<g:jsMessages codes="['execution.show.mode.Log.title','execution.show.mode.LogBeta.title','execution.page.show.tab.Nodes.title']"/>
<g:jsMessages codes="['execution.show.mode.Log.title','execution.show.mode.LogLegacy.title','execution.page.show.tab.Nodes.title']"/>

<asset:stylesheet href="static/css/pages/project-dashboard.css"/>
<g:jsMessages code="jobslist.date.format.ko,select.all,select.none,delete.selected.executions,cancel.bulk.delete,cancel,close,all,bulk.delete,running"/>
Expand Down Expand Up @@ -174,12 +174,10 @@ search
})
</g:javascript>
<asset:javascript src="static/pages/project-activity.js" defer="defer"/>

<feature:enabled name="betaExecOutputViewer">
<asset:stylesheet href="static/css/chunk-vendors.css"/>
<asset:stylesheet href="static/css/components/execution-log.css"/>
<asset:javascript src="static/components/execution-log.js" defer="defer"/>
</feature:enabled>

<asset:stylesheet href="static/css/chunk-vendors.css"/>
<asset:stylesheet href="static/css/pages/execution-show.css"/>
<asset:javascript src="static/pages/execution-show.js" defer="defer"/>
</head>
<g:set var="isAdhoc" value="${!scheduledExecution && execution.workflow.commands.size() == 1}"/>
<body id="executionShowPage">
Expand Down Expand Up @@ -610,7 +608,7 @@ search

<span data-bind="visible: completed()" class="execution-action-links pull-right">

<a data-bind="visible: activeTab() == 'output'" href="#view-options-modal" class="btn btn-secondary btn-sm" data-toggle="modal">
<a data-bind="visible: activeTab() == 'output-legacy'" href="#view-options-modal" class="btn btn-secondary btn-sm" data-toggle="modal">
<g:message code="execution.page.view.options.title"/>
<i class="glyphicon glyphicon-cog"></i>
</a>
Expand Down Expand Up @@ -842,18 +840,17 @@ search
</div>
</div>

<div class="tab-pane " id="output" data-bind="css: {active: activeTab()==='output'}">
<g:render template="/execution/showFragment"
model="[execution: execution, scheduledExecution: scheduledExecution, inlineView: false, followmode: followmode]"/>
</div>

<div style="height: calc(100vh - 250px); display: none; contain: layout;"
id="output-beta"
id="output"
class="card-content-full-width"
data-bind="visible: activeTab().startsWith('output-beta')"
data-bind="visible: activeTab() === 'output' || activeTab().startsWith('outputL')"
>
<div class="execution-log-viewer" data-execution-id="${execution.id}" data-theme="light" data-follow="true"></div>
</div>

<div class="tab-pane " id="output-legacy" data-bind="css: {active: activeTab()==='output-legacy'}">
<g:render template="/execution/showFragment"
model="[execution: execution, scheduledExecution: scheduledExecution, inlineView: false, followmode: followmode]"/>
</div>

</div>
Expand Down Expand Up @@ -891,7 +888,7 @@ search
</div>

<div data-ko-bind="nodeflow"
data-bind="visible: logoutput().fileLoadError() && activeTab()==='output'"
data-bind="visible: logoutput().fileLoadError() && activeTab()==='output-legacy'"
class="alert alert-warning"
style="display:none">
<span data-bind="text: logoutput().fileLoadError" ></span>
Expand Down Expand Up @@ -1170,7 +1167,7 @@ search
tabs:[
{id: 'nodes', title: message('execution.page.show.tab.Nodes.title')},
{id: 'output', title: message('execution.show.mode.Log.title')},
{id: 'output-beta', title: message('execution.show.mode.LogBeta.title')}
{id: 'output-legacy', title: message('execution.show.mode.LogLegacy.title')}
]
});
Expand All @@ -1197,7 +1194,7 @@ search
window.location.hash = "#" + val
if (val === 'nodes') {
followState();
}else if(val==='output'){
}else if(val==='output-legacy'){
followOutput();
}
});
Expand Down Expand Up @@ -1248,10 +1245,10 @@ search
});
followState();
var outDetails = window.location.hash;
if(outDetails === '#output') {
nodeflowvm.activeTab("output");
} else if (outDetails.startsWith('#output-beta')) {
if(outDetails.startsWith('#output') && !outDetails.includes('legacy')) {
nodeflowvm.activeTab(outDetails.slice(1))
} else if (outDetails === '#output-legacy') {
nodeflowvm.activeTab("output-legacy")
} else if (outDetails === '#nodes') {
nodeflowvm.activeTab("nodes");
}else{
Expand Down
6 changes: 5 additions & 1 deletion rundeckapp/grails-app/views/framework/adhoc.gsp
Expand Up @@ -34,7 +34,11 @@
kind: 'event'
)}"/>

<asset:javascript src="executionState.js"/>
<feature:disabled name="legacyExecOutputViewer">
<asset:javascript src="static/css/pages/command.css"/>
<asset:javascript src="static/pages/command.js"/>
</feature:disabled>
<asset:javascript src="executionState.js"/>
<asset:javascript src="executionControl.js"/>
<asset:javascript src="util/yellowfade.js"/>
<asset:javascript src="framework/adhoc.js"/>
Expand Down
3 changes: 2 additions & 1 deletion rundeckapp/grails-app/views/layouts/base.gsp
Expand Up @@ -135,12 +135,13 @@
activeTourStep: '${session.filterPref?.activeTourStep}',
hideVersionUpdateNotification: '${session.filterPref?.hideVersionUpdateNotification}',
feature: {
betaExecOutputViewer: {enabled: ${grailsApplication.config.rundeck?.feature?.betaExecOutputViewer?.enabled}}
legacyExecOutputViewer: {enabled: ${grailsApplication.config.rundeck?.feature?.legacyExecOutputViewer?.enabled}},
}
})
</script>
<g:jsonToken id="ui_token" url="${request.forwardURI}"/>
<asset:stylesheet href="static/css/chunk-vendors.css"/>
<asset:stylesheet href="static/css/chunk-common.css"/>
<asset:javascript src="static/js/chunk-common.js"/>
<asset:javascript src="static/js/chunk-vendors.js"/>
Expand Down
Expand Up @@ -77,11 +77,11 @@
''}>
<g:message code="execution.show.mode.Log.title"/>
</option>
<feature:enabled name="betaExecOutputViewer">
<option value="output-beta" ${scheduledExecution.defaultTab == 'output-beta' ?
<feature:enabled name="legacyExecOutputViewer">
<option value="output-legacy" ${scheduledExecution.defaultTab == 'output-legacy' ?
'selected="selected"' :
''}>
<g:message code="execution.show.mode.LogBeta.title"/>
<g:message code="execution.show.mode.LogLegacy.title"/>
</option>
</feature:enabled>
<option value="html" ${scheduledExecution.defaultTab == 'html' ?
Expand Down
1 change: 1 addition & 0 deletions rundeckapp/grails-spa/.nvmrc
@@ -0,0 +1 @@
v12.16.3

0 comments on commit e7ba195

Please sign in to comment.