super-productivity/app-src/scripts/settings/backup-settings/backup-settings-d.html
2017-11-29 22:26:43 +00:00

99 lines
3.5 KiB
HTML

<h2 class="md-title">
<ng-md-icon icon="swap_vert"></ng-md-icon>
Backup and Sync
</h2>
<help-section>
<p>Here you can export all your data as a
<strong>JSON</strong> for backups, but also to use it in a different context (e.g. you might want to export your projects in the browser and import them into the desktop version).
</p>
<p>The import expects valid JSON to be copied into the text area.
<strong>NOTE: Once you hit the import button all your current settings and data will be overwritten!</strong></p>
<section ng-if="vm.IS_ELECTRON">
<p>There is also the option to do
<strong>automatic backups</strong>. You can choose an interval in seconds of how often the backup should occur and a custom destination to where the backup should be saved. You can use `{unix}` and `{date}` inside the path string to add output a unix timestamp or a date at this location of the string. E.g. `/mypath/{date}.json` will save your data to `/mypath/2017-12-12.json.
</p>
</section>
</help-section>
<a class="md-raised md-button md-ink-ripple"
type="button"
download-backup>
<ng-md-icon icon="file_download"
aria-label="download settings"></ng-md-icon>
Export your tasks and settings
<div class="md-ripple-container"></div>
</a>
<md-button
class="md-raised"
ng-click="vm.showUploadForm=!vm.showUploadForm;">
<ng-md-icon icon="file_upload"
aria-label="import settings"></ng-md-icon>
Import Settings
</md-button>
<form ng-if="vm.showUploadForm"
ng-submit="vm.importSettings(vm.uploadSettingsTextarea)">
<md-input-container class="md-block"
flex-gt-sm>
<label>Copy and paste the contents of the saved JSON file here</label>
<textarea ng-model="vm.uploadSettingsTextarea"
md-auto-focus
rows="3"></textarea>
</md-input-container>
<div><strong>NOTE: Once you hit the import button all your current settings and data will be overwritten!</strong>
</div>
<md-button type="submit"
class="md-raised md-primary">Import settings
</md-button>
</form>
<section ng-if="vm.IS_ELECTRON">
<h3 class="md-caption">Automatic Backups</h3>
<div>
<md-switch ng-model="vm.settings.isEnabled"
aria-label="Enable automatic backups">
Enable automatic backups
</md-switch>
</div>
<p><strong>NOTE:</strong> Changes to automated backup settings require you to restart the application to take effect.
</p>
<div ng-show="vm.settings.isEnabled">
<md-input-container class="md-block">
<label>Interval in seconds to make backups</label>
<input type="number"
ng-model="vm.settings.intervalInSeconds">
</md-input-container>
<md-input-container class="md-block">
<label>Path to backup (e.g. ~/backup-{date}.json)</label>
<input type="text"
ng-model="vm.settings.path">
</md-input-container>
</div>
<h3 class="md-caption">Automatic Sync</h3>
<div>
<md-switch ng-model="vm.settings.isSyncEnabled"
aria-label="Enable automatic backups">
Enable auto sync
</md-switch>
</div>
<p><strong>NOTE:</strong> This is <strong>a highly experimental feature!!!</strong> Take care! Make a backup! Changes to the sync settings require you to restart the application to take effect.
</p>
<div ng-show="vm.settings.isSyncEnabled">
<md-input-container class="md-block">
<label>Path to sync file</label>
<input type="text"
ng-model="vm.settings.syncPath">
</md-input-container>
</div>
</section>