mirror of
https://github.com/pi-hole/web.git
synced 2026-05-08 09:39:05 +01:00
Clear input fields after successfully adding new items (#2832)
This applies to Clients, Domains, Lists, DNS records and CNAME records.
This commit is contained in:
@@ -459,6 +459,7 @@ function addClient() {
|
||||
utils.enableAll();
|
||||
utils.listsAlert("client", ips, data);
|
||||
reloadClientSuggestions();
|
||||
$("#new_comment").val("");
|
||||
table.ajax.reload(null, false);
|
||||
table.rows().deselect();
|
||||
|
||||
|
||||
@@ -553,6 +553,10 @@ function addDomain() {
|
||||
success: function (data) {
|
||||
utils.enableAll();
|
||||
utils.listsAlert("domain", domains, data);
|
||||
$("#new_domain").val("");
|
||||
$("#new_domain_comment").val("");
|
||||
$("#new_regex").val("");
|
||||
$("#new_regex_comment").val("");
|
||||
table.ajax.reload(null, false);
|
||||
table.rows().deselect();
|
||||
|
||||
|
||||
@@ -529,6 +529,8 @@ function addList(event) {
|
||||
success: function (data) {
|
||||
utils.enableAll();
|
||||
utils.listsAlert("list", addresses, data);
|
||||
$("#new_address").val("");
|
||||
$("#new_comment").val("");
|
||||
table.ajax.reload(null, false);
|
||||
table.rows().deselect();
|
||||
|
||||
|
||||
@@ -225,6 +225,8 @@ $(document).ready(function () {
|
||||
.done(function () {
|
||||
utils.enableAll();
|
||||
utils.showAlert("success", "fas fa-plus", "Successfully added DNS record", elem);
|
||||
$("#Hdomain").val("");
|
||||
$("#Hip").val("");
|
||||
$("#hosts-Table").DataTable().ajax.reload(null, false);
|
||||
})
|
||||
.fail(function (data, exception) {
|
||||
@@ -249,6 +251,8 @@ $(document).ready(function () {
|
||||
.done(function () {
|
||||
utils.enableAll();
|
||||
utils.showAlert("success", "fas fa-plus", "Successfully added CNAME record", elem);
|
||||
$("#Cdomain").val("");
|
||||
$("#Ctarget").val("");
|
||||
$("#cnameRecords-Table").DataTable().ajax.reload(null, false);
|
||||
})
|
||||
.fail(function (data, exception) {
|
||||
|
||||
Reference in New Issue
Block a user