👽 adapt to ui changes
This commit is contained in:
parent
8b1d05bb73
commit
b1ba9d9026
@ -26,25 +26,26 @@ function dnswatch_search() {
|
||||
request.onload = function() {
|
||||
if (request.status >= 200 && request.status < 400) {
|
||||
var response = JSON.parse(this.response);
|
||||
//console.log(response);
|
||||
|
||||
// TODO: CLEAN UP THIS MESS OF TABLE GENERATION CODE
|
||||
|
||||
if (response['type'] == 'success') { // success
|
||||
|
||||
var table = '<table>\n';
|
||||
|
||||
//// reference dns
|
||||
response['data']['reference'].forEach(i => {
|
||||
// status
|
||||
table += '<tr>\n';
|
||||
table += '<td class="status ref">\n';
|
||||
table += `<i data-feather="${ response["data"]["reference"]["found"] ? "check" : "x" }"></i>\n`;
|
||||
table += `<i data-feather="${ i["status"] ? "check" : "x" }"></i>\n`;
|
||||
table += '</td>\n';
|
||||
// provider
|
||||
table += '<td class="icon">\n';
|
||||
table += `<img class="uncolored-svg" src="../svg/${ response["data"]["reference"]["nameserver"] }.svg">\n`;
|
||||
table += `<img class="uncolored-svg" src="${ i["icon"] }">\n`;
|
||||
table += '</td>\n'
|
||||
// name and address
|
||||
table += `<td class="name">${ response["data"]["reference"]["name"] }<small>${ response["data"]["reference"]["address"] }</small></td>\n`;
|
||||
table += `<td class="name">${ i["name"] }<small>${ i["address"] }</small></td>\n`;
|
||||
// reference info
|
||||
table += '<td class="desc ref">reference</td>\n';
|
||||
// help button
|
||||
@ -52,20 +53,20 @@ function dnswatch_search() {
|
||||
table += '<button><i data-feather="help-circle"></i></button>\n';
|
||||
table += '</td>\n';
|
||||
table += '</tr>\n'
|
||||
});
|
||||
|
||||
if (response['data']['reference']['found']) { // only if reference confirms
|
||||
if (response['data']['found']) { // only if reference confirms
|
||||
table += '<tr></tr>\n'; // spacer
|
||||
//// search rows
|
||||
response['data']['search'].forEach(i => {
|
||||
//console.log(i);
|
||||
table += '<tr>\n';
|
||||
// status
|
||||
table += `<td class="status ${ i["matching"] ? "check" : "cross" }">\n`;
|
||||
table += `<i data-feather="${ i["matching"] ? "check" : "x" }"></i>\n`;
|
||||
table += `<td class="status ${ i["status"] ? "check" : "cross" }">\n`;
|
||||
table += `<i data-feather="${ i["status"] ? "check" : "x" }"></i>\n`;
|
||||
table += '</td>\n';
|
||||
// provider icon
|
||||
table += '<td class="icon">\n';
|
||||
table += `<img class="uncolored-svg" src="../svg/${ i["nameserver"] }.svg">\n`;
|
||||
table += `<img class="uncolored-svg" src="${ i["icon"] }">\n`;
|
||||
table += '</td>\n';
|
||||
// name and address
|
||||
table += `<td class="name">${ i["name"] }<small>${ i["address"] }</small></td>\n`;
|
||||
|
Reference in New Issue
Block a user