Files
location_managemet/app/templates/workflows/list.html
2026-02-26 19:24:17 +02:00

81 lines
3.1 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% extends "base.html" %}
{% block title %}Workflows Location Management{% endblock %}
{% block content %}
<div class="d-flex align-items-center justify-content-between mb-4">
<h2 class="fw-bold mb-0"><i class="bi bi-diagram-3 me-2 text-warning"></i>Workflows</h2>
{% if current_user.is_admin() %}
<a href="{{ url_for('workflows.add_workflow') }}" class="btn btn-primary">
<i class="bi bi-plus-circle me-1"></i> Add Workflow
</a>
{% endif %}
</div>
{% if workflows %}
<div class="table-responsive">
<table class="table table-hover align-middle">
<thead class="table-dark">
<tr>
<th>Name</th>
<th>Trigger</th>
<th>Action</th>
<th>Status</th>
<th>Last Triggered</th>
<th></th>
</tr>
</thead>
<tbody>
{% for wf in workflows %}
<tr class="{% if not wf.is_enabled %}text-secondary{% endif %}">
<td class="fw-semibold">{{ wf.name }}</td>
<td>
<span class="badge text-bg-secondary">{{ wf.trigger_board.name }}</span>
Input {{ wf.trigger_input }}
<span class="badge text-bg-info">{{ wf.trigger_event }}</span>
</td>
<td>
<span class="badge text-bg-secondary">{{ wf.action_board.name }}</span>
Relay {{ wf.action_relay }}
<span class="badge text-bg-warning">{{ wf.action_type }}</span>
</td>
<td>
<span class="badge {% if wf.is_enabled %}text-bg-success{% else %}text-bg-secondary{% endif %}">
{% if wf.is_enabled %}Enabled{% else %}Disabled{% endif %}
</span>
</td>
<td class="small text-secondary">
{% if wf.last_triggered %}{{ wf.last_triggered.strftime('%Y-%m-%d %H:%M') }}{% else %}Never{% endif %}
</td>
<td>
{% if current_user.is_admin() %}
<a href="{{ url_for('workflows.edit_workflow', wf_id=wf.id) }}" class="btn btn-sm btn-outline-secondary me-1">
<i class="bi bi-pencil"></i>
</a>
<form method="POST" action="{{ url_for('workflows.toggle_workflow', wf_id=wf.id) }}" class="d-inline">
<button class="btn btn-sm {% if wf.is_enabled %}btn-outline-warning{% else %}btn-outline-success{% endif %} me-1"
title="{% if wf.is_enabled %}Disable{% else %}Enable{% endif %}">
<i class="bi bi-{% if wf.is_enabled %}pause{% else %}play{% endif %}"></i>
</button>
</form>
<form method="POST" action="{{ url_for('workflows.delete_workflow', wf_id=wf.id) }}" class="d-inline"
onsubmit="return confirm('Delete workflow {{ wf.name }}?')">
<button class="btn btn-sm btn-outline-danger"><i class="bi bi-trash"></i></button>
</form>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<div class="text-center py-5 text-secondary">
<i class="bi bi-diagram-3 display-2"></i>
<p class="mt-3">No workflows yet.</p>
{% if current_user.is_admin() %}
<a href="{{ url_for('workflows.add_workflow') }}" class="btn btn-primary">Create Workflow</a>
{% endif %}
</div>
{% endif %}
{% endblock %}