Files
tehran_taj/apps/admin-panel/src/views/manage/report.vue
T

43 lines
1.1 KiB
Vue

<template>
<!--
Ported from legacy henza_admin/src/views/manage/report.vue — a shortcut board
of report links, read from the `dashboard.links` setting.
-->
<a-card title="مدیریت گزارشات">
<a-empty v-if="links.length === 0" description="هنوز لینکی تعریف نشده است" />
<div v-else class="links">
<a v-for="(l, i) in links" :key="i" :href="l.url" target="_blank" class="link-card">
{{ l.title }}
</a>
</div>
</a-card>
</template>
<script setup lang="ts">
import { onMounted, ref } from 'vue';
import api from '../../api/client';
const links = ref<{ title: string; url: string }[]>([]);
onMounted(async () => {
try {
const { data } = await api.get('dashboard/link');
links.value = Array.isArray(data) ? data : [];
} catch (e) {
console.log(e);
}
});
</script>
<style scoped>
.links { display: flex; flex-wrap: wrap; gap: 1rem; }
.link-card {
display: block;
padding: 1rem 1.5rem;
border: 1px solid #f0f0f0;
border-radius: 6px;
color: #1c2d56;
}
.link-card:hover { border-color: #1c2d56; }
</style>