Skip to content
Snippets Groups Projects
Commit ad276dbc authored by Pablo Vazquez's avatar Pablo Vazquez
Browse files

Server: Load logs on demand

parent 2f64b5c6
No related branches found
No related tags found
No related merge requests found
...@@ -118,7 +118,7 @@ function loadActivities(url) ...@@ -118,7 +118,7 @@ function loadActivities(url)
function loadTasks(url) { function loadTasks(url) {
return $.get(url) return $.get(url)
.done(function(data) { .done(function(data) {
if(console) console.log('Tasks loaded OK'); if(console) console.log('Tasks loaded OK\n' + url);
$('#tasks').html(data); $('#tasks').html(data);
setupJsTaskLinkClickHandlers(); setupJsTaskLinkClickHandlers();
}) })
...@@ -230,11 +230,11 @@ function getTaskLog(url, container){ ...@@ -230,11 +230,11 @@ function getTaskLog(url, container){
return; return;
} }
var log_height = $('#col_main-overlay-content').height() - $('.flamenco-box.task').offset().top - $('.flamenco-box.task').height() - 20; var log_height = $('#col_main-overlay-content').height() - $('.flamenco-box.task').offset().top - $('.flamenco-box.task').height() - 100;
$.get(url) $.get(url)
.done(function(data) { .done(function(data) {
if(console) console.log('Logs loaded OK'); if(console) console.log('Task log loaded OK\n' + url);
$(container).html(data); $(container).html(data);
var container_content = $(container).children('.item-log-content'); var container_content = $(container).children('.item-log-content');
......
...@@ -281,11 +281,12 @@ nav.sidebar ...@@ -281,11 +281,12 @@ nav.sidebar
width: 100% width: 100%
#item-action-panel #item-action-panel
padding-top: 15px padding: 0 10px 10px 10px
text-align: right width: 100%
.btn .btn
font-size: .8em font-size: .8em
#item-log #item-log
margin: 10px margin: 10px
border-radius: 3px border-radius: 3px
...@@ -335,7 +336,7 @@ nav.sidebar ...@@ -335,7 +336,7 @@ nav.sidebar
color: $color-primary color: $color-primary
border-color: $color-primary border-color: $color-primary
&.disabled, &.active &.disabled
cursor: default cursor: default
pointer-events: none pointer-events: none
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
text-transform: uppercase text-transform: uppercase
opacity: .9 opacity: .9
padding: padding:
left: 20px left: 15px
right: 20px right: 15px
border-radius: $roundness border-radius: $roundness
@if $filled @if $filled
...@@ -45,14 +45,14 @@ ...@@ -45,14 +45,14 @@
color: $mixin-color color: $mixin-color
border-color: $mixin-color border-color: $mixin-color
&:active, &:focus &:active
outline: none outline: none
border-color: $mixin-color border-color: $mixin-color
background-color: $mixin-color background-color: $mixin-color
color: white color: white
i i
margin-right: 10px margin-right: 5px
small small
font-size: .6em font-size: .6em
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
| {% endif %} | {% endif %}
#item-action-panel #item-action-panel
.pull-right
| {% if can_cancel_job %} | {% if can_cancel_job %}
button.btn.btn-danger(onclick="setJobStatus('{{ job._id }}', 'cancel-requested')") button.btn.btn-danger(onclick="setJobStatus('{{ job._id }}', 'cancel-requested')")
i.pi-cancel i.pi-cancel
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
data-task-id="{{ task._id }}", data-task-id="{{ task._id }}",
class="task-link" class="task-link"
) )
| {{ task.task }} | {{ task._id }}
.table-row .table-row
.table-cell task Type .table-cell task Type
.table-cell {{ task.task_type | undertitle }} .table-cell {{ task.task_type | undertitle }}
...@@ -58,6 +58,12 @@ ...@@ -58,6 +58,12 @@
.table-cell {{ task.worker }} .table-cell {{ task.worker }}
#item-action-panel #item-action-panel
button.btn.item-log-load.js-log-load(
data-url="{{ url_for('flamenco.tasks.perproject.view_task_log', project_url=project.url, task_id=task._id) }}")
i.pi-list
| View Log
.pull-right
| {% if can_requeue_task %} | {% if can_requeue_task %}
button.btn.btn-success.requeue-task(onclick="setTaskStatus('{{ task._id }}', 'queued')") button.btn.btn-success.requeue-task(onclick="setTaskStatus('{{ task._id }}', 'queued')")
i.pi-refresh i.pi-refresh
...@@ -66,9 +72,6 @@ ...@@ -66,9 +72,6 @@
.action-result-panel .action-result-panel
#item-log.task #item-log.task
.item-log-loader
span Loading Logs
i.pi-spin.spin
| {% if config.DEBUG %} | {% if config.DEBUG %}
.debug-info .debug-info
...@@ -95,9 +98,13 @@ script. ...@@ -95,9 +98,13 @@ script.
setupJsJobLinkClickHandlers(); setupJsJobLinkClickHandlers();
// Task Logs // Task Logs
var url = "{{ url_for('flamenco.tasks.perproject.view_task_log', project_url=project.url, task_id=task._id) }}"; $('.js-log-load').on('click', function(){
var item_log = $('#item-log.task'); var url = $(this).data('url');
getTaskLog(url, item_log); // on tasks.js var container = $('#item-log.task');
$(container).html('<div class="item-log-loader"><i class="pi-spin spin"></i></div>');
getTaskLog(url, $(container)); // on tasks.js
});
// Close Task Details // Close Task Details
function closeTaskDetails(){ function closeTaskDetails(){
......
...@@ -39,7 +39,7 @@ script. ...@@ -39,7 +39,7 @@ script.
e.preventDefault(); e.preventDefault();
var url = $(this).attr('href'); var url = $(this).attr('href');
getTaskLog(url, item_log); getTaskLog(url, $('#item-log.task'));
}); });
$("p.item-log-line:contains('> Warning:')").addClass('log-warning'); $("p.item-log-line:contains('> Warning:')").addClass('log-warning');
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment