diff --git a/account/assets/js/panelHandlers/domains_subdomains/domain_management.js b/account/assets/js/panelHandlers/domains_subdomains/domain_management.js index 91d5c80..469ad47 100644 --- a/account/assets/js/panelHandlers/domains_subdomains/domain_management.js +++ b/account/assets/js/panelHandlers/domains_subdomains/domain_management.js @@ -4,9 +4,45 @@ jQuery('._js_domain-management').on('click', function(e){ e.preventDefault(); ListDomains(BUNDLE_NAME); + ListServerNameservers(); domainManagementModal.modal('show'); }); +function ListServerNameservers() { + var display = jQuery('._js_server-nameservers'); + + var xhr = new XMLHttpRequest(); + xhr.open('GET', 'api/settings/get_nameservers', true); + xhr.send(); + + xhr.onloadend = function() { + display.html(''); + + if(xhr.status == 200) { + if(xhr.response != undefined && xhr.response.length != 0) { + jsonResponse = JSON.parse(xhr.response) + jQuery.each(jsonResponse, function(k, v) { + display.append('
'+v+'
An error has occurred, please refresh. If problem persists please contact your administrator.
'); + } + } + else if(xhr.status == 204) { + display.html('There are no nameservers stored in the server.
'); + } + else { + if(xhr.response != undefined && xhr.response.length != 0) { + alert('Error: ' + xhr.response); + } + else { + alert('An error has occurred, refresh and try again. If problem persists please contact your administrator.'); + } + } + } +} + function ListDomains(bundle_name) { var list = jQuery('._js_registered-domains'); diff --git a/account/gPanel.html b/account/gPanel.html index 3b512a1..7f47857 100644 --- a/account/gPanel.html +++ b/account/gPanel.html @@ -208,9 +208,16 @@'+v+'
An error has occurred, please refresh. If problem persists please contact your administrator.
'); + } + } + else if(xhr.status == 204) { + display.html('There are no nameservers stored in the server.
'); + } + else { + if(xhr.response != undefined && xhr.response.length != 0) { + alert('Error: ' + xhr.response); + } + else { + alert('An error has occurred, refresh and try again. If problem persists please contact your administrator.'); + } + } + } +} \ No newline at end of file diff --git a/server/document_root/assets/js/panelHandlers/settings/remove_nameserver.js b/server/document_root/assets/js/panelHandlers/settings/remove_nameserver.js new file mode 100644 index 0000000..a41e04c --- /dev/null +++ b/server/document_root/assets/js/panelHandlers/settings/remove_nameserver.js @@ -0,0 +1,30 @@ +jQuery(document).on('click', '._js_remove-nameserver', function(e){ + e.preventDefault(); + + var nameserver = jQuery(this).attr('data'); + var requestData = {}; + requestData["nameserver"] = nameserver; + + var ensure = confirm("Are you sure you want to delete this nameserver?"); + + if(ensure) { + var xhr = new XMLHttpRequest(); + xhr.open('DELETE', 'api/settings/remove_nameserver', true); + xhr.setRequestHeader('Content-Type', 'application/json; charset=UTF-8'); + xhr.send(JSON.stringify(requestData)); + + xhr.onloadend = function () { + if (xhr.status == 204) { + ListNameservers(); + } + else { + if (xhr.response != undefined && xhr.response.length != 0) { + alert('Error: ' + xhr.response); + } + else { + alert('An error has occurred, refresh and try again. If problem persists please contact your administrator.'); + } + } + } + } +}); \ No newline at end of file diff --git a/server/document_root/assets/js/panelHandlers/users/open.js b/server/document_root/assets/js/panelHandlers/users/open.js index df75bc4..ee9c718 100644 --- a/server/document_root/assets/js/panelHandlers/users/open.js +++ b/server/document_root/assets/js/panelHandlers/users/open.js @@ -27,23 +27,18 @@ function listCurrentUsers() { }); } else { - display.html('An error has occurred, please refresh. If problem persists please contact your administrator.
'); + display.html('An error has occurred, please refresh. If problem persists please contact your administrator.
'); } } else if(xhr.status == 204) { - if(xhr.response != undefined && xhr.response.length != 0) { - display.html('There are no users in the server. This is a problem, this shouldn\'t be like this.
'); - } - else { - display.html('An error has occurred, please refresh. If problem persists please contact your administrator.
'); - } + display.html('There are no users in the server. This is a problem, this shouldn\'t be like this.
'); } else { if(xhr.response != undefined && xhr.response.length != 0) { - display.html('Error: ' + xhr.response + '
'); + display.html('Error: ' + xhr.response + '
'); } else { - display.html('An error has occurred, please refresh. If problem persists please contact your administrator.
'); + display.html('An error has occurred, please refresh. If problem persists please contact your administrator.
'); } } } diff --git a/server/document_root/gPanel.html b/server/document_root/gPanel.html index 1ac812d..8446396 100644 --- a/server/document_root/gPanel.html +++ b/server/document_root/gPanel.html @@ -365,6 +365,40 @@