api response
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: ale <ale@manalejandro.com>
This commit is contained in:
ale 2024-11-19 02:17:17 +01:00
parent 00ce9ef88b
commit f5c72c32eb
Signed by: ale
GPG Key ID: 244A9C4DAB1C0C81

View File

@ -37,8 +37,8 @@ document.addEventListener('DOMContentLoaded', function () {
if (content && content.length > 0) { if (content && content.length > 0) {
loading() loading()
fetch('/api/block_count/' + content).then(async function (result) { fetch('/api/block_count/' + content).then(async function (result) {
var res = await result.text() var res = await result.text() || ''
if (res?.length > 0) { if (res.split('\n').length > 0) {
document.getElementById('blockcount').innerText = res.split('\n').length document.getElementById('blockcount').innerText = res.split('\n').length
document.getElementById('blockinstance').innerText = 'ing ' + content document.getElementById('blockinstance').innerText = 'ing ' + content
document.getElementById('blocktook').innerText = '' document.getElementById('blocktook').innerText = ''
@ -173,8 +173,8 @@ document.addEventListener('DOMContentLoaded', function () {
var li = document.createElement('li') var li = document.createElement('li')
li.innerHTML = r.domain + (r.blocks ? ' - ' + r.blocks + ' blocks' : '') li.innerHTML = r.domain + (r.blocks ? ' - ' + r.blocks + ' blocks' : '')
+ (r.nodeinfo ? ' <a href="/api/detail_nodeinfo/' + r.domain + '" title="Nodeinfo for ' + r.domain + '" target="_blank">&#9432;</a>' : '') + (r.nodeinfo ? ' <a href="/api/detail_nodeinfo/' + r.domain + '" title="Nodeinfo for ' + r.domain + '" target="_blank">&#9432;</a>' : '')
+ (r.api.title ? '<br /> <br />' + r.api.title + ' - ' + r.api.uri + '<br />' + (r.last ? '<br />' + 'Last update: ' + (new Date(r.last)).toLocaleString() : '')
+ (r.last ? 'Last update: ' + (new Date(r.last)).toLocaleString() + '<br />' : '') + (r.api?.title ? '<br /><br />' + r.api.title + ' - ' + r.api.uri + '<br />'
+ (r.api.email ? 'Email: ' + r.api.email + '<br />' : '') + (r.api.email ? 'Email: ' + r.api.email + '<br />' : '')
+ 'Registration: ' + (r.api.registrations ? 'open' : 'closed') + ' - Version: ' + r.api.version + '<br />' + 'Registration: ' + (r.api.registrations ? 'open' : 'closed') + ' - Version: ' + r.api.version + '<br />'
+ (r.api.stats ? 'Users: ' + r.api.stats.user_count + ' - Statuses: ' + r.api.stats.status_count + ' - Domains: ' + r.api.stats.domain_count + '<br />' : '') + (r.api.stats ? 'Users: ' + r.api.stats.user_count + ' - Statuses: ' + r.api.stats.status_count + ' - Domains: ' + r.api.stats.domain_count + '<br />' : '')