implemented purge

This commit is contained in:
Andy Miller
2018-09-10 14:33:57 -06:00
parent 12bfe9d561
commit 33f577fdb2
7 changed files with 42 additions and 13 deletions

View File

@@ -89,10 +89,10 @@ PLUGIN_ADMIN:
BACKUP: "Backup"
BACKUPS: "Backups"
BACKUP_NOW: "Backup Now"
BACKUPS_STATS: "Backups Statistics"
BACKUPS_HISTORY: "Backups History"
BACKUPS_CONFIG: "Backups Configuration"
BACKUPS_PROFILES: "Backups Profiles"
BACKUPS_STATS: "Backup Statistics"
BACKUPS_HISTORY: "Backup History"
BACKUPS_PURGE_CONFIG: "Backup Purge Configuration"
BACKUPS_PROFILES: "Backup Profiles"
BACKUPS_COUNT: "Number of Backups"
BACKUPS_PROFILES_COUNT: "Number of Profiles"
BACKUPS_TOTAL_SIZE: "Space Used"

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -95,6 +95,9 @@ tr {
&.right.pad {
padding-right: $padding-default;
.form-data {
padding-right: 0;
}
}
&.left.pad {
@@ -165,3 +168,25 @@ tr {
}
}
}
table.noflex {
display: table;
table-layout: auto;
thead {
display: table-header-group;
}
tbody {
display: table-row-group;
}
tr {
display: table-row;
td, th {
flex: none;
display: table-cell;
}
}
}

View File

@@ -1,6 +1,7 @@
<table class="backups-history">
<table class="backups-history noflex">
<thead>
<tr>
<th>#</th>
<th>Backup Date</th>
<th>Name</th>
<th class="right pad">Size</th>
@@ -10,7 +11,8 @@
<tbody>
{% for backup in backups %}
<tr>
<td><i class="fa fa-clock-o"></i> {{ backup.date }}</td>
<td>{{ loop.index }}</td>
<td style="white-space: nowrap;"> <i class="fa fa-clock-o"></i> {{ backup.date }}</td>
<td>{{ backup.title }}</td>
<td class="right pad">{{ backup.size|nicefilesize }}</td>
<td class="right pad">

View File

@@ -1,17 +1,18 @@
{% set jobs = grav.scheduler.getAllJobs() %}
{% set job_states = grav.scheduler.getJobStates().content() %}
<table class="cron-status">
<table class="cron-status noflex">
<thead>
<tr>
<th style="flex:3;">Id</th>
<th style="flex:3;">Job ID</th>
<th style="flex:3;">Run</th>
<th>Status</th>
<th>State</th>
<th class="right pad">State</th>
</tr>
</thead>
<tbody>
{% for job in jobs %}
{{ dump(job) }}
{% set job_status = attribute(data.status,job.id) %}
{% set job_enabled = job_status is defined and job_status == 'disabled' ? 0 : 1 %}
{% set job_id = job.id %}
@@ -46,7 +47,7 @@
<span class="badge {{ run_type }}">{{ run_text|raw }}</span>
</span>
</td>
<td>
<td class="right pad">
<div class="form-data" data-grav-field="toggle" data-grav-disabled="" data-grav-default="null" data-grav-field-name="data[status][{{ job_id }}]">
<div class="switch-toggle switch-grav switch-2 ">
<input type="radio" value="enabled" id="toggle_status.{{ job_id_md5 }}1" name="data[status][{{ job_id }}]" class="highlight" {% if job_enabled %}checked="checked"{% endif %}>

View File

@@ -3,8 +3,9 @@
{% set data = admin.data('config/backups') %}
{% set backups = grav.backups.getAvailableBackups() %}
{% set profiles = grav.backups.getBackupProfiles() %}
{% set purge_config = grav.backups.getPurgeConfig() %}
{% set space_used = grav.backups.getTotalBackupsSize() %}
{% set space_available = grav.config.backups.max_backups_space * 1024 * 1024 * 1024 %}
{% set space_available = purge_config.max_backups_space * 1024 * 1024 * 1024 %}
{% if authorize(['admin.configuration_backups', 'admin.super']) %}
<div id="admin-dashboard">