mirror of
https://github.com/amir20/dozzle.git
synced 2025-12-21 21:33:18 +01:00
46 lines
1.6 KiB
Vue
46 lines
1.6 KiB
Vue
<template>
|
|
<ScrollableView :scrollable="scrollable" v-if="service.name">
|
|
<template #header>
|
|
<div class="mx-2 flex items-center gap-2 md:ml-4">
|
|
<div class="flex flex-1 gap-1.5 truncate @container md:gap-2">
|
|
<div class="inline-flex font-mono text-sm">
|
|
<div class="font-semibold">{{ service.name }}</div>
|
|
</div>
|
|
<Tag class="mobile-hidden hidden font-mono @3xl:block" size="small">
|
|
{{ $t("label.container", service.containers.length) }}
|
|
</Tag>
|
|
</div>
|
|
<MultiContainerStat class="ml-auto" :containers="service.containers" />
|
|
<MultiContainerActionToolbar class="mobile-hidden" @clear="viewer?.clear()" />
|
|
</div>
|
|
</template>
|
|
<template #default>
|
|
<ViewerWithSource
|
|
ref="viewer"
|
|
:stream-source="useServiceStream"
|
|
:entity="service"
|
|
:visible-keys="new Map<string[], boolean>()"
|
|
:show-container-name="true"
|
|
/>
|
|
</template>
|
|
</ScrollableView>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { Service } from "@/models/Stack";
|
|
import ViewerWithSource from "@/components/LogViewer/ViewerWithSource.vue";
|
|
import { ComponentExposed } from "vue-component-type-helpers";
|
|
|
|
const { name, scrollable = false } = defineProps<{
|
|
scrollable?: boolean;
|
|
name: string;
|
|
}>();
|
|
|
|
const viewer = ref<ComponentExposed<typeof ViewerWithSource>>();
|
|
const store = useSwarmStore();
|
|
const { services } = storeToRefs(store) as unknown as { services: Ref<Service[]> };
|
|
const service = computed(() => services.value.find((s) => s.name === name) ?? new Service("", []));
|
|
|
|
provideLoggingContext(toRef(() => service.value.containers));
|
|
</script>
|