mirror of
https://github.com/pi-hole/web.git
synced 2024-12-06 19:36:21 +01:00
Add "Save and Update" button
This commit is contained in:
@@ -32,9 +32,23 @@ $("#gravityBtn").on("click", () => {
|
||||
eventsource();
|
||||
});
|
||||
|
||||
$("#gravityBtn").on("click", () => {
|
||||
$("#gravityBtn").attr("disabled", true);
|
||||
eventsource();
|
||||
});
|
||||
|
||||
// Handle hiding of alerts
|
||||
$(function(){
|
||||
$("[data-hide]").on("click", function(){
|
||||
$(this).closest("." + $(this).attr("data-hide")).hide();
|
||||
});
|
||||
|
||||
// Do we want to start updating immediately?
|
||||
// gravity.php?go
|
||||
var searchString = window.location.search.substring(1);
|
||||
if(searchString.indexOf("go") !== -1)
|
||||
{
|
||||
$("#gravityBtn").attr("disabled", true);
|
||||
eventsource();
|
||||
}
|
||||
});
|
||||
|
||||
+10
-2
@@ -11,6 +11,14 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
<?php // Check if ad lists should be updated after saving ...
|
||||
if(isset($_POST["submit"])) {
|
||||
if($_POST["submit"] == "saveupdate") {
|
||||
// If that is the case -> refresh to the gravity page and start updating immediately
|
||||
?>
|
||||
<meta http-equiv="refresh" content="1;url=gravity.php?go">
|
||||
<?php }} ?>
|
||||
|
||||
<?php if(isset($debug)){ ?>
|
||||
<div id="alDebug" class="alert alert-warning alert-dismissible fade in" role="alert">
|
||||
<button type="button" class="close" data-hide="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
@@ -665,8 +673,8 @@
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<input type="hidden" name="field" value="adlists">
|
||||
<label>Don't forget to run <a href="gravity.php">Update Lists</a> afterwards</label>
|
||||
<button type="submit" class="btn btn-primary pull-right">Save</button>
|
||||
<button type="submit" class="btn btn-primary" name="submit" value="save">Save</button>
|
||||
<button type="submit" class="btn btn-primary pull-right" name="submit" value="saveupdate">Save and Update</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user