Files
web/settings-teleporter.lp
RD WebDesign bc01ac0ce0 Fix modal markup
- move buttons to the end of the modal-header
- remove the "hidden" attribute from the QR code element
- replace the old `.col-md-offset-3` class with the new `.offset-md-3`

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-07-29 01:31:14 -03:00

112 lines
7.6 KiB
Lua

<? --[[
* Pi-hole: A black hole for Internet advertisements
* (c) 2023 Pi-hole, LLC (https://pi-hole.net)
* Network-wide ad blocking via your own hardware.
*
* This file is copyright under the latest version of the EUPL.
* Please see LICENSE file for your rights under this license.
--]]
mg.include('scripts/lua/header_authenticated.lp','r')
-- Page title and level selector
PageTitle = "Teleporter"
?>
<? mg.include('scripts/lua/settings_header.lp','r') ?>
<div class="app-content">
<div class="container-fluid">
<div class="row">
<div class="col-md-6">
<div class="card card-warning card-outline">
<div class="card-header">
<h3 class="card-title">Export your Pi-hole's configuration</h3>
</div>
<div class="card-body">
<p><strong>Warning:</strong><br>This archive contains sensitive information about your Pi-hole installation, e.g. your 2FA-TOTP secret (if enabled). Please be careful with this file and do not share it with anyone even if they claim to help you.<br> Your long-term history database <code>pihole-FTL.db</code> must be backed up separately.</p>
<p class='text-danger' id="encryption-warning" style="display: none;"><strong>Warning:</strong><br>You are currently not using an end-to-end encryption. This means that secrets like your 2FA-TOTP secret will be transmitted in plain text. We recommend to use HTTPS when exporting your configuration.</p>
<div class="float-end">
<a class="btn btn-app btn-success" id="GETTeleporter" target="_blank">
<i class="fa fa-save fa-xl"></i><br>Export
</a>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card card-warning card-outline">
<div class="card-header">
<h3 class="card-title">Import previously exported configuration</h3>
</div>
<div class="card-body">
<div class="form-group">
<label for="file">File input</label>
<input type="file" name="file" id="file" accept="application/gzip,application/zip">
<br>
<p class="help-block">When importing settings from a <em>newer</em> version of Pi-hole, not yet existing settings will be ignored. When importing from an <em>older</em> version of Pi-hole, settings for newer features will be initialized with their default values.</p>
</div>
<div class="form-group">
<label for="import-selection">Select what to import</label>
<div class="form-check"><input class="import-select form-check-input" type="checkbox" id="import.config" data-key="config" checked><label class="form-check-label" for="import.config"><strong>Configuration</strong></label></div>
<div class="form-check"><input class="import-select form-check-input" type="checkbox" id="import.dhcp_leases" data-key="dhcp_leases" checked><label class="form-check-label" for="import.dhcp_leases"><strong>DHCP leases</strong></label></div>
<div class="form-check"><input class="import-select form-check-input" type="checkbox" id="import.gravity.group" data-key="config" checked><label class="form-check-label" for="import.gravity.group"><strong>Groups</strong></label></div>
<div class="form-check"><input class="import-select form-check-input" type="checkbox" id="import.gravity.adlist" data-key="config" checked><label class="form-check-label" for="import.gravity.adlist"><strong>Lists</strong></label></div>
<div class="form-check"><input class="import-select form-check-input" type="checkbox" id="import.gravity.domainlist" data-key="config" checked><label class="form-check-label" for="import.gravity.domainlist"><strong>Domains/Regexes</strong></label></div>
<div class="form-check"><input class="import-select form-check-input" type="checkbox" id="import.gravity.client" data-key="config" checked><label class="form-check-label" for="import.gravity.client"><strong>Clients</strong></label></div>
</div>
<div class="float-end">
<a class="btn btn-app btn-success" id="submit-import">
<i class="fa fa-upload fa-xl"></i><br>Import
</a>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="modal-import" style="display: none;">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Importing Pi-hole teleporter file...</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p>Depending on your network speed, it may take a few moments until the file is uploaded and imported. Please be patient and don't interrupt the process...</p>
<div class="text-center">
<i id="import-spinner" class="fas fa-spinner fa-pulse fa-5x"></i>
</div>
<div id="modal-import-success" style="display:none">
<div class="alert alert-success alert-dismissible">
<h4><i class="icon fa fa-fw fa-check"></i> <span id="modal-import-success-title"></span></h4>
<div id="modal-import-success-message"></div>
</div>
</div>
<div id="modal-import-error" style="display:none">
<div class="alert alert-danger alert-dismissible">
<h4><i class="icon fa fa-fw fa-ban"></i> <span id="modal-import-error-title"></span></h4>
<div id="modal-import-error-message"></div>
</div>
</div>
<div id="modal-import-gravity" style="display:none">
<div class="alert alert-info alert-dismissible">
<h4><i class="icon fa fa-fw fa-info-circle"></i> Please run gravity</h4>
<p>Use <a href='<?=webhome?>gravity'>Tools &rarr; Update Gravity</a> or run <code>pihole -g</code> to update your lists.</p>
</div>
</div>
<div id="modal-import-info-message"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary float-start" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div><!-- /.container-fluid -->
</div><!-- /.app-content -->
<script src="<?=pihole.fileversion('vendor/bootstrap5-toggle/bootstrap5-toggle.jquery.min.js')?>"></script>
<script src="<?=pihole.fileversion('scripts/js/settings-teleporter.js')?>"></script>
<script src="<?=pihole.fileversion('scripts/js/settings.js')?>"></script>
<? mg.include('scripts/lua/footer.lp','r')?>