{% extends "base.html" %}
{% block title %}Fissue · 新手引导{% endblock %}
{% block content %}
<h2>新手引导</h2>
{% if !deploy_enabled %}
<p class="muted">⚠️ 部署能力未开启(<code>deploy.enabled=false</code>):引导可以看,但写操作会被拒绝。</p>
{% endif %}
{% if source == "fallback" %}
<p class="muted">当前是<b>通用兜底步骤</b>({{ source }}):没有针对这个仓库的细节,但照样能走完。</p>
{% else %}
<p class="muted">来源:{{ source }}{% if !updated_at.is_empty() %} · 更新于 {{ updated_at }}{% endif %}</p>
{% endif %}
{% if !notes.is_empty() %}
<p class="muted">{{ notes }}</p>
{% endif %}
<form method="get" action="/ops/guide" style="display:flex; gap:8px; margin-bottom:16px;">
<input name="repo" value="{{ repo_slug }}" placeholder="owner/name" style="padding:6px; flex:1;">
<select name="host" style="padding:6px;">
<option value="">(不指定主机)</option>
{% for h in hosts %}
<option value="{{ h }}" {% if h.as_str() == host.as_str() %}selected{% endif %}>{{ h }}</option>
{% endfor %}
</select>
<button type="submit">查看</button>
</form>
{% for stage in stages %}
<h2>{{ stage.title }}</h2>
{% if !stage.goal.is_empty() %}
<p class="muted">{{ stage.goal }}</p>
{% endif %}
{% for step in stage.steps %}
<div class="panel" style="margin-bottom:10px;">
<h3>{{ step.title }}</h3>
{% if !step.why.is_empty() %}<p>{{ step.why }}</p>{% endif %}
{% if !step.command.is_empty() %}
<pre>{{ step.command }}</pre>
{% endif %}
{% if !step.verify.is_empty() %}
<p class="muted">怎么确认成了:{{ step.verify }}</p>
{% endif %}
{% if !step.cautions.is_empty() %}
<p class="muted">⚠️ {% for c in step.cautions %}{{ c }}{% if !loop.last %};{% endif %}{% endfor %}</p>
{% endif %}
</div>
{% endfor %}
{% endfor %}
{% endblock %}