{% set data = admin.data('config/backups') %} {% set backups = grav.backups.getAvailableBackups() %} {% set profiles = grav.backups.getBackupProfiles() %} {% set purge_config = grav.backups.getPurgeConfig() %} {% set newest_date = (backups|first).date %} {% set newest_backup = newest_date ? newest_date|nicetime(false, false) : 'none' %} {% set oldest_date = (backups|last).date %} {% set oldest_backup = oldest_date ? oldest_date|nicetime(false, false) : 'none' %} {% switch purge_config.trigger %} {% case 'number' %} {% set count = backups|count %} {% set max_backups = purge_config.max_backups_count %} {% if max_backups > 0 %} {% set percent_used = count == 0 ? 0 : 100 - (count / max_backups * 100) %} {% else %} {% set percent_used = 100 %} {% endif %} {% set bar_msg = "PLUGIN_ADMIN.BACKUPS_PURGE_NUMBER"|t(count, purge_config.max_backups_count) %} {% case 'time' %} {% set last = backups|last %} {% set days = last == null ? 0 : (date('now')).diff(last.time).days %} {% set percent_used = days == 0 ? 0 : 100 - (days / purge_config.max_backups_time * 100) %} {% set bar_msg = "PLUGIN_ADMIN.BACKUPS_PURGE_TIME"|t(purge_config.max_backups_time - days) %} {% default %} {% set space_used = grav.backups.getTotalBackupsSize() %} {% set space_available = purge_config.max_backups_space * 1024 * 1024 * 1024 %} {% set percent_used = space_used == 0 ? 0 : 100 - (space_used / space_available * 100) %} {% set bar_msg = "PLUGIN_ADMIN.BACKUPS_PURGE_SPACE"|t(space_used|nicefilesize, space_available|nicefilesize) %} {% endswitch %}

{{ "PLUGIN_ADMIN.BACKUPS_STATS"|t }}

{% if percent_used >= 100 %}
{% else %}
{% endif %}

{{ bar_msg }}

{{ backups|length }} {{ "PLUGIN_ADMIN.BACKUPS_COUNT"|t }} {{ profiles|count }} {{ "PLUGIN_ADMIN.BACKUPS_PROFILES_COUNT"|t }} {{ newest_backup }} {{ "PLUGIN_ADMIN.BACKUPS_NEWEST"|t }} {{ oldest_backup }} {{ "PLUGIN_ADMIN.BACKUPS_OLDEST"|t }}
{% include 'partials/blueprints.html.twig' with { blueprints: data.blueprints, data: data } %} {% include 'partials/modal-changes-detected.html.twig' %}