This commit is contained in:
parent
6b6ebb7cbf
commit
b44e199d1d
@ -481,21 +481,9 @@ module.exports = (app, client) => {
|
||||
parser(),
|
||||
pick({ filter: 'hits.hits' }),
|
||||
streamArray(),
|
||||
data => data.value._source
|
||||
data => ({ instance: data.value._source.instance, comment: data.value._source.blocks.find(block => block.domain === clean(req.params.instance)).comment })
|
||||
])
|
||||
pipeline.on('data', data => {
|
||||
block_count++
|
||||
instancescomment.push({
|
||||
instance: data.instance, comment: data.blocks.find(block => block.domain === clean(req.params.instance)).comment
|
||||
})
|
||||
})
|
||||
pipeline.on('end', () => {
|
||||
res.json({
|
||||
block_count,
|
||||
instances: instancescomment
|
||||
})
|
||||
})
|
||||
result.pipe(pipeline)
|
||||
result.pipe(pipeline).pipe(res, { end: true })
|
||||
} else {
|
||||
res.status(404).end()
|
||||
}
|
||||
|
@ -38,8 +38,8 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
loading()
|
||||
fetch('/api/block_count/' + content).then(async function (result) {
|
||||
var res = await result.json()
|
||||
if (res && res.block_count >= 0) {
|
||||
document.getElementById('blockcount').innerText = res.block_count
|
||||
if (Array.isArray(res) && res?.length >= 0) {
|
||||
document.getElementById('blockcount').innerText = res.length
|
||||
document.getElementById('blockinstance').innerText = 'ing ' + content
|
||||
document.getElementById('blocktook').innerText = ''
|
||||
var list = document.getElementById('blocklist'),
|
||||
@ -50,7 +50,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
while (list.hasChildNodes()) {
|
||||
list.removeChild(list.firstChild)
|
||||
}
|
||||
res.instances.map(function (instance, index) {
|
||||
res.map(function (instance, index) {
|
||||
var li = document.createElement('li'),
|
||||
text = document.createTextNode((index + 1) + '. '),
|
||||
link = '<a href="/' + (new URLSearchParams(window.location.search).has('matrix') ? '?matrix' : '') + '#' + instance.instance + '" onclick="window.location.href=this.href; window.location.reload(false);">' + instance.instance + '</a>',
|
||||
|
Loading…
Reference in New Issue
Block a user