fix(admin): correct logs sorting by datetime with milliseconds

- Change sortField from datetime to datetime_raw for proper chronological sorting
- Add sortField attribute to 'Date and time' column to show sort indicator
- Remove sorting from 'Level' and 'Channel' columns
- Add information about displaying last 100 events
This commit is contained in:
2025-12-25 18:29:59 +03:00
parent ff7263649c
commit 115c13393f

View File

@@ -9,7 +9,7 @@
showGridlines
stripedRows
size="small"
sortField="datetime"
sortField="datetime_raw"
:sortOrder="-1"
removableSort
paginatorTemplate="FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink CurrentPageReport RowsPerPageDropdown"
@@ -17,6 +17,7 @@
>
<template #header>
<div class="tw:flex tw:items-center tw:justify-between tw:gap-2">
<span class="tw:text-sm tw:text-gray-600">Выводятся последние 100 событий</span>
<Button
icon="fa fa-refresh"
@click="logs.fetchLogsFromServer()"
@@ -41,14 +42,14 @@
</template>
</Column>
<Column field="datetime" header="Дата и время" sortable style="min-width: 180px">
<Column field="datetime" header="Дата и время" sortable sortField="datetime_raw" style="min-width: 180px">
<template #body="{ data }">
<span v-if="data.datetime">{{ data.datetime }}</span>
<span v-else class="tw:text-gray-400"></span>
</template>
</Column>
<Column field="level" header="Уровень" sortable style="min-width: 100px">
<Column field="level" header="Уровень" style="min-width: 100px">
<template #body="{ data }">
<Badge
v-if="data.level"
@@ -59,7 +60,7 @@
</template>
</Column>
<Column field="channel" header="Канал" sortable style="min-width: 120px">
<Column field="channel" header="Канал" style="min-width: 120px">
<template #body="{ data }">
<span v-if="data.channel">{{ data.channel }}</span>
<span v-else class="tw:text-gray-400"></span>