Files
web/src/pages/AuditPage.vue
T
MahdiandCursor cfee6b0546 Expand SuperAdmin web for SMS, servers, plugins, admins, and UI config.
Align SMS tenant panel with Hamkar, add Jalali dates, and support hamkar/khanegi appearance editing.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-30 18:19:54 +03:30

45 lines
1.5 KiB
Vue
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup lang="ts">
import { onMounted, ref } from 'vue'
import { message } from 'ant-design-vue'
import api from '@/api/http'
import { formatIranDateTime } from '@/utils/datetime'
const loading = ref(false)
const rows = ref<any[]>([])
async function load() {
loading.value = true
try {
const { data } = await api.get('/audit?limit=100')
rows.value = data
} catch (e: any) {
message.error(e?.response?.data?.message || 'خطا در دریافت لاگ')
} finally {
loading.value = false
}
}
onMounted(load)
</script>
<template>
<div class="page-shell">
<h1 class="page-title">لاگ تغییرات</h1>
<p class="page-sub">آخرین عملیات روی نسخه‌های فروشی</p>
<a-spin :spinning="loading">
<div v-if="rows.length" class="audit-list" style="margin-top: 14px">
<article v-for="item in rows" :key="item.id" class="audit-item">
<div class="when">{{ formatIranDateTime(item.createdAt) }}</div>
<div class="action">{{ item.action }}</div>
<div style="margin-top: 6px; color: #64748b; font-size: 0.85rem">
نسخه: {{ item.tenant?.nameFa || item.tenantId || '—' }}
· کاربر: {{ item.user?.name || [item.user?.firstName, item.user?.lastName].filter(Boolean).join(' ') || '—' }}
</div>
</article>
</div>
<a-empty v-else description="لاگی نیست" style="margin: 28px 0" />
</a-spin>
</div>
</template>