Skip to content

Commit

Permalink
Show extra info alert on successful import to remind users they shoul…
Browse files Browse the repository at this point in the history
…d run gravity's update

Signed-off-by: DL6ER <[email protected]>
  • Loading branch information
DL6ER committed Nov 3, 2023
1 parent ca0346a commit db3fcb4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 2 additions & 3 deletions scripts/pi-hole/js/settings-teleporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,15 @@ function importZIP() {
if (data.error.hint !== null) $("#modal-import-error-message").text(data.error.hint);
} else if ("files" in data) {
$("#modal-import-success").show();
$("#modal-import-success-title").text(
"Import successful, please run pihole -g to update gravity."
);
$("#modal-import-success-title").text("Import successful");
var text = "<p>Processed files:<ul>";
for (var i = 0; i < data.files.length; i++) {
text += "<li>/" + utils.escapeHtml(data.files[i]) + "</li>";
}

text += "</ul></p>";
$("#modal-import-success-message").html(text);
$("#modal-import-gravity").show();
}

if ("took" in data) {
Expand Down
6 changes: 6 additions & 0 deletions settings-teleporter.lp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ mg.include('scripts/pi-hole/lua/settings_header.lp','r')
<p id="modal-import-error-message"></p>
</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='/admin/gravity'>Tools &rarr; Gravity</a> or run <code>pihole -g</code> to update your lists.</p>
</div>
</div>
<p id="modal-import-info-message"></p>
</div>
<div class="modal-footer">
Expand Down

0 comments on commit db3fcb4

Please sign in to comment.