form to backup and restore

pull/1/head
Ondřej Hruška 7 years ago
parent 8327ff0108
commit 3a4d4b5937
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 4
      _pages.php
  2. 2
      lang/common.php
  3. 5
      lang/en.php
  4. 23
      pages/cfg_system.php
  5. 7
      sass/form/_form_layout.scss

@ -41,7 +41,9 @@ pg('help', 'cfg page-help', 'help', '/help');
pg('about', 'cfg page-about', 'about', '/about'); pg('about', 'cfg page-about', 'about', '/about');
pg('term', 'term', '', '/', 'title.term'); pg('term', 'term', '', '/', 'title.term');
pg('reset_screen', 'api', '', '/api/v1/clear', 'title.term'); pg('reset_screen', 'api', '', '/api/v1/clear');
pg('ini_export', 'api', '', '/cfg/system/export');
pg('ini_import', 'api', '', '/cfg/system/import');
pg('index', 'api', '', '/', ''); pg('index', 'api', '', '/', '');

@ -16,4 +16,6 @@ return [
'menu.restore_hard' => '', 'menu.restore_hard' => '',
'menu.reset_screen' => '', 'menu.reset_screen' => '',
'menu.index' => '', 'menu.index' => '',
'menu.ini_export' => '',
'menu.ini_import' => '',
]; ];

@ -229,6 +229,11 @@ return [
'persist.restore_hard_explain' => 'persist.restore_hard_explain' =>
'(This clears the WiFi config! Does not affect saved defaults or admin password.)', '(This clears the WiFi config! Does not affect saved defaults or admin password.)',
'backup.title' => 'Back-up Config File',
'backup.explain' => 'All config except the admin password can be backed up and restored using an INI file.',
'backup.export' => 'Export to file',
'backup.import' => 'Import!',
// UART settings form // UART settings form
'uart.title' => 'Serial Port Parameters', 'uart.title' => 'Serial Port Parameters',

@ -27,6 +27,29 @@
</div> </div>
</div> </div>
<!-- Backup -->
<div class="Box str mobcol">
<h2 tabindex=0><?= tr('backup.title') ?></h2>
<div class="Row explain nomargintop">
<?= tr('backup.explain') ?>
</div>
<div class="Row buttons2">
<a class="button"
href="<?= e(url('ini_export')) ?>">
<?= tr('backup.export') ?>
</a>
</div>
<div class="Row buttons2">
<form method="POST" action="<?= e(url('ini_import')) ?>" enctype='multipart/form-data'>
<span class="filewrap"><input accept=".ini,text/plain" type="file" name="file"></span>
<input type="submit" value="<?= tr('backup.import') ?>">
</form>
</div>
</div>
<!-- Overclock --> <!-- Overclock -->
<form class="Box str mobcol" action="<?= e(url('system_set')) ?>" method="GET" id="form-hw"> <form class="Box str mobcol" action="<?= e(url('system_set')) ?>" method="GET" id="form-hw">
<h2 tabindex=0><?= tr('hwtuning.title') ?></h2> <h2 tabindex=0><?= tr('hwtuning.title') ?></h2>

@ -110,6 +110,13 @@ form { @include naked(); }
border-top: 2px solid rgba(255, 255, 255, 0.1); border-top: 2px solid rgba(255, 255, 255, 0.1);
} }
.filewrap {
background: $c-form-field-bg;
padding: 6px 10px;
border-radius: 3px;
border: 1px solid #666666;
}
textarea { textarea {
display: inline-block; display: inline-block;
vertical-align: top; vertical-align: top;

Loading…
Cancel
Save