Commit 9163f8ec authored by Janez K's avatar Janez K

streaming visualizations to new design

parent c3afe883
......@@ -44,6 +44,10 @@
</div><!-- /.navbar-collapse -->
</nav>
<div class="container">
{% block 'container' %}
{% endblock %}
</div>
{% block "container" %}
{% endblock %}
......
{% extends 'website/base.html' %}
{% load url from future %}
{% load date_diff %}
{% block "yourworkflowsactive" %}class="active"{% endblock %}
{% block "container" %}
<div class="container">
<h1>{{stream}}</h1>
<div class="well">
<table class="table table-condensed">
<tbody>
<tr>
<td style="width:20%;"><b>Stream status</b></td>
<td>{% if stream.active %}<span class="label label-success">Active</span>{% else %}<span class="label label-warning">Inactive</span>{% endif %}</td>
</tr>
<tr>
<td><b>Last heartbeat</b></td>
<td>{{ stream.last_executed|date_diff }}</td>
</tr>
<tr>
<td><b>Period</b></td>
<td>{{stream.period}} seconds</td>
</tr>
<tr>
<td><b>Workflow</b></td>
<td><a href="{{stream.workflow.get_absolute_url}}">{{stream.workflow}}</a></td>
</tr>
</tbody>
</table>
</div>
<div class="row">
<div class="col-lg-12">
{% if stream.active %}
<a href="{% url 'deactivate stream' stream.pk %}" class="btn btn-warning btn-large">Deactivate</a>
{% else %}
<a href="{% url 'activate stream' stream.pk %}" class="btn btn-success btn-large">Activate</a>
{% endif %}
<a href="javascript:;" class="reset-stream btn btn-warning btn-danger btn-large">Reset</a>
</div>
</div>
<hr>
<h1>Results widgets</h1>
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th>Widget title</th>
<th>Results</th>
</tr>
</thead>
<tbody>
{% for w in stream.stream_visualization_widgets %}
<tr>
<td class="name">{{w}}</td>
<td><a href="{% url 'stream widget visualization' stream.pk w.pk %}" class="btn btn-mini">View results</a></td>
</tr>
{% endfor %}
</tbody>
</table>
<script type="text/javascript">
$(function() {
$(".reset-stream").click(function() {
bootbox.confirm("Are you sure you wish to reset the stream? This means that all data that you have mined so far will be cleared.","No way!", "Yes, definitely!", function(result) {
if (result==true) {
window.location='{% url 'reset stream' stream.pk %}';
}
});
});
});
</script>
</div>
{% endblock %}
......@@ -23,10 +23,10 @@
<td>
{% if w.can_be_streaming %}
{% if w.stream %}
{% if w.stream.active %}<span class="label label-success"><i class="icon-ok icon-white"></i> Active</span> <a href="{{w.stream.get_absolute_url}}" class="btn btn-mini"><i class="icon-wrench"></i></a>
{% else %}<span class="label label-warning"><i class="icon-remove icon-white"></i> Inactive</span> <a href="{{w.stream.get_absolute_url}}" class="btn btn-mini"><i class="icon-wrench"></i></a>{% endif %}
{% else %}<a href="{% url 'start stream' w.pk %}" class="btn btn-mini">Start stream mining</a>{% endif %}
{% else %}<span class="label label-default"><i class="icon-remove icon-white"></i> No streaming widgets</span>{% endif %}
{% if w.stream.active %}<span class="label label-success"><span class="glyphicon glyphicon-ok"></span> Active</span> <a href="{{w.stream.get_absolute_url}}" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-wrench"></span></a>
{% else %}<span class="label label-warning"><span class="glyphicon glyphicon-remove"></span> Inactive</span> <a href="{{w.stream.get_absolute_url}}" class="btn btn-mini"><i class="icon-wrench"></i></a>{% endif %}
{% else %}<a href="{% url 'start stream' w.pk %}" class="btn btn-info btn-xs">Start stream mining</a>{% endif %}
{% else %}<span class="label label-default"><span class="glyphicon glyphicon-remove"></span> No streaming widgets</span>{% endif %}
</td>
<td><a href="{{w.get_absolute_url}}">Edit</a> | <a href="{{w.get_copy_url}}">Open as new</a> | <a href="javascript:;" rel="{{w.pk}}" class="delete_workflow">Delete</a> | {% if not w.public %}<a href="{% url 'make public' w.pk %}">Make public</a>{% else %}<a href="{% url 'make private' w.pk %}">Make private</a>{% endif %}</td>
</tr>
......
<div class="dataTables_paginate paging_bootstrap pagination">
<ul>
<ul class="pagination">
{% if has_previous %}
<li class="prev"><a href="?page={{previous}}"></a></li>
{% else %}
......
......@@ -243,7 +243,7 @@ Preconditions for running this widget have not yet been met. Do you want to run
<div style="height:300px;overflow:auto;">
{% for w in user.workflows.all %}
{% if not w.widget %}
<a onClick="$(this).parent().dialog('close');$('.ajax-loader').show();" href="{{ w.get_absolute_url }}"><span rel="#canvas{{ w.id }}">{{ w }}</span></a> <a onClick="$(this).parent().dialog('close');$('.ajax-loader').show();" href="{{ w.get_copy_url }}">Open as new</a><br />
<a onClick="$(this).parent().dialog('close');$('.ajax-loader').show();" href="{{ w.get_absolute_url }}" target="_parent"><span rel="#canvas{{ w.id }}">{{ w }}</span></a> <a onClick="$(this).parent().dialog('close');$('.ajax-loader').show();" href="{{ w.get_copy_url }}" target="_parent">Open as new</a><br />
{% endif %}
{% endfor %}
</div>
......
......@@ -61,7 +61,7 @@ def new_workflow(request):
w.save()
request.user.userprofile.active_workflow = w
request.user.userprofile.save()
return redirect('the index')
return redirect('editor')
@login_required
def open_workflow(request,workflow_id):
......@@ -71,7 +71,7 @@ def open_workflow(request,workflow_id):
request.user.userprofile.save()
else:
return HttpResponse(status=400)
return redirect('the index')
return redirect('editor')
@login_required
def widget_progress(request):
......@@ -1267,7 +1267,7 @@ def copy_workflow(request,workflow_id):
request.user.userprofile.save()
else:
return HttpResponse(status=400)
return redirect('the index')
return redirect('editor')
@login_required
def workflow_url(request):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment