This commit is contained in:
marzban-dev
2025-03-22 23:43:49 +03:30
parent 852a09c298
commit 2106f3f40b
56 changed files with 198 additions and 161 deletions
+4 -4
View File
@@ -14,7 +14,7 @@ definePageMeta({
// state
const params: GetAllTicketsRequest = useUrlSearchParams("history");
const params = useUrlSearchParams("history") as GetAllTicketsRequest;
const filters = computed(() => {
return {
@@ -72,12 +72,12 @@ const tickets = computed(() => {
return data.value?.results.flat();
});
const hasTickets = computed(() => data.value?.count > 0);
const hasTickets = computed(() => data.value && data.value.count > 0);
const hasFilters = computed(() =>
Object.keys(params)
.filter((key) => key != "page")
.some((key) => params[key] != undefined)
.some((key) => (params as any)[key] != undefined)
);
const paginationData = computed(() => {
@@ -227,7 +227,7 @@ const clearFilters = () => {
</template>
</Table>
<div v-if="data?.count > 7" class="w-full flex-center py-10">
<div v-if="data && paginationData && data.count > 7" class="w-full flex-center py-10">
<Pagination :items="paginationData" :total="data?.count" />
</div>
</div>