feat: add notify icon read
This commit is contained in:
@@ -287,6 +287,20 @@ export const api = {
|
||||
deleteBinding: (id: string) => request('/notify/bindings/' + id, { method: 'DELETE' }),
|
||||
send: (data: { channel_id: string; title: string; text: string }) =>
|
||||
request<NotifyResult>('/notify/send', { method: 'POST', body: JSON.stringify(data) })
|
||||
},
|
||||
appLogs: {
|
||||
list: (params?: { page?: number; page_size?: number; category?: string; status?: string; level?: string; keyword?: string }) => {
|
||||
const query = new URLSearchParams()
|
||||
if (params?.page) query.set('page', String(params.page))
|
||||
if (params?.page_size) query.set('page_size', String(params.page_size))
|
||||
if (params?.category) query.set('category', params.category)
|
||||
if (params?.status) query.set('status', params.status)
|
||||
if (params?.level) query.set('level', params.level)
|
||||
if (params?.keyword) query.set('keyword', params.keyword)
|
||||
return request<AppLogListResponse>(`/app-logs?${query}`)
|
||||
},
|
||||
markAsRead: (data: { id?: string; category?: string }) => request('/app-logs/read', { method: 'POST', body: JSON.stringify(data) }),
|
||||
clear: (category: string) => request('/app-logs/clear', { method: 'POST', body: JSON.stringify({ category }) })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -561,4 +575,40 @@ export interface NotifyResult {
|
||||
error?: string
|
||||
}
|
||||
|
||||
export interface AppLog {
|
||||
id: string
|
||||
category: string
|
||||
title: string
|
||||
content: string
|
||||
level: string
|
||||
status: string
|
||||
ref_id: string
|
||||
error_msg: string
|
||||
created_at: string
|
||||
read_at: string | null
|
||||
}
|
||||
|
||||
export interface AppLogListResponse {
|
||||
data: AppLog[]
|
||||
total: number
|
||||
}
|
||||
|
||||
export const LOG_CATEGORY = {
|
||||
SYSTEM_NOTICE: 'system_notice',
|
||||
PUSH_LOG: 'push_log'
|
||||
} as const
|
||||
|
||||
export const LOG_LEVEL = {
|
||||
INFO: 'info',
|
||||
WARNING: 'warning',
|
||||
ERROR: 'error'
|
||||
} as const
|
||||
|
||||
export const LOG_STATUS = {
|
||||
UNREAD: 'unread',
|
||||
READ: 'read',
|
||||
SUCCESS: 'success',
|
||||
FAILED: 'failed'
|
||||
} as const
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, onUnmounted } from 'vue'
|
||||
import { Bell, Check } from 'lucide-vue-next'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'
|
||||
import { ScrollArea } from '@/components/ui/scroll-area'
|
||||
import { Badge } from '@/components/ui/badge'
|
||||
import { api, AppLog, LOG_CATEGORY, LOG_STATUS } from '@/api'
|
||||
import { toast } from 'vue-sonner'
|
||||
import { format } from 'date-fns'
|
||||
|
||||
const notices = ref<AppLog[]>([])
|
||||
const unreadCount = ref(0)
|
||||
const loading = ref(false)
|
||||
const open = ref(false)
|
||||
|
||||
async function fetchNotices() {
|
||||
try {
|
||||
const res = await api.appLogs.list({
|
||||
category: LOG_CATEGORY.SYSTEM_NOTICE,
|
||||
status: LOG_STATUS.UNREAD,
|
||||
page: 1,
|
||||
page_size: 50
|
||||
})
|
||||
notices.value = res.data || []
|
||||
unreadCount.value = notices.value.length
|
||||
} catch (error: any) {
|
||||
console.error('Failed to fetch notices:', error)
|
||||
}
|
||||
}
|
||||
|
||||
async function markAsRead(id: string) {
|
||||
try {
|
||||
await api.appLogs.markAsRead({ id })
|
||||
notices.value = notices.value.filter((n: AppLog) => n.id !== id)
|
||||
unreadCount.value = notices.value.length
|
||||
} catch (error: any) {
|
||||
toast.error(error.message || '标记已读失败')
|
||||
}
|
||||
}
|
||||
|
||||
async function markAllAsRead() {
|
||||
if (notices.value.length === 0) return
|
||||
loading.value = true
|
||||
try {
|
||||
await api.appLogs.markAsRead({ category: LOG_CATEGORY.SYSTEM_NOTICE })
|
||||
notices.value = []
|
||||
unreadCount.value = 0
|
||||
toast.success('已清空未读消息')
|
||||
open.value = false
|
||||
} catch (error: any) {
|
||||
toast.error(error.message || '全部已读失败')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
let timer: number
|
||||
onMounted(() => {
|
||||
fetchNotices()
|
||||
timer = window.setInterval(fetchNotices, 60000) // 每分钟拉取一次
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
if (timer) clearInterval(timer)
|
||||
})
|
||||
|
||||
function formatDate(dateStr: string) {
|
||||
if (!dateStr) return ''
|
||||
try {
|
||||
return format(new Date(dateStr), 'MM-dd HH:mm')
|
||||
} catch {
|
||||
return dateStr
|
||||
}
|
||||
}
|
||||
|
||||
function getLevelColor(level: string) {
|
||||
switch (level) {
|
||||
case 'error': return 'destructive'
|
||||
case 'warning': return 'warning'
|
||||
default: return 'secondary'
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Popover v-model:open="open">
|
||||
<PopoverTrigger asChild>
|
||||
<Button variant="ghost" size="icon" class="relative">
|
||||
<Bell class="h-5 w-5" />
|
||||
<span v-if="unreadCount > 0" class="absolute top-1 right-1 h-2 w-2 rounded-full bg-red-500 animate-pulse"></span>
|
||||
</Button>
|
||||
</PopoverTrigger>
|
||||
<PopoverContent class="w-80 p-0" align="end">
|
||||
<div class="flex items-center justify-between px-4 py-3 border-b">
|
||||
<span class="font-medium text-sm">系统通知 <span class="text-xs text-muted-foreground ml-1" v-if="unreadCount">({{ unreadCount }})</span></span>
|
||||
<Button variant="ghost" size="sm" class="h-auto p-0 text-xs text-muted-foreground hover:text-foreground" :disabled="loading || unreadCount === 0" @click="markAllAsRead">
|
||||
<Check class="h-3 w-3 mr-1" />
|
||||
全标已读
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<ScrollArea class="h-[300px]" v-if="notices.length > 0">
|
||||
<div class="flex flex-col">
|
||||
<div v-for="notice in notices" :key="notice.id" class="p-4 border-b last:border-0 hover:bg-muted/50 transition-colors group relative">
|
||||
<div class="flex items-start justify-between gap-2 mb-1 cursor-pointer" @click="markAsRead(notice.id)">
|
||||
<div class="flex-1 min-w-0">
|
||||
<div class="flex items-center gap-2 mb-1">
|
||||
<Badge :variant="getLevelColor(notice.level) as any" class="px-1.5 py-0 text-[10px]">{{ notice.level || 'info' }}</Badge>
|
||||
<span class="text-sm font-medium truncate">{{ notice.title }}</span>
|
||||
</div>
|
||||
<p class="text-xs text-muted-foreground line-clamp-2">{{ notice.content }}</p>
|
||||
<p class="text-[10px] text-muted-foreground mt-1">{{ formatDate(notice.created_at) }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ScrollArea>
|
||||
<div v-else class="py-8 text-center text-sm text-muted-foreground flex flex-col items-center">
|
||||
<Bell class="h-8 w-8 text-muted mb-2 opacity-20" />
|
||||
暂无新通知
|
||||
</div>
|
||||
</PopoverContent>
|
||||
</Popover>
|
||||
</template>
|
||||
@@ -5,6 +5,7 @@ import { resetAuthCache } from '@/router'
|
||||
import { LayoutDashboard, ListTodo, FileCode, Settings, LogOut, ScrollText, Terminal, Variable, KeyRound, Menu, X, Server, Globe, Bell } from 'lucide-vue-next'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import ThemeToggle from '@/components/ThemeToggle.vue'
|
||||
import SystemNotice from '@/components/SystemNotice.vue'
|
||||
import { api } from '@/api'
|
||||
import { useSiteSettings } from '@/composables/useSiteSettings'
|
||||
|
||||
@@ -150,7 +151,10 @@ onMounted(() => {
|
||||
<span class="sm:hidden">{{ sentenceContent }}</span>
|
||||
</span>
|
||||
</div>
|
||||
<ThemeToggle />
|
||||
<div class="flex items-center gap-2">
|
||||
<SystemNotice />
|
||||
<ThemeToggle />
|
||||
</div>
|
||||
</div>
|
||||
<div class="p-4 lg:p-6">
|
||||
<RouterView />
|
||||
|
||||
@@ -17,6 +17,7 @@ import ChannelList from './components/ChannelList.vue'
|
||||
import EventBinding from './components/EventBinding.vue'
|
||||
import ApiUsage from './components/ApiUsage.vue'
|
||||
import ChannelDialog from './components/ChannelDialog.vue'
|
||||
import PushLog from './components/PushLog.vue'
|
||||
|
||||
const activeTab = ref('channels')
|
||||
|
||||
@@ -322,9 +323,10 @@ onMounted(() => {
|
||||
<h2 class="text-xl sm:text-2xl font-bold tracking-tight">消息推送</h2>
|
||||
<p class="text-muted-foreground text-sm">配置通知渠道,绑定系统事件实现自动推送</p>
|
||||
</div>
|
||||
<TabsList class="w-full sm:w-auto grid grid-cols-3 sm:inline-flex h-9 gap-1 p-1">
|
||||
<TabsList class="w-full sm:w-auto grid grid-cols-4 sm:inline-flex h-9 gap-1 p-1">
|
||||
<TabsTrigger value="channels" class="text-xs px-3 py-1">渠道管理</TabsTrigger>
|
||||
<TabsTrigger value="events" class="text-xs px-3 py-1">事件绑定</TabsTrigger>
|
||||
<TabsTrigger value="logs" class="text-xs px-3 py-1">推送日志</TabsTrigger>
|
||||
<TabsTrigger value="api" class="text-xs px-3 py-1">脚本调用</TabsTrigger>
|
||||
</TabsList>
|
||||
</div>
|
||||
@@ -346,6 +348,11 @@ onMounted(() => {
|
||||
<ApiUsage :channels="channels" :channel-types="channelTypes" :api-token="apiToken"
|
||||
@generate-token="generateApiToken" @copy-token="copyApiToken" @copy-example="copyApiExample" />
|
||||
</TabsContent>
|
||||
|
||||
<!-- 推送日志 -->
|
||||
<TabsContent value="logs">
|
||||
<PushLog />
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
|
||||
<!-- 添加/编辑渠道弹窗 -->
|
||||
|
||||
@@ -235,7 +235,7 @@ const shellExample = computed(() => `curl -s -X POST "http://${host.value}/api/v
|
||||
<div v-for="ch in channels" :key="ch.id"
|
||||
class="flex items-center gap-2 text-xs bg-zinc-100/80 dark:bg-zinc-900 px-2 py-1.5 rounded border border-zinc-200 dark:border-zinc-800 hover:border-zinc-300 dark:hover:border-zinc-700 transition-colors group">
|
||||
<code class="text-primary font-bold tracking-tighter font-code"
|
||||
:title="ch.id">{{ ch.id.slice(0, 8) }}</code>
|
||||
:title="ch.id">{{ ch.id.slice(0, 8) }}...</code>
|
||||
<span class="text-zinc-600 dark:text-zinc-500 truncate max-w-[100px]">{{ ch.name }}</span>
|
||||
<Button variant="ghost" size="icon"
|
||||
class="h-5 w-5 ml-auto text-zinc-400 hover:text-zinc-800 dark:hover:text-zinc-200 hover:bg-zinc-200 dark:hover:bg-zinc-800 opacity-0 group-hover:opacity-100 transition-all rounded"
|
||||
|
||||
@@ -0,0 +1,274 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, computed } from 'vue'
|
||||
import { api, type AppLog, LOG_CATEGORY, LOG_STATUS } from '@/api'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Input } from '@/components/ui/input'
|
||||
import { Badge } from '@/components/ui/badge'
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectItem,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from '@/components/ui/select'
|
||||
import Pagination from '@/components/Pagination.vue'
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from '@/components/ui/dialog'
|
||||
import { toast } from 'vue-sonner'
|
||||
import { format } from 'date-fns'
|
||||
import {
|
||||
RefreshCw, Trash2, Check, X, Search
|
||||
} from 'lucide-vue-next'
|
||||
import { useSiteSettings } from '@/composables/useSiteSettings'
|
||||
|
||||
|
||||
const { pageSize } = useSiteSettings()
|
||||
|
||||
const logs = ref<AppLog[]>([])
|
||||
const selectedLogId = ref<string | null>(null)
|
||||
const total = ref(0)
|
||||
const loading = ref(false)
|
||||
|
||||
const filters = ref({
|
||||
status: 'all',
|
||||
keyword: '',
|
||||
page: 1
|
||||
})
|
||||
|
||||
let searchTimer: ReturnType<typeof setTimeout> | null = null
|
||||
|
||||
|
||||
const detailDialogProps = ref({
|
||||
open: false,
|
||||
title: '',
|
||||
content: '',
|
||||
error: ''
|
||||
})
|
||||
|
||||
async function fetchLogs() {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await api.appLogs.list({
|
||||
category: LOG_CATEGORY.PUSH_LOG,
|
||||
status: filters.value.status === 'all' ? undefined : filters.value.status,
|
||||
keyword: filters.value.keyword || undefined,
|
||||
page: filters.value.page,
|
||||
page_size: pageSize.value
|
||||
})
|
||||
logs.value = res.data || []
|
||||
total.value = res.total || 0
|
||||
} catch (e: any) {
|
||||
toast.error(e.message || '获取推送日志失败')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function handleSearch() {
|
||||
if (searchTimer) clearTimeout(searchTimer)
|
||||
searchTimer = setTimeout(() => {
|
||||
filters.value.page = 1
|
||||
fetchLogs()
|
||||
}, 300)
|
||||
}
|
||||
|
||||
function handlePageChange(page: number) {
|
||||
filters.value.page = page
|
||||
fetchLogs()
|
||||
}
|
||||
|
||||
function handleStatusChange(val: any) {
|
||||
if (val === null || val === undefined) return
|
||||
filters.value.status = String(val)
|
||||
filters.value.page = 1
|
||||
fetchLogs()
|
||||
}
|
||||
|
||||
function showDetail(log: AppLog) {
|
||||
selectedLogId.value = log.id
|
||||
detailDialogProps.value = {
|
||||
open: true,
|
||||
title: log.title,
|
||||
content: log.content,
|
||||
error: log.error_msg
|
||||
}
|
||||
}
|
||||
|
||||
async function handleClear() {
|
||||
try {
|
||||
await api.appLogs.clear(LOG_CATEGORY.PUSH_LOG)
|
||||
toast.success('清空成功')
|
||||
filters.value.page = 1
|
||||
fetchLogs()
|
||||
} catch (e: any) {
|
||||
toast.error('清空失败: ' + (e.message || ''))
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fetchLogs()
|
||||
})
|
||||
|
||||
const selectedLog = computed(() => logs.value.find((l: AppLog) => l.id === selectedLogId.value))
|
||||
|
||||
function getStatusBadgeClass(status: string) {
|
||||
switch (status) {
|
||||
case LOG_STATUS.SUCCESS:
|
||||
return 'bg-green-500/10 text-green-700 border-green-200/50 dark:bg-green-500/20 dark:text-green-400 dark:border-green-900/50'
|
||||
case LOG_STATUS.FAILED:
|
||||
return 'bg-red-500/10 text-red-700 border-red-200/50 dark:bg-red-500/20 dark:text-red-400 dark:border-red-900/50'
|
||||
default:
|
||||
return 'bg-secondary text-secondary-foreground border-transparent'
|
||||
}
|
||||
}
|
||||
|
||||
function getLogIndex(index: number) {
|
||||
return total.value - (filters.value.page - 1) * pageSize.value - index
|
||||
}
|
||||
|
||||
function formatDate(dateStr: string) {
|
||||
if (!dateStr) return '-'
|
||||
try {
|
||||
return format(new Date(dateStr), 'yyyy-MM-dd HH:mm:ss')
|
||||
} catch {
|
||||
return dateStr
|
||||
}
|
||||
}
|
||||
|
||||
function onDialogClose(open: boolean) {
|
||||
if (!open) {
|
||||
selectedLogId.value = null
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="space-y-6">
|
||||
<div class="flex items-center justify-between gap-2">
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="relative flex-1 sm:flex-none">
|
||||
<Search class="absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" />
|
||||
<Input v-model="filters.keyword" placeholder="搜索标题或内容..." class="h-9 pl-9 w-full sm:w-56 text-sm"
|
||||
@input="handleSearch" />
|
||||
</div>
|
||||
<div class="relative flex-1 sm:flex-none">
|
||||
<Select :model-value="filters.status" @update:model-value="handleStatusChange">
|
||||
<SelectTrigger class="h-9 w-full sm:w-28 text-sm">
|
||||
<SelectValue placeholder="状态" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="all">所有状态</SelectItem>
|
||||
<SelectItem :value="LOG_STATUS.SUCCESS">发送成功</SelectItem>
|
||||
<SelectItem :value="LOG_STATUS.FAILED">发送失败</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
<Button variant="outline" size="icon" class="h-9 w-9 shrink-0" @click="fetchLogs" :disabled="loading" title="刷新">
|
||||
<RefreshCw class="h-4 w-4" :class="{ 'animate-spin': loading }" />
|
||||
</Button>
|
||||
</div>
|
||||
<Button variant="outline"
|
||||
class="h-9 px-4 shrink-0 text-sm text-destructive hover:bg-destructive/10 hover:text-destructive border-destructive/20"
|
||||
@click="handleClear">
|
||||
<Trash2 class="h-4 w-4 sm:mr-2" /> <span class="hidden sm:inline" style="padding-left: 2px;">清空记录</span>
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div class="rounded-lg border bg-card overflow-x-auto">
|
||||
<!-- 表头 -->
|
||||
<div
|
||||
class="flex items-center gap-2 sm:gap-4 px-3 sm:px-4 py-2 border-b bg-muted/50 text-xs sm:text-sm text-muted-foreground font-medium sm:min-w-[700px]">
|
||||
<span class="w-12 sm:w-16 shrink-0">序号</span>
|
||||
<span class="w-40 sm:w-56 shrink-0">标题及渠道</span>
|
||||
<span class="hidden sm:flex sm:flex-1">内容详情</span>
|
||||
<span class="w-10 sm:w-16 shrink-0 text-center">状态</span>
|
||||
<span class="shrink-0 w-24 sm:w-40 sm:text-right">发送时间</span>
|
||||
</div>
|
||||
|
||||
<!-- 列表 -->
|
||||
<div class="divide-y sm:min-w-[700px]">
|
||||
<div v-if="logs.length === 0 && !loading" class="text-sm text-muted-foreground text-center py-8">
|
||||
暂无推送记录
|
||||
</div>
|
||||
<div v-for="(log, index) in logs" :key="log.id"
|
||||
class="flex items-center gap-2 sm:gap-4 px-3 sm:px-4 py-2 hover:bg-muted/50 transition-colors cursor-pointer group"
|
||||
:class="[selectedLogId === log.id && 'bg-accent/50']"
|
||||
@click="showDetail(log)">
|
||||
<span class="w-12 sm:w-16 shrink-0 text-muted-foreground text-xs sm:text-sm">#{{ getLogIndex(index) }}</span>
|
||||
<span class="w-40 sm:w-56 shrink-0 font-medium text-xs sm:text-sm truncate" :title="log.title">{{ log.title }}</span>
|
||||
<span class="hidden sm:flex sm:flex-1 font-medium text-xs sm:text-sm text-muted-foreground truncate" :title="log.content">
|
||||
{{ log.content || '-' }}
|
||||
</span>
|
||||
<span class="w-10 sm:w-16 shrink-0 flex justify-center">
|
||||
<span :class="['h-2 w-2 rounded-full', log.status === LOG_STATUS.SUCCESS ? 'bg-green-500 shadow-[0_0_8px_rgba(34,197,94,0.4)]' : 'bg-red-500 shadow-[0_0_8px_rgba(239,68,68,0.4)]']"></span>
|
||||
</span>
|
||||
<span class="shrink-0 w-24 sm:w-40 sm:text-right text-[10px] sm:text-xs text-muted-foreground font-mono">
|
||||
{{ formatDate(log.created_at) }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 分页 -->
|
||||
<Pagination :total="total" :page="filters.page" @update:page="handlePageChange" />
|
||||
</div>
|
||||
|
||||
<Dialog v-model:open="detailDialogProps.open" @update:open="onDialogClose">
|
||||
<DialogContent class="sm:max-w-2xl max-h-[90vh] flex flex-col p-0 overflow-hidden">
|
||||
<DialogHeader class="px-6 py-4 border-b bg-muted/20">
|
||||
<div class="flex items-center justify-between pr-8">
|
||||
<DialogTitle>日志详情</DialogTitle>
|
||||
<Badge variant="outline" :class="[
|
||||
'px-2 py-0.5 text-[10px] font-bold rounded-full border shadow-sm transition-all duration-300',
|
||||
selectedLog ? getStatusBadgeClass(selectedLog.status) : ''
|
||||
]">
|
||||
<div class="flex items-center gap-1.5 uppercase tracking-wider">
|
||||
<Check v-if="selectedLog?.status === LOG_STATUS.SUCCESS" class="h-3 w-3" />
|
||||
<X v-else class="h-3 w-3" />
|
||||
<span>{{ selectedLog?.status === LOG_STATUS.SUCCESS ? 'Success' : 'Failed' }}</span>
|
||||
</div>
|
||||
</Badge>
|
||||
</div>
|
||||
</DialogHeader>
|
||||
|
||||
<div class="flex-1 overflow-y-auto">
|
||||
<!-- 基础信息区 -->
|
||||
<div class="px-6 py-4 border-b space-y-3 bg-card">
|
||||
<div class="flex justify-between items-center text-sm">
|
||||
<span class="text-muted-foreground">标题</span>
|
||||
<span class="font-medium text-foreground">{{ detailDialogProps.title }}</span>
|
||||
</div>
|
||||
<div class="flex justify-between items-center text-sm">
|
||||
<span class="text-muted-foreground">发生时间</span>
|
||||
<span class="font-mono text-xs text-muted-foreground">{{ selectedLog ? formatDate(selectedLog.created_at) : '-' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 内容输出区 -->
|
||||
<div class="flex flex-col min-h-0 bg-muted/5">
|
||||
<div class="px-6 py-2.5 text-xs font-semibold text-muted-foreground border-b bg-muted/10 uppercase tracking-wider">
|
||||
推送内容
|
||||
</div>
|
||||
<div class="p-6">
|
||||
<pre v-if="detailDialogProps.content"
|
||||
class="text-xs font-mono bg-muted/30 p-4 rounded-lg border border-muted/50 whitespace-pre-wrap break-all leading-relaxed shadow-inner">{{ detailDialogProps.content }}</pre>
|
||||
<div v-else class="text-xs text-muted-foreground italic py-2">无推送内容</div>
|
||||
</div>
|
||||
|
||||
<template v-if="detailDialogProps.error">
|
||||
<div class="px-6 py-2.5 text-xs font-semibold text-red-500 border-y bg-red-500/5 uppercase tracking-wider">
|
||||
错误信息
|
||||
</div>
|
||||
<div class="p-6">
|
||||
<pre class="text-xs font-mono bg-red-500/5 text-red-600/90 p-4 rounded-lg border border-red-500/20 whitespace-pre-wrap break-all leading-relaxed shadow-inner">{{ detailDialogProps.error }}</pre>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user