290 lines
11 KiB
HTML
290 lines
11 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}CrackLab — Jobs{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="jobs-page">
|
|
|
|
<div class="jobs-page-header">
|
|
<div>
|
|
<h1 class="page-title">Jobs</h1>
|
|
<p class="page-description">
|
|
Формирование заданий для CrackLab-клиентов.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
{% if error %}
|
|
<div class="jobs-message jobs-message-error">
|
|
{{ error }}
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if created_job_id %}
|
|
<div class="jobs-message jobs-message-success">
|
|
Job <strong>{{ created_job_id }}</strong> сформирован.
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if database_statistics %}
|
|
<div class="card">
|
|
<h2>Database</h2>
|
|
|
|
<div class="jobs-stats-grid">
|
|
<div class="jobs-stat-item">
|
|
<div class="stat-value">{{ database_statistics["access_points"] }}</div>
|
|
<div class="stat-title">Access points</div>
|
|
</div>
|
|
|
|
<div class="jobs-stat-item">
|
|
<div class="stat-value">{{ database_statistics["handshakes"] }}</div>
|
|
<div class="stat-title">Handshakes</div>
|
|
</div>
|
|
|
|
<div class="jobs-stat-item">
|
|
<div class="stat-value">{{ database_statistics["unique_hashes"] }}</div>
|
|
<div class="stat-title">Unique hashes</div>
|
|
</div>
|
|
|
|
<div class="jobs-stat-item">
|
|
<div class="stat-value">{{ database_statistics["credentials"] }}</div>
|
|
<div class="stat-title">Handshake Cracked</div>
|
|
</div>
|
|
|
|
<div class="jobs-stat-item">
|
|
<div class="stat-value">{{ database_statistics["cracked_access_points"] }}</div>
|
|
<div class="stat-title">Cracked access points</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="card">
|
|
<h2>New Job</h2>
|
|
|
|
|
|
<form method="get" class="jobs-form">
|
|
|
|
<div class="jobs-form-row">
|
|
<div class="jobs-method-field">
|
|
<label for="method_id">Method</label>
|
|
|
|
<select
|
|
id="method_id"
|
|
name="method_id"
|
|
>
|
|
{% for method in methods %}
|
|
{% for version in method_versions[method["id"]] %}
|
|
<option
|
|
value="{{ method["id"] }}"
|
|
data-version="{{ version["version"] }}"
|
|
{% if selected_method_id == method["id"] and selected_version == version["version"] %}selected{% endif %}
|
|
>
|
|
{{ method["name"] }} — v{{ version["version"] }}
|
|
</option>
|
|
{% endfor %}
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
|
|
<span id="selected-method-label"></span>
|
|
|
|
<input
|
|
type="hidden"
|
|
name="method_version"
|
|
id="method_version"
|
|
value="{{ selected_version or '' }}"
|
|
>
|
|
</div>
|
|
</form>
|
|
|
|
<script>
|
|
document.addEventListener("DOMContentLoaded", function () {
|
|
const methodSelect = document.getElementById("method_id");
|
|
const versionInput = document.getElementById("method_version");
|
|
const selectedMethodLabel = document.getElementById("selected-method-label");
|
|
|
|
if (!methodSelect || !versionInput || !selectedMethodLabel) {
|
|
return;
|
|
}
|
|
|
|
const updateSelectedMethodLabel = function () {
|
|
const selectedOption = methodSelect.options[methodSelect.selectedIndex];
|
|
versionInput.value = selectedOption.dataset.version || "";
|
|
selectedMethodLabel.textContent =
|
|
"Selected: " + selectedOption.textContent.trim();
|
|
};
|
|
|
|
updateSelectedMethodLabel();
|
|
|
|
methodSelect.addEventListener("change", function () {
|
|
updateSelectedMethodLabel();
|
|
methodSelect.form.requestSubmit();
|
|
});
|
|
});
|
|
</script>
|
|
|
|
{% if statistics %}
|
|
<div class="jobs-stats-grid">
|
|
<div class="jobs-stat-item">
|
|
<div class="stat-value">{{ statistics["total_count"] }}</div>
|
|
<div class="stat-title">Handshakes</div>
|
|
</div>
|
|
|
|
<div class="jobs-stat-item">
|
|
<div class="stat-value">{{ statistics["found_count"] }}</div>
|
|
<div class="stat-title">Password Found</div>
|
|
</div>
|
|
|
|
<div class="jobs-stat-item">
|
|
<div class="stat-value">{{ statistics["covered_count"] }}</div>
|
|
<div class="stat-title">Covered</div>
|
|
</div>
|
|
|
|
<div class="jobs-stat-item">
|
|
<div class="stat-value">{{ statistics["reserved_count"] }}</div>
|
|
<div class="stat-title">Reserved</div>
|
|
</div>
|
|
|
|
<div class="jobs-stat-item">
|
|
<div class="stat-value">{{ statistics["available_count"] }}</div>
|
|
<div class="stat-title">Available</div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
|
|
<form method="post" class="jobs-form">
|
|
<input
|
|
type="hidden"
|
|
name="method_id"
|
|
value="{{ selected_method_id }}"
|
|
>
|
|
|
|
<input
|
|
type="hidden"
|
|
name="method_version"
|
|
value="{{ selected_version or '' }}"
|
|
>
|
|
|
|
<div class="jobs-form-row">
|
|
<div class="jobs-method-field">
|
|
<label for="limit">Handshakes in job</label>
|
|
|
|
<input
|
|
id="limit"
|
|
name="limit"
|
|
type="number"
|
|
min="1"
|
|
value="{{ request.form.get('limit', 100) }}"
|
|
>
|
|
</div>
|
|
|
|
<button
|
|
type="submit"
|
|
name="issue_mode"
|
|
value="limited"
|
|
class="methods-button"
|
|
>
|
|
Form Job
|
|
</button>
|
|
|
|
<button
|
|
type="submit"
|
|
name="issue_mode"
|
|
value="all"
|
|
class="methods-button-secondary"
|
|
>
|
|
Issue All Available
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<h2>Issued Jobs</h2>
|
|
|
|
{% if active_jobs %}
|
|
<div class="table-container">
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Job</th>
|
|
<th>Method</th>
|
|
<th>Unique Hashes</th>
|
|
<th>Handshakes</th>
|
|
<th>Created</th>
|
|
<th>Status</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for job in active_jobs %}
|
|
<tr>
|
|
<td>
|
|
<strong>{{ job["id"] }}</strong>
|
|
</td>
|
|
<td>
|
|
{{ method_names.get(job["method_id"], job["method_id"]) }}
|
|
v{{ job["method_version"] }}
|
|
</td>
|
|
<td>{{ job["hash_count"] }}</td>
|
|
<td>{{ job["handshake_count"] }}</td>
|
|
<td>{{ job["created_at"] }}</td>
|
|
<td>
|
|
<span class="badge badge-{{ job["status"]|lower }}">
|
|
{{ job["status"] }}
|
|
</span>
|
|
</td>
|
|
<td>
|
|
<a
|
|
class="methods-button-secondary"
|
|
href="{{ url_for('cracklab.job_download', job_id=job['id']) }}"
|
|
>
|
|
Download ZIP
|
|
</a>
|
|
|
|
{% if job["status"] in ["CREATED", "QUEUED", "RUNNING", "PARTIAL"] %}
|
|
<form
|
|
method="post"
|
|
action="{{ url_for('cracklab.job_cancel', job_id=job['id']) }}"
|
|
style="display: inline;"
|
|
onsubmit="return confirm('Cancel this job?');"
|
|
>
|
|
<button
|
|
type="submit"
|
|
class="methods-button-secondary"
|
|
>
|
|
Cancel
|
|
</button>
|
|
</form>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% else %}
|
|
<div class="empty-state">
|
|
No active jobs.
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<script>
|
|
const methodSelect = document.getElementById("method_id");
|
|
const versionInput = document.getElementById("method_version");
|
|
|
|
if (methodSelect && versionInput) {
|
|
methodSelect.addEventListener("change", function () {
|
|
const option = this.options[this.selectedIndex];
|
|
versionInput.value = option.dataset.version || "";
|
|
});
|
|
}
|
|
</script>
|
|
{% endblock %}
|