Добавить templates/index.html
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Проверки SMART{% endblock %}
|
||||
{% block content %}
|
||||
<h1>Проверки SMART</h1>
|
||||
|
||||
<section class="card">
|
||||
<h2>Запустить новую проверку</h2>
|
||||
<form method="post" action="{{ url_for('run') }}">
|
||||
<div class="form-grid">
|
||||
<div class="form-group">
|
||||
<label>SSH host</label>
|
||||
<input name="ssh_host" required placeholder="10.0.0.1">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Пользователь</label>
|
||||
<input name="user" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Пароль</label>
|
||||
<input name="password" type="password">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>SSH-ключ</label>
|
||||
<input name="key_path" placeholder="/home/me/.ssh/id_rsa">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Порт</label>
|
||||
<input name="port" type="number" value="22">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Имя СХД (override)</label>
|
||||
<input name="hostname" placeholder="опционально">
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn">Поехали</button>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section class="card">
|
||||
<h2>История</h2>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th><th>СХД</th><th>SSH</th><th>Старт</th><th>Финиш</th>
|
||||
<th>Статус</th><th>Дисков</th><th>Плохих</th><th>ZIP</th><th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for r in runs %}
|
||||
<tr>
|
||||
<td>{{ r['id'] }}</td>
|
||||
<td><a href="{{ url_for('run_detail', run_id=r['id']) }}">{{ r['hostname'] }}</a></td>
|
||||
<td>{{ r['ssh_host'] or '' }}</td>
|
||||
<td>{{ r['started_at'] }}</td>
|
||||
<td>{{ r['finished_at'] or '—' }}</td>
|
||||
<td>
|
||||
{% if r['id'] in in_progress %}<span class="badge-running">⏳ running</span>
|
||||
{% elif r['status'] == 'ok' %}<span class="badge-ok">✅ ok</span>
|
||||
{% elif r['status'] == 'error' %}<span class="badge-error">❌ error</span>
|
||||
{% else %}{{ r['status'] }}{% endif %}
|
||||
</td>
|
||||
<td>{{ r['drives_count'] }}</td>
|
||||
<td>{{ r['bad_count'] }}</td>
|
||||
<td>
|
||||
{% if r['archive'] %}
|
||||
<a href="{{ url_for('run_download', run_id=r['id']) }}" class="btn" style="padding: 0.2rem 0.5rem; font-size: 0.8rem;">⬇ zip</a>
|
||||
{% else %}—{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<form method="post" action="{{ url_for('run_delete', run_id=r['id']) }}" style="display:inline;" onsubmit="return confirm('Удалить запись из БД?');">
|
||||
<button type="submit" class="btn btn-danger">✖</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr><td colspan="10" style="text-align:center; color:#94a3b8;">Пока пусто</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user