v1
This commit is contained in:
@@ -59,6 +59,38 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<div class="card card-elevated">
|
||||
<div class="card-header">
|
||||
<h2 class="h5 mb-0">Storage limit</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="text-muted small mb-2">
|
||||
Used: <strong>{{ storage.used_bytes }}</strong> bytes
|
||||
</div>
|
||||
|
||||
<form method="post" action="{{ url_for('admin.update_company_storage', company_id=company.id) }}" class="d-flex gap-2 flex-wrap align-items-end">
|
||||
<div>
|
||||
<label class="form-label">Max storage (MB)</label>
|
||||
<input
|
||||
class="form-control"
|
||||
type="number"
|
||||
name="storage_max_mb"
|
||||
min="0"
|
||||
step="1"
|
||||
value="{{ (company.storage_max_bytes / (1024*1024))|int if company.storage_max_bytes else '' }}"
|
||||
placeholder="(empty = unlimited)"
|
||||
/>
|
||||
<div class="text-muted small">Set to 0 or empty to disable the limit.</div>
|
||||
</div>
|
||||
<div>
|
||||
<button class="btn btn-brand" type="submit">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-4">
|
||||
<div class="col-12 col-lg-6">
|
||||
<div class="card card-elevated">
|
||||
|
||||
@@ -44,6 +44,28 @@
|
||||
<div class="text-muted small">Storage used</div>
|
||||
<div class="fs-4 fw-bold">{{ stats['storage_human'] }}</div>
|
||||
<div class="text-muted small">({{ stats['storage_bytes'] }} bytes)</div>
|
||||
{% if stats.get('storage_max_human') %}
|
||||
<div class="text-muted small mt-1">
|
||||
Limit: <strong>{{ stats['storage_max_human'] }}</strong>
|
||||
{% if stats.get('storage_used_percent') is not none %}
|
||||
— Used: <strong>{{ stats['storage_used_percent'] }}%</strong>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if stats.get('storage_used_percent') is not none %}
|
||||
<div class="progress mt-1" style="height: 8px;">
|
||||
<div
|
||||
class="progress-bar {% if stats['storage_used_percent'] >= 100 %}bg-danger{% elif stats['storage_used_percent'] >= 90 %}bg-warning{% else %}bg-success{% endif %}"
|
||||
role="progressbar"
|
||||
style="width: {{ [stats['storage_used_percent'], 100]|min }}%"
|
||||
aria-valuenow="{{ stats['storage_used_percent'] }}"
|
||||
aria-valuemin="0"
|
||||
aria-valuemax="100"
|
||||
></div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<div class="text-muted small mt-1">Limit: <strong>Unlimited</strong></div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user