Fix notification icon and add details for Local DNS/CNAME records

Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
Christian König
2023-11-05 21:48:18 +01:00
parent 1586a94021
commit 6f6f0f98fd
2 changed files with 13 additions and 7 deletions
+11 -6
View File
@@ -156,7 +156,7 @@ function deleteRecord() {
function delHosts(elem) {
utils.disableAll();
utils.showAlert("info", "", "Deleting DNS record...");
utils.showAlert("info", "", "Deleting DNS record...", elem);
const url = "/api/config/dns/hosts/" + encodeURIComponent(elem);
$.ajax({
@@ -165,7 +165,7 @@ function delHosts(elem) {
})
.done(function () {
utils.enableAll();
utils.showAlert("success", "far fa-trash-alt", "Successfully deleted DNS record", "");
utils.showAlert("success", "fas fa-trash-alt", "Successfully deleted DNS record", elem);
$("#hosts-Table").DataTable().ajax.reload(null, false);
})
.fail(function (data, exception) {
@@ -183,7 +183,7 @@ function delHosts(elem) {
function delCNAME(elem) {
utils.disableAll();
utils.showAlert("info", "", "Deleting local CNAME record...");
utils.showAlert("info", "", "Deleting local CNAME record...", elem);
const url = "/api/config/dns/cnameRecords/" + encodeURIComponent(elem);
$.ajax({
@@ -192,7 +192,12 @@ function delCNAME(elem) {
})
.done(function () {
utils.enableAll();
utils.showAlert("success", "far fa-trash-alt", "Successfully deleted local CNAME record", "");
utils.showAlert(
"success",
"fas fa-trash-alt",
"Successfully deleted local CNAME record",
elem
);
$("#cnameRecords-Table").DataTable().ajax.reload(null, false);
})
.fail(function (data, exception) {
@@ -220,7 +225,7 @@ $(document).ready(function () {
})
.done(function () {
utils.enableAll();
utils.showAlert("success", "far fa-plus", "Successfully added DNS record", "");
utils.showAlert("success", "fas fa-plus", "Successfully added DNS record", elem);
$("#hosts-Table").DataTable().ajax.reload(null, false);
})
.fail(function (data, exception) {
@@ -244,7 +249,7 @@ $(document).ready(function () {
})
.done(function () {
utils.enableAll();
utils.showAlert("success", "far fa-plus", "Successfully added CNAME record", "");
utils.showAlert("success", "fas fa-plus", "Successfully added CNAME record", elem);
$("#cnameRecords-Table").DataTable().ajax.reload(null, false);
})
.fail(function (data, exception) {
+2 -1
View File
@@ -88,6 +88,7 @@ function showAlert(type, icon, title, message) {
const options = {
title: "&nbsp;<strong>" + title + "</strong><br>",
message: message,
icon: icon,
},
settings = {
type: type,
@@ -100,7 +101,7 @@ function showAlert(type, icon, title, message) {
};
switch (type) {
case "info":
options.icon = icon !== null && icon.len > 0 ? icon : "far fa-clock";
options.icon = icon !== null && icon.len > 0 ? icon : "fas fa-clock";
break;
case "success":