11<template >
22 <InfiniteLoader :onLoadMore =" fetchMore" :enabled =" !loadingMore && messages.length > 10" />
33 <ul class =" flex animate-pulse flex-col gap-4 p-4" v-if =" loading || (noLogs && waitingForMoreLog)" >
4- <div class =" flex flex-row gap-2" v-for =" size in shuffle(['w-3/5', 'w-2/3', 'w-9/12', 'w-1/2', 'w-1/3', 'w-3/4']) " >
4+ <div class =" flex flex-row gap-2" v-for =" size in sizes " >
55 <div class =" h-3 w-40 shrink-0 rounded-full bg-base-content/50 opacity-50" ></div >
66 <div class =" h-3 rounded-full bg-base-content/50 opacity-50" :class =" size" ></div >
77 </div >
@@ -20,7 +20,7 @@ const { entity, streamSource } = $defineProps<{
2020 entity: T ;
2121}>();
2222
23- const { messages, loadOlderLogs, isLoadingMore, opened, loading, error } = streamSource ($$ (entity ));
23+ const { messages, loadOlderLogs, isLoadingMore, opened, loading, error, eventSourceURL } = streamSource ($$ (entity ));
2424const { loadingMore } = useLoggingContext ();
2525const color = computed (() => {
2626 if (error .value ) return " error" ;
@@ -48,4 +48,8 @@ const fetchMore = async () => {
4848const shuffle = (items : any []) => {
4949 return items .sort (() => Math .random () - 0.5 );
5050};
51+
52+ const sizes = computedWithControl (eventSourceURL , () =>
53+ shuffle ([" w-3/5" , " w-2/3" , " w-9/12" , " w-1/2" , " w-1/3" , " w-3/4" ]),
54+ );
5155 </script >
0 commit comments