diff --git a/web/src/api/index.ts b/web/src/api/index.ts index 3b05f8b..a023c2a 100644 --- a/web/src/api/index.ts +++ b/web/src/api/index.ts @@ -601,7 +601,8 @@ export interface AppLogListResponse { export const LOG_CATEGORY = { SYSTEM_NOTICE: 'system_notice', - PUSH_LOG: 'push_log' + PUSH_LOG: 'push_log', + LOGIN_LOG: 'login_log' } as const export const LOG_LEVEL = { diff --git a/web/src/assets/index.css b/web/src/assets/index.css index 9243ce0..2fb7bd9 100644 --- a/web/src/assets/index.css +++ b/web/src/assets/index.css @@ -78,7 +78,7 @@ --accent: oklch(0.97 0 0); --accent-foreground: oklch(0.205 0 0); --destructive: oklch(0.577 0.245 27.325); - --destructive-foreground: oklch(0.577 0.245 27.325); + --destructive-foreground: oklch(0.985 0 0); --border: oklch(0.922 0 0); --input: oklch(0.922 0 0); --ring: oklch(0.708 0 0); @@ -114,7 +114,7 @@ --accent: oklch(0.32 0 0); --accent-foreground: oklch(0.985 0 0); --destructive: oklch(0.704 0.191 22.216); - --destructive-foreground: oklch(0.637 0.237 25.331); + --destructive-foreground: oklch(0.985 0 0); --border: oklch(1 0 0 / 12%); --input: oklch(1 0 0 / 15%); --ring: oklch(0.556 0 0); diff --git a/web/src/components/ui/alert-dialog/AlertDialogAction.vue b/web/src/components/ui/alert-dialog/AlertDialogAction.vue index 09cf6fc..eb198e8 100644 --- a/web/src/components/ui/alert-dialog/AlertDialogAction.vue +++ b/web/src/components/ui/alert-dialog/AlertDialogAction.vue @@ -4,15 +4,20 @@ import type { HTMLAttributes } from "vue" import { reactiveOmit } from "@vueuse/core" import { AlertDialogAction } from "reka-ui" import { cn } from "@/lib/utils" -import { buttonVariants } from '@/components/ui/button' +import { buttonVariants, type ButtonVariants } from '@/components/ui/button' -const props = defineProps() +const props = defineProps() -const delegatedProps = reactiveOmit(props, "class") +const delegatedProps = reactiveOmit(props, "class", "variant", "size") diff --git a/web/src/views/history/History.vue b/web/src/views/history/History.vue index c162462..da993c7 100644 --- a/web/src/views/history/History.vue +++ b/web/src/views/history/History.vue @@ -385,7 +385,7 @@ watch(() => route.query, (newQuery) => {
#{{ total - (currentPage - 1) * pageSize - index - }} + }} @@ -418,7 +418,7 @@ watch(() => route.query, (newQuery) => {
{{ formatDuration(log.duration) - }} + }} +
+ + + + + + 确认清空所有登录日志? + + 此操作将永久清空所有记录,操作后无法恢复。确认要继续吗? + + + + 取消 + + 确认清空 + + + + +
@@ -139,7 +187,7 @@ onMounted(loadLogs)
{{ log.username - }} + }} {{ log.ip }} @@ -151,7 +199,7 @@ onMounted(loadLogs) {{ log.created_at - }} + }}
diff --git a/web/src/views/loginlogs/tabs/SystemEventTab.vue b/web/src/views/loginlogs/tabs/SystemEventTab.vue index fdccb64..304af36 100644 --- a/web/src/views/loginlogs/tabs/SystemEventTab.vue +++ b/web/src/views/loginlogs/tabs/SystemEventTab.vue @@ -23,6 +23,16 @@ import { format } from 'date-fns' import { RefreshCw, Trash2, Search, Info, AlertTriangle, AlertCircle } from 'lucide-vue-next' +import { + AlertDialog, + AlertDialogAction, + AlertDialogCancel, + AlertDialogContent, + AlertDialogDescription, + AlertDialogFooter, + AlertDialogHeader, + AlertDialogTitle, +} from '@/components/ui/alert-dialog' import { useSiteSettings } from '@/composables/useSiteSettings' const { pageSize } = useSiteSettings() @@ -31,6 +41,7 @@ const logs = ref([]) const selectedLogId = ref(null) const total = ref(0) const loading = ref(false) +const showClearConfirm = ref(false) const filters = ref({ level: 'all', @@ -182,11 +193,28 @@ function onDialogClose(open: boolean) { - + + + + + 确认清空所有系统事件? + + 此操作将永久清空当前分类下的所有系统事件记录,操作后无法恢复。确认要继续吗? + + + + 取消 + + 确认清空 + + + +
diff --git a/web/src/views/notify/components/PushLog.vue b/web/src/views/notify/components/PushLog.vue index e36d59f..fdc2542 100644 --- a/web/src/views/notify/components/PushLog.vue +++ b/web/src/views/notify/components/PushLog.vue @@ -23,6 +23,16 @@ import { format } from 'date-fns' import { RefreshCw, Trash2, Check, X, Search } from 'lucide-vue-next' +import { + AlertDialog, + AlertDialogAction, + AlertDialogCancel, + AlertDialogContent, + AlertDialogDescription, + AlertDialogFooter, + AlertDialogHeader, + AlertDialogTitle, +} from '@/components/ui/alert-dialog' import { useSiteSettings } from '@/composables/useSiteSettings' @@ -32,6 +42,7 @@ const logs = ref([]) const selectedLogId = ref(null) const total = ref(0) const loading = ref(false) +const showClearConfirm = ref(false) const filters = ref({ status: 'all', @@ -172,11 +183,27 @@ function onDialogClose(open: boolean) {
- + + + + + 确认清空所有推送日志? + + 此操作将永久清空当前分类下的所有消息推送历史记录,操作后无法恢复。确认要继续吗? + + + + 取消 + + 确认清空 + + + +