mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-08 22:50:26 +00:00
Fix bugs in #53
This commit is contained in:
parent
7f5a57f80c
commit
c7efb85feb
@ -803,13 +803,15 @@ class Record(object):
|
|||||||
records = []
|
records = []
|
||||||
for r in deleted_records:
|
for r in deleted_records:
|
||||||
record = {
|
record = {
|
||||||
"name": r['name'],
|
"name": r['name'] + '.' if NEW_SCHEMA else r['name'],
|
||||||
"type": r['type'],
|
"type": r['type'],
|
||||||
"changetype": "DELETE",
|
"changetype": "DELETE",
|
||||||
"records": [
|
"records": [
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
records.append(record)
|
records.append(record)
|
||||||
|
|
||||||
|
print records
|
||||||
postdata_for_delete = {"rrsets": records}
|
postdata_for_delete = {"rrsets": records}
|
||||||
|
|
||||||
records = []
|
records = []
|
||||||
@ -895,10 +897,10 @@ class Record(object):
|
|||||||
headers = {}
|
headers = {}
|
||||||
headers['X-API-Key'] = PDNS_API_KEY
|
headers['X-API-Key'] = PDNS_API_KEY
|
||||||
jdata1 = utils.fetch_json(urlparse.urljoin(PDNS_STATS_URL, API_EXTENDED_URL + '/servers/localhost/zones/%s' % domain), headers=headers, method='PATCH', data=postdata_for_delete)
|
jdata1 = utils.fetch_json(urlparse.urljoin(PDNS_STATS_URL, API_EXTENDED_URL + '/servers/localhost/zones/%s' % domain), headers=headers, method='PATCH', data=postdata_for_delete)
|
||||||
#logging.debug(jdata1)
|
logging.debug('jdata1: ', jdata1)
|
||||||
|
|
||||||
jdata2 = utils.fetch_json(urlparse.urljoin(PDNS_STATS_URL, API_EXTENDED_URL + '/servers/localhost/zones/%s' % domain), headers=headers, method='PATCH', data=postdata_for_new)
|
jdata2 = utils.fetch_json(urlparse.urljoin(PDNS_STATS_URL, API_EXTENDED_URL + '/servers/localhost/zones/%s' % domain), headers=headers, method='PATCH', data=postdata_for_new)
|
||||||
#logging.debug(jdata2)
|
logging.debug('jdata2: ', jdata2)
|
||||||
|
|
||||||
if 'error' in jdata2.keys():
|
if 'error' in jdata2.keys():
|
||||||
logging.error('Cannot apply record changes.')
|
logging.error('Cannot apply record changes.')
|
||||||
|
@ -152,10 +152,11 @@
|
|||||||
var modal = $("#modal_delete");
|
var modal = $("#modal_delete");
|
||||||
var table = $("#tbl_records").DataTable();
|
var table = $("#tbl_records").DataTable();
|
||||||
var record = $(this).prop('id');
|
var record = $(this).prop('id');
|
||||||
|
var nRow = $(this).parents('tr')[0];
|
||||||
var info = "Are you sure you want to delete " + record + "?";
|
var info = "Are you sure you want to delete " + record + "?";
|
||||||
modal.find('.modal-body p').text(info);
|
modal.find('.modal-body p').text(info);
|
||||||
modal.find('#button_delete_confirm').click(function() {
|
modal.find('#button_delete_confirm').click(function() {
|
||||||
table.row($(this).parents('tr')[0]).remove().draw();
|
table.row(nRow).remove().draw();
|
||||||
modal.modal('hide');
|
modal.modal('hide');
|
||||||
})
|
})
|
||||||
modal.modal('show');
|
modal.modal('show');
|
||||||
|
Loading…
Reference in New Issue
Block a user