stream filtering by connection id

This commit is contained in:
Jan Prochazka
2024-05-20 14:02:47 +02:00
parent df3313e647
commit 51d4bc9a75
5 changed files with 39 additions and 13 deletions

View File

@@ -8,6 +8,9 @@ import { isOauthCallback, redirectToLogin } from '../clientAuth';
import { showModal } from '../modals/modalTools';
import DatabaseLoginModal, { isDatabaseLoginVisible } from '../modals/DatabaseLoginModal.svelte';
import _ from 'lodash';
import uuidv1 from 'uuid/v1';
export const strmid = uuidv1();
let eventSource;
let apiLogging = false;
@@ -49,7 +52,7 @@ export function removeVolatileMapping(conid) {
function wantEventSource() {
if (!eventSource) {
eventSource = new EventSource(`${resolveApi()}/stream`);
eventSource = new EventSource(`${resolveApi()}/stream?strmid=${strmid}`);
// eventSource.addEventListener('clean-cache', e => cacheClean(JSON.parse(e.data)));
}
}

View File

@@ -1,6 +1,6 @@
import _ from 'lodash';
import { openedConnections, currentDatabase } from '../stores';
import { apiCall } from './api';
import { apiCall, strmid } from './api';
import { getConnectionList } from './metadataLoaders';
// const doServerPing = async value => {
@@ -10,7 +10,7 @@ import { getConnectionList } from './metadataLoaders';
// };
const doServerPing = value => {
apiCall('server-connections/ping', { conidArray: value });
apiCall('server-connections/ping', { conidArray: value, strmid });
};
const doDatabasePing = value => {