2026-09-30 18:42:28 +03:30
|
|
|
|
<template>
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<h1>محتوای لندینگ</h1>
|
2026-09-30 20:33:37 +03:30
|
|
|
|
<p class="muted">متنها را مثل فرم معمولی ویرایش کنید — نیازی به کدنویسی نیست.</p>
|
2026-09-30 18:42:28 +03:30
|
|
|
|
<table class="table">
|
|
|
|
|
|
<thead>
|
2026-09-30 20:33:37 +03:30
|
|
|
|
<tr><th>بخش</th><th>آخرین ویرایش</th><th></th></tr>
|
2026-09-30 18:42:28 +03:30
|
|
|
|
</thead>
|
|
|
|
|
|
<tbody>
|
|
|
|
|
|
<tr v-for="s in sections" :key="s.id">
|
2026-09-30 20:33:37 +03:30
|
|
|
|
<td>{{ label(s.key) }}</td>
|
2026-09-30 18:42:28 +03:30
|
|
|
|
<td class="muted">{{ new Date(s.updatedAt).toLocaleString("fa-IR") }}</td>
|
|
|
|
|
|
<td><RouterLink :to="`/sections/${s.key}`">ویرایش</RouterLink></td>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
</tbody>
|
|
|
|
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
|
import { onMounted, ref } from "vue";
|
|
|
|
|
|
import { api } from "../lib/api";
|
|
|
|
|
|
|
2026-09-30 20:33:37 +03:30
|
|
|
|
const TITLES: Record<string, string> = {
|
|
|
|
|
|
hero: "صفحه اول (هیرو)",
|
|
|
|
|
|
marquee: "نوار متحرک",
|
|
|
|
|
|
manifesto: "معرفی",
|
|
|
|
|
|
services: "خدمات",
|
|
|
|
|
|
work: "نمونه کارها",
|
|
|
|
|
|
process: "فرآیند کار",
|
|
|
|
|
|
stats: "آمار",
|
|
|
|
|
|
team: "تیم",
|
|
|
|
|
|
footer: "تماس و فوتر",
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2026-09-30 18:42:28 +03:30
|
|
|
|
const sections = ref<any[]>([]);
|
2026-09-30 20:33:37 +03:30
|
|
|
|
function label(key: string) {
|
|
|
|
|
|
return TITLES[key] || key;
|
|
|
|
|
|
}
|
2026-09-30 18:42:28 +03:30
|
|
|
|
onMounted(async () => {
|
|
|
|
|
|
const { data } = await api.get("/admin/sections");
|
|
|
|
|
|
sections.value = data;
|
|
|
|
|
|
});
|
|
|
|
|
|
</script>
|