Пример #1
0
 def decorated_function(*args, **kwargs):
     ctx = function(*args, **kwargs) or {}
     if not isinstance(ctx, dict):
         return ctx
     ctx.update({
         'names': pretty_names,
         'property_types': {k: str(v) for k, v in property_types.items()}
     })
     endpoint = request.endpoint.split('.')[-1]
     return render_template(ctx.pop('template', f'{endpoint}.html'), **ctx)
Пример #2
0
 def decorated_function(*args: Any, **kwargs: Any) -> Any:
     ctx = function(*args, **kwargs) or {}
     if not isinstance(ctx, dict):
         return ctx
     ctx.update({
         "names": pretty_names,
         "property_types": {k: str(v)
                            for k, v in property_types.items()},
     })
     if request.endpoint is not None:
         endpoint = request.endpoint.split(".")[-1]
     return render_template(ctx.pop("template", f"{endpoint}.html"), **ctx)
Пример #3
0
def workflow_management():
    workflow_creation_form = WorkflowForm(request.form)
    workflow_creation_form.devices.choices = Device.choices()
    workflow_creation_form.pools.choices = Pool.choices()
    return render_template(
        'workflow_management.html',
        compare_logs_form=CompareLogsForm(request.form),
        names=pretty_names,
        fields=workflow_table_properties,
        property_types={k: str(v)
                        for k, v in property_types.items()},
        workflows=Workflow.serialize(),
        workflow_creation_form=workflow_creation_form)
Пример #4
0
def service_management():
    service_form = JobForm(request.form)
    service_form.devices.choices = Device.choices()
    service_form.pools.choices = Pool.choices()
    return render_template(
        'service_management.html',
        compare_logs_form=CompareLogsForm(request.form),
        fields=service_table_properties,
        names=pretty_names,
        property_types={k: str(v)
                        for k, v in property_types.items()},
        service_form=service_form,
        services_classes=list(service_classes),
        services=Service.serialize())
Пример #5
0
def workflow_builder():
    add_job_form = AddJobForm(request.form)
    add_job_form.job.choices = Job.choices()
    workflow_builder_form = WorkflowBuilderForm(request.form)
    workflow_builder_form.workflow.choices = Workflow.choices()
    service_form = JobForm(request.form)
    service_form.devices.choices = Device.choices()
    service_form.pools.choices = Pool.choices()
    return render_template(
        'workflow_builder.html',
        workflow=session.get('workflow', None),
        add_job_form=add_job_form,
        workflow_builder_form=workflow_builder_form,
        compare_logs_form=CompareLogsForm(request.form),
        names=pretty_names,
        property_types={k: str(v)
                        for k, v in property_types.items()},
        service_form=service_form,
        services_classes=list(service_classes))