Stop showing mock inbox items and update admin login hint.
Header messages/notifications now come only from the API; login form points to the real admin phone. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -5,7 +5,6 @@ import { onClickOutside, useEventListener } from '@vueuse/core'
|
|||||||
import AdminIcon from '@/components/icons/AdminIcon.vue'
|
import AdminIcon from '@/components/icons/AdminIcon.vue'
|
||||||
import BasicIcon from '@/components/BasicPacks/BasicIcon.vue'
|
import BasicIcon from '@/components/BasicPacks/BasicIcon.vue'
|
||||||
import { dashboardApi, notificationsApi } from '@/services/api'
|
import { dashboardApi, notificationsApi } from '@/services/api'
|
||||||
import { adminNotifications, internalMessages } from '@/data/mockData'
|
|
||||||
import { formatDateTime } from '@/utils/format'
|
import { formatDateTime } from '@/utils/format'
|
||||||
import { resolveAdminInboxLink } from '@/utils/inboxLinks'
|
import { resolveAdminInboxLink } from '@/utils/inboxLinks'
|
||||||
import { useAuthStore } from '@/stores/auth'
|
import { useAuthStore } from '@/stores/auth'
|
||||||
@@ -28,8 +27,8 @@ const theme = useThemeStore()
|
|||||||
const openPanel = ref<OpenPanel>(null)
|
const openPanel = ref<OpenPanel>(null)
|
||||||
const actionsRef = ref<HTMLElement | null>(null)
|
const actionsRef = ref<HTMLElement | null>(null)
|
||||||
|
|
||||||
const messageList = ref<InternalMessage[]>(internalMessages.map((m) => ({ ...m })))
|
const messageList = ref<InternalMessage[]>([])
|
||||||
const notificationList = ref<AdminNotification[]>(adminNotifications.map((n) => ({ ...n })))
|
const notificationList = ref<AdminNotification[]>([])
|
||||||
|
|
||||||
const unreadMessages = computed(() => messageList.value.filter((m) => !m.isRead).length)
|
const unreadMessages = computed(() => messageList.value.filter((m) => !m.isRead).length)
|
||||||
const unreadNotifications = computed(() => notificationList.value.filter((n) => !n.isRead).length)
|
const unreadNotifications = computed(() => notificationList.value.filter((n) => !n.isRead).length)
|
||||||
@@ -51,11 +50,12 @@ const themeTriggerIcon = computed(
|
|||||||
void dashboardApi
|
void dashboardApi
|
||||||
.get()
|
.get()
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
if (data.messages?.length) messageList.value = data.messages
|
messageList.value = data.messages ?? []
|
||||||
if (data.notifications?.length) notificationList.value = data.notifications
|
notificationList.value = data.notifications ?? []
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
/* keep mock fallback seeded above */
|
messageList.value = []
|
||||||
|
notificationList.value = []
|
||||||
})
|
})
|
||||||
|
|
||||||
onClickOutside(actionsRef, () => {
|
onClickOutside(actionsRef, () => {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ const route = useRoute()
|
|||||||
const auth = useAuthStore()
|
const auth = useAuthStore()
|
||||||
const toast = useToast()
|
const toast = useToast()
|
||||||
|
|
||||||
const phone = ref('09121112222')
|
const phone = ref('09128081392')
|
||||||
const password = ref('')
|
const password = ref('')
|
||||||
const remember = ref(true)
|
const remember = ref(true)
|
||||||
const showPassword = ref(false)
|
const showPassword = ref(false)
|
||||||
@@ -102,7 +102,7 @@ async function submit() {
|
|||||||
</form>
|
</form>
|
||||||
|
|
||||||
<p class="login-page__hint">
|
<p class="login-page__hint">
|
||||||
حساب آزمایشی: <span dir="ltr">09121112222</span> / رمز: <span dir="ltr">admin123</span>
|
حساب آزمایشی: <span dir="ltr">09128081392</span> / رمز: <span dir="ltr">123456</span>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user