Files
sub-provider/templates/rules.html
2026-04-20 14:16:09 +08:00

41 lines
1.6 KiB
HTML

{% extends "base.html" %}
{% block content %}
<div class="stack">
<div class="actions" style="justify-content:space-between; align-items:center;">
<div>
<h1>Rules: {{ profile_key }}</h1>
<p class="muted">控制规则模块启用状态、顺序和目标策略组。</p>
</div>
<div class="actions">
<a class="button secondary" href="/admin/profiles">Back</a>
<a class="button" href="/admin/profiles/{{ profile_key }}/preview">Preview</a>
</div>
</div>
<form method="post" action="/admin/profiles/{{ profile_key }}/rules" class="card">
<table>
<thead>
<tr><th>Enabled</th><th>Key</th><th>Order</th><th>Policy</th><th>Rule File</th></tr>
</thead>
<tbody>
{% for binding in bindings %}
<tr>
<td>
<input type="hidden" name="rule_key" value="{{ binding.key }}">
<input type="checkbox" name="enabled_{{ binding.key }}" {% if binding.enabled %}checked{% endif %} style="width:auto">
</td>
<td><strong>{{ binding.key }}</strong><div class="muted">{{ binding.behavior }} / {{ binding.format }}</div></td>
<td><input name="order_index_{{ binding.key }}" value="{{ binding.order_index }}"></td>
<td><input name="policy_{{ binding.key }}" value="{{ binding.policy }}"></td>
<td class="muted">{{ binding.file_path or "inline payload" }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="actions" style="margin-top:18px;">
<button type="submit">Save Rules</button>
</div>
</form>
</div>
{% endblock %}