Commit 19eafd43 authored by Jiří Helebrant's avatar Jiří Helebrant

Use DIVs for popup status indicators

parent 5cc6a6a7
Pipeline #43958 failed with stages
in 1 minute and 34 seconds
......@@ -11,12 +11,19 @@ const createDomainRow = async hostname => {
const dnssecCell = document.createElement('td')
const validCell = document.createElement('td')
const status = await getDomainStatus(hostname)
const dnssecDiv = document.createElement('div')
const validDiv = document.createElement('div')
dnssecDiv.className = 'indicator'
validDiv.className = 'indicator'
if (status) {
hostnameCell.innerText = hostname
dnssecCell.dataset.ok = status.dnssec ? '1' : '2'
dnssecDiv.classList.add(status.dnssec ? 'valid' : 'off')
validCell.dataset.ok = status.dnssec ? (status.valid ? '1' : '0') : '2'
validDiv.classList.add(status.dnssec ? (status.valid ? 'valid' : 'invalid') : 'off')
dnssecCell.appendChild(dnssecDiv)
validCell.appendChild(validDiv)
row.appendChild(hostnameCell)
row.appendChild(dnssecCell)
......@@ -50,10 +57,13 @@ const createResolverStatusRow = (label, status) => {
const row = document.createElement('tr')
const labelCell = document.createElement('td')
const statusCell = document.createElement('td')
const statusDiv = document.createElement('div')
statusDiv.className = 'indicator'
labelCell.innerText = label
statusCell.dataset.ok = status ? '1' : '0'
statusDiv.classList.add(status ? 'valid' : 'invalid')
statusCell.appendChild(statusDiv)
row.appendChild(labelCell)
row.appendChild(statusCell)
......@@ -90,9 +100,9 @@ const updatePopup = async () => {
popup.addEventListener('click', updateIcon)
popup.innerHTML = ''
// const domainHeading = document.createElement('h3')
// domainHeading.innerText = 'Request domains'
// popup.append(domainHeading)
const domainHeading = document.createElement('h3')
domainHeading.innerText = 'Requests'
popup.append(domainHeading)
popup.appendChild(await createDomainTable())
const resolverHeading = document.createElement('h3')
resolverHeading.innerText = 'DNS Resolver'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment