eavesdocker
Advanced tools
Comparing version 0.1.6 to 0.1.7
@@ -8,2 +8,7 @@ # Eavesdocker Changelog | ||
## [v0.1.7] - 2021-07-19 | ||
### Fixed | ||
- container list endpoint ignoring swarm siblings | ||
## [v0.1.6] - 2021-07-19 | ||
@@ -84,1 +89,2 @@ | ||
[v0.1.6]: https://gitlab.com/GCSBOSS/eavesdocker/-/tags/v0.1.6 | ||
[v0.1.7]: https://gitlab.com/GCSBOSS/eavesdocker/-/tags/v0.1.7 |
@@ -47,3 +47,3 @@ const { v4: uuidv4 } = require('uuid'); | ||
Object.keys(all).forEach(c => all[c].node = swarm[nid]); | ||
containers = { ...containers, all }; | ||
cs = { ...cs, all }; | ||
} | ||
@@ -50,0 +50,0 @@ } |
@@ -14,22 +14,3 @@ const LAST_COLOR = 13; | ||
function onEntry(listId, { data }){ | ||
data = JSON.parse(data); | ||
const lst = currentLists[listId]; | ||
if(lst.focusServices.size > 0 && !lst.focusServices.has(data.source.service)) | ||
return; | ||
entry = data.entry; | ||
if(typeof entry.message == 'string' && entry.message.length > 2 && entry.message.charAt(0) == '{') | ||
entry = { ...entry, message: null, ...JSON.parse(entry.message) }; | ||
data.source.label = data.source.service + | ||
(serviceCount[data.source.service] > 1 ? ' • ' + data.source.number : ''); | ||
data.source.index = activeContainers[data.source.id].index; | ||
lst.events.push({ container: data.source, entry, id: randomId() }); | ||
m.redraw(); | ||
} | ||
function randomId() { | ||
@@ -44,3 +25,2 @@ const uint32 = window.crypto.getRandomValues(new Uint32Array(1))[0]; | ||
eventSource.removeEventListener('log', lst.cb); | ||
delete currentLists[lst.id]; | ||
@@ -69,8 +49,6 @@ minLists.delete(lst.id); | ||
const id = randomId(); | ||
const cb = onEntry.bind(null, id); | ||
currentLists[id] = { id, name: 'Untitled', cb, events: [], | ||
currentLists[id] = { id, name: 'Untitled', events: [], | ||
focusServices: new Set(), hideFields: {} }; | ||
// TODO When this is loaded from file, populate 'historyServices' from 'excludeServices' | ||
eventSource.addEventListener('log', cb); | ||
} | ||
@@ -504,2 +482,31 @@ | ||
eventSource.addEventListener('log', function({ data }){ | ||
data = JSON.parse(data); | ||
if(!activeContainers[data.source.id]) | ||
return; | ||
const lists = Object.values(currentLists).filter(l => | ||
l.focusServices.size == 0 || l.focusServices.has(data.source.service)); | ||
if(lists.length == 0) | ||
return; | ||
entry = data.entry; | ||
if(typeof entry.message == 'string' && entry.message.length > 2 && entry.message.charAt(0) == '{') | ||
entry = { ...entry, message: null, ...JSON.parse(entry.message) }; | ||
data.source.label = data.source.service + | ||
(serviceCount[data.source.service] > 1 ? ' • ' + data.source.number : ''); | ||
data.source.index = activeContainers[data.source.id].index; | ||
const log = { container: data.source, entry, id: randomId() }; | ||
lists.forEach(lst => lst.events.push(log)); | ||
m.redraw(); | ||
}); | ||
const viewEl = document.getElementById('view'); | ||
@@ -506,0 +513,0 @@ viewEl.setAttribute('data-name', 'main'); |
{ | ||
"name": "eavesdocker", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"main": "lib/main.js", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
69667
1689