-
-
Notifications
You must be signed in to change notification settings - Fork 459
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
more bootstrap-5.3 adjustments in css-classes etc.
Signed-off-by: Michael Kaufmann <[email protected]>
- Loading branch information
Showing
4 changed files
with
144 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,38 @@ | ||
{% macro ditem(lngstr, available, used, assigned = null, formatbytes = false, byte_usage = null) %} | ||
<div class="col border-end border-bottom p-3"> | ||
<div class="row mb-1"> | ||
<div class="col text-truncate">{{ lng(lngstr) }}{% if byte_usage %} <small>({{ byte_usage|formatBytes }})</small>{% endif %}</div> | ||
<div class="col-auto"> | ||
<small>{% if formatbytes %}{{ used|formatBytes }}{% else %}{{ used }}{% endif %}/{% if available < 0 %}{{ lng('panel.unlimited') }}{% else %}{% if formatbytes %}{{ available|formatBytes }}{% else %}{{ available }}{% endif %}{% endif %}</small> | ||
</div> | ||
</div> | ||
<div class="progress progress-thin my-auto"> | ||
{% set usageperc = 1 %} | ||
{% if available > 0 %} | ||
{% set usageperc = (used / available) * 100|round %} | ||
{% endif %} | ||
<div | ||
class="progress-bar{% if available < 0 %} bg-secondary{% elseif usageperc >= 75 and usageperc < 90 %} bg-warning{% elseif usageperc >= 90 %} bg-danger{% endif %}" | ||
role="progressbar" | ||
style="width: {% if available < 0 %}100{% else %}{{ usageperc }}{% endif %}%;" | ||
aria-valuenow="{% if available < 0 %}100{% else %}{{ used }}{% endif %}" | ||
aria-valuemin="0" | ||
aria-valuemax="{% if available < 0 %}100{% else %}{{ available }}{% endif %}"></div> | ||
</div> | ||
{% if assigned is not empty %} | ||
<div class="progress progress-thin mt-2 my-auto"> | ||
<div class="progress-bar bg-primary" role="progressbar" | ||
style="width:{% if available > 0 %}{{ (assigned / available) * 100|round }}{% else %}1{% endif %}%;" | ||
aria-valuenow="{{ assigned }}" aria-valuemin="0" | ||
aria-valuemax="{{ available }}"></div> | ||
</div> | ||
{% endif %} | ||
</div> | ||
<div class="col border-end border-bottom p-3"> | ||
<div class="row mb-1"> | ||
<div class="col text-truncate">{{ lng(lngstr) }}{% if byte_usage %} <small>({{ byte_usage|formatBytes }} | ||
)</small>{% endif %}</div> | ||
<div class="col-auto"> | ||
<small>{% if formatbytes %}{{ used|formatBytes }}{% else %}{{ used }}{% endif %} | ||
/{% if available < 0 %}{{ lng('panel.unlimited') }}{% else %}{% if formatbytes %}{{ available|formatBytes }}{% else %}{{ available }}{% endif %}{% endif %}</small> | ||
</div> | ||
</div> | ||
{% set usageperc = 1 %} | ||
{% if available > 0 %} | ||
{% set usageperc = (used / available) * 100|round %} | ||
{% endif %} | ||
<div class="progress progress-thin my-auto" | ||
role="progressbar" | ||
aria-valuenow="{% if available < 0 %}100{% else %}{{ used }}{% endif %}" | ||
aria-valuemin="0" | ||
aria-valuemax="{% if available < 0 %}100{% else %}{{ available }}{% endif %}" | ||
> | ||
<div | ||
class="progress-bar{% if available < 0 %} bg-secondary{% elseif usageperc >= 75 and usageperc < 90 %} bg-warning{% elseif usageperc >= 90 %} bg-danger{% endif %}" | ||
style="width: {% if available < 0 %}100{% else %}{{ usageperc }}{% endif %}%;" | ||
></div> | ||
</div> | ||
{% if assigned is not empty %} | ||
<div class="progress progress-thin mt-2 my-auto" | ||
role="progressbar" | ||
aria-valuenow="{{ assigned }}" | ||
aria-valuemin="0" | ||
aria-valuemax="{{ available }}" | ||
> | ||
<div class="progress-bar bg-primary" | ||
style="width:{% if available > 0 %}{{ (assigned / available) * 100|round }}{% else %}1{% endif %}%;"></div> | ||
</div> | ||
{% endif %} | ||
</div> | ||
{% endmacro %} |