@vitnode/core 1.2.0-canary.60 → 1.2.0-canary.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/scripts/get-config.js +15 -0
- package/dist/scripts/plugin.js +188 -0
- package/dist/scripts/prepare-database.js +177 -0
- package/dist/scripts/prepare-plugins-files.js +134 -0
- package/dist/scripts/run-interactive-shell-command.js +21 -0
- package/dist/scripts/scripts.js +39 -13
- package/dist/scripts/shared/file-utils.js +203 -0
- package/dist/src/api/adapters/sso/discord.js +1 -77
- package/dist/src/api/adapters/sso/facebook.js +1 -76
- package/dist/src/api/adapters/sso/google.js +1 -87
- package/dist/src/api/config.js +1 -67
- package/dist/src/api/lib/check-plugin-id.js +1 -43
- package/dist/src/api/lib/cron.js +1 -22
- package/dist/src/api/lib/logger-middleware.js +1 -35
- package/dist/src/api/lib/module.js +1 -22
- package/dist/src/api/lib/plugin.js +1 -22
- package/dist/src/api/lib/route.js +1 -27
- package/dist/src/api/lib/with-pagination.js +1 -83
- package/dist/src/api/middlewares/captcha.middleware.js +1 -63
- package/dist/src/api/middlewares/cron-auth.middleware.js +1 -19
- package/dist/src/api/middlewares/global.middleware.js +1 -93
- package/dist/src/api/middlewares/rate-limiter.middleware.js +1 -32
- package/dist/src/api/models/device.js +1 -61
- package/dist/src/api/models/email.js +1 -76
- package/dist/src/api/models/password.js +1 -36
- package/dist/src/api/models/session-admin.js +1 -106
- package/dist/src/api/models/session.js +1 -85
- package/dist/src/api/models/sso.js +1 -120
- package/dist/src/api/models/user/get-user-by-id.js +1 -19
- package/dist/src/api/models/user/sign-in-with-passwords.js +1 -22
- package/dist/src/api/models/user/sign-up.js +1 -73
- package/dist/src/api/models/user.js +1 -8
- package/dist/src/api/modules/admin/admin.module.js +1 -19
- package/dist/src/api/modules/admin/advanced/advanced.admin.module.js +1 -11
- package/dist/src/api/modules/admin/advanced/cron/cron.admin.module.js +1 -12
- package/dist/src/api/modules/admin/advanced/cron/routes/get.route.js +1 -66
- package/dist/src/api/modules/admin/advanced/cron/routes/run.route.js +1 -95
- package/dist/src/api/modules/admin/debug/debug.admin.module.js +1 -10
- package/dist/src/api/modules/admin/debug/routes/logs.route.js +1 -94
- package/dist/src/api/modules/admin/routes/session.route.js +1 -47
- package/dist/src/api/modules/admin/users/routes/list.route.js +1 -79
- package/dist/src/api/modules/admin/users/routes/users.route.js +1 -84
- package/dist/src/api/modules/admin/users/users.admin.module.js +1 -10
- package/dist/src/api/modules/cron/cron/clean.cron.js +1 -24
- package/dist/src/api/modules/cron/cron.module.js +1 -14
- package/dist/src/api/modules/cron/helpers/process-cron-jobs.d.ts.map +1 -1
- package/dist/src/api/modules/cron/helpers/process-cron-jobs.js +1 -76
- package/dist/src/api/modules/cron/routes/cron.route.js +1 -101
- package/dist/src/api/modules/middleware/middleware.module.js +1 -10
- package/dist/src/api/modules/middleware/route.js +1 -49
- package/dist/src/api/modules/users/avatar-color.js +1 -43
- package/dist/src/api/modules/users/routes/change-password.route.js +1 -58
- package/dist/src/api/modules/users/routes/reset-passowrd.route.js +1 -91
- package/dist/src/api/modules/users/routes/session.route.js +1 -46
- package/dist/src/api/modules/users/routes/sign-in.route.js +1 -71
- package/dist/src/api/modules/users/routes/sign-out.route.js +1 -43
- package/dist/src/api/modules/users/routes/sign-up.route.js +1 -77
- package/dist/src/api/modules/users/routes/test.route.js +1 -33
- package/dist/src/api/modules/users/sso/routes/callback.route.js +1 -52
- package/dist/src/api/modules/users/sso/routes/create-url.route.js +1 -36
- package/dist/src/api/modules/users/sso/sso.module.js +1 -12
- package/dist/src/api/modules/users/users.module.js +1 -26
- package/dist/src/api/plugin.js +1 -15
- package/dist/src/app/login/page.js +1 -16
- package/dist/src/app/login/reset-password/page.js +1 -18
- package/dist/src/app/login/sso/[providerId]/page.js +1 -10
- package/dist/src/app/register/page.js +1 -16
- package/dist/src/app_admin/core/advanced/cron/page.js +1 -42
- package/dist/src/app_admin/core/debug/page.js +1 -45
- package/dist/src/app_admin/core/page.js +1 -5
- package/dist/src/app_admin/core/test/page.js +1 -5
- package/dist/src/app_admin/core/users/page.js +1 -38
- package/dist/src/components/avatar.js +1 -14
- package/dist/src/components/confirm-action/confirm-action-alert-dialog.js +1 -42
- package/dist/src/components/confirm-action/content.js +1 -31
- package/dist/src/components/date-format.js +1 -41
- package/dist/src/components/form/auto-form.js +1 -103
- package/dist/src/components/form/common/desc.js +1 -9
- package/dist/src/components/form/common/label.js +1 -18
- package/dist/src/components/form/fields/checkbox.js +1 -37
- package/dist/src/components/form/fields/combobox-async.js +1 -123
- package/dist/src/components/form/fields/combobox.js +1 -87
- package/dist/src/components/form/fields/input.js +1 -39
- package/dist/src/components/form/fields/radio-group.js +1 -50
- package/dist/src/components/form/fields/select.js +1 -58
- package/dist/src/components/form/fields/switch.js +1 -36
- package/dist/src/components/form/fields/textarea.js +1 -36
- package/dist/src/components/i18n-provider.js +1 -43
- package/dist/src/components/logo-vitnode.js +1 -119
- package/dist/src/components/switchers/langs/language-switcher.js +1 -47
- package/dist/src/components/switchers/themes/theme-switcher.js +1 -28
- package/dist/src/components/table/content.js +1 -81
- package/dist/src/components/table/data-table.js +1 -68
- package/dist/src/components/table/order-table-head.js +1 -50
- package/dist/src/components/table/pagination.js +1 -122
- package/dist/src/components/tiptap/extension.js +1 -33
- package/dist/src/components/tiptap/toolbar/actions/alignment-action.js +1 -91
- package/dist/src/components/tiptap/toolbar/actions/bold-action.js +1 -39
- package/dist/src/components/tiptap/toolbar/actions/headings-action.js +1 -93
- package/dist/src/components/tiptap/toolbar/actions/italic-action.js +1 -38
- package/dist/src/components/tiptap/toolbar/actions/list-action.js +1 -61
- package/dist/src/components/tiptap/toolbar/actions/text-format-more/text-format-more.js +1 -59
- package/dist/src/components/tiptap/toolbar/actions/underline-action.js +1 -38
- package/dist/src/components/tiptap/toolbar/actions/undo-redo-actions.js +1 -63
- package/dist/src/components/tiptap/toolbar/actions/utils/tooltip-shortcut.js +1 -11
- package/dist/src/components/tiptap/toolbar/tiptap-toolbar.js +1 -55
- package/dist/src/components/tiptap/toolbar/use-toolbar-editor.js +1 -5
- package/dist/src/components/ui/accordion.js +1 -46
- package/dist/src/components/ui/alert-dialog.js +1 -123
- package/dist/src/components/ui/alert.js +1 -39
- package/dist/src/components/ui/badge.js +1 -28
- package/dist/src/components/ui/button-client.js +1 -57
- package/dist/src/components/ui/button.js +1 -32
- package/dist/src/components/ui/card.js +1 -52
- package/dist/src/components/ui/checkbox.js +1 -20
- package/dist/src/components/ui/collapsible.js +1 -22
- package/dist/src/components/ui/command.js +1 -98
- package/dist/src/components/ui/context-menu.js +1 -140
- package/dist/src/components/ui/dialog.js +1 -189
- package/dist/src/components/ui/drawer.js +1 -83
- package/dist/src/components/ui/dropdown-menu.js +1 -141
- package/dist/src/components/ui/editor-content.js +1 -10
- package/dist/src/components/ui/editor.js +1 -35
- package/dist/src/components/ui/form.js +1 -148
- package/dist/src/components/ui/header-content.js +1 -30
- package/dist/src/components/ui/hover-card.js +1 -29
- package/dist/src/components/ui/input-otp.js +1 -48
- package/dist/src/components/ui/input.js +1 -11
- package/dist/src/components/ui/label.js +1 -12
- package/dist/src/components/ui/loader.js +1 -16
- package/dist/src/components/ui/menubar.js +1 -151
- package/dist/src/components/ui/navigation-menu.js +1 -82
- package/dist/src/components/ui/popover.js +1 -35
- package/dist/src/components/ui/progress.js +1 -19
- package/dist/src/components/ui/radio-group.js +1 -27
- package/dist/src/components/ui/scroll-area.js +1 -33
- package/dist/src/components/ui/select.js +1 -113
- package/dist/src/components/ui/separator.js +1 -14
- package/dist/src/components/ui/sheet.js +1 -92
- package/dist/src/components/ui/sidebar.js +1 -433
- package/dist/src/components/ui/skeleton.js +1 -10
- package/dist/src/components/ui/slider.js +1 -50
- package/dist/src/components/ui/sonner.js +1 -26
- package/dist/src/components/ui/switch.js +1 -16
- package/dist/src/components/ui/table.js +1 -63
- package/dist/src/components/ui/tabs.js +1 -33
- package/dist/src/components/ui/textarea.js +1 -10
- package/dist/src/components/ui/toggle-group.js +1 -45
- package/dist/src/components/ui/toggle.js +1 -34
- package/dist/src/components/ui/tooltip.js +1 -57
- package/dist/src/config.js +1 -4
- package/dist/src/database/admins.js +1 -74
- package/dist/src/database/cron.js +1 -22
- package/dist/src/database/languages.js +1 -52
- package/dist/src/database/logs.js +1 -34
- package/dist/src/database/moderators.js +1 -37
- package/dist/src/database/roles.js +1 -13
- package/dist/src/database/sessions.js +1 -60
- package/dist/src/database/users.js +1 -145
- package/dist/src/drizzle.config.js +1 -67
- package/dist/src/emails/default-template.js +1 -99
- package/dist/src/emails/reset-password.js +1 -132
- package/dist/src/emails/ui/button.js +1 -36
- package/dist/src/emails/ui/card.js +1 -39
- package/dist/src/hooks/use-before-unload.js +1 -30
- package/dist/src/hooks/use-captcha.js +1 -122
- package/dist/src/hooks/use-mobile.js +1 -16
- package/dist/src/lib/api/get-middleware-api.js +1 -13
- package/dist/src/lib/api/get-next-cron-run-date.js +1 -14
- package/dist/src/lib/api/get-next-cron-run-date.test.js +1 -55
- package/dist/src/lib/api/get-session-admin-api.js +1 -19
- package/dist/src/lib/api/get-session-api.js +1 -14
- package/dist/src/lib/api/should-cron-job-run.js +1 -16
- package/dist/src/lib/api/should-cron-job-run.test.js +1 -213
- package/dist/src/lib/api/validate-cron-schedule.d.ts +2 -0
- package/dist/src/lib/api/validate-cron-schedule.d.ts.map +1 -0
- package/dist/src/lib/api/validate-cron-schedule.js +1 -0
- package/dist/src/lib/api/validate-cron-schedule.test.d.ts +2 -0
- package/dist/src/lib/api/validate-cron-schedule.test.d.ts.map +1 -0
- package/dist/src/lib/api/validate-cron-schedule.test.js +1 -0
- package/dist/src/lib/colors.js +1 -140
- package/dist/src/lib/colors.test.js +1 -173
- package/dist/src/lib/config.js +1 -14
- package/dist/src/lib/ctrl-or-command-character.js +1 -5
- package/dist/src/lib/fetcher/cookie-from-string-to-object.js +1 -12
- package/dist/src/lib/fetcher/cookie-from-string-to-object.test.js +1 -78
- package/dist/src/lib/fetcher/core.js +3 -48
- package/dist/src/lib/fetcher/helpers-server.js +1 -18
- package/dist/src/lib/fetcher/helpers.js +1 -16
- package/dist/src/lib/fetcher/helpers.test.js +1 -37
- package/dist/src/lib/fetcher/types.js +1 -1
- package/dist/src/lib/fetcher-client.js +1 -17
- package/dist/src/lib/fetcher.js +1 -33
- package/dist/src/lib/helpers/auto-form.js +1 -98
- package/dist/src/lib/helpers/auto-form.test.js +1 -336
- package/dist/src/lib/navigation.js +1 -11
- package/dist/src/lib/plugin.js +1 -3
- package/dist/src/lib/special-characters.js +1 -4
- package/dist/src/lib/special-characters.test.js +1 -56
- package/dist/src/lib/utils.js +1 -5
- package/dist/src/locales/en.json +308 -0
- package/dist/src/tests/setup.js +1 -6
- package/dist/src/views/admin/layouts/admin-layout.js +1 -73
- package/dist/src/views/admin/layouts/sidebar/nav/item.js +1 -98
- package/dist/src/views/admin/layouts/sidebar/nav/nav.js +1 -60
- package/dist/src/views/admin/layouts/sidebar/sidebar.js +1 -28
- package/dist/src/views/admin/layouts/sidebar/sign-out.js +1 -14
- package/dist/src/views/admin/layouts/user-bar/client.js +1 -69
- package/dist/src/views/admin/layouts/user-bar/user-bar.js +1 -32
- package/dist/src/views/admin/sign-in/sign-in-admin-view.js +1 -27
- package/dist/src/views/admin/views/core/advanced/cron/cron-table-view.js +1 -97
- package/dist/src/views/admin/views/core/advanced/cron/run-action/mutation-api.js +1 -23
- package/dist/src/views/admin/views/core/advanced/cron/run-action/run-action.js +1 -38
- package/dist/src/views/admin/views/core/dashboard/dashboard-admin-view.js +1 -44
- package/dist/src/views/admin/views/core/debug/actions/clear-cache/clear-cache.js +1 -35
- package/dist/src/views/admin/views/core/debug/actions/clear-cache/mutation-api.js +1 -5
- package/dist/src/views/admin/views/core/debug/system-logs/actions/more/content.js +1 -281
- package/dist/src/views/admin/views/core/debug/system-logs/actions/more/more.js +1 -67
- package/dist/src/views/admin/views/core/debug/system-logs/badges/badge-status.js +1 -14
- package/dist/src/views/admin/views/core/debug/system-logs/badges/badge-type-log.js +1 -30
- package/dist/src/views/admin/views/core/debug/system-logs/system-logs-view.js +1 -96
- package/dist/src/views/admin/views/core/test.js +1 -161
- package/dist/src/views/admin/views/core/users/users-admin-view.js +1 -89
- package/dist/src/views/auth/password-reset/change-password-form/form.js +1 -48
- package/dist/src/views/auth/password-reset/change-password-form/mutation-api.js +1 -22
- package/dist/src/views/auth/password-reset/change-password-form/use-form.js +1 -36
- package/dist/src/views/auth/password-reset/form/form.js +1 -104
- package/dist/src/views/auth/password-reset/form/mutation-api.js +1 -21
- package/dist/src/views/auth/password-reset/form/use-form.js +1 -33
- package/dist/src/views/auth/password-reset/password-reset-view.js +1 -37
- package/dist/src/views/auth/sign-in/form/form.js +1 -64
- package/dist/src/views/auth/sign-in/form/mutation-api.js +1 -33
- package/dist/src/views/auth/sign-in/form/use-form.js +1 -38
- package/dist/src/views/auth/sign-in/sign-in-view.js +1 -61
- package/dist/src/views/auth/sign-up/components/password-input.js +1 -96
- package/dist/src/views/auth/sign-up/email-confirmation-view.js +1 -55
- package/dist/src/views/auth/sign-up/form/form.js +1 -89
- package/dist/src/views/auth/sign-up/form/mutation-api.js +1 -30
- package/dist/src/views/auth/sign-up/form/use-form.js +1 -70
- package/dist/src/views/auth/sign-up/sign-up-view.js +1 -65
- package/dist/src/views/auth/sign-up/wrapper.js +1 -22
- package/dist/src/views/auth/sso/buttons/client.js +1 -22
- package/dist/src/views/auth/sso/buttons/mutation-api.js +1 -24
- package/dist/src/views/auth/sso/buttons/sso-buttons.js +1 -56
- package/dist/src/views/auth/sso/callback/callback-sso-view.js +1 -32
- package/dist/src/views/auth/sso/callback/client/client.js +1 -68
- package/dist/src/views/auth/sso/callback/client/mutation-api.js +1 -32
- package/dist/src/views/error/back-button.js +1 -14
- package/dist/src/views/error/error-view.js +1 -58
- package/dist/src/views/error/global-error-view.js +1 -50
- package/dist/src/views/layouts/provider.js +1 -44
- package/dist/src/views/layouts/root-layout.js +1 -25
- package/dist/src/views/layouts/theme/header/header.js +1 -38
- package/dist/src/views/layouts/theme/header/user/auth/auth.js +1 -33
- package/dist/src/views/layouts/theme/header/user/auth/client.js +1 -47
- package/dist/src/views/layouts/theme/header/user/auth/log-out-mutation-api.js +1 -27
- package/dist/src/views/layouts/theme/header/user/user.js +1 -32
- package/dist/src/views/layouts/theme/layout.js +1 -16
- package/dist/src/vitnode.config.js +1 -42
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/tsup.config.js +18 -0
- package/dist/vitest.config.d.ts.map +1 -1
- package/dist/vitest.config.js +49 -0
- package/eslint.config.mjs +2 -0
- package/package.json +6 -10
- package/dist/src/api/adapters/cron/node-cron.adapter.d.ts +0 -3
- package/dist/src/api/adapters/cron/node-cron.adapter.d.ts.map +0 -1
- package/dist/src/api/adapters/cron/node-cron.adapter.js +0 -11
- package/dist/src/api/adapters/email/nodemailer.d.ts +0 -10
- package/dist/src/api/adapters/email/nodemailer.d.ts.map +0 -1
- package/dist/src/api/adapters/email/nodemailer.js +0 -30
- package/dist/src/api/adapters/email/resend.d.ts +0 -6
- package/dist/src/api/adapters/email/resend.d.ts.map +0 -1
- package/dist/src/api/adapters/email/resend.js +0 -21
|
@@ -1,281 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { CalendarIcon, GlobeIcon, HashIcon, PlugIcon, ServerIcon, UserIcon } from "lucide-react";
|
|
3
|
-
import { useTranslations } from "next-intl";
|
|
4
|
-
import { DateFormat } from "../../../../../../../../components/date-format.js";
|
|
5
|
-
import { Badge } from "../../../../../../../../components/ui/badge.js";
|
|
6
|
-
import { Card, CardContent, CardHeader, CardTitle } from "../../../../../../../../components/ui/card.js";
|
|
7
|
-
import { Input } from "../../../../../../../../components/ui/input.js";
|
|
8
|
-
import { Label } from "../../../../../../../../components/ui/label.js";
|
|
9
|
-
import { Textarea } from "../../../../../../../../components/ui/textarea.js";
|
|
10
|
-
import { Link } from "../../../../../../../../lib/navigation.js";
|
|
11
|
-
import { BadgeStatus } from "../../badges/badge-status.js";
|
|
12
|
-
import { BadgeTypeLog } from "../../badges/badge-type-log.js";
|
|
13
|
-
export const ContentMoreActionSystemLogs = ({ content, ipAddress, pluginId, createdAt, type, id, method, path, userAgent, statusCode, user })=>{
|
|
14
|
-
const t = useTranslations("admin.debug.logs.more");
|
|
15
|
-
return /*#__PURE__*/ _jsxs("div", {
|
|
16
|
-
className: "space-y-6",
|
|
17
|
-
children: [
|
|
18
|
-
/*#__PURE__*/ _jsxs(Card, {
|
|
19
|
-
children: [
|
|
20
|
-
/*#__PURE__*/ _jsx(CardHeader, {
|
|
21
|
-
children: /*#__PURE__*/ _jsxs(CardTitle, {
|
|
22
|
-
className: "flex items-center gap-2",
|
|
23
|
-
children: [
|
|
24
|
-
/*#__PURE__*/ _jsx(HashIcon, {
|
|
25
|
-
className: "size-4"
|
|
26
|
-
}),
|
|
27
|
-
t("log_overview.title")
|
|
28
|
-
]
|
|
29
|
-
})
|
|
30
|
-
}),
|
|
31
|
-
/*#__PURE__*/ _jsxs(CardContent, {
|
|
32
|
-
className: "space-y-6",
|
|
33
|
-
children: [
|
|
34
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
35
|
-
className: "grid grid-cols-1 gap-4 md:grid-cols-3",
|
|
36
|
-
children: [
|
|
37
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
38
|
-
className: "space-y-2",
|
|
39
|
-
children: [
|
|
40
|
-
/*#__PURE__*/ _jsx(Label, {
|
|
41
|
-
className: "text-muted-foreground text-xs font-medium",
|
|
42
|
-
htmlFor: "log-type",
|
|
43
|
-
children: t("log_overview.log_type")
|
|
44
|
-
}),
|
|
45
|
-
/*#__PURE__*/ _jsx(BadgeTypeLog, {
|
|
46
|
-
type: type
|
|
47
|
-
})
|
|
48
|
-
]
|
|
49
|
-
}),
|
|
50
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
51
|
-
className: "space-y-2",
|
|
52
|
-
children: [
|
|
53
|
-
/*#__PURE__*/ _jsx(Label, {
|
|
54
|
-
className: "text-muted-foreground text-xs font-medium",
|
|
55
|
-
children: t("log_overview.status_code")
|
|
56
|
-
}),
|
|
57
|
-
/*#__PURE__*/ _jsx(BadgeStatus, {
|
|
58
|
-
statusCode: statusCode
|
|
59
|
-
})
|
|
60
|
-
]
|
|
61
|
-
}),
|
|
62
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
63
|
-
className: "space-y-2",
|
|
64
|
-
children: [
|
|
65
|
-
/*#__PURE__*/ _jsx(Label, {
|
|
66
|
-
className: "text-muted-foreground text-xs font-medium",
|
|
67
|
-
htmlFor: "log-id",
|
|
68
|
-
children: t("log_overview.log_id")
|
|
69
|
-
}),
|
|
70
|
-
/*#__PURE__*/ _jsx(Input, {
|
|
71
|
-
id: "log-id",
|
|
72
|
-
readOnly: true,
|
|
73
|
-
value: `#${id}`
|
|
74
|
-
})
|
|
75
|
-
]
|
|
76
|
-
})
|
|
77
|
-
]
|
|
78
|
-
}),
|
|
79
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
80
|
-
className: "grid grid-cols-1 gap-4 md:grid-cols-3",
|
|
81
|
-
children: [
|
|
82
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
83
|
-
className: "space-y-2",
|
|
84
|
-
children: [
|
|
85
|
-
/*#__PURE__*/ _jsxs(Label, {
|
|
86
|
-
className: "text-muted-foreground flex items-center gap-1 text-xs font-medium",
|
|
87
|
-
htmlFor: "created-at",
|
|
88
|
-
children: [
|
|
89
|
-
/*#__PURE__*/ _jsx(CalendarIcon, {
|
|
90
|
-
className: "size-3"
|
|
91
|
-
}),
|
|
92
|
-
t("log_overview.created_at")
|
|
93
|
-
]
|
|
94
|
-
}),
|
|
95
|
-
/*#__PURE__*/ _jsx("div", {
|
|
96
|
-
className: "text-sm",
|
|
97
|
-
id: "created-at",
|
|
98
|
-
children: /*#__PURE__*/ _jsx(DateFormat, {
|
|
99
|
-
date: createdAt
|
|
100
|
-
})
|
|
101
|
-
})
|
|
102
|
-
]
|
|
103
|
-
}),
|
|
104
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
105
|
-
className: "space-y-2",
|
|
106
|
-
children: [
|
|
107
|
-
/*#__PURE__*/ _jsxs(Label, {
|
|
108
|
-
className: "text-muted-foreground flex items-center gap-1 text-xs font-medium",
|
|
109
|
-
htmlFor: "plugin-id",
|
|
110
|
-
children: [
|
|
111
|
-
/*#__PURE__*/ _jsx(PlugIcon, {
|
|
112
|
-
className: "size-3"
|
|
113
|
-
}),
|
|
114
|
-
t("log_overview.plugin")
|
|
115
|
-
]
|
|
116
|
-
}),
|
|
117
|
-
/*#__PURE__*/ _jsx(Input, {
|
|
118
|
-
id: "plugin-id",
|
|
119
|
-
readOnly: true,
|
|
120
|
-
value: pluginId
|
|
121
|
-
})
|
|
122
|
-
]
|
|
123
|
-
}),
|
|
124
|
-
user && /*#__PURE__*/ _jsxs("div", {
|
|
125
|
-
className: "space-y-2",
|
|
126
|
-
children: [
|
|
127
|
-
/*#__PURE__*/ _jsxs(Label, {
|
|
128
|
-
className: "text-muted-foreground flex items-center gap-1 text-xs font-medium",
|
|
129
|
-
htmlFor: "user-link",
|
|
130
|
-
children: [
|
|
131
|
-
/*#__PURE__*/ _jsx(UserIcon, {
|
|
132
|
-
className: "size-3"
|
|
133
|
-
}),
|
|
134
|
-
t("log_overview.user")
|
|
135
|
-
]
|
|
136
|
-
}),
|
|
137
|
-
/*#__PURE__*/ _jsxs(Link, {
|
|
138
|
-
className: "border-input bg-background hover:bg-accent hover:text-accent-foreground block rounded-md border px-3 py-2 text-sm font-medium",
|
|
139
|
-
href: `/admin/core/users/${user.id}`,
|
|
140
|
-
id: "user-link",
|
|
141
|
-
children: [
|
|
142
|
-
user.name,
|
|
143
|
-
" (#",
|
|
144
|
-
user.id,
|
|
145
|
-
")"
|
|
146
|
-
]
|
|
147
|
-
})
|
|
148
|
-
]
|
|
149
|
-
})
|
|
150
|
-
]
|
|
151
|
-
})
|
|
152
|
-
]
|
|
153
|
-
})
|
|
154
|
-
]
|
|
155
|
-
}),
|
|
156
|
-
/*#__PURE__*/ _jsxs(Card, {
|
|
157
|
-
children: [
|
|
158
|
-
/*#__PURE__*/ _jsx(CardHeader, {
|
|
159
|
-
children: /*#__PURE__*/ _jsxs(CardTitle, {
|
|
160
|
-
className: "flex items-center gap-2",
|
|
161
|
-
children: [
|
|
162
|
-
/*#__PURE__*/ _jsx(GlobeIcon, {
|
|
163
|
-
className: "size-4"
|
|
164
|
-
}),
|
|
165
|
-
t("request_information.title")
|
|
166
|
-
]
|
|
167
|
-
})
|
|
168
|
-
}),
|
|
169
|
-
/*#__PURE__*/ _jsxs(CardContent, {
|
|
170
|
-
className: "space-y-6",
|
|
171
|
-
children: [
|
|
172
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
173
|
-
className: "grid grid-cols-1 gap-6 md:grid-cols-2",
|
|
174
|
-
children: [
|
|
175
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
176
|
-
className: "space-y-3",
|
|
177
|
-
children: [
|
|
178
|
-
/*#__PURE__*/ _jsx(Label, {
|
|
179
|
-
className: "text-muted-foreground text-xs font-medium",
|
|
180
|
-
htmlFor: "ip-address",
|
|
181
|
-
children: t("request_information.ip_address")
|
|
182
|
-
}),
|
|
183
|
-
/*#__PURE__*/ _jsx(Input, {
|
|
184
|
-
id: "ip-address",
|
|
185
|
-
readOnly: true,
|
|
186
|
-
value: ipAddress
|
|
187
|
-
})
|
|
188
|
-
]
|
|
189
|
-
}),
|
|
190
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
191
|
-
className: "space-y-3",
|
|
192
|
-
children: [
|
|
193
|
-
/*#__PURE__*/ _jsx(Label, {
|
|
194
|
-
className: "text-muted-foreground text-xs font-medium",
|
|
195
|
-
htmlFor: "request-method",
|
|
196
|
-
children: t("request_information.request_method")
|
|
197
|
-
}),
|
|
198
|
-
/*#__PURE__*/ _jsx("div", {
|
|
199
|
-
className: "flex",
|
|
200
|
-
children: /*#__PURE__*/ _jsx(Badge, {
|
|
201
|
-
className: "px-3 py-1",
|
|
202
|
-
id: "request-method",
|
|
203
|
-
variant: "outline",
|
|
204
|
-
children: method
|
|
205
|
-
})
|
|
206
|
-
})
|
|
207
|
-
]
|
|
208
|
-
})
|
|
209
|
-
]
|
|
210
|
-
}),
|
|
211
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
212
|
-
className: "space-y-3",
|
|
213
|
-
children: [
|
|
214
|
-
/*#__PURE__*/ _jsx(Label, {
|
|
215
|
-
className: "text-muted-foreground text-xs font-medium",
|
|
216
|
-
htmlFor: "request-url",
|
|
217
|
-
children: t("request_information.request_url")
|
|
218
|
-
}),
|
|
219
|
-
/*#__PURE__*/ _jsx(Input, {
|
|
220
|
-
id: "request-url",
|
|
221
|
-
readOnly: true,
|
|
222
|
-
value: path
|
|
223
|
-
})
|
|
224
|
-
]
|
|
225
|
-
}),
|
|
226
|
-
userAgent && /*#__PURE__*/ _jsxs("div", {
|
|
227
|
-
className: "space-y-3",
|
|
228
|
-
children: [
|
|
229
|
-
/*#__PURE__*/ _jsx(Label, {
|
|
230
|
-
className: "text-muted-foreground text-xs font-medium",
|
|
231
|
-
htmlFor: "user-agent",
|
|
232
|
-
children: t("request_information.user_agent")
|
|
233
|
-
}),
|
|
234
|
-
/*#__PURE__*/ _jsx(Textarea, {
|
|
235
|
-
className: "resize-none font-mono text-sm",
|
|
236
|
-
id: "user-agent",
|
|
237
|
-
readOnly: true,
|
|
238
|
-
value: userAgent
|
|
239
|
-
})
|
|
240
|
-
]
|
|
241
|
-
})
|
|
242
|
-
]
|
|
243
|
-
})
|
|
244
|
-
]
|
|
245
|
-
}),
|
|
246
|
-
/*#__PURE__*/ _jsxs(Card, {
|
|
247
|
-
children: [
|
|
248
|
-
/*#__PURE__*/ _jsx(CardHeader, {
|
|
249
|
-
children: /*#__PURE__*/ _jsxs(CardTitle, {
|
|
250
|
-
className: "flex items-center gap-2",
|
|
251
|
-
children: [
|
|
252
|
-
/*#__PURE__*/ _jsx(ServerIcon, {
|
|
253
|
-
className: "size-4"
|
|
254
|
-
}),
|
|
255
|
-
t("log_content.title")
|
|
256
|
-
]
|
|
257
|
-
})
|
|
258
|
-
}),
|
|
259
|
-
/*#__PURE__*/ _jsx(CardContent, {
|
|
260
|
-
children: /*#__PURE__*/ _jsxs("div", {
|
|
261
|
-
className: "space-y-2",
|
|
262
|
-
children: [
|
|
263
|
-
/*#__PURE__*/ _jsx(Label, {
|
|
264
|
-
className: "text-muted-foreground text-xs font-medium",
|
|
265
|
-
htmlFor: "log-content",
|
|
266
|
-
children: t("log_content.full_log")
|
|
267
|
-
}),
|
|
268
|
-
/*#__PURE__*/ _jsx(Textarea, {
|
|
269
|
-
className: "min-h-[120px] font-mono text-sm",
|
|
270
|
-
id: "log-content",
|
|
271
|
-
readOnly: true,
|
|
272
|
-
value: content
|
|
273
|
-
})
|
|
274
|
-
]
|
|
275
|
-
})
|
|
276
|
-
})
|
|
277
|
-
]
|
|
278
|
-
})
|
|
279
|
-
]
|
|
280
|
-
});
|
|
281
|
-
};
|
|
1
|
+
import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{CalendarIcon,GlobeIcon,HashIcon,PlugIcon,ServerIcon,UserIcon}from"lucide-react";import{useTranslations}from"next-intl";import{DateFormat}from"../../../../../../../../components/date-format.js";import{Badge}from"../../../../../../../../components/ui/badge.js";import{Card,CardContent,CardHeader,CardTitle}from"../../../../../../../../components/ui/card.js";import{Input}from"../../../../../../../../components/ui/input.js";import{Label}from"../../../../../../../../components/ui/label.js";import{Textarea}from"../../../../../../../../components/ui/textarea.js";import{Link}from"../../../../../../../../lib/navigation.js";import{BadgeStatus}from"../../badges/badge-status.js";import{BadgeTypeLog}from"../../badges/badge-type-log.js";export const ContentMoreActionSystemLogs=({content,ipAddress,pluginId,createdAt,type,id,method,path,userAgent,statusCode,user})=>{const t=useTranslations("admin.debug.logs.more");return _jsxs("div",{className:"space-y-6",children:[_jsxs(Card,{children:[_jsx(CardHeader,{children:_jsxs(CardTitle,{className:"flex items-center gap-2",children:[_jsx(HashIcon,{className:"size-4"}),t("log_overview.title")]})}),_jsxs(CardContent,{className:"space-y-6",children:[_jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[_jsxs("div",{className:"space-y-2",children:[_jsx(Label,{className:"text-muted-foreground text-xs font-medium",htmlFor:"log-type",children:t("log_overview.log_type")}),_jsx(BadgeTypeLog,{type:type})]}),_jsxs("div",{className:"space-y-2",children:[_jsx(Label,{className:"text-muted-foreground text-xs font-medium",children:t("log_overview.status_code")}),_jsx(BadgeStatus,{statusCode:statusCode})]}),_jsxs("div",{className:"space-y-2",children:[_jsx(Label,{className:"text-muted-foreground text-xs font-medium",htmlFor:"log-id",children:t("log_overview.log_id")}),_jsx(Input,{id:"log-id",readOnly:true,value:`#${id}`})]})]}),_jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[_jsxs("div",{className:"space-y-2",children:[_jsxs(Label,{className:"text-muted-foreground flex items-center gap-1 text-xs font-medium",htmlFor:"created-at",children:[_jsx(CalendarIcon,{className:"size-3"}),t("log_overview.created_at")]}),_jsx("div",{className:"text-sm",id:"created-at",children:_jsx(DateFormat,{date:createdAt})})]}),_jsxs("div",{className:"space-y-2",children:[_jsxs(Label,{className:"text-muted-foreground flex items-center gap-1 text-xs font-medium",htmlFor:"plugin-id",children:[_jsx(PlugIcon,{className:"size-3"}),t("log_overview.plugin")]}),_jsx(Input,{id:"plugin-id",readOnly:true,value:pluginId})]}),user&&_jsxs("div",{className:"space-y-2",children:[_jsxs(Label,{className:"text-muted-foreground flex items-center gap-1 text-xs font-medium",htmlFor:"user-link",children:[_jsx(UserIcon,{className:"size-3"}),t("log_overview.user")]}),_jsxs(Link,{className:"border-input bg-background hover:bg-accent hover:text-accent-foreground block rounded-md border px-3 py-2 text-sm font-medium",href:`/admin/core/users/${user.id}`,id:"user-link",children:[user.name," (#",user.id,")"]})]})]})]})]}),_jsxs(Card,{children:[_jsx(CardHeader,{children:_jsxs(CardTitle,{className:"flex items-center gap-2",children:[_jsx(GlobeIcon,{className:"size-4"}),t("request_information.title")]})}),_jsxs(CardContent,{className:"space-y-6",children:[_jsxs("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2",children:[_jsxs("div",{className:"space-y-3",children:[_jsx(Label,{className:"text-muted-foreground text-xs font-medium",htmlFor:"ip-address",children:t("request_information.ip_address")}),_jsx(Input,{id:"ip-address",readOnly:true,value:ipAddress})]}),_jsxs("div",{className:"space-y-3",children:[_jsx(Label,{className:"text-muted-foreground text-xs font-medium",htmlFor:"request-method",children:t("request_information.request_method")}),_jsx("div",{className:"flex",children:_jsx(Badge,{className:"px-3 py-1",id:"request-method",variant:"outline",children:method})})]})]}),_jsxs("div",{className:"space-y-3",children:[_jsx(Label,{className:"text-muted-foreground text-xs font-medium",htmlFor:"request-url",children:t("request_information.request_url")}),_jsx(Input,{id:"request-url",readOnly:true,value:path})]}),userAgent&&_jsxs("div",{className:"space-y-3",children:[_jsx(Label,{className:"text-muted-foreground text-xs font-medium",htmlFor:"user-agent",children:t("request_information.user_agent")}),_jsx(Textarea,{className:"resize-none font-mono text-sm",id:"user-agent",readOnly:true,value:userAgent})]})]})]}),_jsxs(Card,{children:[_jsx(CardHeader,{children:_jsxs(CardTitle,{className:"flex items-center gap-2",children:[_jsx(ServerIcon,{className:"size-4"}),t("log_content.title")]})}),_jsx(CardContent,{children:_jsxs("div",{className:"space-y-2",children:[_jsx(Label,{className:"text-muted-foreground text-xs font-medium",htmlFor:"log-content",children:t("log_content.full_log")}),_jsx(Textarea,{className:"min-h-[120px] font-mono text-sm",id:"log-content",readOnly:true,value:content})]})})]})]})};
|
|
@@ -1,67 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { SearchIcon } from "lucide-react";
|
|
4
|
-
import { useTranslations } from "next-intl";
|
|
5
|
-
import dynamic from "next/dynamic";
|
|
6
|
-
import React from "react";
|
|
7
|
-
import { Button } from "../../../../../../../../components/ui/button.js";
|
|
8
|
-
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger } from "../../../../../../../../components/ui/dialog.js";
|
|
9
|
-
import { Loader } from "../../../../../../../../components/ui/loader.js";
|
|
10
|
-
import { TooltipWithContent } from "../../../../../../../../components/ui/tooltip.js";
|
|
11
|
-
const ContentMoreActionSystemLogs = dynamic(async ()=>import("./content.js").then((module)=>({
|
|
12
|
-
default: module.ContentMoreActionSystemLogs
|
|
13
|
-
})));
|
|
14
|
-
export const MoreActionSystemLogs = (props)=>{
|
|
15
|
-
const t = useTranslations("admin.debug.logs.more");
|
|
16
|
-
return /*#__PURE__*/ _jsxs(Dialog, {
|
|
17
|
-
children: [
|
|
18
|
-
/*#__PURE__*/ _jsx(TooltipWithContent, {
|
|
19
|
-
text: t("title"),
|
|
20
|
-
children: /*#__PURE__*/ _jsx(DialogTrigger, {
|
|
21
|
-
asChild: true,
|
|
22
|
-
children: /*#__PURE__*/ _jsx(Button, {
|
|
23
|
-
"aria-label": t("title"),
|
|
24
|
-
size: "icon",
|
|
25
|
-
variant: "ghost",
|
|
26
|
-
children: /*#__PURE__*/ _jsx(SearchIcon, {})
|
|
27
|
-
})
|
|
28
|
-
})
|
|
29
|
-
}),
|
|
30
|
-
/*#__PURE__*/ _jsxs(DialogContent, {
|
|
31
|
-
className: "sm:max-w-4xl",
|
|
32
|
-
children: [
|
|
33
|
-
/*#__PURE__*/ _jsxs(DialogHeader, {
|
|
34
|
-
children: [
|
|
35
|
-
/*#__PURE__*/ _jsxs(DialogTitle, {
|
|
36
|
-
className: "flex items-center gap-2",
|
|
37
|
-
children: [
|
|
38
|
-
/*#__PURE__*/ _jsx(SearchIcon, {
|
|
39
|
-
className: "size-5"
|
|
40
|
-
}),
|
|
41
|
-
t("title")
|
|
42
|
-
]
|
|
43
|
-
}),
|
|
44
|
-
/*#__PURE__*/ _jsx(DialogDescription, {
|
|
45
|
-
children: t.rich("desc", {
|
|
46
|
-
logId: ()=>/*#__PURE__*/ _jsxs("span", {
|
|
47
|
-
className: "font-semibold",
|
|
48
|
-
children: [
|
|
49
|
-
"#",
|
|
50
|
-
props.id
|
|
51
|
-
]
|
|
52
|
-
})
|
|
53
|
-
})
|
|
54
|
-
})
|
|
55
|
-
]
|
|
56
|
-
}),
|
|
57
|
-
/*#__PURE__*/ _jsx(React.Suspense, {
|
|
58
|
-
fallback: /*#__PURE__*/ _jsx(Loader, {}),
|
|
59
|
-
children: /*#__PURE__*/ _jsx(ContentMoreActionSystemLogs, {
|
|
60
|
-
...props
|
|
61
|
-
})
|
|
62
|
-
})
|
|
63
|
-
]
|
|
64
|
-
})
|
|
65
|
-
]
|
|
66
|
-
});
|
|
67
|
-
};
|
|
1
|
+
"use client";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{SearchIcon}from"lucide-react";import{useTranslations}from"next-intl";import dynamic from"next/dynamic";import React from"react";import{Button}from"../../../../../../../../components/ui/button.js";import{Dialog,DialogContent,DialogDescription,DialogHeader,DialogTitle,DialogTrigger}from"../../../../../../../../components/ui/dialog.js";import{Loader}from"../../../../../../../../components/ui/loader.js";import{TooltipWithContent}from"../../../../../../../../components/ui/tooltip.js";const ContentMoreActionSystemLogs=dynamic(async()=>import("./content.js").then(module=>({default:module.ContentMoreActionSystemLogs})));export const MoreActionSystemLogs=props=>{const t=useTranslations("admin.debug.logs.more");return _jsxs(Dialog,{children:[_jsx(TooltipWithContent,{text:t("title"),children:_jsx(DialogTrigger,{asChild:true,children:_jsx(Button,{"aria-label":t("title"),size:"icon",variant:"ghost",children:_jsx(SearchIcon,{})})})}),_jsxs(DialogContent,{className:"sm:max-w-4xl",children:[_jsxs(DialogHeader,{children:[_jsxs(DialogTitle,{className:"flex items-center gap-2",children:[_jsx(SearchIcon,{className:"size-5"}),t("title")]}),_jsx(DialogDescription,{children:t.rich("desc",{logId:()=>_jsxs("span",{className:"font-semibold",children:["#",props.id]})})})]}),_jsx(React.Suspense,{fallback:_jsx(Loader,{}),children:_jsx(ContentMoreActionSystemLogs,{...props})})]})]})};
|
|
@@ -1,14 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Badge } from "../../../../../../../components/ui/badge.js";
|
|
3
|
-
export const BadgeStatus = ({ statusCode })=>{
|
|
4
|
-
let variant = "secondary";
|
|
5
|
-
if (statusCode >= 200 && statusCode < 300) {
|
|
6
|
-
variant = "default";
|
|
7
|
-
} else if (statusCode >= 400) {
|
|
8
|
-
variant = "destructive";
|
|
9
|
-
}
|
|
10
|
-
return /*#__PURE__*/ _jsx(Badge, {
|
|
11
|
-
variant: variant,
|
|
12
|
-
children: statusCode
|
|
13
|
-
});
|
|
14
|
-
};
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import{Badge}from"../../../../../../../components/ui/badge.js";export const BadgeStatus=({statusCode})=>{let variant="secondary";if(statusCode>=200&&statusCode<300){variant="default"}else if(statusCode>=400){variant="destructive"}return _jsx(Badge,{variant:variant,children:statusCode})};
|
|
@@ -1,30 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { TriangleAlertIcon, XIcon } from "lucide-react";
|
|
3
|
-
import { useTranslations } from "next-intl";
|
|
4
|
-
import { Badge } from "../../../../../../../components/ui/badge.js";
|
|
5
|
-
export const BadgeTypeLog = ({ type })=>{
|
|
6
|
-
const t = useTranslations("admin.debug.logs.types");
|
|
7
|
-
if (type === "warn") {
|
|
8
|
-
return /*#__PURE__*/ _jsxs(Badge, {
|
|
9
|
-
className: "bg-warn/10 border-warn/50 text-warn",
|
|
10
|
-
children: [
|
|
11
|
-
/*#__PURE__*/ _jsx(TriangleAlertIcon, {}),
|
|
12
|
-
" ",
|
|
13
|
-
t(type)
|
|
14
|
-
]
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
if (type === "error") {
|
|
18
|
-
return /*#__PURE__*/ _jsxs(Badge, {
|
|
19
|
-
className: "bg-destructive/10 border-destructive/50 text-destructive",
|
|
20
|
-
children: [
|
|
21
|
-
/*#__PURE__*/ _jsx(XIcon, {}),
|
|
22
|
-
" ",
|
|
23
|
-
t(type)
|
|
24
|
-
]
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
return /*#__PURE__*/ _jsx(Badge, {
|
|
28
|
-
children: t(type)
|
|
29
|
-
});
|
|
30
|
-
};
|
|
1
|
+
import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{TriangleAlertIcon,XIcon}from"lucide-react";import{useTranslations}from"next-intl";import{Badge}from"../../../../../../../components/ui/badge.js";export const BadgeTypeLog=({type})=>{const t=useTranslations("admin.debug.logs.types");if(type==="warn"){return _jsxs(Badge,{className:"bg-warn/10 border-warn/50 text-warn",children:[_jsx(TriangleAlertIcon,{})," ",t(type)]})}if(type==="error"){return _jsxs(Badge,{className:"bg-destructive/10 border-destructive/50 text-destructive",children:[_jsx(XIcon,{})," ",t(type)]})}return _jsx(Badge,{children:t(type)})};
|
|
@@ -1,96 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { getTranslations } from "next-intl/server";
|
|
3
|
-
import { debugAdminModule } from "../../../../../../api/modules/admin/debug/debug.admin.module.js";
|
|
4
|
-
import { DateFormat } from "../../../../../../components/date-format.js";
|
|
5
|
-
import { DataTable } from "../../../../../../components/table/data-table.js";
|
|
6
|
-
import { fetcher } from "../../../../../../lib/fetcher.js";
|
|
7
|
-
import { MoreActionSystemLogs } from "./actions/more/more.js";
|
|
8
|
-
import { BadgeStatus } from "./badges/badge-status.js";
|
|
9
|
-
import { BadgeTypeLog } from "./badges/badge-type-log.js";
|
|
10
|
-
export const getSystemLogsData = async (query)=>{
|
|
11
|
-
const res = await fetcher(debugAdminModule, {
|
|
12
|
-
prefixPath: "/admin",
|
|
13
|
-
path: "/logs",
|
|
14
|
-
method: "get",
|
|
15
|
-
module: "debug",
|
|
16
|
-
args: {
|
|
17
|
-
query
|
|
18
|
-
},
|
|
19
|
-
withPagination: true
|
|
20
|
-
});
|
|
21
|
-
return await res.json();
|
|
22
|
-
};
|
|
23
|
-
export const SystemLogsView = async ({ searchParams })=>{
|
|
24
|
-
const [t, query] = await Promise.all([
|
|
25
|
-
getTranslations("admin.debug.logs"),
|
|
26
|
-
searchParams
|
|
27
|
-
]);
|
|
28
|
-
const data = await getSystemLogsData(query);
|
|
29
|
-
return /*#__PURE__*/ _jsx(DataTable, {
|
|
30
|
-
columns: [
|
|
31
|
-
{
|
|
32
|
-
id: "pluginId",
|
|
33
|
-
label: t("plugin"),
|
|
34
|
-
className: "w-48"
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
id: "type",
|
|
38
|
-
label: t("type"),
|
|
39
|
-
cell: ({ row })=>/*#__PURE__*/ _jsx(BadgeTypeLog, {
|
|
40
|
-
type: row.type
|
|
41
|
-
})
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
id: "statusCode",
|
|
45
|
-
label: t("status_code"),
|
|
46
|
-
className: "w-26",
|
|
47
|
-
cell: ({ row })=>/*#__PURE__*/ _jsx(BadgeStatus, {
|
|
48
|
-
statusCode: row.statusCode
|
|
49
|
-
})
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
id: "createdAt",
|
|
53
|
-
label: t("created_at"),
|
|
54
|
-
cell: ({ row })=>/*#__PURE__*/ _jsx(DateFormat, {
|
|
55
|
-
date: row.createdAt,
|
|
56
|
-
showFullDate: true
|
|
57
|
-
})
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
id: "content",
|
|
61
|
-
label: t("content"),
|
|
62
|
-
cell: ({ row })=>{
|
|
63
|
-
const CHARACTERS = 50;
|
|
64
|
-
const content = row.content;
|
|
65
|
-
const isLong = content.length > CHARACTERS;
|
|
66
|
-
const displayContent = isLong ? `${content.slice(0, CHARACTERS)}...` : content;
|
|
67
|
-
return /*#__PURE__*/ _jsx("span", {
|
|
68
|
-
children: displayContent
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
id: "actions",
|
|
74
|
-
label: "",
|
|
75
|
-
cell: ({ row })=>/*#__PURE__*/ _jsx(MoreActionSystemLogs, {
|
|
76
|
-
...row
|
|
77
|
-
})
|
|
78
|
-
}
|
|
79
|
-
],
|
|
80
|
-
edges: data.edges.map((edge)=>({
|
|
81
|
-
...edge
|
|
82
|
-
})),
|
|
83
|
-
order: {
|
|
84
|
-
columns: [
|
|
85
|
-
"createdAt",
|
|
86
|
-
"pluginId",
|
|
87
|
-
"type"
|
|
88
|
-
],
|
|
89
|
-
defaultOrder: {
|
|
90
|
-
column: "createdAt",
|
|
91
|
-
order: "desc"
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
pageInfo: data.pageInfo
|
|
95
|
-
});
|
|
96
|
-
};
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import{getTranslations}from"next-intl/server";import{debugAdminModule}from"../../../../../../api/modules/admin/debug/debug.admin.module.js";import{DateFormat}from"../../../../../../components/date-format.js";import{DataTable}from"../../../../../../components/table/data-table.js";import{fetcher}from"../../../../../../lib/fetcher.js";import{MoreActionSystemLogs}from"./actions/more/more.js";import{BadgeStatus}from"./badges/badge-status.js";import{BadgeTypeLog}from"./badges/badge-type-log.js";export const getSystemLogsData=async query=>{const res=await fetcher(debugAdminModule,{prefixPath:"/admin",path:"/logs",method:"get",module:"debug",args:{query},withPagination:true});return await res.json()};export const SystemLogsView=async({searchParams})=>{const[t,query]=await Promise.all([getTranslations("admin.debug.logs"),searchParams]);const data=await getSystemLogsData(query);return _jsx(DataTable,{columns:[{id:"pluginId",label:t("plugin"),className:"w-48"},{id:"type",label:t("type"),cell:({row})=>_jsx(BadgeTypeLog,{type:row.type})},{id:"statusCode",label:t("status_code"),className:"w-26",cell:({row})=>_jsx(BadgeStatus,{statusCode:row.statusCode})},{id:"createdAt",label:t("created_at"),cell:({row})=>_jsx(DateFormat,{date:row.createdAt,showFullDate:true})},{id:"content",label:t("content"),cell:({row})=>{const CHARACTERS=50;const content=row.content;const isLong=content.length>CHARACTERS;const displayContent=isLong?`${content.slice(0,CHARACTERS)}...`:content;return _jsx("span",{children:displayContent})}},{id:"actions",label:"",cell:({row})=>_jsx(MoreActionSystemLogs,{...row})}],edges:data.edges.map(edge=>({...edge})),order:{columns:["createdAt","pluginId","type"],defaultOrder:{column:"createdAt",order:"desc"}},pageInfo:data.pageInfo})};
|