{% extends "base.html" %}
{% block title %}Fissue · 部署{% endblock %}
{% block content %}
<h2>部署</h2>
{% if !enabled %}
  <p class="muted">部署能力已关闭(<code>deploy.enabled=false</code>):不会对任何远端机器做操作。</p>
{% endif %}
{% if allow_dangerous %}
  <p class="muted">⚠️ 已放行危险动作(<code>deploy.allow_dangerous=true</code>):<code>sudo</code> / <code>rm -rf</code> 一类命令不再被拒绝。</p>
{% endif %}
<p class="muted">发布根:<code>{{ app_root }}</code></p>

<h2>目标主机</h2>
{% if hosts.is_empty() %}
  <p class="muted">还没有登记主机。用 <code>fissue host add</code> 添加。</p>
{% else %}
<table>
  <thead><tr><th>名称</th><th>地址</th><th>用户</th><th>认证</th><th>凭据</th><th>指纹</th><th>最近连接</th><th>状态</th></tr></thead>
  <tbody>
  {% for host in hosts %}
    <tr>
      <td>{{ host.name }}</td>
      <td>{{ host.address }}:{{ host.port }}</td>
      <td>{{ host.user }}</td>
      <td>{{ host.auth_method }}</td>
      <td>{% if host.credential_present %}已配置{% else %}未配置{% endif %}</td>
      <td>{{ host.fingerprint }}</td>
      <td class="muted">{{ host.last_seen }}</td>
      <td>{% if host.enabled %}启用{% else %}停用{% endif %}</td>
    </tr>
  {% endfor %}
  </tbody>
</table>
{% endif %}

<h2>最近部署</h2>
{% if deployments.is_empty() %}
  <p class="muted">还没有部署记录。</p>
{% else %}
<table>
  <thead><tr><th>部署</th><th>状态</th></tr></thead>
  <tbody>
  {% for deployment in deployments %}
    <tr><td>{{ deployment.0 }}</td><td>{{ deployment.1 }}</td></tr>
  {% endfor %}
  </tbody>
</table>
{% endif %}
{% endblock %}