{% extends "base.html" %}
{% block title %}devendra · adopt {{ id }}{% endblock %}
{% block content %}
<p class="muted"><a href="/">← hosts</a></p>
<h1>Adopt files · {{ id }}</h1>
{% if not has_report %}
<div class="card muted">
No pending adoption proposal for <code>{{ id }}</code>.
Run <code>devendra-agent adopt --host-id {{ id }} --ticket '…'</code> on the host.
</div>
{% else %}
<p class="muted">
Discovered under <code>{{ scan_dir }}</code> · {{ age }} ·
{{ files | length }} file{{ files | length != 1 and "s" or "" }}.
Accepting a file copies it into <code>config/files/{{ id }}/…</code>, adds it to
this host's config, and publishes it.
</p>
{% if files %}
<form method="post" action="/hosts/{{ id }}/adopt" style="margin:1rem 0">
<button type="submit" name="all" value="1">Adopt all {{ files | length }} files</button>
</form>
{% for f in files %}
<div class="card">
<div style="display:flex; gap:.6rem; align-items:baseline; flex-wrap:wrap">
<code class="break" style="font-weight:600">{{ f.path }}</code>
<span class="muted">mode {{ f.mode }} · {{ f.size }} B</span>
<form method="post" action="/hosts/{{ id }}/adopt" style="margin-left:auto">
<input type="hidden" name="path" value="{{ f.path }}">
<button type="submit">Adopt this file</button>
</form>
</div>
{% if f.preview is not none %}
<pre class="code">{{ f.preview }}{% if f.truncated %}
… (truncated){% endif %}</pre>
{% else %}
<p class="muted">Binary file — no preview.</p>
{% endif %}
</div>
{% endfor %}
{% else %}
<div class="card muted">The proposal is empty (no files found on the host).</div>
{% endif %}
{% endif %}
{% endblock %}
neiam
/devendra
public · Issues · Pulls · Labels · Forks · Compare · Actions failure · Badges · Packages
⭐
Log in to mark this repository.
1.8 KiB · text
History
e832e77