2022-07-17 18:16:00 +00:00
|
|
|
<!--
|
2024-01-26 20:03:41 +00:00
|
|
|
Copyright (C) 2024 Nicola Murino
|
2022-07-17 18:16:00 +00:00
|
|
|
|
2024-01-26 20:03:41 +00:00
|
|
|
This WebUI uses the KeenThemes Mega Bundle, a proprietary theme:
|
2022-07-17 18:16:00 +00:00
|
|
|
|
2024-01-26 20:03:41 +00:00
|
|
|
https://keenthemes.com/products/templates-mega-bundle
|
2022-07-17 18:16:00 +00:00
|
|
|
|
2024-01-26 20:03:41 +00:00
|
|
|
KeenThemes HTML/CSS/JS components are allowed for use only within the
|
|
|
|
SFTPGo product and restricted to be used in a resealable HTML template
|
|
|
|
that can compete with KeenThemes products anyhow.
|
|
|
|
|
|
|
|
This WebUI is allowed for use only within the SFTPGo product and
|
|
|
|
therefore cannot be used in derivative works/products without an
|
|
|
|
explicit grant from the SFTPGo Team (support@sftpgo.com).
|
2022-07-17 18:16:00 +00:00
|
|
|
-->
|
2021-01-22 18:42:18 +00:00
|
|
|
{{template "base" .}}
|
|
|
|
|
2024-01-26 20:03:41 +00:00
|
|
|
{{- define "page_body"}}
|
|
|
|
<div class="card shadow-sm">
|
|
|
|
<div class="card-header bg-light">
|
|
|
|
<h3 data-i18n="maintenance.restore" class="card-title section-title">Restore</h3>
|
2021-01-22 18:42:18 +00:00
|
|
|
</div>
|
|
|
|
<div class="card-body">
|
2024-01-26 20:03:41 +00:00
|
|
|
{{- template "errmsg" .Error}}
|
2021-01-22 18:42:18 +00:00
|
|
|
<form id="restore_form" enctype="multipart/form-data" action="{{.RestorePath}}" method="POST">
|
2024-01-26 20:03:41 +00:00
|
|
|
|
2021-01-22 18:42:18 +00:00
|
|
|
<div class="form-group row">
|
2024-01-26 20:03:41 +00:00
|
|
|
<label for="idBackupFile" data-i18n="maintenance.backup_file" class="col-md-3 col-form-label">Backup file</label>
|
|
|
|
<div class="col-md-9">
|
|
|
|
<input id="idBackupFile" type="file" accept="application/json" required class="form-control" name="backup_file" aria-describedby="idBackupFileHelp" />
|
|
|
|
<div id="idBackupFileHelp" class="form-text" data-i18n="maintenance.backup_file_help"></div>
|
2021-01-22 18:42:18 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2024-01-26 20:03:41 +00:00
|
|
|
|
|
|
|
<div class="form-group row mt-10">
|
|
|
|
<label for="idMode" data-i18n="general.mode" class="col-md-3 col-form-label">Mode</label>
|
|
|
|
<div class="col-md-9">
|
|
|
|
<select id="idMode" name="mode" class="form-select" data-control="i18n-select2" data-hide-search="true">
|
|
|
|
<option data-i18n="maintenance.restore_mode1" value="1">add only</option>
|
|
|
|
<option data-i18n="maintenance.restore_mode0" value="0">add and update</option>
|
|
|
|
<option data-i18n="maintenance.restore_mode2" value="2">add, update and disconnect</option>
|
2021-01-22 18:42:18 +00:00
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-01-26 20:03:41 +00:00
|
|
|
|
|
|
|
<div class="form-group row mt-10">
|
|
|
|
<label for="idQuota" data-i18n="maintenance.after_restore" class="col-md-3 col-form-label">After restore</label>
|
|
|
|
<div class="col-md-9">
|
|
|
|
<select id="idQuota" name="quota" class="form-select" data-control="i18n-select2" data-hide-search="true">
|
|
|
|
<option data-i18n="maintenance.quota_mode0" value="0">no quota update</option>
|
|
|
|
<option data-i18n="maintenance.quota_mode1" value="1">update quota</option>
|
|
|
|
<option data-i18n="maintenance.quota_mode2" value="2">update quota if the user has quota restrictions</option>
|
2021-01-22 18:42:18 +00:00
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-01-26 20:03:41 +00:00
|
|
|
|
|
|
|
<div class="d-flex justify-content-end mt-12">
|
|
|
|
<input type="hidden" name="_form_token" value="{{.CSRFToken}}">
|
|
|
|
<button type="submit" id="form_submit" class="btn btn-primary px-10" name="form_action" value="submit">
|
|
|
|
<span data-i18n="maintenance.restore" class="indicator-label">
|
|
|
|
Restore
|
|
|
|
</span>
|
|
|
|
<span data-i18n="general.wait" class="indicator-progress">
|
|
|
|
Please wait...
|
|
|
|
<span class="spinner-border spinner-border-sm align-middle ms-2"></span>
|
|
|
|
</span>
|
|
|
|
</button>
|
|
|
|
</div>
|
2021-01-22 18:42:18 +00:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2024-01-26 20:03:41 +00:00
|
|
|
<div class="card shadow-sm mt-10">
|
|
|
|
<div class="card-header bg-light">
|
|
|
|
<h3 data-i18n="maintenance.backup" class="card-title section-title">Backup</h3>
|
2021-01-22 18:42:18 +00:00
|
|
|
</div>
|
|
|
|
<div class="card-body">
|
2024-01-26 20:03:41 +00:00
|
|
|
<div>
|
|
|
|
<a href="{{.BackupPath}}?output-data=1" target="_blank" class="btn btn-primary btn-block">
|
|
|
|
<span data-i18n="maintenance.backup_do">Backup your data</span>
|
|
|
|
</a>
|
|
|
|
</div>
|
2021-01-22 18:42:18 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2024-01-26 20:03:41 +00:00
|
|
|
|
|
|
|
{{- end}}
|
|
|
|
|
|
|
|
{{- define "extra_js"}}
|
|
|
|
<script type="text/javascript" {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}}>
|
|
|
|
$(document).on("i18nshow", function(){
|
|
|
|
$('#restore_form').submit(function (event) {
|
|
|
|
let submitButton = document.querySelector('#form_submit');
|
|
|
|
submitButton.setAttribute('data-kt-indicator', 'on');
|
|
|
|
submitButton.disabled = true;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
{{- end}}
|