Add list of tasks for an execution
Change-Id: I15993d359d858190f5692916e24f0b0e9c500767
This commit is contained in:
@@ -4,11 +4,23 @@ from horizon import tables
|
|||||||
|
|
||||||
|
|
||||||
class ExecutionsTable(tables.DataTable):
|
class ExecutionsTable(tables.DataTable):
|
||||||
id = tables.Column("id", verbose_name=_("ID"))
|
id = tables.Column("id",
|
||||||
|
verbose_name=_("ID"),
|
||||||
|
link=("horizon:mistral:executions:tasks"))
|
||||||
wb_name = tables.Column("workbook_name", verbose_name=_("Workbook"))
|
wb_name = tables.Column("workbook_name", verbose_name=_("Workbook"))
|
||||||
state = tables.Column("state", verbose_name=_("State"))
|
state = tables.Column("state", verbose_name=_("State"))
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
name = "executions"
|
name = "executions"
|
||||||
verbose_name = _("Executions")
|
verbose_name = _("Executions")
|
||||||
# row_actions = (ExecuteWorkflow,)
|
|
||||||
|
|
||||||
|
class TaskTable(tables.DataTable):
|
||||||
|
id = tables.Column("id", verbose_name=_("ID"))
|
||||||
|
name = tables.Column("name", verbose_name=_("Name"))
|
||||||
|
action = tables.Column("action", verbose_name=_("Action"))
|
||||||
|
state = tables.Column("state", verbose_name=_("State"))
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
name = "tasks"
|
||||||
|
verbose_name = _("Tasks")
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
{% block title %}{% trans "Executions" %}{% endblock %}
|
{% block title %}{% trans "Executions" %}{% endblock %}
|
||||||
|
|
||||||
{% block page_header %}
|
{% block page_header %}
|
||||||
{% include "horizon/common/_page_header.html" with title=_("Workbooks") %}
|
{% include "horizon/common/_page_header.html" with title=_("Executions") %}
|
||||||
{% endblock page_header %}
|
{% endblock page_header %}
|
||||||
|
|
||||||
{% block main %}
|
{% block main %}
|
||||||
|
@@ -1,9 +1,13 @@
|
|||||||
from django.conf.urls import patterns # noqa
|
from django.conf.urls import patterns # noqa
|
||||||
from django.conf.urls import url # noqa
|
from django.conf.urls import url # noqa
|
||||||
|
|
||||||
from demo_dashboard.dashboards.mistral.executions.views import IndexView
|
from demo_dashboard.dashboards.mistral.executions.views \
|
||||||
|
import IndexView, TaskView
|
||||||
|
|
||||||
|
EXECUTIONS = r'^(?P<execution_id>[^/]+)/%s$'
|
||||||
|
|
||||||
urlpatterns = patterns(
|
urlpatterns = patterns(
|
||||||
'',
|
'',
|
||||||
url(r'^$', IndexView.as_view(), name='index'),
|
url(r'^$', IndexView.as_view(), name='index'),
|
||||||
|
url(EXECUTIONS % 'tasks', TaskView.as_view(), name='tasks'),
|
||||||
)
|
)
|
||||||
|
@@ -2,6 +2,7 @@ from horizon import tables
|
|||||||
|
|
||||||
from demo_dashboard.dashboards.mistral import api
|
from demo_dashboard.dashboards.mistral import api
|
||||||
from demo_dashboard.dashboards.mistral.executions.tables import ExecutionsTable
|
from demo_dashboard.dashboards.mistral.executions.tables import ExecutionsTable
|
||||||
|
from demo_dashboard.dashboards.mistral.executions.tables import TaskTable
|
||||||
|
|
||||||
|
|
||||||
class IndexView(tables.DataTableView):
|
class IndexView(tables.DataTableView):
|
||||||
@@ -12,3 +13,14 @@ class IndexView(tables.DataTableView):
|
|||||||
client = api.mistralclient(self.request)
|
client = api.mistralclient(self.request)
|
||||||
return [item for wb in client.workbooks.list()
|
return [item for wb in client.workbooks.list()
|
||||||
for item in client.executions.list(wb.name)]
|
for item in client.executions.list(wb.name)]
|
||||||
|
|
||||||
|
|
||||||
|
class TaskView(tables.DataTableView):
|
||||||
|
table_class = TaskTable
|
||||||
|
template_name = 'mistral/executions/index.html'
|
||||||
|
|
||||||
|
def get_data(self):
|
||||||
|
client = api.mistralclient(self.request)
|
||||||
|
return [item for wb in client.workbooks.list()
|
||||||
|
for item in client.tasks.list(wb.name,
|
||||||
|
self.kwargs['execution_id'])]
|
||||||
|
Reference in New Issue
Block a user