This commit is contained in:
Timothy Jaeryang Baek committed 2026-04-02 02:50:05 -05:00
1 parent 4632f200a9
commit 60e4d75174
4 files changed
+379 -221

No files matched your search

+18
View File
@@ -215,6 +215,13 @@ class FeedbackTable:
query = db.query(Feedback, User).join(User, Feedback.user_id == User.id) query = db.query(Feedback, User).join(User, Feedback.user_id == User.id)
if filter: if filter:
# Apply model_id filter (exact match)
model_id = filter.get('model_id')
if model_id:
query = query.filter(
Feedback.data['model_id'].as_string() == model_id
)
order_by = filter.get('order_by') order_by = filter.get('order_by')
direction = filter.get('direction') direction = filter.get('direction')
@@ -288,6 +295,17 @@ class FeedbackTable:
.all() .all()
] ]
def get_distinct_model_ids(self, db: Optional[Session] = None) -> list[str]:
"""Get distinct model_ids from feedback data for filter dropdowns."""
with get_db_context(db) as db:
rows = (
db.query(Feedback.data['model_id'].as_string())
.filter(Feedback.data['model_id'].as_string().isnot(None))
.distinct()
.all()
)
return sorted([row[0] for row in rows if row[0]])
def get_feedbacks_for_leaderboard(self, db: Optional[Session] = None) -> list[LeaderboardFeedbackData]: def get_feedbacks_for_leaderboard(self, db: Optional[Session] = None) -> list[LeaderboardFeedbackData]:
"""Fetch only id and data for leaderboard computation (excludes snapshot/meta).""" """Fetch only id and data for leaderboard computation (excludes snapshot/meta)."""
with get_db_context(db) as db: with get_db_context(db) as db:
+18 -1
View File
@@ -291,6 +291,11 @@ async def update_config(
} }
@router.get('/feedbacks/models', response_model=list[str])
async def get_feedback_model_ids(user=Depends(get_admin_user), db: Session = Depends(get_session)):
return Feedbacks.get_distinct_model_ids(db=db)
@router.get('/feedbacks/all', response_model=list[FeedbackResponse]) @router.get('/feedbacks/all', response_model=list[FeedbackResponse])
async def get_all_feedbacks(user=Depends(get_admin_user), db: Session = Depends(get_session)): async def get_all_feedbacks(user=Depends(get_admin_user), db: Session = Depends(get_session)):
feedbacks = Feedbacks.get_all_feedbacks(db=db) feedbacks = Feedbacks.get_all_feedbacks(db=db)
@@ -309,8 +314,17 @@ async def delete_all_feedbacks(user=Depends(get_admin_user), db: Session = Depen
@router.get('/feedbacks/all/export', response_model=list[FeedbackModel]) @router.get('/feedbacks/all/export', response_model=list[FeedbackModel])
async def export_all_feedbacks(user=Depends(get_admin_user), db: Session = Depends(get_session)): async def export_all_feedbacks(
model_id: Optional[str] = None,
user=Depends(get_admin_user),
db: Session = Depends(get_session),
):
feedbacks = Feedbacks.get_all_feedbacks(db=db) feedbacks = Feedbacks.get_all_feedbacks(db=db)
if model_id:
feedbacks = [
f for f in feedbacks
if f.data and f.data.get('model_id') == model_id
]
return feedbacks return feedbacks
@@ -334,6 +348,7 @@ async def get_feedbacks(
order_by: Optional[str] = None, order_by: Optional[str] = None,
direction: Optional[str] = None, direction: Optional[str] = None,
page: Optional[int] = 1, page: Optional[int] = 1,
model_id: Optional[str] = None,
user=Depends(get_admin_user), user=Depends(get_admin_user),
db: Session = Depends(get_session), db: Session = Depends(get_session),
): ):
@@ -347,6 +362,8 @@ async def get_feedbacks(
filter['order_by'] = order_by filter['order_by'] = order_by
if direction: if direction:
filter['direction'] = direction filter['direction'] = direction
if model_id:
filter['model_id'] = model_id
result = Feedbacks.get_feedback_items(filter=filter, skip=skip, limit=limit, db=db) result = Feedbacks.get_feedback_items(filter=filter, skip=skip, limit=limit, db=db)
return result return result
+35 -3
View File
@@ -161,13 +161,42 @@ export const getModelHistory = async (token: string = '', modelId: string, days:
return res; return res;
}; };
export const getFeedbackItems = async (token: string = '', orderBy, direction, page) => { export const getFeedbackModelIds = async (token: string = '') => {
let error = null;
const res = await fetch(`${WEBUI_API_BASE_URL}/evaluations/feedbacks/models`, {
method: 'GET',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
authorization: `Bearer ${token}`
}
})
.then(async (res) => {
if (!res.ok) throw await res.json();
return res.json();
})
.catch((err) => {
error = err.detail;
console.error(err);
return null;
});
if (error) {
throw error;
}
return res;
};
export const getFeedbackItems = async (token: string = '', orderBy, direction, page, modelId: string = '') => {
let error = null; let error = null;
const searchParams = new URLSearchParams(); const searchParams = new URLSearchParams();
if (orderBy) searchParams.append('order_by', orderBy); if (orderBy) searchParams.append('order_by', orderBy);
if (direction) searchParams.append('direction', direction); if (direction) searchParams.append('direction', direction);
if (page) searchParams.append('page', page.toString()); if (page) searchParams.append('page', page.toString());
if (modelId) searchParams.append('model_id', modelId);
const res = await fetch( const res = await fetch(
`${WEBUI_API_BASE_URL}/evaluations/feedbacks/list?${searchParams.toString()}`, `${WEBUI_API_BASE_URL}/evaluations/feedbacks/list?${searchParams.toString()}`,
@@ -200,10 +229,13 @@ export const getFeedbackItems = async (token: string = '', orderBy, direction, p
return res; return res;
}; };
export const exportAllFeedbacks = async (token: string = '') => { export const exportAllFeedbacks = async (token: string = '', modelId: string = '') => {
let error = null; let error = null;
const res = await fetch(`${WEBUI_API_BASE_URL}/evaluations/feedbacks/all/export`, { const searchParams = new URLSearchParams();
if (modelId) searchParams.append('model_id', modelId);
const res = await fetch(`${WEBUI_API_BASE_URL}/evaluations/feedbacks/all/export?${searchParams.toString()}`, {
method: 'GET', method: 'GET',
headers: { headers: {
Accept: 'application/json', Accept: 'application/json',
@@ -10,7 +10,12 @@
import { onMount, getContext } from 'svelte'; import { onMount, getContext } from 'svelte';
const i18n = getContext('i18n'); const i18n = getContext('i18n');
import { deleteFeedbackById, exportAllFeedbacks, getFeedbackItems } from '$lib/apis/evaluations'; import {
deleteFeedbackById,
exportAllFeedbacks,
getFeedbackItems,
getFeedbackModelIds
} from '$lib/apis/evaluations';
import Tooltip from '$lib/components/common/Tooltip.svelte'; import Tooltip from '$lib/components/common/Tooltip.svelte';
import Download from '$lib/components/icons/Download.svelte'; import Download from '$lib/components/icons/Download.svelte';
@@ -26,6 +31,8 @@
import { WEBUI_API_BASE_URL, WEBUI_BASE_URL } from '$lib/constants'; import { WEBUI_API_BASE_URL, WEBUI_BASE_URL } from '$lib/constants';
import { config } from '$lib/stores'; import { config } from '$lib/stores';
import Spinner from '$lib/components/common/Spinner.svelte'; import Spinner from '$lib/components/common/Spinner.svelte';
import Select from '$lib/components/common/Select.svelte';
import Check from '$lib/components/icons/Check.svelte';
let page = 1; let page = 1;
let items = null; let items = null;
@@ -34,6 +41,9 @@
let orderBy: string = 'updated_at'; let orderBy: string = 'updated_at';
let direction: 'asc' | 'desc' = 'desc'; let direction: 'asc' | 'desc' = 'desc';
let selectedModelId: string = '';
let modelIds: string[] = [];
const setSortKey = (key) => { const setSortKey = (key) => {
if (orderBy === key) { if (orderBy === key) {
direction = direction === 'asc' ? 'desc' : 'asc'; direction = direction === 'asc' ? 'desc' : 'asc';
@@ -64,12 +74,16 @@
const getFeedbacks = async () => { const getFeedbacks = async () => {
try { try {
const res = await getFeedbackItems(localStorage.token, orderBy, direction, page).catch( const res = await getFeedbackItems(
(error) => { localStorage.token,
toast.error(`${error}`); orderBy,
return null; direction,
} page,
); selectedModelId
).catch((error) => {
toast.error(`${error}`);
return null;
});
if (res) { if (res) {
items = res.items; items = res.items;
@@ -80,10 +94,21 @@
} }
}; };
$: if (orderBy && direction && page) { $: if (orderBy && direction && page !== undefined) {
getFeedbacks(); getFeedbacks();
} }
const loadModelIds = async () => {
try {
const res = await getFeedbackModelIds(localStorage.token);
if (res) {
modelIds = res;
}
} catch (err) {
console.error(err);
}
};
const deleteFeedbackHandler = async (feedbackId: string) => { const deleteFeedbackHandler = async (feedbackId: string) => {
const response = await deleteFeedbackById(localStorage.token, feedbackId).catch((err) => { const response = await deleteFeedbackById(localStorage.token, feedbackId).catch((err) => {
toast.error(err); toast.error(err);
@@ -124,10 +149,12 @@
}; };
const exportHandler = async () => { const exportHandler = async () => {
const _feedbacks = await exportAllFeedbacks(localStorage.token).catch((err) => { const _feedbacks = await exportAllFeedbacks(localStorage.token, selectedModelId).catch(
toast.error(err); (err) => {
return null; toast.error(err);
}); return null;
}
);
if (_feedbacks) { if (_feedbacks) {
let blob = new Blob([JSON.stringify(_feedbacks)], { let blob = new Blob([JSON.stringify(_feedbacks)], {
@@ -136,6 +163,10 @@
saveAs(blob, `feedback-history-export-${Date.now()}.json`); saveAs(blob, `feedback-history-export-${Date.now()}.json`);
} }
}; };
onMount(() => {
loadModelIds();
});
</script> </script>
<FeedbackModal bind:show={showFeedbackModal} {selectedFeedback} onClose={closeFeedbackModal} /> <FeedbackModal bind:show={showFeedbackModal} {selectedFeedback} onClose={closeFeedbackModal} />
@@ -145,236 +176,296 @@
<Spinner className="size-5" /> <Spinner className="size-5" />
</div> </div>
{:else} {:else}
<div class="mt-0.5 mb-1 gap-1 flex flex-row justify-between"> <div class="flex flex-col gap-1 mt-0.5 mb-3">
<div class="flex items-center md:self-center text-xl font-medium px-0.5 gap-2 shrink-0"> <div class="flex justify-between items-center">
<div> <div class="flex items-center md:self-center text-xl font-medium px-0.5 gap-2 shrink-0">
{$i18n.t('Feedback History')} <div>
{$i18n.t('Feedback History')}
</div>
<div class="text-lg font-medium text-gray-500 dark:text-gray-500">
{total}
</div>
</div> </div>
<div class="text-lg font-medium text-gray-500 dark:text-gray-500"> <div class="flex w-full justify-end gap-1.5">
{total} {#if total > 0}
</div>
</div>
{#if total > 0}
<div>
<Tooltip content={$i18n.t('Export')}>
<button <button
class=" p-2 rounded-xl hover:bg-gray-100 dark:bg-gray-900 dark:hover:bg-gray-850 transition font-medium text-sm flex items-center space-x-1" class="flex text-xs items-center space-x-1 px-3 py-1.5 rounded-xl bg-gray-50 hover:bg-gray-100 dark:bg-gray-850 dark:hover:bg-gray-800 dark:text-gray-200 transition"
on:click={() => { on:click={() => {
exportHandler(); exportHandler();
}} }}
> >
<Download className="size-3" /> <div class="self-center font-medium line-clamp-1">
{$i18n.t('Export')}
</div>
</button> </button>
</Tooltip> {/if}
</div> </div>
{/if} </div>
</div> </div>
<div class="scrollbar-hidden relative whitespace-nowrap overflow-x-auto max-w-full"> <div
{#if (items ?? []).length === 0} class="py-2 bg-white dark:bg-gray-900 rounded-3xl border border-gray-100/30 dark:border-gray-850/30"
<div class="text-center text-xs text-gray-500 dark:text-gray-400 py-1"> >
{$i18n.t('No feedback found')} {#if modelIds.length > 0}
</div> <div
{:else} class="px-2.5 flex w-full bg-transparent overflow-x-auto scrollbar-none mb-1"
<table on:wheel={(e) => {
class="w-full text-sm text-left text-gray-500 dark:text-gray-400 table-auto max-w-full" if (e.deltaY !== 0) {
e.preventDefault();
e.currentTarget.scrollLeft += e.deltaY;
}
}}
> >
<thead class="text-xs text-gray-800 uppercase bg-transparent dark:text-gray-200"> <div
<tr class=" border-b-[1.5px] border-gray-50 dark:border-gray-850/30"> class="flex gap-0.5 w-fit text-center text-sm rounded-full bg-transparent whitespace-nowrap"
<th >
scope="col" <Select
class="px-2.5 py-2 cursor-pointer select-none w-3" bind:value={selectedModelId}
on:click={() => setSortKey('user')} items={[
> { value: '', label: $i18n.t('All') },
<div class="flex gap-1.5 items-center justify-end"> ...modelIds.map((mid) => ({ value: mid, label: mid }))
{$i18n.t('User')} ]}
{#if orderBy === 'user'} placeholder={$i18n.t('All')}
<span class="font-normal"> triggerClass="relative w-full flex items-center gap-0.5 px-2.5 py-1.5 bg-gray-50 dark:bg-gray-850 rounded-xl"
{#if direction === 'asc'} onChange={() => {
<ChevronUp className="size-2" /> page = 1;
{:else} getFeedbacks();
<ChevronDown className="size-2" /> }}
{/if} >
</span> <svelte:fragment slot="trigger" let:selectedLabel>
{:else} <span
<span class="invisible"> class="inline-flex h-input px-0.5 w-full outline-hidden bg-transparent truncate placeholder-gray-400 focus:outline-hidden"
<ChevronUp className="size-2" /> >
</span> {selectedLabel}
{/if} </span>
</div> <ChevronDown className="size-3.5" strokeWidth="2.5" />
</th> </svelte:fragment>
<th <svelte:fragment slot="item" let:item let:selected>
scope="col" {item.label}
class="px-2.5 py-2 cursor-pointer select-none" <div class="ml-auto {selected ? '' : 'invisible'}">
on:click={() => setSortKey('model_id')} <Check />
>
<div class="flex gap-1.5 items-center">
{$i18n.t('Models')}
{#if orderBy === 'model_id'}
<span class="font-normal">
{#if direction === 'asc'}
<ChevronUp className="size-2" />
{:else}
<ChevronDown className="size-2" />
{/if}
</span>
{:else}
<span class="invisible">
<ChevronUp className="size-2" />
</span>
{/if}
</div> </div>
</th> </svelte:fragment>
</Select>
</div>
</div>
{/if}
<th <div class="scrollbar-hidden relative whitespace-nowrap overflow-x-auto max-w-full px-2">
scope="col" {#if (items ?? []).length === 0}
class="px-2.5 py-2 text-right cursor-pointer select-none w-fit" <div class="w-full h-full flex flex-col justify-center items-center my-16 mb-24">
on:click={() => setSortKey('rating')} <div class="max-w-md text-center">
> <div class="text-3xl mb-3">😕</div>
<div class="flex gap-1.5 items-center justify-end"> <div class="text-lg font-medium mb-1">{$i18n.t('No feedback found')}</div>
{$i18n.t('Result')} <div class="text-gray-500 text-center text-xs">
{#if orderBy === 'rating'} {$i18n.t('Try adjusting your search or filter to find what you are looking for.')}
<span class="font-normal"> </div>
{#if direction === 'asc'} </div>
</div>
{:else}
<table
class="w-full text-sm text-left text-gray-500 dark:text-gray-400 table-auto max-w-full px-2"
>
<thead class="text-xs text-gray-800 uppercase bg-transparent dark:text-gray-200">
<tr class=" border-b-[1.5px] border-gray-50 dark:border-gray-850/30">
<th
scope="col"
class="px-2.5 py-2 cursor-pointer select-none w-3"
on:click={() => setSortKey('user')}
>
<div class="flex gap-1.5 items-center justify-end">
{$i18n.t('User')}
{#if orderBy === 'user'}
<span class="font-normal">
{#if direction === 'asc'}
<ChevronUp className="size-2" />
{:else}
<ChevronDown className="size-2" />
{/if}
</span>
{:else}
<span class="invisible">
<ChevronUp className="size-2" /> <ChevronUp className="size-2" />
{:else} </span>
<ChevronDown className="size-2" /> {/if}
{/if}
</span>
{:else}
<span class="invisible">
<ChevronUp className="size-2" />
</span>
{/if}
</div>
</th>
<th
scope="col"
class="px-2.5 py-2 text-right cursor-pointer select-none w-0"
on:click={() => setSortKey('updated_at')}
>
<div class="flex gap-1.5 items-center justify-end">
{$i18n.t('Updated At')}
{#if orderBy === 'updated_at'}
<span class="font-normal">
{#if direction === 'asc'}
<ChevronUp className="size-2" />
{:else}
<ChevronDown className="size-2" />
{/if}
</span>
{:else}
<span class="invisible">
<ChevronUp className="size-2" />
</span>
{/if}
</div>
</th>
<th scope="col" class="px-2.5 py-2 text-right cursor-pointer select-none w-0"> </th>
</tr>
</thead>
<tbody class="">
{#each items as feedback (feedback.id)}
<tr
class="bg-white dark:bg-gray-900 dark:border-gray-850 text-xs cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-850/50 transition"
on:click={() => openFeedbackModal(feedback)}
>
<td class=" py-0.5 text-right font-medium">
<div class="flex justify-center">
<Tooltip content={feedback?.user?.name}>
<div class="shrink-0">
<img
src={`${WEBUI_API_BASE_URL}/users/${feedback.user.id}/profile/image`}
alt={feedback?.user?.name}
class="size-5 rounded-full object-cover shrink-0"
/>
</div>
</Tooltip>
</div> </div>
</td> </th>
<td class=" py-1 pl-3 flex flex-col"> <th
<div class="flex flex-col items-start gap-0.5 h-full"> scope="col"
<div class="flex flex-col h-full"> class="px-2.5 py-2 cursor-pointer select-none"
{#if feedback.data?.sibling_model_ids} on:click={() => setSortKey('model_id')}
<Tooltip content={feedback.data?.model_id} placement="top-start"> >
<div <div class="flex gap-1.5 items-center">
class="font-medium text-gray-600 dark:text-gray-400 flex-1 line-clamp-1" {$i18n.t('Models')}
> {#if orderBy === 'model_id'}
{feedback.data?.model_id} <span class="font-normal">
</div> {#if direction === 'asc'}
</Tooltip> <ChevronUp className="size-2" />
{:else}
<Tooltip content={feedback.data.sibling_model_ids.join(', ')}> <ChevronDown className="size-2" />
<div class=" text-[0.65rem] text-gray-600 dark:text-gray-400 line-clamp-1"> {/if}
{#if feedback.data.sibling_model_ids.length > 2} </span>
<!-- {$i18n.t('and {{COUNT}} more')} --> {:else}
{feedback.data.sibling_model_ids.slice(0, 2).join(', ')}, {$i18n.t( <span class="invisible">
'and {{COUNT}} more', <ChevronUp className="size-2" />
{ COUNT: feedback.data.sibling_model_ids.length - 2 } </span>
)} {/if}
{:else}
{feedback.data.sibling_model_ids.join(', ')}
{/if}
</div>
</Tooltip>
{:else}
<Tooltip content={feedback.data?.model_id} placement="top-start">
<div
class="text-sm font-medium text-gray-600 dark:text-gray-400 flex-1 py-1.5 line-clamp-1"
>
{feedback.data?.model_id}
</div>
</Tooltip>
{/if}
</div>
</div> </div>
</td> </th>
{#if feedback?.data?.rating} <th
<td class="px-3 py-1 text-right font-medium text-gray-900 dark:text-white w-max"> scope="col"
<div class=" flex justify-end"> class="px-2.5 py-2 text-right cursor-pointer select-none w-fit"
{#if feedback?.data?.rating.toString() === '1'} on:click={() => setSortKey('rating')}
<Badge type="info" content={$i18n.t('Won')} /> >
{:else if feedback?.data?.rating.toString() === '0'} <div class="flex gap-1.5 items-center justify-end">
<Badge type="muted" content={$i18n.t('Draw')} /> {$i18n.t('Result')}
{:else if feedback?.data?.rating.toString() === '-1'} {#if orderBy === 'rating'}
<Badge type="error" content={$i18n.t('Lost')} /> <span class="font-normal">
{/if} {#if direction === 'asc'}
<ChevronUp className="size-2" />
{:else}
<ChevronDown className="size-2" />
{/if}
</span>
{:else}
<span class="invisible">
<ChevronUp className="size-2" />
</span>
{/if}
</div>
</th>
<th
scope="col"
class="px-2.5 py-2 text-right cursor-pointer select-none w-0"
on:click={() => setSortKey('updated_at')}
>
<div class="flex gap-1.5 items-center justify-end">
{$i18n.t('Updated At')}
{#if orderBy === 'updated_at'}
<span class="font-normal">
{#if direction === 'asc'}
<ChevronUp className="size-2" />
{:else}
<ChevronDown className="size-2" />
{/if}
</span>
{:else}
<span class="invisible">
<ChevronUp className="size-2" />
</span>
{/if}
</div>
</th>
<th scope="col" class="px-2.5 py-2 text-right cursor-pointer select-none w-0"> </th>
</tr>
</thead>
<tbody class="">
{#each items as feedback (feedback.id)}
<tr
class="bg-white dark:bg-gray-900 dark:border-gray-850 text-xs cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-850/50 transition rounded-xl"
on:click={() => openFeedbackModal(feedback)}
>
<td class=" py-0.5 text-right font-medium">
<div class="flex justify-center">
<Tooltip content={feedback?.user?.name}>
<div class="shrink-0">
<img
src={`${WEBUI_API_BASE_URL}/users/${feedback.user.id}/profile/image`}
alt={feedback?.user?.name}
class="size-5 rounded-full object-cover shrink-0"
/>
</div>
</Tooltip>
</div> </div>
</td> </td>
{/if}
<td class=" px-3 py-1 text-right font-medium"> <td class=" py-1 pl-3 flex flex-col">
{dayjs(feedback.updated_at * 1000).fromNow()} <div class="flex flex-col items-start gap-0.5 h-full">
</td> <div class="flex flex-col h-full">
{#if feedback.data?.sibling_model_ids}
<Tooltip content={feedback.data?.model_id} placement="top-start">
<div
class="font-medium text-gray-600 dark:text-gray-400 flex-1 line-clamp-1"
>
{feedback.data?.model_id}
</div>
</Tooltip>
<td class=" px-3 py-1 text-right font-medium" on:click={(e) => e.stopPropagation()}> <Tooltip content={feedback.data.sibling_model_ids.join(', ')}>
<FeedbackMenu <div
on:delete={(e) => { class=" text-[0.65rem] text-gray-600 dark:text-gray-400 line-clamp-1"
deleteFeedbackHandler(feedback.id); >
}} {#if feedback.data.sibling_model_ids.length > 2}
> <!-- {$i18n.t('and {{COUNT}} more')} -->
<button {feedback.data.sibling_model_ids.slice(0, 2).join(', ')}, {$i18n.t(
class="self-center w-fit text-sm p-1.5 dark:text-gray-300 dark:hover:text-white hover:bg-black/5 dark:hover:bg-white/5 rounded-xl" 'and {{COUNT}} more',
{ COUNT: feedback.data.sibling_model_ids.length - 2 }
)}
{:else}
{feedback.data.sibling_model_ids.join(', ')}
{/if}
</div>
</Tooltip>
{:else}
<Tooltip content={feedback.data?.model_id} placement="top-start">
<div
class="text-sm font-medium text-gray-600 dark:text-gray-400 flex-1 py-1.5 line-clamp-1"
>
{feedback.data?.model_id}
</div>
</Tooltip>
{/if}
</div>
</div>
</td>
{#if feedback?.data?.rating}
<td class="px-3 py-1 text-right font-medium text-gray-900 dark:text-white w-max">
<div class=" flex justify-end">
{#if feedback?.data?.rating.toString() === '1'}
<Badge type="info" content={$i18n.t('Won')} />
{:else if feedback?.data?.rating.toString() === '0'}
<Badge type="muted" content={$i18n.t('Draw')} />
{:else if feedback?.data?.rating.toString() === '-1'}
<Badge type="error" content={$i18n.t('Lost')} />
{/if}
</div>
</td>
{/if}
<td class=" px-3 py-1 text-right font-medium">
{dayjs(feedback.updated_at * 1000).fromNow()}
</td>
<td class=" px-3 py-1 text-right font-medium" on:click={(e) => e.stopPropagation()}>
<FeedbackMenu
on:delete={(e) => {
deleteFeedbackHandler(feedback.id);
}}
> >
<EllipsisHorizontal /> <button
</button> class="self-center w-fit text-sm p-1.5 dark:text-gray-300 dark:hover:text-white hover:bg-black/5 dark:hover:bg-white/5 rounded-xl"
</FeedbackMenu> >
</td> <EllipsisHorizontal />
</tr> </button>
{/each} </FeedbackMenu>
</tbody> </td>
</table> </tr>
{/each}
</tbody>
</table>
{/if}
</div>
{#if total > 30}
<Pagination bind:page count={total} perPage={30} />
{/if} {/if}
</div> </div>
{#if total > 30}
<Pagination bind:page count={total} perPage={30} />
{/if}
{/if} {/if}