From e2d783713dd9ea2b52306f2db815646f1e101118 Mon Sep 17 00:00:00 2001 From: ale Date: Tue, 19 Nov 2024 02:56:23 +0100 Subject: [PATCH] api response Signed-off-by: ale --- public/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/main.js b/public/main.js index 5486e83..4f9d4e5 100644 --- a/public/main.js +++ b/public/main.js @@ -38,7 +38,7 @@ document.addEventListener('DOMContentLoaded', function () { loading() fetch('/api/block_count/' + content).then(async function (result) { var res = await result.text() || '' - if (res.split('\n').length > 0) { + if (res.length > 0) { document.getElementById('blockcount').innerText = res.split('\n').length document.getElementById('blockinstance').innerText = 'ing ' + content document.getElementById('blocktook').innerText = '' @@ -173,7 +173,7 @@ document.addEventListener('DOMContentLoaded', function () { var li = document.createElement('li') li.innerHTML = r.domain + (r.blocks ? ' - ' + r.blocks + ' blocks' : '') + (r.nodeinfo ? ' ' : '') - + (r.last ? '
' + 'Last update: ' + (new Date(r.last)).toLocaleString() : '') + + (r.last ? '

' + 'Last update: ' + (new Date(r.last)).toLocaleString() : '') + (r.api?.title ? '

' + r.api.title + ' - ' + r.api.uri + '
' + (r.api.email ? 'Email: ' + r.api.email + '
' : '') + 'Registration: ' + (r.api.registrations ? 'open' : 'closed') + ' - Version: ' + r.api.version + '
'