Initial Backups support

This commit is contained in:
Andy Miller
2018-09-07 18:18:42 -06:00
parent 487bffc3d2
commit 5880254ade
9 changed files with 59 additions and 8 deletions

View File

@@ -841,7 +841,8 @@ class AdminPlugin extends Plugin
{
$event['tools'] = array_merge($event['tools'], [
$this->grav['language']->translate('PLUGIN_ADMIN.DIRECT_INSTALL'),
$this->grav['language']->translate('PLUGIN_ADMIN.SCHEDULER')
$this->grav['language']->translate('PLUGIN_ADMIN.SCHEDULER'),
$this->grav['language']->translate('PLUGIN_ADMIN.BACKUPS')
]);
return $event;
@@ -859,8 +860,8 @@ class AdminPlugin extends Plugin
case 'tools/scheduler':
$e['type'] = 'config/scheduler';
break;
case 'tools/backup':
$e['type'] = 'config/backup';
case 'tools/backups':
$e['type'] = 'config/backups';
break;
}
}

View File

@@ -87,6 +87,9 @@ PLUGIN_ADMIN:
DAYS: "Days"
UPDATE: "Update"
BACKUP: "Backup"
BACKUPS: "Backups"
BACKUPS_HISTORY: "Backups History"
BACKUPS_CONFIG: "Backups Configuration"
STATISTICS: "Statistics"
TODAY: "Today"
WEEK: "Week"

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -675,6 +675,11 @@ textarea.frontmatter {
}
}
[data-grav-field="cron"] {
display: flex;
align-items: center;
}
.cron-install {
margin: 1rem;
@@ -691,9 +696,10 @@ textarea.frontmatter {
}
}
.cron-status {
.cron-status, .backups-history {
margin-bottom: 4rem;
.cron-at code {
font-size: 120%;
padding: 2px 10px;
@@ -709,7 +715,7 @@ textarea.frontmatter {
}
}
form .cron-job-list {
form .cron-job-list, form .backups-list {
li {
display: flex;
flex-direction: row;

View File

@@ -7,7 +7,7 @@
{% set tab_title = (tab_title_string|tu == tab_title_string ? config_slug|capitalize : tab_title_string|tu) %}
{% set title = "PLUGIN_ADMIN.CONFIGURATION"|tu ~ ": " ~ tab_title %}
{% set config_ignores = ['scheduler', 'backup'] %}
{% set config_ignores = ['scheduler', 'backups'] %}
{% if not isInfo %}
{% set data = admin.data('config/' ~ config_slug) %}

View File

@@ -0,0 +1,22 @@
{% set backups = [] %}
<table class="backups-history">
<thead>
<tr>
<th style="flex:3;">Name</th>
<th style="flex:3;">Type</th>
<th>Status</th>
<th>State</th>
</tr>
</thead>
<tbody>
{% for backup in backups %}
<tr>
<td style="flex:3;overflow:hidden;"><kbd>{{ backup.name }}</kbd></td>
<td style="flex:3;">{{ backup.type }}</td>
<td></td>
<td></td>
</tr>
{% endfor %}
</tbody>
</table>

View File

@@ -0,0 +1,6 @@
<div class="button-bar">
<a class="button" href="{{ base_url }}"><i class="fa fa-reply"></i> {{ "PLUGIN_ADMIN.BACK"|tu }}</a>
<button class="button" type="submit" name="task" value="save" form="blueprints"><i class="fa fa-check"></i> {{ "PLUGIN_ADMIN.SAVE"|tu }}</button>
</div>
<h1><i class="fa fa-fw fa-life-saver"></i> {{ "PLUGIN_ADMIN.BACKUPS"|tu }}</h1>

View File

@@ -0,0 +1,13 @@
<div class="scheduler-content">
{% set data = admin.data('config/backups') %}
{% if authorize(['admin.configuration_scheduler', 'admin.super']) %}
{% include 'partials/blueprints.html.twig' with { blueprints: data.blueprints, data: data } %}
{% include 'partials/modal-changes-detected.html.twig' %}
{% endif %}
</div>