mirror of
https://github.com/amir20/dozzle.git
synced 2025-12-24 06:28:42 +01:00
feat: supports swarm mode with stacks and services on remote hosts 🙌🏼 (#2961)
This commit is contained in:
38
assets/components/LogViewer/ViewerWithSource.vue
Normal file
38
assets/components/LogViewer/ViewerWithSource.vue
Normal file
@@ -0,0 +1,38 @@
|
||||
<template>
|
||||
<EventSource
|
||||
ref="source"
|
||||
#default="{ messages }"
|
||||
@loading-more="loadingMore($event)"
|
||||
:stream-source="streamSource"
|
||||
:entity="props.entity"
|
||||
>
|
||||
<LogViewer :messages="messages" :visible-keys="visibleKeys" :show-container-name="showContainerName" />
|
||||
</EventSource>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup generic="T">
|
||||
import LogEventSource from "@/components/ContainerViewer/LogEventSource.vue";
|
||||
import { LogStreamSource } from "@/composable/eventStreams";
|
||||
|
||||
const props = defineProps<{
|
||||
streamSource: (t: Ref<T>) => LogStreamSource;
|
||||
visibleKeys: string[][];
|
||||
showContainerName: boolean;
|
||||
entity: T;
|
||||
}>();
|
||||
|
||||
const loadingMore = defineEmit<[value: boolean]>();
|
||||
|
||||
const source = $ref<InstanceType<typeof LogEventSource>>();
|
||||
|
||||
defineExpose({
|
||||
clear: () => source?.clear(),
|
||||
});
|
||||
|
||||
onKeyStroke("k", (e) => {
|
||||
if ((e.ctrlKey || e.metaKey) && e.shiftKey) {
|
||||
source?.clear();
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user