From b3347490f96dcee6eb02f4589cd82cf79ab15614 Mon Sep 17 00:00:00 2001 From: thetek42 Date: Fri, 7 May 2021 13:39:58 +0200 Subject: [PATCH 01/13] :adhesive_bandage: fix 'learn more' font size --- ui/raw/index.sass | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/raw/index.sass b/ui/raw/index.sass index f4326a5..d8a65f6 100644 --- a/ui/raw/index.sass +++ b/ui/raw/index.sass @@ -126,6 +126,7 @@ input, button small.random color: darken($c-fg, 50%) display: block + font-size: .8rem margin-top: 1rem text-align: center button @@ -133,6 +134,7 @@ input, button border: none color: darken($c-fg, 40%) cursor: pointer + font-size: .8rem outline: none text-decoration: underline -- 2.30.2 From 9e9ca89272dd98fa050a4b2a1ada63a0ba48d868 Mon Sep 17 00:00:00 2001 From: thetek42 Date: Fri, 7 May 2021 14:16:43 +0200 Subject: [PATCH 02/13] :sparkles: add support for offline nameservers --- ui/raw/index.sass | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ui/raw/index.sass b/ui/raw/index.sass index d8a65f6..2c4a2c2 100644 --- a/ui/raw/index.sass +++ b/ui/raw/index.sass @@ -1,10 +1,11 @@ // variables -$c-bg: #21252b -$c-blue: #61afef -$c-fg: #d3d7de -$c-green: #98c379 -$c-red: #e06c75 -$f-sans: -apple-system, system-ui, BlinkMacSystemFont, 'Inter', 'Segoe UI', 'Helvetica Neue', 'Helvetica', sans-serif +$c-bg: #21252b +$c-blue: #61afef +$c-fg: #d3d7de +$c-green: #98c379 +$c-orange: #d19a66 +$c-red: #e06c75 +$f-sans: -apple-system, system-ui, BlinkMacSystemFont, 'Inter', 'Segoe UI', 'Helvetica Neue', 'Helvetica', sans-serif // styles * @@ -151,6 +152,8 @@ input, button color: $c-red &.ref color: $c-blue + &.offline + color: $c-orange td.icon border-left: solid transparent 2rem width: 3rem -- 2.30.2 From 40aba5e993ac14c0b2dbd992c34ef3802210d10d Mon Sep 17 00:00:00 2001 From: thetek42 Date: Fri, 7 May 2021 14:17:23 +0200 Subject: [PATCH 03/13] :sparkles: offline nameservers & :art: table code :sparkles: support for offline nameservers :art: rework table row generation code --- ui/raw/index.js | 92 ++++++++++++++++++++++++++++--------------------- 1 file changed, 53 insertions(+), 39 deletions(-) diff --git a/ui/raw/index.js b/ui/raw/index.js index 5bc698f..79f6e94 100644 --- a/ui/raw/index.js +++ b/ui/raw/index.js @@ -34,28 +34,25 @@ function dnswatch_search() { var table = '\n'; //// reference dns + let first_ref = true; response['data']['reference'].forEach(i => { - // status - table += '\n'; - table += '\n'; - // provider - table += '\n' - // name and address - table += `\n`; - // reference info - table += '\n'; - // help button - table += '\n'; - table += '\n' + + table += gen_tablerow({ + status_color: 'ref', + status_icon: get_status_icon(i['status']), + dns_icon: i['icon'], + dns_name: i['name'], + dns_address: i['address'], + desc_color: 'ref', + desc_text: 'reference', + show_help: first_ref + }) + first_ref = false; + }); table += '
\n'; - table += `\n`; - table += '\n'; - table += `\n`; - table += '${ i["name"] }${ i["address"] }reference\n'; - table += '\n'; - table += '
'; + // randomized response message if (response['data']['randomized_response']) { table += 'This domain uses randomized responses. \n'; @@ -65,27 +62,18 @@ function dnswatch_search() { table += '\n'; // spacer //// search rows response['data']['search'].forEach(i => { - table += '\n'; - // status - table += `\n'; - // provider icon - table += '\n'; - // name and address - table += `\n`; - // status info - if (i['cause'] !== null) { - if (i['cause'] == 'cuii') { - table += '\n'; - table += '\n' - } - } - table += '\n'; + + table += gen_tablerow({ + status_color: get_status_color(i['status']), + status_icon: get_status_icon(i['status']), + dns_icon: i['icon'], + dns_name: i['name'], + dns_address: i['address'], + desc_color: i['cause'] !== null ? 'blocked': '', + desc_text: i['cause'] == 'cuii' ? 'reference' : '', + show_help: i['cause'] !== null + }) + }); } table += '
\n`; - table += `\n`; - table += '\n'; - table += `\n`; - table += '${ i["name"] }${ i["address"] }blocked by cuii\n'; - table += '\n'; - table += '
'; @@ -140,6 +128,32 @@ function is_valid_domain(str) { +function gen_tablerow(options) { + return ` + + + + ${ options.dns_name }${ options.dns_address } + ${ options.desc_text } + ${ options.show_help ? '' : '' } + +` +} + +function get_status_color(status) { + if (status === true) return 'check' + if (status === false) return 'cross' + return 'offline' +} + +function get_status_icon(status) { + if (status === true) return 'check' + if (status === false) return 'x' + return 'wifi-off' +} + + + // add event triggers document.addEventListener('DOMContentLoaded', () => { document.getElementById('dnswatch-search-submit').addEventListener('click', (event) => { -- 2.30.2 From 49fd26093c5d388a898363217551234d4127c218 Mon Sep 17 00:00:00 2001 From: thetek42 Date: Fri, 7 May 2021 14:22:19 +0200 Subject: [PATCH 04/13] :adhesive_bandage: unite similar help buttons --- ui/raw/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/raw/index.js b/ui/raw/index.js index 79f6e94..06735a6 100644 --- a/ui/raw/index.js +++ b/ui/raw/index.js @@ -61,6 +61,7 @@ function dnswatch_search() { if (response['data']['found']) { // only if reference confirms table += '\n'; // spacer //// search rows + let causes = []; response['data']['search'].forEach(i => { table += gen_tablerow({ @@ -71,9 +72,11 @@ function dnswatch_search() { dns_address: i['address'], desc_color: i['cause'] !== null ? 'blocked': '', desc_text: i['cause'] == 'cuii' ? 'reference' : '', - show_help: i['cause'] !== null + show_help: i['cause'] !== null && !causes.includes(i['cause']) }) + if (i['cause'] !== null) causes.push(i['cause']) + }); } table += '
'; -- 2.30.2 From bbca8553ac7ccb4c6acc21433259619c6d08e147 Mon Sep 17 00:00:00 2001 From: thetek42 Date: Fri, 7 May 2021 14:30:25 +0200 Subject: [PATCH 05/13] :adhesive_bandage: fix blocked message --- ui/raw/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ui/raw/index.js b/ui/raw/index.js index 06735a6..84ce786 100644 --- a/ui/raw/index.js +++ b/ui/raw/index.js @@ -71,7 +71,7 @@ function dnswatch_search() { dns_name: i['name'], dns_address: i['address'], desc_color: i['cause'] !== null ? 'blocked': '', - desc_text: i['cause'] == 'cuii' ? 'reference' : '', + desc_text: get_blocked_text(i['cause']), show_help: i['cause'] !== null && !causes.includes(i['cause']) }) @@ -155,6 +155,12 @@ function get_status_icon(status) { return 'wifi-off' } +function get_blocked_text(cause) { + if (cause == 'cuii') return 'blocked by cuii' + if (cause !== null) return `bocked: ${cause}` + return '' +} + // add event triggers -- 2.30.2 From 380277e0b3083f073c21738096c36a1111d20da0 Mon Sep 17 00:00:00 2001 From: thetek42 Date: Fri, 7 May 2021 14:33:05 +0200 Subject: [PATCH 06/13] :package: compile html --- ui/html/index.css | 5 +++ ui/html/index.css.map | 2 +- ui/html/index.js | 101 ++++++++++++++++++++++++++---------------- 3 files changed, 68 insertions(+), 40 deletions(-) diff --git a/ui/html/index.css b/ui/html/index.css index ef11ef2..0d1d3b6 100644 --- a/ui/html/index.css +++ b/ui/html/index.css @@ -136,6 +136,7 @@ input, button { #results small.random { color: #4c5666; display: block; + font-size: 0.8rem; margin-top: 1rem; text-align: center; } @@ -144,6 +145,7 @@ input, button { border: none; color: #626e83; cursor: pointer; + font-size: 0.8rem; outline: none; text-decoration: underline; } @@ -166,6 +168,9 @@ input, button { #results table tr td.status.ref { color: #61afef; } +#results table tr td.status.offline { + color: #d19a66; +} #results table tr td.icon { border-left: solid transparent 2rem; width: 3rem; diff --git a/ui/html/index.css.map b/ui/html/index.css.map index a891566..a3967ac 100644 --- a/ui/html/index.css.map +++ b/ui/html/index.css.map @@ -1 +1 @@ -{"version":3,"sourceRoot":"","sources":["../raw/index.sass"],"names":[],"mappings":"AASA;EACC;;;AAED;EACC,kBAZS;EAaT,OAXS;EAYT,aATS;EAUT;EACA;EACA;;;AAED;EACC,aAfS;;;AAiBV;EACC;EACA;EACA;;AACA;EACC,kBA3BQ;EA4BR;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;;;AAEH;EACC;EACA;EACA;;AACA;EACC;EACA;;AACA;EACC;;;AAEH;EACC;EACA;;AAEC;EACC;EACA;;AACD;EACC;EACA;EACA;EACA,OA3DO;EA4DP;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;;AACF;EACC;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;EACA;;AACA;EACC;EACA,OAlFK;;AAmFP;EACC;EACA;EACA;EACA;;AACA;EACC;EACA;;AAEJ;EACC;EACA;EACA;;AAED;EACC;EACA;EACA;;AACA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;AACD;EACC,OA/GO;EAgHP;;AAEF;EACC,OAhHQ;EAiHR;EACA;EACA;;AACA;EACC;;;AAGF;EACC;EACA;EACA;EACA;;AACA;EACC;EACA;EACA;EACA;EACA;EACA;;AAEF;EACC;EACA;;AACA;EACC;;AACA;EACC;;AACA;EACC,OA9IK;;AA+IN;EACC,OA/IK;;AAgJN;EACC,OApJK;;AAqJP;EACC;EACA;;AACD;EACC;EACA;;AACD;EACC;;AACA;EACC,OA3JK;;AA4JN;EACC,OAhKK;;AAiKP;EACC;EACA;;AACA;EACC,kBAtKK;EAuKL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;;AACD;EACC;EACA;EACA;;;AAEN;EACC;;;AAED;EACC;IACC;;EACD;IACC","file":"index.css"} \ No newline at end of file +{"version":3,"sourceRoot":"","sources":["../raw/index.sass"],"names":[],"mappings":"AAUA;EACC;;;AAED;EACC,kBAbU;EAcV,OAZU;EAaV,aATU;EAUV;EACA;EACA;;;AAED;EACC,aAfU;;;AAiBX;EACC;EACA;EACA;;AACA;EACC,kBA5BS;EA6BT;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;;;AAEH;EACC;EACA;EACA;;AACA;EACC;EACA;;AACA;EACC;;;AAEH;EACC;EACA;;AAEC;EACC;EACA;;AACD;EACC;EACA;EACA;EACA,OA5DQ;EA6DR;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;;AACF;EACC;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;EACA;;AACA;EACC;EACA,OAnFM;;AAoFR;EACC;EACA;EACA;EACA;;AACA;EACC;EACA;;AAEJ;EACC;EACA;EACA;;AAED;EACC;EACA;EACA;;AACA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;AACD;EACC,OAhHQ;EAiHR;;AAEF;EACC,OAhHS;EAiHT;EACA;EACA;;AACA;EACC;;;AAGF;EACC;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;AAEF;EACC;EACA;;AACA;EACC;;AACA;EACC;;AACA;EACC,OAjJM;;AAkJP;EACC,OAjJM;;AAkJP;EACC,OAvJM;;AAwJP;EACC,OAtJM;;AAuJR;EACC;EACA;;AACD;EACC;EACA;;AACD;EACC;;AACA;EACC,OA/JM;;AAgKP;EACC,OArKM;;AAsKR;EACC;EACA;;AACA;EACC,kBA3KM;EA4KN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;;AACD;EACC;EACA;EACA;;;AAEN;EACC;;;AAED;EACC;IACC;;EACD;IACC","file":"index.css"} \ No newline at end of file diff --git a/ui/html/index.js b/ui/html/index.js index 5bc698f..84ce786 100644 --- a/ui/html/index.js +++ b/ui/html/index.js @@ -34,28 +34,25 @@ function dnswatch_search() { var table = '\n'; //// reference dns + let first_ref = true; response['data']['reference'].forEach(i => { - // status - table += '\n'; - table += '\n'; - // provider - table += '\n' - // name and address - table += `\n`; - // reference info - table += '\n'; - // help button - table += '\n'; - table += '\n' + + table += gen_tablerow({ + status_color: 'ref', + status_icon: get_status_icon(i['status']), + dns_icon: i['icon'], + dns_name: i['name'], + dns_address: i['address'], + desc_color: 'ref', + desc_text: 'reference', + show_help: first_ref + }) + first_ref = false; + }); table += '
\n'; - table += `\n`; - table += '\n'; - table += `\n`; - table += '${ i["name"] }${ i["address"] }reference\n'; - table += '\n'; - table += '
'; + // randomized response message if (response['data']['randomized_response']) { table += 'This domain uses randomized responses. \n'; @@ -64,28 +61,22 @@ function dnswatch_search() { if (response['data']['found']) { // only if reference confirms table += '\n'; // spacer //// search rows + let causes = []; response['data']['search'].forEach(i => { - table += '\n'; - // status - table += `\n'; - // provider icon - table += '\n'; - // name and address - table += `\n`; - // status info - if (i['cause'] !== null) { - if (i['cause'] == 'cuii') { - table += '\n'; - table += '\n' - } - } - table += '\n'; + + table += gen_tablerow({ + status_color: get_status_color(i['status']), + status_icon: get_status_icon(i['status']), + dns_icon: i['icon'], + dns_name: i['name'], + dns_address: i['address'], + desc_color: i['cause'] !== null ? 'blocked': '', + desc_text: get_blocked_text(i['cause']), + show_help: i['cause'] !== null && !causes.includes(i['cause']) + }) + + if (i['cause'] !== null) causes.push(i['cause']) + }); } table += '
\n`; - table += `\n`; - table += '\n'; - table += `\n`; - table += '${ i["name"] }${ i["address"] }blocked by cuii\n'; - table += '\n'; - table += '
'; @@ -140,6 +131,38 @@ function is_valid_domain(str) { +function gen_tablerow(options) { + return ` + + + + ${ options.dns_name }${ options.dns_address } + ${ options.desc_text } + ${ options.show_help ? '' : '' } + +` +} + +function get_status_color(status) { + if (status === true) return 'check' + if (status === false) return 'cross' + return 'offline' +} + +function get_status_icon(status) { + if (status === true) return 'check' + if (status === false) return 'x' + return 'wifi-off' +} + +function get_blocked_text(cause) { + if (cause == 'cuii') return 'blocked by cuii' + if (cause !== null) return `bocked: ${cause}` + return '' +} + + + // add event triggers document.addEventListener('DOMContentLoaded', () => { document.getElementById('dnswatch-search-submit').addEventListener('click', (event) => { -- 2.30.2 From 2415a6b03a7b9a66fc83e4ef70d7a5e81ae3099c Mon Sep 17 00:00:00 2001 From: thetek42 Date: Fri, 7 May 2021 14:33:16 +0200 Subject: [PATCH 07/13] :package: compile jhtml --- ui/jhtml-compat/index.css | 5 ++ ui/jhtml-compat/index.css.map | 2 +- ui/jhtml-compat/index.js | 101 +++++++++++++++++++++------------- 3 files changed, 68 insertions(+), 40 deletions(-) diff --git a/ui/jhtml-compat/index.css b/ui/jhtml-compat/index.css index b0368d5..763a795 100644 --- a/ui/jhtml-compat/index.css +++ b/ui/jhtml-compat/index.css @@ -137,6 +137,7 @@ input, button { #results small.random { color: #4c5666; display: block; + font-size: 0.8rem; margin-top: 1rem; text-align: center; } @@ -145,6 +146,7 @@ input, button { border: none; color: #626e83; cursor: pointer; + font-size: 0.8rem; outline: none; text-decoration: underline; } @@ -167,6 +169,9 @@ input, button { #results table tr td.status.ref { color: #61afef; } +#results table tr td.status.offline { + color: #d19a66; +} #results table tr td.icon { border-left: solid transparent 2rem; width: 3rem; diff --git a/ui/jhtml-compat/index.css.map b/ui/jhtml-compat/index.css.map index a891566..a3967ac 100644 --- a/ui/jhtml-compat/index.css.map +++ b/ui/jhtml-compat/index.css.map @@ -1 +1 @@ -{"version":3,"sourceRoot":"","sources":["../raw/index.sass"],"names":[],"mappings":"AASA;EACC;;;AAED;EACC,kBAZS;EAaT,OAXS;EAYT,aATS;EAUT;EACA;EACA;;;AAED;EACC,aAfS;;;AAiBV;EACC;EACA;EACA;;AACA;EACC,kBA3BQ;EA4BR;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;;;AAEH;EACC;EACA;EACA;;AACA;EACC;EACA;;AACA;EACC;;;AAEH;EACC;EACA;;AAEC;EACC;EACA;;AACD;EACC;EACA;EACA;EACA,OA3DO;EA4DP;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;;AACF;EACC;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;EACA;;AACA;EACC;EACA,OAlFK;;AAmFP;EACC;EACA;EACA;EACA;;AACA;EACC;EACA;;AAEJ;EACC;EACA;EACA;;AAED;EACC;EACA;EACA;;AACA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;AACD;EACC,OA/GO;EAgHP;;AAEF;EACC,OAhHQ;EAiHR;EACA;EACA;;AACA;EACC;;;AAGF;EACC;EACA;EACA;EACA;;AACA;EACC;EACA;EACA;EACA;EACA;EACA;;AAEF;EACC;EACA;;AACA;EACC;;AACA;EACC;;AACA;EACC,OA9IK;;AA+IN;EACC,OA/IK;;AAgJN;EACC,OApJK;;AAqJP;EACC;EACA;;AACD;EACC;EACA;;AACD;EACC;;AACA;EACC,OA3JK;;AA4JN;EACC,OAhKK;;AAiKP;EACC;EACA;;AACA;EACC,kBAtKK;EAuKL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;;AACD;EACC;EACA;EACA;;;AAEN;EACC;;;AAED;EACC;IACC;;EACD;IACC","file":"index.css"} \ No newline at end of file +{"version":3,"sourceRoot":"","sources":["../raw/index.sass"],"names":[],"mappings":"AAUA;EACC;;;AAED;EACC,kBAbU;EAcV,OAZU;EAaV,aATU;EAUV;EACA;EACA;;;AAED;EACC,aAfU;;;AAiBX;EACC;EACA;EACA;;AACA;EACC,kBA5BS;EA6BT;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;;;AAEH;EACC;EACA;EACA;;AACA;EACC;EACA;;AACA;EACC;;;AAEH;EACC;EACA;;AAEC;EACC;EACA;;AACD;EACC;EACA;EACA;EACA,OA5DQ;EA6DR;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;;AACF;EACC;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;EACA;;AACA;EACC;EACA,OAnFM;;AAoFR;EACC;EACA;EACA;EACA;;AACA;EACC;EACA;;AAEJ;EACC;EACA;EACA;;AAED;EACC;EACA;EACA;;AACA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;AACD;EACC,OAhHQ;EAiHR;;AAEF;EACC,OAhHS;EAiHT;EACA;EACA;;AACA;EACC;;;AAGF;EACC;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;AAEF;EACC;EACA;;AACA;EACC;;AACA;EACC;;AACA;EACC,OAjJM;;AAkJP;EACC,OAjJM;;AAkJP;EACC,OAvJM;;AAwJP;EACC,OAtJM;;AAuJR;EACC;EACA;;AACD;EACC;EACA;;AACD;EACC;;AACA;EACC,OA/JM;;AAgKP;EACC,OArKM;;AAsKR;EACC;EACA;;AACA;EACC,kBA3KM;EA4KN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;;AACD;EACC;EACA;EACA;;;AAEN;EACC;;;AAED;EACC;IACC;;EACD;IACC","file":"index.css"} \ No newline at end of file diff --git a/ui/jhtml-compat/index.js b/ui/jhtml-compat/index.js index 1b48888..1c0e95c 100644 --- a/ui/jhtml-compat/index.js +++ b/ui/jhtml-compat/index.js @@ -35,28 +35,25 @@ function dnswatch_search() { var table = '\n'; //// reference dns + let first_ref = true; response['data']['reference'].forEach(i => { - // status - table += '\n'; - table += '\n'; - // provider - table += '\n' - // name and address - table += `\n`; - // reference info - table += '\n'; - // help button - table += '\n'; - table += '\n' + + table += gen_tablerow({ + status_color: 'ref', + status_icon: get_status_icon(i['status']), + dns_icon: i['icon'], + dns_name: i['name'], + dns_address: i['address'], + desc_color: 'ref', + desc_text: 'reference', + show_help: first_ref + }) + first_ref = false; + }); table += '
\n'; - table += `\n`; - table += '\n'; - table += `\n`; - table += '${ i["name"] }${ i["address"] }reference\n'; - table += '\n'; - table += '
'; + // randomized response message if (response['data']['randomized_response']) { table += 'This domain uses randomized responses. \n'; @@ -65,28 +62,22 @@ function dnswatch_search() { if (response['data']['found']) { // only if reference confirms table += '\n'; // spacer //// search rows + let causes = []; response['data']['search'].forEach(i => { - table += '\n'; - // status - table += `\n'; - // provider icon - table += '\n'; - // name and address - table += `\n`; - // status info - if (i['cause'] !== null) { - if (i['cause'] == 'cuii') { - table += '\n'; - table += '\n' - } - } - table += '\n'; + + table += gen_tablerow({ + status_color: get_status_color(i['status']), + status_icon: get_status_icon(i['status']), + dns_icon: i['icon'], + dns_name: i['name'], + dns_address: i['address'], + desc_color: i['cause'] !== null ? 'blocked': '', + desc_text: get_blocked_text(i['cause']), + show_help: i['cause'] !== null && !causes.includes(i['cause']) + }) + + if (i['cause'] !== null) causes.push(i['cause']) + }); } table += '
\n`; - table += `\n`; - table += '\n'; - table += `\n`; - table += '${ i["name"] }${ i["address"] }blocked by cuii\n'; - table += '\n'; - table += '
'; @@ -141,6 +132,38 @@ function is_valid_domain(str) { +function gen_tablerow(options) { + return ` + + + + ${ options.dns_name }${ options.dns_address } + ${ options.desc_text } + ${ options.show_help ? '' : '' } + +` +} + +function get_status_color(status) { + if (status === true) return 'check' + if (status === false) return 'cross' + return 'offline' +} + +function get_status_icon(status) { + if (status === true) return 'check' + if (status === false) return 'x' + return 'wifi-off' +} + +function get_blocked_text(cause) { + if (cause == 'cuii') return 'blocked by cuii' + if (cause !== null) return `bocked: ${cause}` + return '' +} + + + // add event triggers document.addEventListener('DOMContentLoaded', () => { document.getElementById('dnswatch-search-submit').addEventListener('click', (event) => { -- 2.30.2 From 9d5b855f2295cd968243f0acecb6dbcc9e147554 Mon Sep 17 00:00:00 2001 From: thetek42 Date: Fri, 7 May 2021 16:51:57 +0200 Subject: [PATCH 08/13] :sparkles: 'by tjdev.de' subheader --- ui/raw/index.pug | 5 ++++- ui/raw/index.sass | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ui/raw/index.pug b/ui/raw/index.pug index 8e1c1ec..71617bd 100644 --- a/ui/raw/index.pug +++ b/ui/raw/index.pug @@ -3,7 +3,10 @@ button: i( data-feather='sun' ) #title - h1 dns-watch.org + h1 dns-watch + span .org + span by + a( href='https://www.tjdev.de' ) tjdev.de #search #searchbar diff --git a/ui/raw/index.sass b/ui/raw/index.sass index 2c4a2c2..c15732e 100644 --- a/ui/raw/index.sass +++ b/ui/raw/index.sass @@ -47,8 +47,13 @@ input, button h1 font-size: 4rem font-weight: 200 + margin-bottom: 1rem span color: darken($c-fg, 50%) + span + color: darken($c-fg, 30%) + a + color: darken($c-fg, 30%) #search text-align: center -- 2.30.2 From 0a05f6b2f1c8ef5d1312c291dc5b0dcaaf116257 Mon Sep 17 00:00:00 2001 From: thetek42 Date: Fri, 7 May 2021 17:03:24 +0200 Subject: [PATCH 09/13] :sparkles: add github button --- ui/raw/index.pug | 2 ++ ui/raw/index.sass | 2 ++ 2 files changed, 4 insertions(+) diff --git a/ui/raw/index.pug b/ui/raw/index.pug index 71617bd..b4fdeb4 100644 --- a/ui/raw/index.pug +++ b/ui/raw/index.pug @@ -1,4 +1,6 @@ #header + a( href='https://github.com/tjdev-de/dns-watch' ) + button.spaceleft: i( data-feather='github' ) button: i( data-feather='globe' ) button: i( data-feather='sun' ) diff --git a/ui/raw/index.sass b/ui/raw/index.sass index c15732e..94cd46b 100644 --- a/ui/raw/index.sass +++ b/ui/raw/index.sass @@ -39,6 +39,8 @@ input, button &:hover background-color: lighten($c-bg, 5%) color: darken($c-fg, 20%) + &.spaceleft + margin-left: 1rem #title margin-bottom: 5rem -- 2.30.2 From 23098e88d87605f74f91aa2e69757310805ac56d Mon Sep 17 00:00:00 2001 From: thetek42 Date: Fri, 7 May 2021 17:21:35 +0200 Subject: [PATCH 10/13] :sparkles: add footer --- ui/raw/index.pug | 58 +++++++++++++++++++++++++++-------------------- ui/raw/index.sass | 11 +++++++++ 2 files changed, 44 insertions(+), 25 deletions(-) diff --git a/ui/raw/index.pug b/ui/raw/index.pug index b4fdeb4..b17d990 100644 --- a/ui/raw/index.pug +++ b/ui/raw/index.pug @@ -1,27 +1,35 @@ -#header - a( href='https://github.com/tjdev-de/dns-watch' ) - button.spaceleft: i( data-feather='github' ) - button: i( data-feather='globe' ) - button: i( data-feather='sun' ) - -#title - h1 dns-watch - span .org - span by - a( href='https://www.tjdev.de' ) tjdev.de +#content -#search - #searchbar - .buttonspacer - input#dnswatch-search( type='text' placeholder='Search...' autofocus ) - button#dnswatch-search-submit: i( data-feather='search' ) - button#help: i( data-feather='help-circle' ) - small Try "gnu.org", "wikipedia.org", "s.to" or your own website! - #loadani - #spinner - span loading... - #invaliddomain - i( data-feather='x' ) - span invalid domain. + #header + a( href='https://github.com/tjdev-de/dns-watch' ) + button.spaceleft: i( data-feather='github' ) + button: i( data-feather='globe' ) + button: i( data-feather='sun' ) + + #title + h1 dns-watch + span .org + span by + a( href='https://www.tjdev.de' ) tjdev.de -#results + #search + #searchbar + .buttonspacer + input#dnswatch-search( type='text' placeholder='Search...' autofocus ) + button#dnswatch-search-submit: i( data-feather='search' ) + button#help: i( data-feather='help-circle' ) + small Try "gnu.org", "wikipedia.org", "s.to" or your own website! + #loadani + #spinner + span loading... + #invaliddomain + i( data-feather='x' ) + span invalid domain. + + #results + +#footer + span dns-watch.org by + a( href='https://www.tjdev.de' ) tjdev.de + span | + a( href='/imprint' ) imprint diff --git a/ui/raw/index.sass b/ui/raw/index.sass index 94cd46b..669602b 100644 --- a/ui/raw/index.sass +++ b/ui/raw/index.sass @@ -22,6 +22,9 @@ html, body input, button font-family: $f-sans +#content + min-height: calc(100vh - 9rem) + #header height: 4rem padding: .5rem @@ -194,6 +197,14 @@ input, button vertical-align: -.2rem width: 1.2rem +#footer + color: darken($c-fg, 30%) + height: 9rem + padding-top: 5rem + text-align: center + a + color: darken($c-fg, 30%) + .uncolored-svg filter: invert(.8) -- 2.30.2 From b938958e90afc56be2795ecaac9cf63e6cb4c0be Mon Sep 17 00:00:00 2001 From: thetek42 Date: Fri, 7 May 2021 17:24:06 +0200 Subject: [PATCH 11/13] :adhesive_bandage: fix unfitting scrollbar color --- ui/raw/index.sass | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/raw/index.sass b/ui/raw/index.sass index 669602b..be95743 100644 --- a/ui/raw/index.sass +++ b/ui/raw/index.sass @@ -16,8 +16,9 @@ html, body color: $c-fg font-family: $f-sans margin: 0 - padding: 0 overflow-x: hidden + padding: 0 + scrollbar-color: lighten($c-bg, 20%) $c-bg !important input, button font-family: $f-sans -- 2.30.2 From 1c5008b25d64ca6de96af880ed8a1b615414f5db Mon Sep 17 00:00:00 2001 From: thetek42 Date: Fri, 7 May 2021 17:24:38 +0200 Subject: [PATCH 12/13] :package: compile html --- ui/html/index.css | 27 ++++++++++++++++++++++++++- ui/html/index.css.map | 2 +- ui/html/index.html | 2 +- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/ui/html/index.css b/ui/html/index.css index 0d1d3b6..ec6c4b5 100644 --- a/ui/html/index.css +++ b/ui/html/index.css @@ -7,14 +7,19 @@ html, body { color: #d3d7de; font-family: -apple-system, system-ui, BlinkMacSystemFont, "Inter", "Segoe UI", "Helvetica Neue", "Helvetica", sans-serif; margin: 0; - padding: 0; overflow-x: hidden; + padding: 0; + scrollbar-color: #4d5765 #21252b !important; } input, button { font-family: -apple-system, system-ui, BlinkMacSystemFont, "Inter", "Segoe UI", "Helvetica Neue", "Helvetica", sans-serif; } +#content { + min-height: calc(100vh - 9rem); +} + #header { height: 4rem; padding: 0.5rem; @@ -35,6 +40,9 @@ input, button { background-color: #2c3139; color: #99a2b2; } +#header button.spaceleft { + margin-left: 1rem; +} #title { margin-bottom: 5rem; @@ -44,10 +52,17 @@ input, button { #title h1 { font-size: 4rem; font-weight: 200; + margin-bottom: 1rem; } #title h1 span { color: #4c5666; } +#title span { + color: #7c889c; +} +#title span a { + color: #7c889c; +} #search { text-align: center; @@ -213,6 +228,16 @@ input, button { width: 1.2rem; } +#footer { + color: #7c889c; + height: 9rem; + padding-top: 5rem; + text-align: center; +} +#footer a { + color: #7c889c; +} + .uncolored-svg { filter: invert(0.8); } diff --git a/ui/html/index.css.map b/ui/html/index.css.map index a3967ac..fc41d60 100644 --- a/ui/html/index.css.map +++ b/ui/html/index.css.map @@ -1 +1 @@ -{"version":3,"sourceRoot":"","sources":["../raw/index.sass"],"names":[],"mappings":"AAUA;EACC;;;AAED;EACC,kBAbU;EAcV,OAZU;EAaV,aATU;EAUV;EACA;EACA;;;AAED;EACC,aAfU;;;AAiBX;EACC;EACA;EACA;;AACA;EACC,kBA5BS;EA6BT;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;;;AAEH;EACC;EACA;EACA;;AACA;EACC;EACA;;AACA;EACC;;;AAEH;EACC;EACA;;AAEC;EACC;EACA;;AACD;EACC;EACA;EACA;EACA,OA5DQ;EA6DR;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;;AACF;EACC;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;EACA;;AACA;EACC;EACA,OAnFM;;AAoFR;EACC;EACA;EACA;EACA;;AACA;EACC;EACA;;AAEJ;EACC;EACA;EACA;;AAED;EACC;EACA;EACA;;AACA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;AACD;EACC,OAhHQ;EAiHR;;AAEF;EACC,OAhHS;EAiHT;EACA;EACA;;AACA;EACC;;;AAGF;EACC;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;AAEF;EACC;EACA;;AACA;EACC;;AACA;EACC;;AACA;EACC,OAjJM;;AAkJP;EACC,OAjJM;;AAkJP;EACC,OAvJM;;AAwJP;EACC,OAtJM;;AAuJR;EACC;EACA;;AACD;EACC;EACA;;AACD;EACC;;AACA;EACC,OA/JM;;AAgKP;EACC,OArKM;;AAsKR;EACC;EACA;;AACA;EACC,kBA3KM;EA4KN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;;AACD;EACC;EACA;EACA;;;AAEN;EACC;;;AAED;EACC;IACC;;EACD;IACC","file":"index.css"} \ No newline at end of file +{"version":3,"sourceRoot":"","sources":["../raw/index.sass"],"names":[],"mappings":"AAUA;EACC;;;AAED;EACC,kBAbU;EAcV,OAZU;EAaV,aATU;EAUV;EACA;EACA;EACA;;;AAED;EACC,aAhBU;;;AAkBX;EACC;;;AAED;EACC;EACA;EACA;;AACA;EACC,kBAhCS;EAiCT;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;;AACD;EACC;;;AAEH;EACC;EACA;EACA;;AACA;EACC;EACA;EACA;;AACA;EACC;;AACF;EACC;;AACA;EACC;;;AAEH;EACC;EACA;;AAEC;EACC;EACA;;AACD;EACC;EACA;EACA;EACA,OAvEQ;EAwER;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;;AACF;EACC;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;EACA;;AACA;EACC;EACA,OA9FM;;AA+FR;EACC;EACA;EACA;EACA;;AACA;EACC;EACA;;AAEJ;EACC;EACA;EACA;;AAED;EACC;EACA;EACA;;AACA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;AACD;EACC,OA3HQ;EA4HR;;AAEF;EACC,OA3HS;EA4HT;EACA;EACA;;AACA;EACC;;;AAGF;EACC;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;AAEF;EACC;EACA;;AACA;EACC;;AACA;EACC;;AACA;EACC,OA5JM;;AA6JP;EACC,OA5JM;;AA6JP;EACC,OAlKM;;AAmKP;EACC,OAjKM;;AAkKR;EACC;EACA;;AACD;EACC;EACA;;AACD;EACC;;AACA;EACC,OA1KM;;AA2KP;EACC,OAhLM;;AAiLR;EACC;EACA;;AACA;EACC,kBAtLM;EAuLN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;;AACD;EACC;EACA;EACA;;;AAEN;EACC;EACA;EACA;EACA;;AACA;EACC;;;AAEF;EACC;;;AAED;EACC;IACC;;EACD;IACC","file":"index.css"} \ No newline at end of file diff --git a/ui/html/index.html b/ui/html/index.html index a2b496c..f28a9a2 100644 --- a/ui/html/index.html +++ b/ui/html/index.html @@ -6,4 +6,4 @@ -

dns-watch.org

+

dns-watch.org

by tjdev.de
-- 2.30.2 From e877936e73474d91cf2d930121b44fad5cd747c4 Mon Sep 17 00:00:00 2001 From: thetek42 Date: Fri, 7 May 2021 17:24:49 +0200 Subject: [PATCH 13/13] :package: compile jhtml --- ui/jhtml-compat/index.css | 27 ++++++++++++++++++++++++++- ui/jhtml-compat/index.css.map | 2 +- ui/jhtml-compat/index.php | 2 +- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/ui/jhtml-compat/index.css b/ui/jhtml-compat/index.css index 763a795..7546559 100644 --- a/ui/jhtml-compat/index.css +++ b/ui/jhtml-compat/index.css @@ -8,14 +8,19 @@ html, body { color: #d3d7de; font-family: -apple-system, system-ui, BlinkMacSystemFont, "Inter", "Segoe UI", "Helvetica Neue", "Helvetica", sans-serif; margin: 0; - padding: 0; overflow-x: hidden; + padding: 0; + scrollbar-color: #4d5765 #21252b !important; } input, button { font-family: -apple-system, system-ui, BlinkMacSystemFont, "Inter", "Segoe UI", "Helvetica Neue", "Helvetica", sans-serif; } +#content { + min-height: calc(100vh - 9rem); +} + #header { height: 4rem; padding: 0.5rem; @@ -36,6 +41,9 @@ input, button { background-color: #2c3139; color: #99a2b2; } +#header button.spaceleft { + margin-left: 1rem; +} #title { margin-bottom: 5rem; @@ -45,10 +53,17 @@ input, button { #title h1 { font-size: 4rem; font-weight: 200; + margin-bottom: 1rem; } #title h1 span { color: #4c5666; } +#title span { + color: #7c889c; +} +#title span a { + color: #7c889c; +} #search { text-align: center; @@ -214,6 +229,16 @@ input, button { width: 1.2rem; } +#footer { + color: #7c889c; + height: 9rem; + padding-top: 5rem; + text-align: center; +} +#footer a { + color: #7c889c; +} + .uncolored-svg { filter: invert(0.8); } diff --git a/ui/jhtml-compat/index.css.map b/ui/jhtml-compat/index.css.map index a3967ac..fc41d60 100644 --- a/ui/jhtml-compat/index.css.map +++ b/ui/jhtml-compat/index.css.map @@ -1 +1 @@ -{"version":3,"sourceRoot":"","sources":["../raw/index.sass"],"names":[],"mappings":"AAUA;EACC;;;AAED;EACC,kBAbU;EAcV,OAZU;EAaV,aATU;EAUV;EACA;EACA;;;AAED;EACC,aAfU;;;AAiBX;EACC;EACA;EACA;;AACA;EACC,kBA5BS;EA6BT;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;;;AAEH;EACC;EACA;EACA;;AACA;EACC;EACA;;AACA;EACC;;;AAEH;EACC;EACA;;AAEC;EACC;EACA;;AACD;EACC;EACA;EACA;EACA,OA5DQ;EA6DR;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;;AACF;EACC;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;EACA;;AACA;EACC;EACA,OAnFM;;AAoFR;EACC;EACA;EACA;EACA;;AACA;EACC;EACA;;AAEJ;EACC;EACA;EACA;;AAED;EACC;EACA;EACA;;AACA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;AACD;EACC,OAhHQ;EAiHR;;AAEF;EACC,OAhHS;EAiHT;EACA;EACA;;AACA;EACC;;;AAGF;EACC;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;AAEF;EACC;EACA;;AACA;EACC;;AACA;EACC;;AACA;EACC,OAjJM;;AAkJP;EACC,OAjJM;;AAkJP;EACC,OAvJM;;AAwJP;EACC,OAtJM;;AAuJR;EACC;EACA;;AACD;EACC;EACA;;AACD;EACC;;AACA;EACC,OA/JM;;AAgKP;EACC,OArKM;;AAsKR;EACC;EACA;;AACA;EACC,kBA3KM;EA4KN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;;AACD;EACC;EACA;EACA;;;AAEN;EACC;;;AAED;EACC;IACC;;EACD;IACC","file":"index.css"} \ No newline at end of file +{"version":3,"sourceRoot":"","sources":["../raw/index.sass"],"names":[],"mappings":"AAUA;EACC;;;AAED;EACC,kBAbU;EAcV,OAZU;EAaV,aATU;EAUV;EACA;EACA;EACA;;;AAED;EACC,aAhBU;;;AAkBX;EACC;;;AAED;EACC;EACA;EACA;;AACA;EACC,kBAhCS;EAiCT;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;;AACD;EACC;;;AAEH;EACC;EACA;EACA;;AACA;EACC;EACA;EACA;;AACA;EACC;;AACF;EACC;;AACA;EACC;;;AAEH;EACC;EACA;;AAEC;EACC;EACA;;AACD;EACC;EACA;EACA;EACA,OAvEQ;EAwER;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;;AACF;EACC;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;EACA;;AACA;EACC;EACA,OA9FM;;AA+FR;EACC;EACA;EACA;EACA;;AACA;EACC;EACA;;AAEJ;EACC;EACA;EACA;;AAED;EACC;EACA;EACA;;AACA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;AACD;EACC,OA3HQ;EA4HR;;AAEF;EACC,OA3HS;EA4HT;EACA;EACA;;AACA;EACC;;;AAGF;EACC;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;AAEF;EACC;EACA;;AACA;EACC;;AACA;EACC;;AACA;EACC,OA5JM;;AA6JP;EACC,OA5JM;;AA6JP;EACC,OAlKM;;AAmKP;EACC,OAjKM;;AAkKR;EACC;EACA;;AACD;EACC;EACA;;AACD;EACC;;AACA;EACC,OA1KM;;AA2KP;EACC,OAhLM;;AAiLR;EACC;EACA;;AACA;EACC,kBAtLM;EAuLN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACC;EACA;;AACD;EACC;EACA;EACA;;;AAEN;EACC;EACA;EACA;EACA;;AACA;EACC;;;AAEF;EACC;;;AAED;EACC;IACC;;EACD;IACC","file":"index.css"} \ No newline at end of file diff --git a/ui/jhtml-compat/index.php b/ui/jhtml-compat/index.php index 161b38c..38bfa02 100644 --- a/ui/jhtml-compat/index.php +++ b/ui/jhtml-compat/index.php @@ -5,4 +5,4 @@ *js("///index.js") *js("https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js") *postjs("///feather.js") -

dns-watch.org

\ No newline at end of file +

dns-watch.org

by tjdev.de
\ No newline at end of file -- 2.30.2