Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix worker tool box in visualizer #2063

Merged
merged 2 commits into from
Mar 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions luigi/static/visualiser/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ <h4 class="modal-title" id="disiableWorkerLabel">Disable worker?</h4>
</div>
</div>
</div>
{{#workers}}
{{#workerList}}
{{#is_disabled}}
<div class="box box-solid box-default">
{{/is_disabled}}
Expand All @@ -336,6 +336,7 @@ <h3 class="box-title">{{name}}</h3>
<span class="label-unread-worker-messages">{{num_unread_rpc_messages}} unread message(s)</span>
{{/num_unread_rpc_messages}}
{{^is_disabled}}
{{#workers}}
<div class="btn-group">
<button type="button" class="btn btn-sm btn-default dropdown-toggle btn-set-workers" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Workers: <span id="label-n-workers" data-worker="{{name}}">{{workers}}</span> <span class="caret"></span>
Expand All @@ -352,6 +353,7 @@ <h3 class="box-title">{{name}}</h3>
</a></li>
</ul>
</div>
{{/workers}}
<div class="button-tooltip" data-toggle="tooltip" title="Disable Worker">
<button type="button" class="btn btn-sm btn-danger btn-disable-worker" data-toggle="modal" data-target="#disableWorkerModal" data-worker="{{name}}">
<i class="fa fa-fire-extinguisher"></i>
Expand Down Expand Up @@ -399,7 +401,7 @@ <h3 class="box-title">{{name}}</h3>
</table>
</div>
</div>
{{/workers}}
{{/workerList}}
</script>

<script type="text/template" name="resourceTemplate">
Expand Down
8 changes: 5 additions & 3 deletions luigi/static/visualiser/js/visualiserApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ function visualiserApp(luigi) {
}

function renderWorkers(workers) {
return renderTemplate("workerTemplate", {"workers": workers.map(processWorker)});
return renderTemplate("workerTemplate", {"workerList": workers.map(processWorker)});
}

function processResource(resource) {
Expand Down Expand Up @@ -1038,8 +1038,10 @@ function visualiserApp(luigi) {
luigi.disableWorker(worker);

// show the worker as disabled in the visualiser
triggerButton.parents('.box').addClass('box-solid box-default');
triggerButton.remove();
var box = triggerButton.parents('.box').addClass('box-solid box-default');

// remove the worker tools
box.find('.box-tools').remove();
});

$('#workerList').on('click', '#btn-increment-workers', function($event) {
Expand Down