Skip to content

Commit

Permalink
Merge d711cb9 into 3e11074
Browse files Browse the repository at this point in the history
  • Loading branch information
brew committed Feb 3, 2019
2 parents 3e11074 + d711cb9 commit 83a4289
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 15 deletions.
15 changes: 12 additions & 3 deletions datapackage_pipelines/web/server.py
Expand Up @@ -105,11 +105,20 @@ def wrapper(*args, **kwargs):


@blueprint.route("")
@blueprint.route("<path:pipeline_path>")
@basic_auth_required
def main():
all_pipeline_ids = sorted(status.all_pipeline_ids())
def main(pipeline_path=None):
pipeline_ids = sorted(status.all_pipeline_ids())

# If we have a pipeline_path, filter the pipeline ids.
if pipeline_path is not None:
if not pipeline_path.startswith('./'):
pipeline_path = './' + pipeline_path

pipeline_ids = [p for p in pipeline_ids if p.startswith(pipeline_path)]

statuses = []
for pipeline_id in all_pipeline_ids:
for pipeline_id in pipeline_ids:
pipeline_status = status.get(pipeline_id)
ex = pipeline_status.get_last_execution()
success_ex = pipeline_status.get_last_successful_execution()
Expand Down
30 changes: 18 additions & 12 deletions datapackage_pipelines/web/templates/dashboard.html
Expand Up @@ -100,7 +100,7 @@
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<a class="navbar-brand" href="#">Pipeline Status Dashboard</a>
<a class="navbar-brand" href="{{ url_for('dpp.main') }}">Pipeline Status Dashboard</a>
</div>

<!-- Collect the nav links, forms, and other content for toggling -->
Expand All @@ -121,17 +121,22 @@
<div class="row">
<div class="col-md-3 hidden-xs hidden-sm">
<div data-spy="affix" >
{% macro nested_pipelines(statuses) %}
{% macro nested_pipelines(statuses, parent='') %}
{% for k, children in statuses.children.items() %}
<div class="row">
<div class="col-xs-12">
<div class="nesting open">
<div class="nesting-title">
<span class="glyphicon glyphicon-menu-right"></span>
<span>{{ k }}</span>
{% if parent %}
{% set pipeline_path = parent + '/' + k %}
{% else %}
{% set pipeline_path = k %}
{% endif %}
<span><a href="{{ url_for('dpp.main', pipeline_path=pipeline_path) }}">{{ k }}</a></span>
</div>
<div class="nesting-contents">
{{ nested_pipelines(children) }}
{{ nested_pipelines(children, k) }}
</div>
</div>
</div>
Expand Down Expand Up @@ -283,14 +288,15 @@ <h1 class="panel-title">
var field = target.attr('data-field');
if (!field) return;
var pipeline_id = target.attr('data-pipeline');
$.get('api/'+field+'/'+pipeline_id, function(data) {
text = data.text;
contents = '<pre>';
for (i = 0 ; i < text.length ; i++) contents += text[i] + '\n';
contents = contents + '</pre>';
target.html(contents);
target.attr('data-full', true);
}, 'json');
$.get("{{ url_for('dpp.main') }}" + "api/" + field + "/" + pipeline_id,
function(data) {
text = data.text;
contents = '<pre>';
for (i = 0 ; i < text.length ; i++) contents += text[i] + '\n';
contents = contents + '</pre>';
target.html(contents);
target.attr('data-full', true);
}, 'json');
}

$('[role=tabpanel]').on('shown.bs.tab', function(e) {
Expand Down

0 comments on commit 83a4289

Please sign in to comment.