Mistral-dashboard: Tasks list-addition of Execution detail screen
* Added “Execution detail” screen link Implements blueprint: tasks-screen-improvments Change-Id: I21f615c576f86364085e458b451ac02646882656
This commit is contained in:
parent
e084e2bc65
commit
3de32160a9
@ -20,24 +20,19 @@ from horizon import tables
|
||||
|
||||
from mistraldashboard.default.utils import humantime
|
||||
from mistraldashboard.default.utils import label
|
||||
from mistraldashboard.default.utils import prettyprint
|
||||
|
||||
|
||||
class TaskTable(tables.DataTable):
|
||||
id = tables.Column(
|
||||
"id",
|
||||
verbose_name=_("ID"),
|
||||
link="horizon:mistral:tasks:result")
|
||||
link="horizon:mistral:tasks:detail")
|
||||
name = tables.Column("name", verbose_name=_("Name"))
|
||||
|
||||
workflow_execution_id = tables.Column(
|
||||
"workflow_execution_id",
|
||||
verbose_name=_("Workflow Execution ID"),
|
||||
)
|
||||
output = tables.Column(
|
||||
"output",
|
||||
verbose_name=_("Output"),
|
||||
filters=[prettyprint]
|
||||
link="horizon:mistral:tasks:execution"
|
||||
)
|
||||
created_at = tables.Column(
|
||||
"created_at",
|
||||
|
39
mistraldashboard/tasks/templates/tasks/execution.html
Normal file
39
mistraldashboard/tasks/templates/tasks/execution.html
Normal file
@ -0,0 +1,39 @@
|
||||
{% extends 'base.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block page_header %}
|
||||
<h1>
|
||||
{% trans "Execution Overview " %}
|
||||
</h1>
|
||||
{% endblock page_header %}
|
||||
|
||||
{% block main %}
|
||||
{% load i18n sizeformat %}
|
||||
|
||||
<div class="detail">
|
||||
<h4>{% trans "Information" %}</h4>
|
||||
<hr class="header_rule">
|
||||
<dl class="dl-horizontal">
|
||||
<dt>{% trans "ID" %}</dt>
|
||||
<dd>{{ execution.id|default:_("None") }}</dd>
|
||||
<dt>{% trans "Worflow Name" %}</dt>
|
||||
<dd>{{ execution.workflow_name }}</dd>
|
||||
<dt>{% trans "State" %}</dt>
|
||||
<dd>{{ execution.state }}</dd>
|
||||
{% if execution.description %}
|
||||
<dt>{% trans "Description" %}</dt>
|
||||
<dd>{{ execution.description }}</dd>
|
||||
{% endif %}
|
||||
<dt>{% trans "Created At" %}</dt>
|
||||
<dd>{{ execution.created_at }}</dd>
|
||||
<dt>{% trans "Updated At" %}</dt>
|
||||
<dd>{{ execution.updated_at }}</dd>
|
||||
<dt>{% trans "Params" %}</dt>
|
||||
<dd>{{ execution.params }}</dd>
|
||||
<dt>{% trans "Input" %}</dt>
|
||||
<dd>{{ execution.input }}</dd>
|
||||
<dt>{% trans "Output" %}</dt>
|
||||
<dd>{{ execution.output }}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
{% endblock %}
|
@ -24,7 +24,6 @@ TASKS = r'^(?P<task_id>[^/]+)/%s$'
|
||||
urlpatterns = patterns(
|
||||
'',
|
||||
url(r'^$', views.IndexView.as_view(), name='index'),
|
||||
url(TASKS % 'result', views.ResultView.as_view(), name='result'),
|
||||
url(TASKS % 'detail', views.OverviewView.as_view(), name='detail')
|
||||
|
||||
url(TASKS % 'detail', views.OverviewView.as_view(), name='detail'),
|
||||
url(TASKS % 'execution', views.ExecutionView.as_view(), name='execution'),
|
||||
)
|
||||
|
@ -18,21 +18,29 @@ from django.core.urlresolvers import reverse
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.views import generic
|
||||
|
||||
|
||||
from horizon import exceptions
|
||||
from horizon import tables
|
||||
|
||||
from mistraldashboard import api
|
||||
from mistraldashboard.default.utils import prettyprint
|
||||
from mistraldashboard.tasks.tables import TaskTable
|
||||
|
||||
|
||||
class ResultView(generic.TemplateView):
|
||||
template_name = 'mistral/tasks/result.html'
|
||||
page_title = _("Task Result")
|
||||
class ExecutionView(generic.TemplateView):
|
||||
template_name = 'mistral/tasks/execution.html'
|
||||
page_title = _("Execution Overview")
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(ResultView, self).get_context_data(**kwargs)
|
||||
context = super(ExecutionView, self).get_context_data(**kwargs)
|
||||
task = self.get_data(self.request, **kwargs)
|
||||
context['result'] = task.result
|
||||
execution = api.execution_get(self.request, task.workflow_execution_id)
|
||||
execution.input = prettyprint(execution.input)
|
||||
execution.output = prettyprint(execution.output)
|
||||
execution.params = prettyprint(execution.params)
|
||||
|
||||
context['task'] = task
|
||||
context['execution'] = execution
|
||||
|
||||
return context
|
||||
|
||||
@ -55,8 +63,8 @@ class OverviewView(generic.TemplateView):
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(OverviewView, self).get_context_data(**kwargs)
|
||||
task = self.get_data(self.request, **kwargs)
|
||||
task.result = prettyprint(task.result)
|
||||
context['task'] = task
|
||||
|
||||
return context
|
||||
|
||||
def get_data(self, request, **kwargs):
|
||||
|
Loading…
Reference in New Issue
Block a user