mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-14 17:26:17 +01:00
This commit is contained in:
@@ -73,7 +73,7 @@ class secMiddleware:
|
|||||||
or key == 'imageByPass' or key == 'passwordByPass' or key == 'cronCommand' \
|
or key == 'imageByPass' or key == 'passwordByPass' or key == 'cronCommand' \
|
||||||
or key == 'emailMessage' or key == 'configData' or key == 'rewriteRules' \
|
or key == 'emailMessage' or key == 'configData' or key == 'rewriteRules' \
|
||||||
or key == 'modSecRules' or key == 'recordContentTXT' or key == 'SecAuditLogRelevantStatus' \
|
or key == 'modSecRules' or key == 'recordContentTXT' or key == 'SecAuditLogRelevantStatus' \
|
||||||
or key == 'fileContent' or key == 'commands' or key == 'gitHost' or key == 'ipv6':
|
or key == 'fileContent' or key == 'commands' or key == 'gitHost' or key == 'ipv6' or key == 'contentNow':
|
||||||
continue
|
continue
|
||||||
if value.find(';') > -1 or value.find('&&') > -1 or value.find('|') > -1 or value.find('...') > -1 \
|
if value.find(';') > -1 or value.find('&&') > -1 or value.find('|') > -1 or value.find('...') > -1 \
|
||||||
or value.find("`") > -1 or value.find("$") > -1 or value.find("(") > -1 or value.find(")") > -1 \
|
or value.find("`") > -1 or value.find("$") > -1 or value.find("(") > -1 or value.find(")") > -1 \
|
||||||
|
|||||||
@@ -418,6 +418,47 @@ class DNSManager:
|
|||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
|
def updateRecord(self, userID = None, data = None):
|
||||||
|
try:
|
||||||
|
|
||||||
|
currentACL = ACLManager.loadedACL(userID)
|
||||||
|
|
||||||
|
if ACLManager.currentContextPermission(currentACL, 'addDeleteRecords') == 0:
|
||||||
|
return ACLManager.loadErrorJson('add_status', 0)
|
||||||
|
|
||||||
|
zoneDomain = data['selectedZone']
|
||||||
|
|
||||||
|
admin = Administrator.objects.get(pk=userID)
|
||||||
|
if ACLManager.checkOwnershipZone(zoneDomain, admin, currentACL) == 1:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
return ACLManager.loadErrorJson()
|
||||||
|
|
||||||
|
record = Records.objects.get(pk=data['id'])
|
||||||
|
|
||||||
|
if data['nameNow'] != None:
|
||||||
|
record.name = data['nameNow']
|
||||||
|
|
||||||
|
if data['ttlNow'] != None:
|
||||||
|
record.ttl = int(data['ttlNow'])
|
||||||
|
|
||||||
|
if data['priorityNow'] != None:
|
||||||
|
record.prio = int(data['priorityNow'])
|
||||||
|
|
||||||
|
if data['contentNow'] != None:
|
||||||
|
record.content = data['contentNow']
|
||||||
|
|
||||||
|
record.save()
|
||||||
|
|
||||||
|
final_dic = {'status': 1, 'error_message': "None"}
|
||||||
|
final_json = json.dumps(final_dic)
|
||||||
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
|
except BaseException as msg:
|
||||||
|
final_dic = {'status': 0, 'error_message': str(msg)}
|
||||||
|
final_json = json.dumps(final_dic)
|
||||||
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
def deleteDNSRecord(self, userID = None, data = None):
|
def deleteDNSRecord(self, userID = None, data = None):
|
||||||
try:
|
try:
|
||||||
currentACL = ACLManager.loadedACL(userID)
|
currentACL = ACLManager.loadedACL(userID)
|
||||||
|
|||||||
@@ -154,346 +154,434 @@ app.controller('createDNSZone', function ($scope, $http) {
|
|||||||
|
|
||||||
app.controller('addModifyDNSRecords', function ($scope, $http) {
|
app.controller('addModifyDNSRecords', function ($scope, $http) {
|
||||||
|
|
||||||
$scope.addRecordsBox = true;
|
$scope.addRecordsBox = true;
|
||||||
$scope.currentRecords = true;
|
$scope.currentRecords = true;
|
||||||
$scope.canNotFetchRecords = true;
|
$scope.canNotFetchRecords = true;
|
||||||
$scope.recordsFetched = true;
|
$scope.recordsFetched = true;
|
||||||
$scope.recordDeleted = true;
|
$scope.recordDeleted = true;
|
||||||
$scope.recordAdded = true;
|
$scope.recordAdded = true;
|
||||||
$scope.couldNotConnect = true;
|
$scope.couldNotConnect = true;
|
||||||
$scope.recordsLoading = true;
|
$scope.recordsLoading = true;
|
||||||
$scope.recordDeleted = true;
|
$scope.recordDeleted = true;
|
||||||
$scope.couldNotDeleteRecords = true;
|
$scope.couldNotDeleteRecords = true;
|
||||||
$scope.couldNotAddRecord = true;
|
$scope.couldNotAddRecord = true;
|
||||||
$scope.recordValueDefault = false;
|
$scope.recordValueDefault = false;
|
||||||
|
|
||||||
// Hide records boxes
|
// Hide records boxes
|
||||||
$(".aaaaRecord").hide();
|
$(".aaaaRecord").hide();
|
||||||
$(".cNameRecord").hide();
|
$(".cNameRecord").hide();
|
||||||
$(".mxRecord").hide();
|
$(".mxRecord").hide();
|
||||||
$(".txtRecord").hide();
|
$(".txtRecord").hide();
|
||||||
$(".spfRecord").hide();
|
$(".spfRecord").hide();
|
||||||
$(".nsRecord").hide();
|
$(".nsRecord").hide();
|
||||||
$(".soaRecord").hide();
|
$(".soaRecord").hide();
|
||||||
$(".srvRecord").hide();
|
$(".srvRecord").hide();
|
||||||
$(".caaRecord").hide();
|
$(".caaRecord").hide();
|
||||||
|
|
||||||
|
|
||||||
var currentSelection = "aRecord";
|
var currentSelection = "aRecord";
|
||||||
$("#" + currentSelection).addClass("active");
|
|
||||||
|
|
||||||
$scope.fetchRecordsTabs = function (recordType) {
|
|
||||||
$("#" + currentSelection).removeClass("active");
|
|
||||||
$("." + currentSelection).hide();
|
|
||||||
$scope.recordsLoading = false;
|
|
||||||
currentSelection = recordType;
|
|
||||||
$("#" + currentSelection).addClass("active");
|
$("#" + currentSelection).addClass("active");
|
||||||
$("." + currentSelection).show();
|
|
||||||
populateCurrentRecords();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
$scope.fetchRecordsTabs = function (recordType) {
|
||||||
$scope.fetchRecords = function () {
|
$("#" + currentSelection).removeClass("active");
|
||||||
$scope.recordsLoading = false;
|
$("." + currentSelection).hide();
|
||||||
$scope.addRecordsBox = false;
|
$scope.recordsLoading = false;
|
||||||
populateCurrentRecords();
|
currentSelection = recordType;
|
||||||
};
|
$("#" + currentSelection).addClass("active");
|
||||||
|
$("." + currentSelection).show();
|
||||||
|
populateCurrentRecords();
|
||||||
$scope.addDNSRecord = function (type) {
|
|
||||||
|
|
||||||
$scope.recordsLoading = false;
|
|
||||||
|
|
||||||
|
|
||||||
url = "/dns/addDNSRecord";
|
|
||||||
|
|
||||||
|
|
||||||
// Record specific values
|
|
||||||
|
|
||||||
var data = {};
|
|
||||||
|
|
||||||
if (type === "MX") {
|
|
||||||
data.selectedZone = $scope.selectedZone;
|
|
||||||
data.recordName = $scope.recordName;
|
|
||||||
data.recordContentMX = $scope.recordContentMX;
|
|
||||||
data.priority = $scope.priority;
|
|
||||||
data.ttl = $scope.ttl;
|
|
||||||
data.recordType = type;
|
|
||||||
} else if (type === "A") {
|
|
||||||
|
|
||||||
data.selectedZone = $scope.selectedZone;
|
|
||||||
data.recordName = $scope.recordName;
|
|
||||||
data.recordContentA = $scope.recordContentA;
|
|
||||||
data.ttl = $scope.ttl;
|
|
||||||
data.recordType = type;
|
|
||||||
|
|
||||||
} else if (type === "AAAA") {
|
|
||||||
data.selectedZone = $scope.selectedZone;
|
|
||||||
data.recordName = $scope.recordName;
|
|
||||||
data.recordContentAAAA = $scope.recordContentAAAA;
|
|
||||||
data.ttl = $scope.ttl;
|
|
||||||
data.recordType = type;
|
|
||||||
} else if (type === "CNAME") {
|
|
||||||
data.selectedZone = $scope.selectedZone;
|
|
||||||
data.recordName = $scope.recordName;
|
|
||||||
data.recordContentCNAME = $scope.recordContentCNAME;
|
|
||||||
data.ttl = $scope.ttl;
|
|
||||||
data.recordType = type;
|
|
||||||
} else if (type === "SPF") {
|
|
||||||
data.selectedZone = $scope.selectedZone;
|
|
||||||
data.recordName = $scope.recordName;
|
|
||||||
data.recordContentSPF = $scope.recordContentSPF;
|
|
||||||
data.ttl = $scope.ttl;
|
|
||||||
data.recordType = type;
|
|
||||||
} else if (type === "SOA") {
|
|
||||||
data.selectedZone = $scope.selectedZone;
|
|
||||||
data.recordName = $scope.selectedZone;
|
|
||||||
data.recordContentSOA = $scope.recordContentSOA;
|
|
||||||
data.ttl = $scope.ttl;
|
|
||||||
data.recordType = type;
|
|
||||||
} else if (type === "TXT") {
|
|
||||||
data.selectedZone = $scope.selectedZone;
|
|
||||||
data.recordName = $scope.recordName;
|
|
||||||
data.recordContentTXT = $scope.recordContentTXT;
|
|
||||||
data.ttl = $scope.ttl;
|
|
||||||
data.recordType = type;
|
|
||||||
} else if (type === "NS") {
|
|
||||||
data.selectedZone = $scope.selectedZone;
|
|
||||||
data.recordName = $scope.selectedZone;
|
|
||||||
data.recordContentNS = $scope.recordContentNS;
|
|
||||||
data.ttl = $scope.ttl;
|
|
||||||
data.recordType = type;
|
|
||||||
} else if (type === "SRV") {
|
|
||||||
data.selectedZone = $scope.selectedZone;
|
|
||||||
data.recordName = $scope.recordName;
|
|
||||||
data.recordContentSRV = $scope.recordContentSRV;
|
|
||||||
data.priority = $scope.priority;
|
|
||||||
data.ttl = $scope.ttl;
|
|
||||||
data.recordType = type;
|
|
||||||
} else if (type === "CAA") {
|
|
||||||
data.selectedZone = $scope.selectedZone;
|
|
||||||
data.recordName = $scope.recordName;
|
|
||||||
data.recordContentCAA = $scope.recordContentCAA;
|
|
||||||
data.ttl = $scope.ttl;
|
|
||||||
data.recordType = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var config = {
|
|
||||||
headers: {
|
|
||||||
'X-CSRFToken': getCookie('csrftoken')
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
$scope.fetchRecords = function () {
|
||||||
|
$scope.recordsLoading = false;
|
||||||
|
$scope.addRecordsBox = false;
|
||||||
function ListInitialDatas(response) {
|
populateCurrentRecords();
|
||||||
|
|
||||||
|
|
||||||
if (response.data.add_status === 1) {
|
|
||||||
|
|
||||||
|
|
||||||
populateCurrentRecords();
|
|
||||||
|
|
||||||
$scope.canNotFetchRecords = true;
|
|
||||||
$scope.recordsFetched = false;
|
|
||||||
$scope.recordDeleted = true;
|
|
||||||
$scope.recordAdded = false;
|
|
||||||
$scope.couldNotConnect = true;
|
|
||||||
$scope.couldNotAddRecord = true;
|
|
||||||
$scope.recordsLoading = true;
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
$scope.recordsFetched = true;
|
|
||||||
$scope.recordDeleted = true;
|
|
||||||
$scope.recordAdded = true;
|
|
||||||
$scope.couldNotConnect = true;
|
|
||||||
$scope.recordsLoading = true;
|
|
||||||
$scope.couldNotAddRecord = false;
|
|
||||||
|
|
||||||
$scope.errorMessage = response.data.error_message;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function cantLoadInitialDatas(response) {
|
|
||||||
|
|
||||||
$scope.addRecordsBox = true;
|
|
||||||
$scope.currentRecords = true;
|
|
||||||
$scope.canNotFetchRecords = true;
|
|
||||||
$scope.recordsFetched = true;
|
|
||||||
$scope.recordDeleted = true;
|
|
||||||
$scope.recordAdded = true;
|
|
||||||
$scope.couldNotConnect = false;
|
|
||||||
$scope.couldNotAddRecord = true;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
function populateCurrentRecords() {
|
|
||||||
|
|
||||||
var selectedZone = $scope.selectedZone;
|
|
||||||
|
|
||||||
url = "/dns/getCurrentRecordsForDomain";
|
|
||||||
|
|
||||||
var data = {
|
|
||||||
selectedZone: selectedZone,
|
|
||||||
currentSelection: currentSelection
|
|
||||||
};
|
|
||||||
|
|
||||||
var config = {
|
|
||||||
headers: {
|
|
||||||
'X-CSRFToken': getCookie('csrftoken')
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
$scope.addDNSRecord = function (type) {
|
||||||
|
|
||||||
|
$scope.recordsLoading = false;
|
||||||
|
|
||||||
|
|
||||||
function ListInitialDatas(response) {
|
url = "/dns/addDNSRecord";
|
||||||
if (response.data.fetchStatus === 1) {
|
|
||||||
|
|
||||||
$scope.records = JSON.parse(response.data.data);
|
|
||||||
|
|
||||||
$scope.currentRecords = false;
|
// Record specific values
|
||||||
$scope.canNotFetchRecords = true;
|
|
||||||
$scope.recordsFetched = false;
|
|
||||||
$scope.recordDeleted = true;
|
|
||||||
$scope.recordAdded = true;
|
|
||||||
$scope.couldNotConnect = true;
|
|
||||||
$scope.recordsLoading = true;
|
|
||||||
$scope.couldNotAddRecord = true;
|
|
||||||
|
|
||||||
$scope.domainFeteched = $scope.selectedZone;
|
var data = {};
|
||||||
|
|
||||||
} else {
|
if (type === "MX") {
|
||||||
|
data.selectedZone = $scope.selectedZone;
|
||||||
|
data.recordName = $scope.recordName;
|
||||||
|
data.recordContentMX = $scope.recordContentMX;
|
||||||
|
data.priority = $scope.priority;
|
||||||
|
data.ttl = $scope.ttl;
|
||||||
|
data.recordType = type;
|
||||||
|
} else if (type === "A") {
|
||||||
|
|
||||||
|
data.selectedZone = $scope.selectedZone;
|
||||||
|
data.recordName = $scope.recordName;
|
||||||
|
data.recordContentA = $scope.recordContentA;
|
||||||
|
data.ttl = $scope.ttl;
|
||||||
|
data.recordType = type;
|
||||||
|
|
||||||
|
} else if (type === "AAAA") {
|
||||||
|
data.selectedZone = $scope.selectedZone;
|
||||||
|
data.recordName = $scope.recordName;
|
||||||
|
data.recordContentAAAA = $scope.recordContentAAAA;
|
||||||
|
data.ttl = $scope.ttl;
|
||||||
|
data.recordType = type;
|
||||||
|
} else if (type === "CNAME") {
|
||||||
|
data.selectedZone = $scope.selectedZone;
|
||||||
|
data.recordName = $scope.recordName;
|
||||||
|
data.recordContentCNAME = $scope.recordContentCNAME;
|
||||||
|
data.ttl = $scope.ttl;
|
||||||
|
data.recordType = type;
|
||||||
|
} else if (type === "SPF") {
|
||||||
|
data.selectedZone = $scope.selectedZone;
|
||||||
|
data.recordName = $scope.recordName;
|
||||||
|
data.recordContentSPF = $scope.recordContentSPF;
|
||||||
|
data.ttl = $scope.ttl;
|
||||||
|
data.recordType = type;
|
||||||
|
} else if (type === "SOA") {
|
||||||
|
data.selectedZone = $scope.selectedZone;
|
||||||
|
data.recordName = $scope.selectedZone;
|
||||||
|
data.recordContentSOA = $scope.recordContentSOA;
|
||||||
|
data.ttl = $scope.ttl;
|
||||||
|
data.recordType = type;
|
||||||
|
} else if (type === "TXT") {
|
||||||
|
data.selectedZone = $scope.selectedZone;
|
||||||
|
data.recordName = $scope.recordName;
|
||||||
|
data.recordContentTXT = $scope.recordContentTXT;
|
||||||
|
data.ttl = $scope.ttl;
|
||||||
|
data.recordType = type;
|
||||||
|
} else if (type === "NS") {
|
||||||
|
data.selectedZone = $scope.selectedZone;
|
||||||
|
data.recordName = $scope.selectedZone;
|
||||||
|
data.recordContentNS = $scope.recordContentNS;
|
||||||
|
data.ttl = $scope.ttl;
|
||||||
|
data.recordType = type;
|
||||||
|
} else if (type === "SRV") {
|
||||||
|
data.selectedZone = $scope.selectedZone;
|
||||||
|
data.recordName = $scope.recordName;
|
||||||
|
data.recordContentSRV = $scope.recordContentSRV;
|
||||||
|
data.priority = $scope.priority;
|
||||||
|
data.ttl = $scope.ttl;
|
||||||
|
data.recordType = type;
|
||||||
|
} else if (type === "CAA") {
|
||||||
|
data.selectedZone = $scope.selectedZone;
|
||||||
|
data.recordName = $scope.recordName;
|
||||||
|
data.recordContentCAA = $scope.recordContentCAA;
|
||||||
|
data.ttl = $scope.ttl;
|
||||||
|
data.recordType = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var config = {
|
||||||
|
headers: {
|
||||||
|
'X-CSRFToken': getCookie('csrftoken')
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||||
|
|
||||||
|
|
||||||
|
function ListInitialDatas(response) {
|
||||||
|
|
||||||
|
|
||||||
|
if (response.data.add_status === 1) {
|
||||||
|
|
||||||
|
|
||||||
|
populateCurrentRecords();
|
||||||
|
|
||||||
|
$scope.canNotFetchRecords = true;
|
||||||
|
$scope.recordsFetched = false;
|
||||||
|
$scope.recordDeleted = true;
|
||||||
|
$scope.recordAdded = false;
|
||||||
|
$scope.couldNotConnect = true;
|
||||||
|
$scope.couldNotAddRecord = true;
|
||||||
|
$scope.recordsLoading = true;
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
$scope.recordsFetched = true;
|
||||||
|
$scope.recordDeleted = true;
|
||||||
|
$scope.recordAdded = true;
|
||||||
|
$scope.couldNotConnect = true;
|
||||||
|
$scope.recordsLoading = true;
|
||||||
|
$scope.couldNotAddRecord = false;
|
||||||
|
|
||||||
|
$scope.errorMessage = response.data.error_message;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function cantLoadInitialDatas(response) {
|
||||||
|
|
||||||
$scope.addRecordsBox = true;
|
$scope.addRecordsBox = true;
|
||||||
$scope.currentRecords = true;
|
$scope.currentRecords = true;
|
||||||
$scope.canNotFetchRecords = false;
|
$scope.canNotFetchRecords = true;
|
||||||
$scope.recordsFetched = true;
|
$scope.recordsFetched = true;
|
||||||
$scope.recordDeleted = true;
|
$scope.recordDeleted = true;
|
||||||
$scope.recordAdded = true;
|
$scope.recordAdded = true;
|
||||||
$scope.couldNotConnect = true;
|
$scope.couldNotConnect = false;
|
||||||
$scope.recordsLoading = true;
|
|
||||||
$scope.couldNotAddRecord = true;
|
$scope.couldNotAddRecord = true;
|
||||||
|
|
||||||
$scope.errorMessage = response.data.error_message;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function cantLoadInitialDatas(response) {
|
|
||||||
|
|
||||||
$scope.addRecordsBox = true;
|
|
||||||
$scope.currentRecords = true;
|
|
||||||
$scope.canNotFetchRecords = true;
|
|
||||||
$scope.recordsFetched = true;
|
|
||||||
$scope.recordDeleted = true;
|
|
||||||
$scope.recordAdded = true;
|
|
||||||
$scope.couldNotConnect = false;
|
|
||||||
$scope.couldNotAddRecord = true;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
$scope.deleteRecord = function (id) {
|
|
||||||
|
|
||||||
|
|
||||||
var selectedZone = $scope.selectedZone;
|
|
||||||
|
|
||||||
url = "/dns/deleteDNSRecord";
|
|
||||||
|
|
||||||
var data = {
|
|
||||||
id: id,
|
|
||||||
};
|
|
||||||
|
|
||||||
var config = {
|
|
||||||
headers: {
|
|
||||||
'X-CSRFToken': getCookie('csrftoken')
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
function populateCurrentRecords() {
|
||||||
|
|
||||||
|
var selectedZone = $scope.selectedZone;
|
||||||
|
|
||||||
|
url = "/dns/getCurrentRecordsForDomain";
|
||||||
|
|
||||||
|
var data = {
|
||||||
|
selectedZone: selectedZone,
|
||||||
|
currentSelection: currentSelection
|
||||||
|
};
|
||||||
|
|
||||||
|
var config = {
|
||||||
|
headers: {
|
||||||
|
'X-CSRFToken': getCookie('csrftoken')
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
function ListInitialDatas(response) {
|
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||||
|
|
||||||
|
|
||||||
if (response.data.delete_status == 1) {
|
function ListInitialDatas(response) {
|
||||||
|
if (response.data.fetchStatus === 1) {
|
||||||
|
|
||||||
|
$scope.records = JSON.parse(response.data.data);
|
||||||
|
|
||||||
|
$scope.currentRecords = false;
|
||||||
|
$scope.canNotFetchRecords = true;
|
||||||
|
$scope.recordsFetched = false;
|
||||||
|
$scope.recordDeleted = true;
|
||||||
|
$scope.recordAdded = true;
|
||||||
|
$scope.couldNotConnect = true;
|
||||||
|
$scope.recordsLoading = true;
|
||||||
|
$scope.couldNotAddRecord = true;
|
||||||
|
|
||||||
|
$scope.domainFeteched = $scope.selectedZone;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
$scope.addRecordsBox = true;
|
||||||
|
$scope.currentRecords = true;
|
||||||
|
$scope.canNotFetchRecords = false;
|
||||||
|
$scope.recordsFetched = true;
|
||||||
|
$scope.recordDeleted = true;
|
||||||
|
$scope.recordAdded = true;
|
||||||
|
$scope.couldNotConnect = true;
|
||||||
|
$scope.recordsLoading = true;
|
||||||
|
$scope.couldNotAddRecord = true;
|
||||||
|
|
||||||
|
$scope.errorMessage = response.data.error_message;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function cantLoadInitialDatas(response) {
|
||||||
|
|
||||||
|
$scope.addRecordsBox = true;
|
||||||
|
$scope.currentRecords = true;
|
||||||
|
$scope.canNotFetchRecords = true;
|
||||||
|
$scope.recordsFetched = true;
|
||||||
|
$scope.recordDeleted = true;
|
||||||
|
$scope.recordAdded = true;
|
||||||
|
$scope.couldNotConnect = false;
|
||||||
|
$scope.couldNotAddRecord = true;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
var globalID = null;
|
||||||
|
var nameNow = null;
|
||||||
|
var ttlNow = null;
|
||||||
|
var contentNow = null;
|
||||||
|
var priorityNow = null;
|
||||||
|
|
||||||
|
|
||||||
|
$scope.setupContent = function (id, type, content) {
|
||||||
|
if (globalID === null) {
|
||||||
|
globalID = id;
|
||||||
|
} else {
|
||||||
|
if (globalID !== id) {
|
||||||
|
globalID = id;
|
||||||
|
nameNow = null;
|
||||||
|
ttlNow = null;
|
||||||
|
contentNow = null;
|
||||||
|
priorityNow = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type === 'name') {
|
||||||
|
nameNow = content;
|
||||||
|
} else if (type === 'ttl') {
|
||||||
|
ttlNow = content;
|
||||||
|
} else if (type === 'content') {
|
||||||
|
contentNow = content;
|
||||||
|
} else if (type === 'priority') {
|
||||||
|
priorityNow = content;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.saveNow = function (id) {
|
||||||
|
|
||||||
|
if (id !== globalID) {
|
||||||
|
alert('This record is not changed');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$scope.recordsLoading = false;
|
||||||
|
|
||||||
|
url = "/dns/updateRecord";
|
||||||
|
|
||||||
|
var data = {
|
||||||
|
selectedZone: $scope.selectedZone,
|
||||||
|
id: globalID,
|
||||||
|
nameNow: nameNow,
|
||||||
|
ttlNow: ttlNow,
|
||||||
|
contentNow: contentNow,
|
||||||
|
priorityNow: priorityNow,
|
||||||
|
};
|
||||||
|
|
||||||
|
var config = {
|
||||||
|
headers: {
|
||||||
|
'X-CSRFToken': getCookie('csrftoken')
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||||
|
|
||||||
|
|
||||||
|
function ListInitialDatas(response) {
|
||||||
|
$scope.recordsLoading = true;
|
||||||
|
|
||||||
|
if (response.data.status === 1) {
|
||||||
|
|
||||||
|
new PNotify({
|
||||||
|
title: 'Success!',
|
||||||
|
text: 'Record updated.',
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
|
|
||||||
|
} else {
|
||||||
|
new PNotify({
|
||||||
|
title: 'Operation Failed!',
|
||||||
|
text: response.data.error_message,
|
||||||
|
type: 'error'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function cantLoadInitialDatas(response) {
|
||||||
|
$scope.recordsLoading = true;
|
||||||
|
new PNotify({
|
||||||
|
title: 'Operation Failed!',
|
||||||
|
text: 'Could not connect to server, please refresh this page',
|
||||||
|
type: 'error'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.deleteRecord = function (id) {
|
||||||
|
|
||||||
|
var selectedZone = $scope.selectedZone;
|
||||||
|
|
||||||
|
url = "/dns/deleteDNSRecord";
|
||||||
|
|
||||||
|
var data = {
|
||||||
|
id: id,
|
||||||
|
};
|
||||||
|
|
||||||
|
var config = {
|
||||||
|
headers: {
|
||||||
|
'X-CSRFToken': getCookie('csrftoken')
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||||
|
|
||||||
|
|
||||||
|
function ListInitialDatas(response) {
|
||||||
|
|
||||||
|
|
||||||
|
if (response.data.delete_status == 1) {
|
||||||
|
|
||||||
|
|
||||||
|
$scope.addRecordsBox = false;
|
||||||
|
$scope.currentRecords = false;
|
||||||
|
$scope.canNotFetchRecords = true;
|
||||||
|
$scope.recordsFetched = true;
|
||||||
|
$scope.recordDeleted = false;
|
||||||
|
$scope.recordAdded = true;
|
||||||
|
$scope.couldNotConnect = true;
|
||||||
|
$scope.recordsLoading = true;
|
||||||
|
$scope.recordDeleted = true;
|
||||||
|
$scope.couldNotDeleteRecords = true;
|
||||||
|
$scope.couldNotAddRecord = true;
|
||||||
|
|
||||||
|
populateCurrentRecords();
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
$scope.addRecordsBox = true;
|
||||||
|
$scope.currentRecords = true;
|
||||||
|
$scope.canNotFetchRecords = true;
|
||||||
|
$scope.recordsFetched = false;
|
||||||
|
$scope.recordDeleted = true;
|
||||||
|
$scope.recordAdded = true;
|
||||||
|
$scope.couldNotConnect = true;
|
||||||
|
$scope.recordsLoading = true;
|
||||||
|
$scope.recordDeleted = true;
|
||||||
|
$scope.couldNotDeleteRecords = false;
|
||||||
|
$scope.couldNotAddRecord = true;
|
||||||
|
|
||||||
|
|
||||||
|
$scope.errorMessage = response.data.error_message;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function cantLoadInitialDatas(response) {
|
||||||
|
|
||||||
$scope.addRecordsBox = false;
|
$scope.addRecordsBox = false;
|
||||||
$scope.currentRecords = false;
|
$scope.currentRecords = false;
|
||||||
$scope.canNotFetchRecords = true;
|
$scope.canNotFetchRecords = true;
|
||||||
$scope.recordsFetched = true;
|
$scope.recordsFetched = true;
|
||||||
$scope.recordDeleted = false;
|
$scope.recordDeleted = true;
|
||||||
$scope.recordAdded = true;
|
$scope.recordAdded = true;
|
||||||
$scope.couldNotConnect = true;
|
$scope.couldNotConnect = false;
|
||||||
$scope.recordsLoading = true;
|
$scope.recordsLoading = true;
|
||||||
$scope.recordDeleted = true;
|
$scope.recordDeleted = true;
|
||||||
$scope.couldNotDeleteRecords = true;
|
$scope.couldNotDeleteRecords = true;
|
||||||
$scope.couldNotAddRecord = true;
|
$scope.couldNotAddRecord = true;
|
||||||
|
|
||||||
populateCurrentRecords();
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
$scope.addRecordsBox = true;
|
|
||||||
$scope.currentRecords = true;
|
|
||||||
$scope.canNotFetchRecords = true;
|
|
||||||
$scope.recordsFetched = false;
|
|
||||||
$scope.recordDeleted = true;
|
|
||||||
$scope.recordAdded = true;
|
|
||||||
$scope.couldNotConnect = true;
|
|
||||||
$scope.recordsLoading = true;
|
|
||||||
$scope.recordDeleted = true;
|
|
||||||
$scope.couldNotDeleteRecords = false;
|
|
||||||
$scope.couldNotAddRecord = true;
|
|
||||||
|
|
||||||
|
|
||||||
$scope.errorMessage = response.data.error_message;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function cantLoadInitialDatas(response) {
|
};
|
||||||
|
|
||||||
$scope.addRecordsBox = false;
|
|
||||||
$scope.currentRecords = false;
|
|
||||||
$scope.canNotFetchRecords = true;
|
|
||||||
$scope.recordsFetched = true;
|
|
||||||
$scope.recordDeleted = true;
|
|
||||||
$scope.recordAdded = true;
|
|
||||||
$scope.couldNotConnect = false;
|
|
||||||
$scope.recordsLoading = true;
|
|
||||||
$scope.recordDeleted = true;
|
|
||||||
$scope.couldNotDeleteRecords = true;
|
|
||||||
$scope.couldNotAddRecord = true;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
);
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
/* Java script code to delete DNS Zone */
|
/* Java script code to delete DNS Zone */
|
||||||
|
|
||||||
@@ -1049,7 +1137,7 @@ app.controller('addModifyDNSRecordsCloudFlare', function ($scope, $http, $window
|
|||||||
|
|
||||||
$scope.syncCF = function () {
|
$scope.syncCF = function () {
|
||||||
|
|
||||||
$scope.recordsLoading = false;
|
$scope.recordsLoading = false;
|
||||||
var selectedZone = $scope.selectedZone;
|
var selectedZone = $scope.selectedZone;
|
||||||
|
|
||||||
url = "/dns/syncCF";
|
url = "/dns/syncCF";
|
||||||
|
|||||||
@@ -3,405 +3,458 @@
|
|||||||
{% block title %}{% trans "Add/Modify DNS Records - CyberPanel" %}{% endblock %}
|
{% block title %}{% trans "Add/Modify DNS Records - CyberPanel" %}{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
{% load static %}
|
{% load static %}
|
||||||
{% get_current_language as LANGUAGE_CODE %}
|
{% get_current_language as LANGUAGE_CODE %}
|
||||||
<!-- Current language: {{ LANGUAGE_CODE }} -->
|
<!-- Current language: {{ LANGUAGE_CODE }} -->
|
||||||
|
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div id="page-title">
|
<div id="page-title">
|
||||||
<h2>{% trans "Add/Modify DNS Zone" %} - <a target="_blank" href="http://go.cyberpanel.net/dns-records" style="height: 23px;line-height: 21px;" class="btn btn-border btn-alt border-red btn-link font-red" title=""><span>{% trans "DNS Docs" %}</span></a></h2>
|
<h2>{% trans "Add/Modify DNS Zone" %} - <a target="_blank" href="http://go.cyberpanel.net/dns-records"
|
||||||
<p>{% trans "On this page you can add/modify dns records for domains whose dns zone is already created." %}</p>
|
style="height: 23px;line-height: 21px;"
|
||||||
</div>
|
class="btn btn-border btn-alt border-red btn-link font-red"
|
||||||
<div ng-controller="addModifyDNSRecords" class="panel">
|
title=""><span>{% trans "DNS Docs" %}</span></a></h2>
|
||||||
<div class="panel-body">
|
<p>{% trans "On this page you can add/modify dns records for domains whose dns zone is already created." %}</p>
|
||||||
<h3 class="content-box-header">
|
|
||||||
{% trans "Add Records" %} <img ng-hide="recordsLoading" src="{% static 'images/loading.gif' %}">
|
|
||||||
</h3>
|
|
||||||
<div class="example-box-wrapper">
|
|
||||||
|
|
||||||
|
|
||||||
{% if not status %}
|
|
||||||
|
|
||||||
<div class="col-md-12 text-center" style="margin-bottom: 2%;">
|
|
||||||
<h3>{% trans "PowerDNS is disabled." %}
|
|
||||||
<a href="{% url 'managePowerDNS' %}"><button class="btn btn-alt btn-hover btn-blue-alt">
|
|
||||||
<span>{% trans "Enable Now" %}</span>
|
|
||||||
<i class="glyph-icon icon-arrow-right"></i>
|
|
||||||
</button></a></h3>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
{% else %}
|
|
||||||
|
|
||||||
|
|
||||||
<form action="/" class="form-horizontal bordered-row panel-body">
|
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-3 control-label">{% trans "Select Domain" %} </label>
|
|
||||||
<div class="col-sm-6">
|
|
||||||
<select ng-change="fetchRecords()" ng-model="selectedZone" class="form-control">
|
|
||||||
{% for items in domainsList %}
|
|
||||||
<option>{{ items }}</option>
|
|
||||||
{% endfor %}
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div ng-hide="addRecordsBox" class="form-group">
|
|
||||||
|
|
||||||
<div class="example-box-wrapper">
|
|
||||||
<ul class="nav nav-tabs">
|
|
||||||
<li ng-click="fetchRecordsTabs('aRecord')" id="aRecord" ><a href="">A</a></li>
|
|
||||||
<li ng-click="fetchRecordsTabs('aaaaRecord')" id="aaaaRecord" ><a href="">AAAA</a></li>
|
|
||||||
<li ng-click="fetchRecordsTabs('cNameRecord')" id="cNameRecord"><a href="">CNAME</a></li>
|
|
||||||
<li ng-click="fetchRecordsTabs('mxRecord')" id="mxRecord"><a href="">MX</a></li>
|
|
||||||
<li ng-click="fetchRecordsTabs('txtRecord')" id="txtRecord"><a href="">TXT</a></li>
|
|
||||||
<li ng-click="fetchRecordsTabs('spfRecord')" id="spfRecord"><a href="">SPF</a></li>
|
|
||||||
<li ng-click="fetchRecordsTabs('nsRecord')" id="nsRecord"><a href="">NS</a></li>
|
|
||||||
<li ng-click="fetchRecordsTabs('soaRecord')" id="soaRecord" ><a href="">SOA</a></li>
|
|
||||||
<li ng-click="fetchRecordsTabs('srvRecord')" id="srvRecord" ><a href="">SRV</a></li>
|
|
||||||
<li ng-click="fetchRecordsTabs('caaRecord')" id="caaRecord" ><a href="">CAA</a></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!------------- A Record box ------------->
|
|
||||||
|
|
||||||
|
|
||||||
<div class="col-sm-3 aRecord">
|
|
||||||
<input placeholder="{% trans 'Name' %}" name="dom" type="text" class="form-control" ng-model="recordName" required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-sm-3 aRecord">
|
|
||||||
<input placeholder="{% trans 'TTL' %}" type="number" class="form-control" ng-model="ttl" required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-sm-3 aRecord">
|
|
||||||
<input placeholder="{% trans 'IP Address' %}" name="dom" type="text" class="form-control" ng-model="recordContentA" required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="col-sm-3 aRecord">
|
|
||||||
<button style="width: 100%;" type="button" ng-click="addDNSRecord('A')" class="btn btn-primary">{% trans "Add" %}</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!------------- A Record box ------------->
|
|
||||||
|
|
||||||
<!------------- AAAA Record box ------------->
|
|
||||||
|
|
||||||
|
|
||||||
<div class="col-sm-3 aaaaRecord">
|
|
||||||
<input placeholder="{% trans 'Name' %}" name="dom" type="text" class="form-control" ng-model="recordName" required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-sm-3 aaaaRecord">
|
|
||||||
<input placeholder="{% trans 'TTL' %}" type="number" class="form-control" ng-model="ttl" required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-sm-3 aaaaRecord">
|
|
||||||
<input placeholder="{% trans 'IPV6 Address' %}" name="dom" type="text" class="form-control" ng-model="recordContentAAAA" required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="col-sm-3 aaaaRecord">
|
|
||||||
<button style="width: 100%;" type="button" ng-click="addDNSRecord('AAAA')" class="btn btn-primary">{% trans "Add" %}</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!------------- AAAA Record box ------------->
|
|
||||||
|
|
||||||
|
|
||||||
<!------------- CNAME Record box ------------->
|
|
||||||
|
|
||||||
|
|
||||||
<div class="col-sm-3 cNameRecord">
|
|
||||||
<input placeholder="{% trans 'Name' %}" type="text" class="form-control" ng-model="recordName" required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-sm-3 cNameRecord">
|
|
||||||
<input placeholder="{% trans 'TTL' %}" type="number" class="form-control" ng-model="ttl" required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-sm-3 cNameRecord">
|
|
||||||
<input placeholder="{% trans 'Domain Name' %}" type="text" class="form-control" ng-model="recordContentCNAME" required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="col-sm-3 cNameRecord">
|
|
||||||
<button style="width: 100%;" type="button" ng-click="addDNSRecord('CNAME')" class="btn btn-primary">{% trans "Add" %}</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!------------- CNAME Record box ------------->
|
|
||||||
|
|
||||||
<!------------- MX Record box ------------->
|
|
||||||
|
|
||||||
|
|
||||||
<div class="col-sm-3 mxRecord">
|
|
||||||
<input placeholder="{% trans 'Name' %}" type="text" class="form-control" ng-model="recordName" required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-sm-2 mxRecord">
|
|
||||||
<input placeholder="{% trans 'TTL' %}" type="number" class="form-control" ng-model="ttl" required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-sm-2 mxRecord">
|
|
||||||
<input placeholder="{% trans 'Priority' %}" type="number" class="form-control" ng-model="priority" required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-sm-3 mxRecord">
|
|
||||||
<input placeholder="{% trans 'Domain Name' %}" type="text" class="form-control" ng-model="recordContentMX" required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="col-sm-2 mxRecord">
|
|
||||||
<button style="width: 100%;" type="button" ng-click="addDNSRecord('MX')" class="btn btn-primary">{% trans "Add" %}</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!------------- CNAME Record box ------------->
|
|
||||||
|
|
||||||
|
|
||||||
<!------------- SPF Record box ------------->
|
|
||||||
|
|
||||||
|
|
||||||
<div class="col-sm-3 spfRecord">
|
|
||||||
<input placeholder="{% trans 'Name' %}" type="text" class="form-control" ng-model="recordName" required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-sm-3 spfRecord">
|
|
||||||
<input placeholder="{% trans 'TTL' %}" type="number" class="form-control" ng-model="ttl" required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="col-sm-3 spfRecord">
|
|
||||||
<input placeholder="{% trans 'Policy' %}" type="text" class="form-control" ng-model="recordContentSPF" required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="col-sm-3 spfRecord">
|
|
||||||
<button style="width: 100%;" type="button" ng-click="addDNSRecord('SPF')" class="btn btn-primary">{% trans "Add" %}</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!------------- SPF Record box ------------->
|
|
||||||
|
|
||||||
<!------------- TXT Record box ------------->
|
|
||||||
|
|
||||||
|
|
||||||
<div class="col-sm-3 txtRecord">
|
|
||||||
<input placeholder="{% trans 'Name' %}" type="text" class="form-control" ng-model="recordName" required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-sm-3 txtRecord">
|
|
||||||
<input placeholder="{% trans 'TTL' %}" type="number" class="form-control" ng-model="ttl" required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="col-sm-3 txtRecord">
|
|
||||||
<input placeholder="{% trans 'Text' %}" type="text" class="form-control" ng-model="recordContentTXT" required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="col-sm-3 txtRecord">
|
|
||||||
<button style="width: 100%;" type="button" ng-click="addDNSRecord('TXT')" class="btn btn-primary">{% trans "Add" %}</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!------------- TXT Record box ------------->
|
|
||||||
|
|
||||||
<!------------- SOA Record box ------------->
|
|
||||||
|
|
||||||
|
|
||||||
<div class="col-sm-3 soaRecord">
|
|
||||||
<input placeholder="{% trans 'Name' %}" type="text" class="form-control" ng-model="selectedZone" disabled>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-sm-3 soaRecord">
|
|
||||||
<input placeholder="{% trans 'TTL' %}" type="number" class="form-control" ng-model="ttl" required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="col-sm-3 soaRecord">
|
|
||||||
<input placeholder="{% trans 'SOA Value' %}" type="text" class="form-control" ng-model="recordContentSOA" required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="col-sm-3 soaRecord">
|
|
||||||
<button style="width: 100%;" type="button" ng-click="addDNSRecord('SOA')" class="btn btn-primary">{% trans "Add" %}</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!------------- SOA Record box ------------->
|
|
||||||
|
|
||||||
<!------------- NS Record box ------------->
|
|
||||||
|
|
||||||
|
|
||||||
<div class="col-sm-3 nsRecord">
|
|
||||||
<input placeholder="{% trans 'Name' %}" type="text" class="form-control" ng-model="selectedZone" disabled>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-sm-3 nsRecord">
|
|
||||||
<input placeholder="{% trans 'TTL' %}" type="number" class="form-control" ng-model="ttl" required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="col-sm-3 nsRecord">
|
|
||||||
<input placeholder="{% trans 'Name server' %}" type="text" class="form-control" ng-model="recordContentNS" required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="col-sm-3 nsRecord">
|
|
||||||
<button style="width: 100%;" type="button" ng-click="addDNSRecord('NS')" class="btn btn-primary">{% trans "Add" %}</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!------------- NS Record box ------------->
|
|
||||||
|
|
||||||
<!------------- SRV Record box ------------->
|
|
||||||
|
|
||||||
|
|
||||||
<div class="col-sm-3 srvRecord">
|
|
||||||
<input placeholder="{% trans 'Name' %}" type="text" class="form-control" ng-model="recordName">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-sm-2 srvRecord">
|
|
||||||
<input placeholder="{% trans 'TTL' %}" type="number" class="form-control" ng-model="ttl" required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-sm-2 srvRecord">
|
|
||||||
<input placeholder="{% trans 'Prioirty' %}" type="number" class="form-control" ng-model="priority" required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="col-sm-3 srvRecord">
|
|
||||||
<input placeholder="{% trans 'Content' %}" type="text" class="form-control" ng-model="recordContentSRV" required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="col-sm-2 srvRecord">
|
|
||||||
<button style="width: 100%;" type="button" ng-click="addDNSRecord('SRV')" class="btn btn-primary">{% trans "Add" %}</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!------------- SRV Record box ------------->
|
|
||||||
|
|
||||||
<!------------- CAA Record box ------------->
|
|
||||||
|
|
||||||
<div class="col-sm-3 caaRecord">
|
|
||||||
<input placeholder="{% trans 'Name' %}" type="text" class="form-control" ng-model="recordName">
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-3 caaRecord">
|
|
||||||
<input placeholder="{% trans 'TTL' %}" type="number" class="form-control" ng-model="ttl" required>
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-3 caaRecord">
|
|
||||||
<input placeholder='Value e.g: 0 issue "letsencrypt.org"' type="text" class="form-control" ng-model="recordContentCAA" required>
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-3 caaRecord">
|
|
||||||
<button style="width: 100%;" type="button" ng-click="addDNSRecord('CAA')" class="btn btn-primary">{% trans "Add" %}</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!------------- CAA Record box ------------->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!------ List of records --------------->
|
|
||||||
|
|
||||||
<div ng-hide="currentRecords" class="form-group">
|
|
||||||
|
|
||||||
<div class="col-sm-12">
|
|
||||||
|
|
||||||
<table class="table">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>{% trans "ID" %}</th>
|
|
||||||
<th>{% trans "Type" %}</th>
|
|
||||||
<th>{% trans "Name" %}</th>
|
|
||||||
<th>{% trans "TTL" %}</th>
|
|
||||||
<th>{% trans "Value" %}</th>
|
|
||||||
<th>{% trans "Priority" %}</th>
|
|
||||||
<th>{% trans "Delete" %}</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<tr ng-repeat="record in records track by $index">
|
|
||||||
<td ng-bind="record.id"></td>
|
|
||||||
<td ng-bind="record.type"></td>
|
|
||||||
<td ng-bind="record.name"></td>
|
|
||||||
<td ng-bind="record.ttl"></td>
|
|
||||||
<td ng-bind="record.content"></td>
|
|
||||||
<td ng-bind="record.priority"></td>
|
|
||||||
<td ng-click="deleteRecord(record.id)"><img src="{% static 'images/delete.png' %}"></td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!------ List of records --------------->
|
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
|
|
||||||
|
|
||||||
<label class="col-sm-3 control-label"></label>
|
|
||||||
<div class="col-sm-4">
|
|
||||||
<div ng-hide="canNotFetchRecords" class="alert alert-danger">
|
|
||||||
<p>{% trans "Cannot fetch records. Error message:" %}{$ errorMessage $}</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div ng-hide="couldNotAddRecord" class="alert alert-danger">
|
|
||||||
<p>{% trans "Cannot add record. Error message: " %}{$ errorMessage $}</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div ng-hide="recordsFetched" class="alert alert-success">
|
|
||||||
<p>{% trans "Records successfully fetched for" %} <strong>{$ domainFeteched $}</strong></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div ng-hide="recordDeleted" class="alert alert-success">
|
|
||||||
<p>{% trans "Record Successfully Deleted" %}</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div ng-hide="couldNotDeleteRecords" class="alert alert-danger">
|
|
||||||
<p>{% trans "Cannot delete record. Error message:" %} {$ errorMessage $}</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div ng-hide="recordAdded" class="alert alert-success">
|
|
||||||
<p>{% trans "Record Successfully Added." %}</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div ng-hide="couldNotConnect" class="alert alert-success">
|
|
||||||
<p>{% trans "Could not connect to server. Please refresh this page." %}</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</form>
|
|
||||||
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<div ng-controller="addModifyDNSRecords" class="panel">
|
||||||
|
<div class="panel-body">
|
||||||
|
<h3 class="content-box-header">
|
||||||
|
{% trans "Add Records" %} <img ng-hide="recordsLoading" src="{% static 'images/loading.gif' %}">
|
||||||
|
</h3>
|
||||||
|
<div class="example-box-wrapper">
|
||||||
|
|
||||||
|
|
||||||
|
{% if not status %}
|
||||||
|
|
||||||
|
<div class="col-md-12 text-center" style="margin-bottom: 2%;">
|
||||||
|
<h3>{% trans "PowerDNS is disabled." %}
|
||||||
|
<a href="{% url 'managePowerDNS' %}">
|
||||||
|
<button class="btn btn-alt btn-hover btn-blue-alt">
|
||||||
|
<span>{% trans "Enable Now" %}</span>
|
||||||
|
<i class="glyph-icon icon-arrow-right"></i>
|
||||||
|
</button>
|
||||||
|
</a></h3>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{% else %}
|
||||||
|
|
||||||
|
|
||||||
|
<form action="/" class="form-horizontal bordered-row panel-body">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Select Domain" %} </label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<select ng-change="fetchRecords()" ng-model="selectedZone" class="form-control">
|
||||||
|
{% for items in domainsList %}
|
||||||
|
<option>{{ items }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div ng-hide="addRecordsBox" class="form-group">
|
||||||
|
|
||||||
|
<div class="example-box-wrapper">
|
||||||
|
<ul class="nav nav-tabs">
|
||||||
|
<li ng-click="fetchRecordsTabs('aRecord')" id="aRecord"><a href="">A</a></li>
|
||||||
|
<li ng-click="fetchRecordsTabs('aaaaRecord')" id="aaaaRecord"><a
|
||||||
|
href="">AAAA</a></li>
|
||||||
|
<li ng-click="fetchRecordsTabs('cNameRecord')" id="cNameRecord"><a
|
||||||
|
href="">CNAME</a></li>
|
||||||
|
<li ng-click="fetchRecordsTabs('mxRecord')" id="mxRecord"><a href="">MX</a></li>
|
||||||
|
<li ng-click="fetchRecordsTabs('txtRecord')" id="txtRecord"><a href="">TXT</a>
|
||||||
|
</li>
|
||||||
|
<li ng-click="fetchRecordsTabs('spfRecord')" id="spfRecord"><a href="">SPF</a>
|
||||||
|
</li>
|
||||||
|
<li ng-click="fetchRecordsTabs('nsRecord')" id="nsRecord"><a href="">NS</a></li>
|
||||||
|
<li ng-click="fetchRecordsTabs('soaRecord')" id="soaRecord"><a href="">SOA</a>
|
||||||
|
</li>
|
||||||
|
<li ng-click="fetchRecordsTabs('srvRecord')" id="srvRecord"><a href="">SRV</a>
|
||||||
|
</li>
|
||||||
|
<li ng-click="fetchRecordsTabs('caaRecord')" id="caaRecord"><a href="">CAA</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!------------- A Record box ------------->
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-sm-3 aRecord">
|
||||||
|
<input placeholder="{% trans 'Name' %}" name="dom" type="text" class="form-control"
|
||||||
|
ng-model="recordName" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-sm-3 aRecord">
|
||||||
|
<input placeholder="{% trans 'TTL' %}" type="number" class="form-control"
|
||||||
|
ng-model="ttl" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-sm-3 aRecord">
|
||||||
|
<input placeholder="{% trans 'IP Address' %}" name="dom" type="text"
|
||||||
|
class="form-control" ng-model="recordContentA" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-sm-3 aRecord">
|
||||||
|
<button style="width: 100%;" type="button" ng-click="addDNSRecord('A')"
|
||||||
|
class="btn btn-primary">{% trans "Add" %}</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!------------- A Record box ------------->
|
||||||
|
|
||||||
|
<!------------- AAAA Record box ------------->
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-sm-3 aaaaRecord">
|
||||||
|
<input placeholder="{% trans 'Name' %}" name="dom" type="text" class="form-control"
|
||||||
|
ng-model="recordName" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-sm-3 aaaaRecord">
|
||||||
|
<input placeholder="{% trans 'TTL' %}" type="number" class="form-control"
|
||||||
|
ng-model="ttl" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-sm-3 aaaaRecord">
|
||||||
|
<input placeholder="{% trans 'IPV6 Address' %}" name="dom" type="text"
|
||||||
|
class="form-control" ng-model="recordContentAAAA" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-sm-3 aaaaRecord">
|
||||||
|
<button style="width: 100%;" type="button" ng-click="addDNSRecord('AAAA')"
|
||||||
|
class="btn btn-primary">{% trans "Add" %}</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!------------- AAAA Record box ------------->
|
||||||
|
|
||||||
|
|
||||||
|
<!------------- CNAME Record box ------------->
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-sm-3 cNameRecord">
|
||||||
|
<input placeholder="{% trans 'Name' %}" type="text" class="form-control"
|
||||||
|
ng-model="recordName" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-sm-3 cNameRecord">
|
||||||
|
<input placeholder="{% trans 'TTL' %}" type="number" class="form-control"
|
||||||
|
ng-model="ttl" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-sm-3 cNameRecord">
|
||||||
|
<input placeholder="{% trans 'Domain Name' %}" type="text" class="form-control"
|
||||||
|
ng-model="recordContentCNAME" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-sm-3 cNameRecord">
|
||||||
|
<button style="width: 100%;" type="button" ng-click="addDNSRecord('CNAME')"
|
||||||
|
class="btn btn-primary">{% trans "Add" %}</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!------------- CNAME Record box ------------->
|
||||||
|
|
||||||
|
<!------------- MX Record box ------------->
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-sm-3 mxRecord">
|
||||||
|
<input placeholder="{% trans 'Name' %}" type="text" class="form-control"
|
||||||
|
ng-model="recordName" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-sm-2 mxRecord">
|
||||||
|
<input placeholder="{% trans 'TTL' %}" type="number" class="form-control"
|
||||||
|
ng-model="ttl" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-sm-2 mxRecord">
|
||||||
|
<input placeholder="{% trans 'Priority' %}" type="number" class="form-control"
|
||||||
|
ng-model="priority" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-sm-3 mxRecord">
|
||||||
|
<input placeholder="{% trans 'Domain Name' %}" type="text" class="form-control"
|
||||||
|
ng-model="recordContentMX" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-sm-2 mxRecord">
|
||||||
|
<button style="width: 100%;" type="button" ng-click="addDNSRecord('MX')"
|
||||||
|
class="btn btn-primary">{% trans "Add" %}</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!------------- CNAME Record box ------------->
|
||||||
|
|
||||||
|
|
||||||
|
<!------------- SPF Record box ------------->
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-sm-3 spfRecord">
|
||||||
|
<input placeholder="{% trans 'Name' %}" type="text" class="form-control"
|
||||||
|
ng-model="recordName" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-sm-3 spfRecord">
|
||||||
|
<input placeholder="{% trans 'TTL' %}" type="number" class="form-control"
|
||||||
|
ng-model="ttl" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-sm-3 spfRecord">
|
||||||
|
<input placeholder="{% trans 'Policy' %}" type="text" class="form-control"
|
||||||
|
ng-model="recordContentSPF" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-sm-3 spfRecord">
|
||||||
|
<button style="width: 100%;" type="button" ng-click="addDNSRecord('SPF')"
|
||||||
|
class="btn btn-primary">{% trans "Add" %}</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!------------- SPF Record box ------------->
|
||||||
|
|
||||||
|
<!------------- TXT Record box ------------->
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-sm-3 txtRecord">
|
||||||
|
<input placeholder="{% trans 'Name' %}" type="text" class="form-control"
|
||||||
|
ng-model="recordName" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-sm-3 txtRecord">
|
||||||
|
<input placeholder="{% trans 'TTL' %}" type="number" class="form-control"
|
||||||
|
ng-model="ttl" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-sm-3 txtRecord">
|
||||||
|
<input placeholder="{% trans 'Text' %}" type="text" class="form-control"
|
||||||
|
ng-model="recordContentTXT" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-sm-3 txtRecord">
|
||||||
|
<button style="width: 100%;" type="button" ng-click="addDNSRecord('TXT')"
|
||||||
|
class="btn btn-primary">{% trans "Add" %}</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!------------- TXT Record box ------------->
|
||||||
|
|
||||||
|
<!------------- SOA Record box ------------->
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-sm-3 soaRecord">
|
||||||
|
<input placeholder="{% trans 'Name' %}" type="text" class="form-control"
|
||||||
|
ng-model="selectedZone" disabled>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-sm-3 soaRecord">
|
||||||
|
<input placeholder="{% trans 'TTL' %}" type="number" class="form-control"
|
||||||
|
ng-model="ttl" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-sm-3 soaRecord">
|
||||||
|
<input placeholder="{% trans 'SOA Value' %}" type="text" class="form-control"
|
||||||
|
ng-model="recordContentSOA" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-sm-3 soaRecord">
|
||||||
|
<button style="width: 100%;" type="button" ng-click="addDNSRecord('SOA')"
|
||||||
|
class="btn btn-primary">{% trans "Add" %}</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!------------- SOA Record box ------------->
|
||||||
|
|
||||||
|
<!------------- NS Record box ------------->
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-sm-3 nsRecord">
|
||||||
|
<input placeholder="{% trans 'Name' %}" type="text" class="form-control"
|
||||||
|
ng-model="selectedZone" disabled>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-sm-3 nsRecord">
|
||||||
|
<input placeholder="{% trans 'TTL' %}" type="number" class="form-control"
|
||||||
|
ng-model="ttl" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-sm-3 nsRecord">
|
||||||
|
<input placeholder="{% trans 'Name server' %}" type="text" class="form-control"
|
||||||
|
ng-model="recordContentNS" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-sm-3 nsRecord">
|
||||||
|
<button style="width: 100%;" type="button" ng-click="addDNSRecord('NS')"
|
||||||
|
class="btn btn-primary">{% trans "Add" %}</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!------------- NS Record box ------------->
|
||||||
|
|
||||||
|
<!------------- SRV Record box ------------->
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-sm-3 srvRecord">
|
||||||
|
<input placeholder="{% trans 'Name' %}" type="text" class="form-control"
|
||||||
|
ng-model="recordName">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-sm-2 srvRecord">
|
||||||
|
<input placeholder="{% trans 'TTL' %}" type="number" class="form-control"
|
||||||
|
ng-model="ttl" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-sm-2 srvRecord">
|
||||||
|
<input placeholder="{% trans 'Prioirty' %}" type="number" class="form-control"
|
||||||
|
ng-model="priority" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-sm-3 srvRecord">
|
||||||
|
<input placeholder="{% trans 'Content' %}" type="text" class="form-control"
|
||||||
|
ng-model="recordContentSRV" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-sm-2 srvRecord">
|
||||||
|
<button style="width: 100%;" type="button" ng-click="addDNSRecord('SRV')"
|
||||||
|
class="btn btn-primary">{% trans "Add" %}</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!------------- SRV Record box ------------->
|
||||||
|
|
||||||
|
<!------------- CAA Record box ------------->
|
||||||
|
|
||||||
|
<div class="col-sm-3 caaRecord">
|
||||||
|
<input placeholder="{% trans 'Name' %}" type="text" class="form-control"
|
||||||
|
ng-model="recordName">
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-3 caaRecord">
|
||||||
|
<input placeholder="{% trans 'TTL' %}" type="number" class="form-control"
|
||||||
|
ng-model="ttl" required>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-3 caaRecord">
|
||||||
|
<input placeholder='Value e.g: 0 issue "letsencrypt.org"' type="text"
|
||||||
|
class="form-control" ng-model="recordContentCAA" required>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-3 caaRecord">
|
||||||
|
<button style="width: 100%;" type="button" ng-click="addDNSRecord('CAA')"
|
||||||
|
class="btn btn-primary">{% trans "Add" %}</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!------------- CAA Record box ------------->
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<!------ List of records --------------->
|
||||||
|
|
||||||
|
<div ng-hide="currentRecords" class="form-group">
|
||||||
|
|
||||||
|
<div class="col-sm-12">
|
||||||
|
|
||||||
|
<table style="margin: 0px; padding: 0px" class="table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>{% trans "Type" %}</th>
|
||||||
|
<th>{% trans "Name" %}</th>
|
||||||
|
<th style="width: 100px;">{% trans "TTL" %}</th>
|
||||||
|
<th>{% trans "Value" %}</th>
|
||||||
|
<th style="width: 87px;">{% trans "Priority" %}</th>
|
||||||
|
<th>{% trans "Delete" %}</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr ng-repeat="record in records track by $index">
|
||||||
|
<td ng-bind="record.type"></td>
|
||||||
|
<td><input ng-change="setupContent(record.id, 'name', nameNow)"
|
||||||
|
ng-model="nameNow" type="text" class="form-control"
|
||||||
|
ng-value="record.name">
|
||||||
|
</td>
|
||||||
|
<td><input ng-change="setupContent(record.id, 'ttl', ttlNow)"
|
||||||
|
ng-model="ttlNow" type="number" class="form-control"
|
||||||
|
ng-value="record.ttl"></td>
|
||||||
|
<td><input ng-change="setupContent(record.id, 'content', contentNow)"
|
||||||
|
ng-model="contentNow" type="text" class="form-control"
|
||||||
|
ng-value="record.content"></td>
|
||||||
|
<td><input ng-change="setupContent(record.id, 'priority', priorityNow)"
|
||||||
|
type="number" class="form-control" ng-model="priorityNow"
|
||||||
|
ng-value="record.priority"></td>
|
||||||
|
<td>
|
||||||
|
<button type="button" ng-click="saveNow(record.id)"
|
||||||
|
class="btn btn-round btn-blue-alt">
|
||||||
|
<i class="glyph-icon icon-save"></i>
|
||||||
|
</button>
|
||||||
|
<img ng-click="deleteRecord(record.id)"
|
||||||
|
src="{% static 'images/delete.png' %}">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!------ List of records --------------->
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
|
||||||
|
|
||||||
|
<label class="col-sm-3 control-label"></label>
|
||||||
|
<div class="col-sm-4">
|
||||||
|
<div ng-hide="canNotFetchRecords" class="alert alert-danger">
|
||||||
|
<p>{% trans "Cannot fetch records. Error message:" %}{$ errorMessage $}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div ng-hide="couldNotAddRecord" class="alert alert-danger">
|
||||||
|
<p>{% trans "Cannot add record. Error message: " %}{$ errorMessage $}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div ng-hide="recordsFetched" class="alert alert-success">
|
||||||
|
<p>{% trans "Records successfully fetched for" %} <strong>{$ domainFeteched
|
||||||
|
$}</strong></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div ng-hide="recordDeleted" class="alert alert-success">
|
||||||
|
<p>{% trans "Record Successfully Deleted" %}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div ng-hide="couldNotDeleteRecords" class="alert alert-danger">
|
||||||
|
<p>{% trans "Cannot delete record. Error message:" %} {$ errorMessage $}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div ng-hide="recordAdded" class="alert alert-success">
|
||||||
|
<p>{% trans "Record Successfully Added." %}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div ng-hide="couldNotConnect" class="alert alert-success">
|
||||||
|
<p>{% trans "Could not connect to server. Please refresh this page." %}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ urlpatterns = [
|
|||||||
url(r'^submitZoneDeletion',views.submitZoneDeletion,name='submitZoneDeletion'),
|
url(r'^submitZoneDeletion',views.submitZoneDeletion,name='submitZoneDeletion'),
|
||||||
url(r'^saveNSConfigurations$', views.saveNSConfigurations, name='saveNSConfigurations'),
|
url(r'^saveNSConfigurations$', views.saveNSConfigurations, name='saveNSConfigurations'),
|
||||||
url(r'^saveCFConfigs$', views.saveCFConfigs, name='saveCFConfigs'),
|
url(r'^saveCFConfigs$', views.saveCFConfigs, name='saveCFConfigs'),
|
||||||
|
url(r'^updateRecord$', views.updateRecord, name='updateRecord'),
|
||||||
|
|
||||||
url(r'^getCurrentRecordsForDomainCloudFlare$', views.getCurrentRecordsForDomainCloudFlare, name='getCurrentRecordsForDomainCloudFlare'),
|
url(r'^getCurrentRecordsForDomainCloudFlare$', views.getCurrentRecordsForDomainCloudFlare, name='getCurrentRecordsForDomainCloudFlare'),
|
||||||
url(r'^deleteDNSRecordCloudFlare$', views.deleteDNSRecordCloudFlare, name='deleteDNSRecordCloudFlare'),
|
url(r'^deleteDNSRecordCloudFlare$', views.deleteDNSRecordCloudFlare, name='deleteDNSRecordCloudFlare'),
|
||||||
|
|||||||
@@ -78,6 +78,14 @@ def addDeleteDNSRecords(request):
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
return redirect(loadLoginPage)
|
return redirect(loadLoginPage)
|
||||||
|
|
||||||
|
def updateRecord(request):
|
||||||
|
try:
|
||||||
|
userID = request.session['userID']
|
||||||
|
dm = DNSManager()
|
||||||
|
return dm.updateRecord(userID, json.loads(request.body))
|
||||||
|
except KeyError:
|
||||||
|
return redirect(loadLoginPage)
|
||||||
|
|
||||||
def getCurrentRecordsForDomain(request):
|
def getCurrentRecordsForDomain(request):
|
||||||
try:
|
try:
|
||||||
userID = request.session['userID']
|
userID = request.session['userID']
|
||||||
|
|||||||
@@ -814,175 +814,176 @@ class ApplicationInstaller(multi.Thread):
|
|||||||
logging.writeToFile(str(msg))
|
logging.writeToFile(str(msg))
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
def installMagento(self):
|
# def installMagento(self):
|
||||||
try:
|
# try:
|
||||||
|
#
|
||||||
username = self.extraArgs['username']
|
# username = self.extraArgs['username']
|
||||||
domainName = self.extraArgs['domainName']
|
# domainName = self.extraArgs['domainName']
|
||||||
home = self.extraArgs['home']
|
# home = self.extraArgs['home']
|
||||||
firstName = self.extraArgs['firstName']
|
# firstName = self.extraArgs['firstName']
|
||||||
lastName = self.extraArgs['lastName']
|
# lastName = self.extraArgs['lastName']
|
||||||
email = self.extraArgs['email']
|
# email = self.extraArgs['email']
|
||||||
password = self.extraArgs['password']
|
# password = self.extraArgs['password']
|
||||||
tempStatusPath = self.extraArgs['tempStatusPath']
|
# tempStatusPath = self.extraArgs['tempStatusPath']
|
||||||
sampleData = self.extraArgs['sampleData']
|
# sampleData = self.extraArgs['sampleData']
|
||||||
self.tempStatusPath = tempStatusPath
|
# self.tempStatusPath = tempStatusPath
|
||||||
|
#
|
||||||
FNULL = open(os.devnull, 'w')
|
# FNULL = open(os.devnull, 'w')
|
||||||
|
#
|
||||||
## Open Status File
|
# ## Open Status File
|
||||||
|
#
|
||||||
statusFile = open(tempStatusPath, 'w')
|
# statusFile = open(tempStatusPath, 'w')
|
||||||
statusFile.writelines('Setting up paths,0')
|
# statusFile.writelines('Setting up paths,0')
|
||||||
statusFile.close()
|
# statusFile.close()
|
||||||
|
#
|
||||||
finalPath = ''
|
# finalPath = ''
|
||||||
self.premPath = ''
|
# self.premPath = ''
|
||||||
|
#
|
||||||
try:
|
# try:
|
||||||
website = ChildDomains.objects.get(domain=domainName)
|
# website = ChildDomains.objects.get(domain=domainName)
|
||||||
externalApp = website.master.externalApp
|
# externalApp = website.master.externalApp
|
||||||
self.masterDomain = website.master.domain
|
# self.masterDomain = website.master.domain
|
||||||
|
#
|
||||||
if home == '0':
|
# if home == '0':
|
||||||
path = self.extraArgs['path']
|
# path = self.extraArgs['path']
|
||||||
finalPath = website.path.rstrip('/') + "/" + path + "/"
|
# finalPath = website.path.rstrip('/') + "/" + path + "/"
|
||||||
else:
|
# else:
|
||||||
finalPath = website.path + "/"
|
# finalPath = website.path + "/"
|
||||||
|
#
|
||||||
if website.master.package.dataBases > website.master.databases_set.all().count():
|
# if website.master.package.dataBases > website.master.databases_set.all().count():
|
||||||
pass
|
# pass
|
||||||
else:
|
# else:
|
||||||
raise BaseException( "Maximum database limit reached for this website.")
|
# raise BaseException( "Maximum database limit reached for this website.")
|
||||||
|
#
|
||||||
statusFile = open(tempStatusPath, 'w')
|
# statusFile = open(tempStatusPath, 'w')
|
||||||
statusFile.writelines('Setting up Database,20')
|
# statusFile.writelines('Setting up Database,20')
|
||||||
statusFile.close()
|
# statusFile.close()
|
||||||
|
#
|
||||||
dbName, dbUser, dbPassword = self.dbCreation(tempStatusPath, website.master)
|
# dbName, dbUser, dbPassword = self.dbCreation(tempStatusPath, website.master)
|
||||||
self.permPath = website.path
|
# self.permPath = website.path
|
||||||
|
#
|
||||||
except:
|
# except:
|
||||||
website = Websites.objects.get(domain=domainName)
|
# website = Websites.objects.get(domain=domainName)
|
||||||
externalApp = website.externalApp
|
# externalApp = website.externalApp
|
||||||
self.masterDomain = website.domain
|
# self.masterDomain = website.domain
|
||||||
|
#
|
||||||
if home == '0':
|
# if home == '0':
|
||||||
path = self.extraArgs['path']
|
# path = self.extraArgs['path']
|
||||||
finalPath = "/home/" + domainName + "/public_html/" + path + "/"
|
# finalPath = "/home/" + domainName + "/public_html/" + path + "/"
|
||||||
else:
|
# else:
|
||||||
finalPath = "/home/" + domainName + "/public_html/"
|
# finalPath = "/home/" + domainName + "/public_html/"
|
||||||
|
#
|
||||||
if website.package.dataBases > website.databases_set.all().count():
|
# if website.package.dataBases > website.databases_set.all().count():
|
||||||
pass
|
# pass
|
||||||
else:
|
# else:
|
||||||
raise BaseException( "Maximum database limit reached for this website.")
|
# raise BaseException( "Maximum database limit reached for this website.")
|
||||||
|
#
|
||||||
statusFile = open(tempStatusPath, 'w')
|
# statusFile = open(tempStatusPath, 'w')
|
||||||
statusFile.writelines('Setting up Database,20')
|
# statusFile.writelines('Setting up Database,20')
|
||||||
statusFile.close()
|
# statusFile.close()
|
||||||
|
#
|
||||||
dbName, dbUser, dbPassword = self.dbCreation(tempStatusPath, website)
|
# dbName, dbUser, dbPassword = self.dbCreation(tempStatusPath, website)
|
||||||
self.permPath = '/home/%s/public_html' % (website.domain)
|
# self.permPath = '/home/%s/public_html' % (website.domain)
|
||||||
|
#
|
||||||
## Security Check
|
# ## Security Check
|
||||||
|
#
|
||||||
if finalPath.find("..") > -1:
|
# if finalPath.find("..") > -1:
|
||||||
raise BaseException( "Specified path must be inside virtual host home.")
|
# raise BaseException( "Specified path must be inside virtual host home.")
|
||||||
|
#
|
||||||
command = 'chmod 755 %s' % (self.permPath)
|
# command = 'chmod 755 %s' % (self.permPath)
|
||||||
ProcessUtilities.executioner(command)
|
# ProcessUtilities.executioner(command)
|
||||||
|
#
|
||||||
if not os.path.exists(finalPath):
|
# if not os.path.exists(finalPath):
|
||||||
command = 'mkdir -p ' + finalPath
|
# command = 'mkdir -p ' + finalPath
|
||||||
ProcessUtilities.executioner(command, externalApp)
|
# ProcessUtilities.executioner(command, externalApp)
|
||||||
|
#
|
||||||
## checking for directories/files
|
# ## checking for directories/files
|
||||||
|
#
|
||||||
if self.dataLossCheck(finalPath, tempStatusPath) == 0:
|
# if self.dataLossCheck(finalPath, tempStatusPath) == 0:
|
||||||
raise BaseException('Directory not empty.')
|
# raise BaseException('Directory not empty.')
|
||||||
|
#
|
||||||
####
|
# ####
|
||||||
|
#
|
||||||
statusFile = open(tempStatusPath, 'w')
|
# statusFile = open(tempStatusPath, 'w')
|
||||||
statusFile.writelines('Downloading Magento Community Core via composer to document root ..,30')
|
# statusFile.writelines('Downloading Magento Community Core via composer to document root ..,30')
|
||||||
statusFile.close()
|
# statusFile.close()
|
||||||
|
#
|
||||||
command = 'composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition %s' % (finalPath)
|
# command = 'composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition %s' % (finalPath)
|
||||||
|
#
|
||||||
ProcessUtilities.executioner(command, externalApp)
|
# ProcessUtilities.executioner(command, externalApp)
|
||||||
|
#
|
||||||
###
|
# ###
|
||||||
|
#
|
||||||
statusFile = open(tempStatusPath, 'w')
|
# statusFile = open(tempStatusPath, 'w')
|
||||||
statusFile.writelines('Configuring the installation,40')
|
# statusFile.writelines('Configuring the installation,40')
|
||||||
statusFile.close()
|
# statusFile.close()
|
||||||
|
#
|
||||||
if home == '0':
|
# if home == '0':
|
||||||
path = self.extraArgs['path']
|
# path = self.extraArgs['path']
|
||||||
# finalURL = domainName + '/' + path
|
# # finalURL = domainName + '/' + path
|
||||||
finalURL = domainName
|
# finalURL = domainName
|
||||||
else:
|
# else:
|
||||||
finalURL = domainName
|
# finalURL = domainName
|
||||||
|
#
|
||||||
statusFile = open(tempStatusPath, 'w')
|
# statusFile = open(tempStatusPath, 'w')
|
||||||
statusFile.writelines('Installing and configuring Magento..,60')
|
# statusFile.writelines('Installing and configuring Magento..,60')
|
||||||
statusFile.close()
|
# statusFile.close()
|
||||||
|
#
|
||||||
command = '/usr/local/lsws/lsphp73/bin/php -d memory_limit=512M %sbin/magento setup:install --base-url="http://%s" ' \
|
# command = '/usr/local/lsws/lsphp73/bin/php -d memory_limit=512M %sbin/magento setup:install --base-url="http://%s" ' \
|
||||||
' --db-host="localhost" --db-name="%s" --db-user="%s" --db-password="%s" --admin-firstname="%s" ' \
|
# ' --db-host="localhost" --db-name="%s" --db-user="%s" --db-password="%s" --admin-firstname="%s" ' \
|
||||||
' --admin-lastname="%s" --admin-email="%s" --admin-user="%s" --admin-password="%s" --language="%s" --timezone="%s" ' \
|
# ' --admin-lastname="%s" --admin-email="%s" --admin-user="%s" --admin-password="%s" --language="%s" --timezone="%s" ' \
|
||||||
' --use-rewrites=1 --search-engine="elasticsearch7" --elasticsearch-host="localhost" --elasticsearch-port="9200" ' \
|
# ' --use-rewrites=1 --search-engine="elasticsearch7" --elasticsearch-host="localhost" --elasticsearch-port="9200" ' \
|
||||||
' --elasticsearch-index-prefix="%s"' \
|
# ' --elasticsearch-index-prefix="%s"' \
|
||||||
% (finalPath, finalURL, dbName, dbUser, dbPassword, firstName, lastName, email, username, password, language, timezone, dbName )
|
# % (finalPath, finalURL, dbName, dbUser, dbPassword, firstName, lastName, email, username, password, 'language', 'timezone', dbName )
|
||||||
result = ProcessUtilities.outputExecutioner(command, externalApp)
|
#
|
||||||
logging.writeToFile(result)
|
# result = ProcessUtilities.outputExecutioner(command, externalApp)
|
||||||
|
# logging.writeToFile(result)
|
||||||
##
|
#
|
||||||
|
# ##
|
||||||
ProcessUtilities.executioner(command, externalApp)
|
#
|
||||||
|
# ProcessUtilities.executioner(command, externalApp)
|
||||||
##
|
#
|
||||||
|
# ##
|
||||||
from filemanager.filemanager import FileManager
|
#
|
||||||
|
# from filemanager.filemanager import FileManager
|
||||||
fm = FileManager(None, None)
|
#
|
||||||
fm.fixPermissions(self.masterDomain)
|
# fm = FileManager(None, None)
|
||||||
|
# fm.fixPermissions(self.masterDomain)
|
||||||
installUtilities.reStartLiteSpeed()
|
#
|
||||||
|
# installUtilities.reStartLiteSpeed()
|
||||||
statusFile = open(tempStatusPath, 'w')
|
#
|
||||||
statusFile.writelines("Successfully Installed. [200]")
|
# statusFile = open(tempStatusPath, 'w')
|
||||||
statusFile.close()
|
# statusFile.writelines("Successfully Installed. [200]")
|
||||||
return 0
|
# statusFile.close()
|
||||||
|
# return 0
|
||||||
|
#
|
||||||
except BaseException as msg:
|
#
|
||||||
# remove the downloaded files
|
# except BaseException as msg:
|
||||||
|
# # remove the downloaded files
|
||||||
homeDir = "/home/" + domainName + "/public_html"
|
#
|
||||||
|
# homeDir = "/home/" + domainName + "/public_html"
|
||||||
if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
|
#
|
||||||
groupName = 'nobody'
|
# if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
|
||||||
else:
|
# groupName = 'nobody'
|
||||||
groupName = 'nogroup'
|
# else:
|
||||||
|
# groupName = 'nogroup'
|
||||||
if not os.path.exists(homeDir):
|
#
|
||||||
command = "chown -R " + externalApp + ":" + groupName + " " + homeDir
|
# if not os.path.exists(homeDir):
|
||||||
ProcessUtilities.executioner(command, externalApp)
|
# command = "chown -R " + externalApp + ":" + groupName + " " + homeDir
|
||||||
|
# ProcessUtilities.executioner(command, externalApp)
|
||||||
try:
|
#
|
||||||
mysqlUtilities.deleteDatabase(dbName, dbUser)
|
# try:
|
||||||
db = Databases.objects.get(dbName=dbName)
|
# mysqlUtilities.deleteDatabase(dbName, dbUser)
|
||||||
db.delete()
|
# db = Databases.objects.get(dbName=dbName)
|
||||||
except:
|
# db.delete()
|
||||||
pass
|
# except:
|
||||||
|
# pass
|
||||||
permPath = '/home/%s/public_html' % (domainName)
|
#
|
||||||
command = 'chmod 750 %s' % (permPath)
|
# permPath = '/home/%s/public_html' % (domainName)
|
||||||
ProcessUtilities.executioner(command)
|
# command = 'chmod 750 %s' % (permPath)
|
||||||
|
# ProcessUtilities.executioner(command)
|
||||||
statusFile = open(self.tempStatusPath, 'w')
|
#
|
||||||
statusFile.writelines(str(msg) + " [404]")
|
# statusFile = open(self.tempStatusPath, 'w')
|
||||||
statusFile.close()
|
# statusFile.writelines(str(msg) + " [404]")
|
||||||
return 0
|
# statusFile.close()
|
||||||
|
# return 0
|
||||||
|
|||||||
@@ -154,346 +154,434 @@ app.controller('createDNSZone', function ($scope, $http) {
|
|||||||
|
|
||||||
app.controller('addModifyDNSRecords', function ($scope, $http) {
|
app.controller('addModifyDNSRecords', function ($scope, $http) {
|
||||||
|
|
||||||
$scope.addRecordsBox = true;
|
$scope.addRecordsBox = true;
|
||||||
$scope.currentRecords = true;
|
$scope.currentRecords = true;
|
||||||
$scope.canNotFetchRecords = true;
|
$scope.canNotFetchRecords = true;
|
||||||
$scope.recordsFetched = true;
|
$scope.recordsFetched = true;
|
||||||
$scope.recordDeleted = true;
|
$scope.recordDeleted = true;
|
||||||
$scope.recordAdded = true;
|
$scope.recordAdded = true;
|
||||||
$scope.couldNotConnect = true;
|
$scope.couldNotConnect = true;
|
||||||
$scope.recordsLoading = true;
|
$scope.recordsLoading = true;
|
||||||
$scope.recordDeleted = true;
|
$scope.recordDeleted = true;
|
||||||
$scope.couldNotDeleteRecords = true;
|
$scope.couldNotDeleteRecords = true;
|
||||||
$scope.couldNotAddRecord = true;
|
$scope.couldNotAddRecord = true;
|
||||||
$scope.recordValueDefault = false;
|
$scope.recordValueDefault = false;
|
||||||
|
|
||||||
// Hide records boxes
|
// Hide records boxes
|
||||||
$(".aaaaRecord").hide();
|
$(".aaaaRecord").hide();
|
||||||
$(".cNameRecord").hide();
|
$(".cNameRecord").hide();
|
||||||
$(".mxRecord").hide();
|
$(".mxRecord").hide();
|
||||||
$(".txtRecord").hide();
|
$(".txtRecord").hide();
|
||||||
$(".spfRecord").hide();
|
$(".spfRecord").hide();
|
||||||
$(".nsRecord").hide();
|
$(".nsRecord").hide();
|
||||||
$(".soaRecord").hide();
|
$(".soaRecord").hide();
|
||||||
$(".srvRecord").hide();
|
$(".srvRecord").hide();
|
||||||
$(".caaRecord").hide();
|
$(".caaRecord").hide();
|
||||||
|
|
||||||
|
|
||||||
var currentSelection = "aRecord";
|
var currentSelection = "aRecord";
|
||||||
$("#" + currentSelection).addClass("active");
|
|
||||||
|
|
||||||
$scope.fetchRecordsTabs = function (recordType) {
|
|
||||||
$("#" + currentSelection).removeClass("active");
|
|
||||||
$("." + currentSelection).hide();
|
|
||||||
$scope.recordsLoading = false;
|
|
||||||
currentSelection = recordType;
|
|
||||||
$("#" + currentSelection).addClass("active");
|
$("#" + currentSelection).addClass("active");
|
||||||
$("." + currentSelection).show();
|
|
||||||
populateCurrentRecords();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
$scope.fetchRecordsTabs = function (recordType) {
|
||||||
$scope.fetchRecords = function () {
|
$("#" + currentSelection).removeClass("active");
|
||||||
$scope.recordsLoading = false;
|
$("." + currentSelection).hide();
|
||||||
$scope.addRecordsBox = false;
|
$scope.recordsLoading = false;
|
||||||
populateCurrentRecords();
|
currentSelection = recordType;
|
||||||
};
|
$("#" + currentSelection).addClass("active");
|
||||||
|
$("." + currentSelection).show();
|
||||||
|
populateCurrentRecords();
|
||||||
$scope.addDNSRecord = function (type) {
|
|
||||||
|
|
||||||
$scope.recordsLoading = false;
|
|
||||||
|
|
||||||
|
|
||||||
url = "/dns/addDNSRecord";
|
|
||||||
|
|
||||||
|
|
||||||
// Record specific values
|
|
||||||
|
|
||||||
var data = {};
|
|
||||||
|
|
||||||
if (type === "MX") {
|
|
||||||
data.selectedZone = $scope.selectedZone;
|
|
||||||
data.recordName = $scope.recordName;
|
|
||||||
data.recordContentMX = $scope.recordContentMX;
|
|
||||||
data.priority = $scope.priority;
|
|
||||||
data.ttl = $scope.ttl;
|
|
||||||
data.recordType = type;
|
|
||||||
} else if (type === "A") {
|
|
||||||
|
|
||||||
data.selectedZone = $scope.selectedZone;
|
|
||||||
data.recordName = $scope.recordName;
|
|
||||||
data.recordContentA = $scope.recordContentA;
|
|
||||||
data.ttl = $scope.ttl;
|
|
||||||
data.recordType = type;
|
|
||||||
|
|
||||||
} else if (type === "AAAA") {
|
|
||||||
data.selectedZone = $scope.selectedZone;
|
|
||||||
data.recordName = $scope.recordName;
|
|
||||||
data.recordContentAAAA = $scope.recordContentAAAA;
|
|
||||||
data.ttl = $scope.ttl;
|
|
||||||
data.recordType = type;
|
|
||||||
} else if (type === "CNAME") {
|
|
||||||
data.selectedZone = $scope.selectedZone;
|
|
||||||
data.recordName = $scope.recordName;
|
|
||||||
data.recordContentCNAME = $scope.recordContentCNAME;
|
|
||||||
data.ttl = $scope.ttl;
|
|
||||||
data.recordType = type;
|
|
||||||
} else if (type === "SPF") {
|
|
||||||
data.selectedZone = $scope.selectedZone;
|
|
||||||
data.recordName = $scope.recordName;
|
|
||||||
data.recordContentSPF = $scope.recordContentSPF;
|
|
||||||
data.ttl = $scope.ttl;
|
|
||||||
data.recordType = type;
|
|
||||||
} else if (type === "SOA") {
|
|
||||||
data.selectedZone = $scope.selectedZone;
|
|
||||||
data.recordName = $scope.selectedZone;
|
|
||||||
data.recordContentSOA = $scope.recordContentSOA;
|
|
||||||
data.ttl = $scope.ttl;
|
|
||||||
data.recordType = type;
|
|
||||||
} else if (type === "TXT") {
|
|
||||||
data.selectedZone = $scope.selectedZone;
|
|
||||||
data.recordName = $scope.recordName;
|
|
||||||
data.recordContentTXT = $scope.recordContentTXT;
|
|
||||||
data.ttl = $scope.ttl;
|
|
||||||
data.recordType = type;
|
|
||||||
} else if (type === "NS") {
|
|
||||||
data.selectedZone = $scope.selectedZone;
|
|
||||||
data.recordName = $scope.selectedZone;
|
|
||||||
data.recordContentNS = $scope.recordContentNS;
|
|
||||||
data.ttl = $scope.ttl;
|
|
||||||
data.recordType = type;
|
|
||||||
} else if (type === "SRV") {
|
|
||||||
data.selectedZone = $scope.selectedZone;
|
|
||||||
data.recordName = $scope.recordName;
|
|
||||||
data.recordContentSRV = $scope.recordContentSRV;
|
|
||||||
data.priority = $scope.priority;
|
|
||||||
data.ttl = $scope.ttl;
|
|
||||||
data.recordType = type;
|
|
||||||
} else if (type === "CAA") {
|
|
||||||
data.selectedZone = $scope.selectedZone;
|
|
||||||
data.recordName = $scope.recordName;
|
|
||||||
data.recordContentCAA = $scope.recordContentCAA;
|
|
||||||
data.ttl = $scope.ttl;
|
|
||||||
data.recordType = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var config = {
|
|
||||||
headers: {
|
|
||||||
'X-CSRFToken': getCookie('csrftoken')
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
$scope.fetchRecords = function () {
|
||||||
|
$scope.recordsLoading = false;
|
||||||
|
$scope.addRecordsBox = false;
|
||||||
function ListInitialDatas(response) {
|
populateCurrentRecords();
|
||||||
|
|
||||||
|
|
||||||
if (response.data.add_status === 1) {
|
|
||||||
|
|
||||||
|
|
||||||
populateCurrentRecords();
|
|
||||||
|
|
||||||
$scope.canNotFetchRecords = true;
|
|
||||||
$scope.recordsFetched = false;
|
|
||||||
$scope.recordDeleted = true;
|
|
||||||
$scope.recordAdded = false;
|
|
||||||
$scope.couldNotConnect = true;
|
|
||||||
$scope.couldNotAddRecord = true;
|
|
||||||
$scope.recordsLoading = true;
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
$scope.recordsFetched = true;
|
|
||||||
$scope.recordDeleted = true;
|
|
||||||
$scope.recordAdded = true;
|
|
||||||
$scope.couldNotConnect = true;
|
|
||||||
$scope.recordsLoading = true;
|
|
||||||
$scope.couldNotAddRecord = false;
|
|
||||||
|
|
||||||
$scope.errorMessage = response.data.error_message;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function cantLoadInitialDatas(response) {
|
|
||||||
|
|
||||||
$scope.addRecordsBox = true;
|
|
||||||
$scope.currentRecords = true;
|
|
||||||
$scope.canNotFetchRecords = true;
|
|
||||||
$scope.recordsFetched = true;
|
|
||||||
$scope.recordDeleted = true;
|
|
||||||
$scope.recordAdded = true;
|
|
||||||
$scope.couldNotConnect = false;
|
|
||||||
$scope.couldNotAddRecord = true;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
function populateCurrentRecords() {
|
|
||||||
|
|
||||||
var selectedZone = $scope.selectedZone;
|
|
||||||
|
|
||||||
url = "/dns/getCurrentRecordsForDomain";
|
|
||||||
|
|
||||||
var data = {
|
|
||||||
selectedZone: selectedZone,
|
|
||||||
currentSelection: currentSelection
|
|
||||||
};
|
|
||||||
|
|
||||||
var config = {
|
|
||||||
headers: {
|
|
||||||
'X-CSRFToken': getCookie('csrftoken')
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
$scope.addDNSRecord = function (type) {
|
||||||
|
|
||||||
|
$scope.recordsLoading = false;
|
||||||
|
|
||||||
|
|
||||||
function ListInitialDatas(response) {
|
url = "/dns/addDNSRecord";
|
||||||
if (response.data.fetchStatus === 1) {
|
|
||||||
|
|
||||||
$scope.records = JSON.parse(response.data.data);
|
|
||||||
|
|
||||||
$scope.currentRecords = false;
|
// Record specific values
|
||||||
$scope.canNotFetchRecords = true;
|
|
||||||
$scope.recordsFetched = false;
|
|
||||||
$scope.recordDeleted = true;
|
|
||||||
$scope.recordAdded = true;
|
|
||||||
$scope.couldNotConnect = true;
|
|
||||||
$scope.recordsLoading = true;
|
|
||||||
$scope.couldNotAddRecord = true;
|
|
||||||
|
|
||||||
$scope.domainFeteched = $scope.selectedZone;
|
var data = {};
|
||||||
|
|
||||||
} else {
|
if (type === "MX") {
|
||||||
|
data.selectedZone = $scope.selectedZone;
|
||||||
|
data.recordName = $scope.recordName;
|
||||||
|
data.recordContentMX = $scope.recordContentMX;
|
||||||
|
data.priority = $scope.priority;
|
||||||
|
data.ttl = $scope.ttl;
|
||||||
|
data.recordType = type;
|
||||||
|
} else if (type === "A") {
|
||||||
|
|
||||||
|
data.selectedZone = $scope.selectedZone;
|
||||||
|
data.recordName = $scope.recordName;
|
||||||
|
data.recordContentA = $scope.recordContentA;
|
||||||
|
data.ttl = $scope.ttl;
|
||||||
|
data.recordType = type;
|
||||||
|
|
||||||
|
} else if (type === "AAAA") {
|
||||||
|
data.selectedZone = $scope.selectedZone;
|
||||||
|
data.recordName = $scope.recordName;
|
||||||
|
data.recordContentAAAA = $scope.recordContentAAAA;
|
||||||
|
data.ttl = $scope.ttl;
|
||||||
|
data.recordType = type;
|
||||||
|
} else if (type === "CNAME") {
|
||||||
|
data.selectedZone = $scope.selectedZone;
|
||||||
|
data.recordName = $scope.recordName;
|
||||||
|
data.recordContentCNAME = $scope.recordContentCNAME;
|
||||||
|
data.ttl = $scope.ttl;
|
||||||
|
data.recordType = type;
|
||||||
|
} else if (type === "SPF") {
|
||||||
|
data.selectedZone = $scope.selectedZone;
|
||||||
|
data.recordName = $scope.recordName;
|
||||||
|
data.recordContentSPF = $scope.recordContentSPF;
|
||||||
|
data.ttl = $scope.ttl;
|
||||||
|
data.recordType = type;
|
||||||
|
} else if (type === "SOA") {
|
||||||
|
data.selectedZone = $scope.selectedZone;
|
||||||
|
data.recordName = $scope.selectedZone;
|
||||||
|
data.recordContentSOA = $scope.recordContentSOA;
|
||||||
|
data.ttl = $scope.ttl;
|
||||||
|
data.recordType = type;
|
||||||
|
} else if (type === "TXT") {
|
||||||
|
data.selectedZone = $scope.selectedZone;
|
||||||
|
data.recordName = $scope.recordName;
|
||||||
|
data.recordContentTXT = $scope.recordContentTXT;
|
||||||
|
data.ttl = $scope.ttl;
|
||||||
|
data.recordType = type;
|
||||||
|
} else if (type === "NS") {
|
||||||
|
data.selectedZone = $scope.selectedZone;
|
||||||
|
data.recordName = $scope.selectedZone;
|
||||||
|
data.recordContentNS = $scope.recordContentNS;
|
||||||
|
data.ttl = $scope.ttl;
|
||||||
|
data.recordType = type;
|
||||||
|
} else if (type === "SRV") {
|
||||||
|
data.selectedZone = $scope.selectedZone;
|
||||||
|
data.recordName = $scope.recordName;
|
||||||
|
data.recordContentSRV = $scope.recordContentSRV;
|
||||||
|
data.priority = $scope.priority;
|
||||||
|
data.ttl = $scope.ttl;
|
||||||
|
data.recordType = type;
|
||||||
|
} else if (type === "CAA") {
|
||||||
|
data.selectedZone = $scope.selectedZone;
|
||||||
|
data.recordName = $scope.recordName;
|
||||||
|
data.recordContentCAA = $scope.recordContentCAA;
|
||||||
|
data.ttl = $scope.ttl;
|
||||||
|
data.recordType = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var config = {
|
||||||
|
headers: {
|
||||||
|
'X-CSRFToken': getCookie('csrftoken')
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||||
|
|
||||||
|
|
||||||
|
function ListInitialDatas(response) {
|
||||||
|
|
||||||
|
|
||||||
|
if (response.data.add_status === 1) {
|
||||||
|
|
||||||
|
|
||||||
|
populateCurrentRecords();
|
||||||
|
|
||||||
|
$scope.canNotFetchRecords = true;
|
||||||
|
$scope.recordsFetched = false;
|
||||||
|
$scope.recordDeleted = true;
|
||||||
|
$scope.recordAdded = false;
|
||||||
|
$scope.couldNotConnect = true;
|
||||||
|
$scope.couldNotAddRecord = true;
|
||||||
|
$scope.recordsLoading = true;
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
$scope.recordsFetched = true;
|
||||||
|
$scope.recordDeleted = true;
|
||||||
|
$scope.recordAdded = true;
|
||||||
|
$scope.couldNotConnect = true;
|
||||||
|
$scope.recordsLoading = true;
|
||||||
|
$scope.couldNotAddRecord = false;
|
||||||
|
|
||||||
|
$scope.errorMessage = response.data.error_message;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function cantLoadInitialDatas(response) {
|
||||||
|
|
||||||
$scope.addRecordsBox = true;
|
$scope.addRecordsBox = true;
|
||||||
$scope.currentRecords = true;
|
$scope.currentRecords = true;
|
||||||
$scope.canNotFetchRecords = false;
|
$scope.canNotFetchRecords = true;
|
||||||
$scope.recordsFetched = true;
|
$scope.recordsFetched = true;
|
||||||
$scope.recordDeleted = true;
|
$scope.recordDeleted = true;
|
||||||
$scope.recordAdded = true;
|
$scope.recordAdded = true;
|
||||||
$scope.couldNotConnect = true;
|
$scope.couldNotConnect = false;
|
||||||
$scope.recordsLoading = true;
|
|
||||||
$scope.couldNotAddRecord = true;
|
$scope.couldNotAddRecord = true;
|
||||||
|
|
||||||
$scope.errorMessage = response.data.error_message;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function cantLoadInitialDatas(response) {
|
|
||||||
|
|
||||||
$scope.addRecordsBox = true;
|
|
||||||
$scope.currentRecords = true;
|
|
||||||
$scope.canNotFetchRecords = true;
|
|
||||||
$scope.recordsFetched = true;
|
|
||||||
$scope.recordDeleted = true;
|
|
||||||
$scope.recordAdded = true;
|
|
||||||
$scope.couldNotConnect = false;
|
|
||||||
$scope.couldNotAddRecord = true;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
$scope.deleteRecord = function (id) {
|
|
||||||
|
|
||||||
|
|
||||||
var selectedZone = $scope.selectedZone;
|
|
||||||
|
|
||||||
url = "/dns/deleteDNSRecord";
|
|
||||||
|
|
||||||
var data = {
|
|
||||||
id: id,
|
|
||||||
};
|
|
||||||
|
|
||||||
var config = {
|
|
||||||
headers: {
|
|
||||||
'X-CSRFToken': getCookie('csrftoken')
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
function populateCurrentRecords() {
|
||||||
|
|
||||||
|
var selectedZone = $scope.selectedZone;
|
||||||
|
|
||||||
|
url = "/dns/getCurrentRecordsForDomain";
|
||||||
|
|
||||||
|
var data = {
|
||||||
|
selectedZone: selectedZone,
|
||||||
|
currentSelection: currentSelection
|
||||||
|
};
|
||||||
|
|
||||||
|
var config = {
|
||||||
|
headers: {
|
||||||
|
'X-CSRFToken': getCookie('csrftoken')
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
function ListInitialDatas(response) {
|
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||||
|
|
||||||
|
|
||||||
if (response.data.delete_status == 1) {
|
function ListInitialDatas(response) {
|
||||||
|
if (response.data.fetchStatus === 1) {
|
||||||
|
|
||||||
|
$scope.records = JSON.parse(response.data.data);
|
||||||
|
|
||||||
|
$scope.currentRecords = false;
|
||||||
|
$scope.canNotFetchRecords = true;
|
||||||
|
$scope.recordsFetched = false;
|
||||||
|
$scope.recordDeleted = true;
|
||||||
|
$scope.recordAdded = true;
|
||||||
|
$scope.couldNotConnect = true;
|
||||||
|
$scope.recordsLoading = true;
|
||||||
|
$scope.couldNotAddRecord = true;
|
||||||
|
|
||||||
|
$scope.domainFeteched = $scope.selectedZone;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
$scope.addRecordsBox = true;
|
||||||
|
$scope.currentRecords = true;
|
||||||
|
$scope.canNotFetchRecords = false;
|
||||||
|
$scope.recordsFetched = true;
|
||||||
|
$scope.recordDeleted = true;
|
||||||
|
$scope.recordAdded = true;
|
||||||
|
$scope.couldNotConnect = true;
|
||||||
|
$scope.recordsLoading = true;
|
||||||
|
$scope.couldNotAddRecord = true;
|
||||||
|
|
||||||
|
$scope.errorMessage = response.data.error_message;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function cantLoadInitialDatas(response) {
|
||||||
|
|
||||||
|
$scope.addRecordsBox = true;
|
||||||
|
$scope.currentRecords = true;
|
||||||
|
$scope.canNotFetchRecords = true;
|
||||||
|
$scope.recordsFetched = true;
|
||||||
|
$scope.recordDeleted = true;
|
||||||
|
$scope.recordAdded = true;
|
||||||
|
$scope.couldNotConnect = false;
|
||||||
|
$scope.couldNotAddRecord = true;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
var globalID = null;
|
||||||
|
var nameNow = null;
|
||||||
|
var ttlNow = null;
|
||||||
|
var contentNow = null;
|
||||||
|
var priorityNow = null;
|
||||||
|
|
||||||
|
|
||||||
|
$scope.setupContent = function (id, type, content) {
|
||||||
|
if (globalID === null) {
|
||||||
|
globalID = id;
|
||||||
|
} else {
|
||||||
|
if (globalID !== id) {
|
||||||
|
globalID = id;
|
||||||
|
nameNow = null;
|
||||||
|
ttlNow = null;
|
||||||
|
contentNow = null;
|
||||||
|
priorityNow = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type === 'name') {
|
||||||
|
nameNow = content;
|
||||||
|
} else if (type === 'ttl') {
|
||||||
|
ttlNow = content;
|
||||||
|
} else if (type === 'content') {
|
||||||
|
contentNow = content;
|
||||||
|
} else if (type === 'priority') {
|
||||||
|
priorityNow = content;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.saveNow = function (id) {
|
||||||
|
|
||||||
|
if (id !== globalID) {
|
||||||
|
alert('This record is not changed');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$scope.recordsLoading = false;
|
||||||
|
|
||||||
|
url = "/dns/updateRecord";
|
||||||
|
|
||||||
|
var data = {
|
||||||
|
selectedZone: $scope.selectedZone,
|
||||||
|
id: globalID,
|
||||||
|
nameNow: nameNow,
|
||||||
|
ttlNow: ttlNow,
|
||||||
|
contentNow: contentNow,
|
||||||
|
priorityNow: priorityNow,
|
||||||
|
};
|
||||||
|
|
||||||
|
var config = {
|
||||||
|
headers: {
|
||||||
|
'X-CSRFToken': getCookie('csrftoken')
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||||
|
|
||||||
|
|
||||||
|
function ListInitialDatas(response) {
|
||||||
|
$scope.recordsLoading = true;
|
||||||
|
|
||||||
|
if (response.data.status === 1) {
|
||||||
|
|
||||||
|
new PNotify({
|
||||||
|
title: 'Success!',
|
||||||
|
text: 'Record updated.',
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
|
|
||||||
|
} else {
|
||||||
|
new PNotify({
|
||||||
|
title: 'Operation Failed!',
|
||||||
|
text: response.data.error_message,
|
||||||
|
type: 'error'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function cantLoadInitialDatas(response) {
|
||||||
|
$scope.recordsLoading = true;
|
||||||
|
new PNotify({
|
||||||
|
title: 'Operation Failed!',
|
||||||
|
text: 'Could not connect to server, please refresh this page',
|
||||||
|
type: 'error'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.deleteRecord = function (id) {
|
||||||
|
|
||||||
|
var selectedZone = $scope.selectedZone;
|
||||||
|
|
||||||
|
url = "/dns/deleteDNSRecord";
|
||||||
|
|
||||||
|
var data = {
|
||||||
|
id: id,
|
||||||
|
};
|
||||||
|
|
||||||
|
var config = {
|
||||||
|
headers: {
|
||||||
|
'X-CSRFToken': getCookie('csrftoken')
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||||
|
|
||||||
|
|
||||||
|
function ListInitialDatas(response) {
|
||||||
|
|
||||||
|
|
||||||
|
if (response.data.delete_status == 1) {
|
||||||
|
|
||||||
|
|
||||||
|
$scope.addRecordsBox = false;
|
||||||
|
$scope.currentRecords = false;
|
||||||
|
$scope.canNotFetchRecords = true;
|
||||||
|
$scope.recordsFetched = true;
|
||||||
|
$scope.recordDeleted = false;
|
||||||
|
$scope.recordAdded = true;
|
||||||
|
$scope.couldNotConnect = true;
|
||||||
|
$scope.recordsLoading = true;
|
||||||
|
$scope.recordDeleted = true;
|
||||||
|
$scope.couldNotDeleteRecords = true;
|
||||||
|
$scope.couldNotAddRecord = true;
|
||||||
|
|
||||||
|
populateCurrentRecords();
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
$scope.addRecordsBox = true;
|
||||||
|
$scope.currentRecords = true;
|
||||||
|
$scope.canNotFetchRecords = true;
|
||||||
|
$scope.recordsFetched = false;
|
||||||
|
$scope.recordDeleted = true;
|
||||||
|
$scope.recordAdded = true;
|
||||||
|
$scope.couldNotConnect = true;
|
||||||
|
$scope.recordsLoading = true;
|
||||||
|
$scope.recordDeleted = true;
|
||||||
|
$scope.couldNotDeleteRecords = false;
|
||||||
|
$scope.couldNotAddRecord = true;
|
||||||
|
|
||||||
|
|
||||||
|
$scope.errorMessage = response.data.error_message;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function cantLoadInitialDatas(response) {
|
||||||
|
|
||||||
$scope.addRecordsBox = false;
|
$scope.addRecordsBox = false;
|
||||||
$scope.currentRecords = false;
|
$scope.currentRecords = false;
|
||||||
$scope.canNotFetchRecords = true;
|
$scope.canNotFetchRecords = true;
|
||||||
$scope.recordsFetched = true;
|
$scope.recordsFetched = true;
|
||||||
$scope.recordDeleted = false;
|
$scope.recordDeleted = true;
|
||||||
$scope.recordAdded = true;
|
$scope.recordAdded = true;
|
||||||
$scope.couldNotConnect = true;
|
$scope.couldNotConnect = false;
|
||||||
$scope.recordsLoading = true;
|
$scope.recordsLoading = true;
|
||||||
$scope.recordDeleted = true;
|
$scope.recordDeleted = true;
|
||||||
$scope.couldNotDeleteRecords = true;
|
$scope.couldNotDeleteRecords = true;
|
||||||
$scope.couldNotAddRecord = true;
|
$scope.couldNotAddRecord = true;
|
||||||
|
|
||||||
populateCurrentRecords();
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
$scope.addRecordsBox = true;
|
|
||||||
$scope.currentRecords = true;
|
|
||||||
$scope.canNotFetchRecords = true;
|
|
||||||
$scope.recordsFetched = false;
|
|
||||||
$scope.recordDeleted = true;
|
|
||||||
$scope.recordAdded = true;
|
|
||||||
$scope.couldNotConnect = true;
|
|
||||||
$scope.recordsLoading = true;
|
|
||||||
$scope.recordDeleted = true;
|
|
||||||
$scope.couldNotDeleteRecords = false;
|
|
||||||
$scope.couldNotAddRecord = true;
|
|
||||||
|
|
||||||
|
|
||||||
$scope.errorMessage = response.data.error_message;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function cantLoadInitialDatas(response) {
|
};
|
||||||
|
|
||||||
$scope.addRecordsBox = false;
|
|
||||||
$scope.currentRecords = false;
|
|
||||||
$scope.canNotFetchRecords = true;
|
|
||||||
$scope.recordsFetched = true;
|
|
||||||
$scope.recordDeleted = true;
|
|
||||||
$scope.recordAdded = true;
|
|
||||||
$scope.couldNotConnect = false;
|
|
||||||
$scope.recordsLoading = true;
|
|
||||||
$scope.recordDeleted = true;
|
|
||||||
$scope.couldNotDeleteRecords = true;
|
|
||||||
$scope.couldNotAddRecord = true;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
);
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
/* Java script code to delete DNS Zone */
|
/* Java script code to delete DNS Zone */
|
||||||
|
|
||||||
@@ -1049,7 +1137,7 @@ app.controller('addModifyDNSRecordsCloudFlare', function ($scope, $http, $window
|
|||||||
|
|
||||||
$scope.syncCF = function () {
|
$scope.syncCF = function () {
|
||||||
|
|
||||||
$scope.recordsLoading = false;
|
$scope.recordsLoading = false;
|
||||||
var selectedZone = $scope.selectedZone;
|
var selectedZone = $scope.selectedZone;
|
||||||
|
|
||||||
url = "/dns/syncCF";
|
url = "/dns/syncCF";
|
||||||
|
|||||||
Reference in New Issue
Block a user