mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-08 14:40:27 +00:00
Fix bugs in #53
This commit is contained in:
parent
7f5a57f80c
commit
c7efb85feb
@ -803,13 +803,15 @@ class Record(object):
|
||||
records = []
|
||||
for r in deleted_records:
|
||||
record = {
|
||||
"name": r['name'],
|
||||
"name": r['name'] + '.' if NEW_SCHEMA else r['name'],
|
||||
"type": r['type'],
|
||||
"changetype": "DELETE",
|
||||
"records": [
|
||||
]
|
||||
}
|
||||
records.append(record)
|
||||
|
||||
print records
|
||||
postdata_for_delete = {"rrsets": records}
|
||||
|
||||
records = []
|
||||
@ -895,10 +897,10 @@ class Record(object):
|
||||
headers = {}
|
||||
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)
|
||||
#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)
|
||||
#logging.debug(jdata2)
|
||||
logging.debug('jdata2: ', jdata2)
|
||||
|
||||
if 'error' in jdata2.keys():
|
||||
logging.error('Cannot apply record changes.')
|
||||
|
@ -152,10 +152,11 @@
|
||||
var modal = $("#modal_delete");
|
||||
var table = $("#tbl_records").DataTable();
|
||||
var record = $(this).prop('id');
|
||||
var nRow = $(this).parents('tr')[0];
|
||||
var info = "Are you sure you want to delete " + record + "?";
|
||||
modal.find('.modal-body p').text(info);
|
||||
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('show');
|
||||
|
Loading…
Reference in New Issue
Block a user