Making style changes and adding AUTHORS file

Change-Id: I3238253e03d9f80975c65a3efc84bd202b338815
This commit is contained in:
Renat Akhmerov 2014-09-27 21:50:24 -07:00
parent cdd08e49d2
commit f928ac885e
9 changed files with 81 additions and 53 deletions

View File

@ -1,3 +1,4 @@
Christian Berendt <berendt@b1-systems.de>
Kirill Izotov <enykeev@stackstorm.com>
Nikolay Mahotkin <nmakhotkin@mirantis.com>
Renat Akhmerov <rakhmerov@mirantis.com>

View File

@ -31,7 +31,10 @@ def mistralclient(request):
# additional troubles for those who still rely on v2.0 stack-wise.
auth_url=getattr(settings, 'OPENSTACK_KEYSTONE_URL'),
# Todo: add SECONDARY_ENDPOINT_TYPE support
endpoint_type=getattr(settings,
'OPENSTACK_ENDPOINT_TYPE',
'internalURL'),
service_type=SERVICE_TYPE)
endpoint_type=getattr(
settings,
'OPENSTACK_ENDPOINT_TYPE',
'internalURL'
),
service_type=SERVICE_TYPE
)

View File

@ -24,24 +24,35 @@ from mistraldashboard.default.utils import prettyprint
class ExecutionsTable(tables.DataTable):
id = tables.Column("id", verbose_name=_("ID"),
link="horizon:mistral:executions:tasks")
id = tables.Column(
"id",
verbose_name=_("ID"),
link="horizon:mistral:executions:tasks"
)
workflow_name = tables.Column("workflow_name", verbose_name=_("Workflow"))
input = tables.Column("input",
verbose_name=_("Input"),
filters=[prettyprint])
output = tables.Column("output",
verbose_name=_("Output"),
filters=[prettyprint])
input = tables.Column(
"input",
verbose_name=_("Input"),
filters=[prettyprint]
)
output = tables.Column(
"output",
verbose_name=_("Output"),
filters=[prettyprint]
)
created_at = tables.Column("created_at",
verbose_name=_("Created at"),
filters=[humantime])
updated_at = tables.Column("updated_at",
verbose_name=_("Updated at"),
filters=[humantime])
created_at = tables.Column(
"created_at",
verbose_name=_("Created at"),
filters=[humantime]
)
updated_at = tables.Column(
"updated_at",
verbose_name=_("Updated at"),
filters=[humantime]
)
state = tables.Column("state", verbose_name=_("State"), filters=[label])

View File

@ -26,8 +26,7 @@ class IndexView(tables.DataTableView):
template_name = 'mistral/executions/index.html'
def get_data(self):
client = api.mistralclient(self.request)
return client.executions.list()
return api.mistralclient(self.request).executions.list()
class TaskView(tables.DataTableView):
@ -35,5 +34,6 @@ class TaskView(tables.DataTableView):
template_name = 'mistral/executions/index.html'
def get_data(self):
client = api.mistralclient(self.request)
return client.tasks.list(self.kwargs['execution_id'])
return api.mistralclient(self.request).tasks.list(
self.kwargs['execution_id']
)

View File

@ -27,18 +27,26 @@ class TaskTable(tables.DataTable):
id = tables.Column("id", verbose_name=_("ID"))
name = tables.Column("name", verbose_name=_("Name"))
parameters = tables.Column("parameters",
verbose_name=_("Parameters"),
filters=[prettyprint])
output = tables.Column("output",
verbose_name=_("Output"),
filters=[prettyprint])
created_at = tables.Column("created_at",
verbose_name=_("Created at"),
filters=[humantime])
updated_at = tables.Column("updated_at",
verbose_name=_("Updated at"),
filters=[humantime])
parameters = tables.Column(
"parameters",
verbose_name=_("Parameters"),
filters=[prettyprint]
)
output = tables.Column(
"output",
verbose_name=_("Output"),
filters=[prettyprint]
)
created_at = tables.Column(
"created_at",
verbose_name=_("Created at"),
filters=[humantime]
)
updated_at = tables.Column(
"updated_at",
verbose_name=_("Updated at"),
filters=[humantime]
)
state = tables.Column("state", verbose_name=_("State"), filters=[label])

View File

@ -25,5 +25,4 @@ class IndexView(tables.DataTableView):
template_name = 'mistral/tasks/index.html'
def get_data(self):
client = api.mistralclient(self.request)
return client.tasks.list()
return api.mistralclient(self.request).tasks.list()

View File

@ -25,17 +25,22 @@ from mistraldashboard import api
class ExecuteForm(forms.SelfHandlingForm):
workflow_name = forms.CharField(label=_("Workflow"),
required=True,
widget=forms.TextInput(
attrs={'readonly': 'readonly'}))
workflow_input = forms.CharField(label=_("Input"),
required=False,
initial="{}",
widget=forms.widgets.Textarea())
task_name = forms.CharField(label=_("Task name"),
required=False,
widget=forms.TextInput())
workflow_name = forms.CharField(
label=_("Workflow"),
required=True,
widget=forms.TextInput(attrs={'readonly': 'readonly'})
)
workflow_input = forms.CharField(
label=_("Input"),
required=False,
initial="{}",
widget=forms.widgets.Textarea()
)
task_name = forms.CharField(
label=_("Task name"),
required=False,
widget=forms.TextInput()
)
def handle(self, request, data):
try:
@ -43,6 +48,7 @@ class ExecuteForm(forms.SelfHandlingForm):
msg = _('Execution has been created with id "%s".') % ex.id
messages.success(request, msg)
return True
except Exception:
msg = _('Failed to execute workflow "%s".') % data['workflow_name']

View File

@ -30,7 +30,7 @@ def tags_to_string(workflow):
return ', '.join(workflow.tags) if workflow.tags else None
class WorkbooksTable(tables.DataTable):
class WorkflowsTable(tables.DataTable):
name = tables.Column("name", verbose_name=_("Name"))
description = tables.Column("description", verbose_name=_("Description"))
tags = tables.Column(tags_to_string, verbose_name=_("Tags"))

View File

@ -20,12 +20,12 @@ from horizon import tables
from horizon import forms
from mistraldashboard import api
from mistraldashboard.workflows.tables import WorkbooksTable
from mistraldashboard.workflows.tables import WorkflowsTable
from mistraldashboard.workflows.forms import ExecuteForm
class IndexView(tables.DataTableView):
table_class = WorkbooksTable
table_class = WorkflowsTable
template_name = 'mistral/workflows/index.html'
def get_data(self):
@ -39,10 +39,10 @@ class ExecuteView(forms.ModalFormView):
def get_context_data(self, **kwargs):
context = super(ExecuteView, self).get_context_data(**kwargs)
context["workflow_name"] = self.kwargs['workflow_name']
return context
def get_initial(self, **kwargs):
return {
'workflow_name': self.kwargs['workflow_name']
}
return {'workflow_name': self.kwargs['workflow_name']}