@vitnode/core 1.2.0-canary.60 → 1.2.0-canary.61

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.
Files changed (274) hide show
  1. package/dist/scripts/get-config.js +15 -0
  2. package/dist/scripts/plugin.js +188 -0
  3. package/dist/scripts/prepare-database.js +177 -0
  4. package/dist/scripts/prepare-plugins-files.js +134 -0
  5. package/dist/scripts/run-interactive-shell-command.js +21 -0
  6. package/dist/scripts/scripts.js +39 -13
  7. package/dist/scripts/shared/file-utils.js +203 -0
  8. package/dist/src/api/adapters/sso/discord.js +1 -77
  9. package/dist/src/api/adapters/sso/facebook.js +1 -76
  10. package/dist/src/api/adapters/sso/google.js +1 -87
  11. package/dist/src/api/config.js +1 -67
  12. package/dist/src/api/lib/check-plugin-id.js +1 -43
  13. package/dist/src/api/lib/cron.js +1 -22
  14. package/dist/src/api/lib/logger-middleware.js +1 -35
  15. package/dist/src/api/lib/module.js +1 -22
  16. package/dist/src/api/lib/plugin.js +1 -22
  17. package/dist/src/api/lib/route.js +1 -27
  18. package/dist/src/api/lib/with-pagination.js +1 -83
  19. package/dist/src/api/middlewares/captcha.middleware.js +1 -63
  20. package/dist/src/api/middlewares/cron-auth.middleware.js +1 -19
  21. package/dist/src/api/middlewares/global.middleware.js +1 -93
  22. package/dist/src/api/middlewares/rate-limiter.middleware.js +1 -32
  23. package/dist/src/api/models/device.js +1 -61
  24. package/dist/src/api/models/email.js +1 -76
  25. package/dist/src/api/models/password.js +1 -36
  26. package/dist/src/api/models/session-admin.js +1 -106
  27. package/dist/src/api/models/session.js +1 -85
  28. package/dist/src/api/models/sso.js +1 -120
  29. package/dist/src/api/models/user/get-user-by-id.js +1 -19
  30. package/dist/src/api/models/user/sign-in-with-passwords.js +1 -22
  31. package/dist/src/api/models/user/sign-up.js +1 -73
  32. package/dist/src/api/models/user.js +1 -8
  33. package/dist/src/api/modules/admin/admin.module.js +1 -19
  34. package/dist/src/api/modules/admin/advanced/advanced.admin.module.js +1 -11
  35. package/dist/src/api/modules/admin/advanced/cron/cron.admin.module.js +1 -12
  36. package/dist/src/api/modules/admin/advanced/cron/routes/get.route.js +1 -66
  37. package/dist/src/api/modules/admin/advanced/cron/routes/run.route.js +1 -95
  38. package/dist/src/api/modules/admin/debug/debug.admin.module.js +1 -10
  39. package/dist/src/api/modules/admin/debug/routes/logs.route.js +1 -94
  40. package/dist/src/api/modules/admin/routes/session.route.js +1 -47
  41. package/dist/src/api/modules/admin/users/routes/list.route.js +1 -79
  42. package/dist/src/api/modules/admin/users/routes/users.route.js +1 -84
  43. package/dist/src/api/modules/admin/users/users.admin.module.js +1 -10
  44. package/dist/src/api/modules/cron/cron/clean.cron.js +1 -24
  45. package/dist/src/api/modules/cron/cron.module.js +1 -14
  46. package/dist/src/api/modules/cron/helpers/process-cron-jobs.d.ts.map +1 -1
  47. package/dist/src/api/modules/cron/helpers/process-cron-jobs.js +1 -76
  48. package/dist/src/api/modules/cron/routes/cron.route.js +1 -101
  49. package/dist/src/api/modules/middleware/middleware.module.js +1 -10
  50. package/dist/src/api/modules/middleware/route.js +1 -49
  51. package/dist/src/api/modules/users/avatar-color.js +1 -43
  52. package/dist/src/api/modules/users/routes/change-password.route.js +1 -58
  53. package/dist/src/api/modules/users/routes/reset-passowrd.route.js +1 -91
  54. package/dist/src/api/modules/users/routes/session.route.js +1 -46
  55. package/dist/src/api/modules/users/routes/sign-in.route.js +1 -71
  56. package/dist/src/api/modules/users/routes/sign-out.route.js +1 -43
  57. package/dist/src/api/modules/users/routes/sign-up.route.js +1 -77
  58. package/dist/src/api/modules/users/routes/test.route.js +1 -33
  59. package/dist/src/api/modules/users/sso/routes/callback.route.js +1 -52
  60. package/dist/src/api/modules/users/sso/routes/create-url.route.js +1 -36
  61. package/dist/src/api/modules/users/sso/sso.module.js +1 -12
  62. package/dist/src/api/modules/users/users.module.js +1 -26
  63. package/dist/src/api/plugin.js +1 -15
  64. package/dist/src/app/login/page.js +1 -16
  65. package/dist/src/app/login/reset-password/page.js +1 -18
  66. package/dist/src/app/login/sso/[providerId]/page.js +1 -10
  67. package/dist/src/app/register/page.js +1 -16
  68. package/dist/src/app_admin/core/advanced/cron/page.js +1 -42
  69. package/dist/src/app_admin/core/debug/page.js +1 -45
  70. package/dist/src/app_admin/core/page.js +1 -5
  71. package/dist/src/app_admin/core/test/page.js +1 -5
  72. package/dist/src/app_admin/core/users/page.js +1 -38
  73. package/dist/src/components/avatar.js +1 -14
  74. package/dist/src/components/confirm-action/confirm-action-alert-dialog.js +1 -42
  75. package/dist/src/components/confirm-action/content.js +1 -31
  76. package/dist/src/components/date-format.js +1 -41
  77. package/dist/src/components/form/auto-form.js +1 -103
  78. package/dist/src/components/form/common/desc.js +1 -9
  79. package/dist/src/components/form/common/label.js +1 -18
  80. package/dist/src/components/form/fields/checkbox.js +1 -37
  81. package/dist/src/components/form/fields/combobox-async.js +1 -123
  82. package/dist/src/components/form/fields/combobox.js +1 -87
  83. package/dist/src/components/form/fields/input.js +1 -39
  84. package/dist/src/components/form/fields/radio-group.js +1 -50
  85. package/dist/src/components/form/fields/select.js +1 -58
  86. package/dist/src/components/form/fields/switch.js +1 -36
  87. package/dist/src/components/form/fields/textarea.js +1 -36
  88. package/dist/src/components/i18n-provider.js +1 -43
  89. package/dist/src/components/logo-vitnode.js +1 -119
  90. package/dist/src/components/switchers/langs/language-switcher.js +1 -47
  91. package/dist/src/components/switchers/themes/theme-switcher.js +1 -28
  92. package/dist/src/components/table/content.js +1 -81
  93. package/dist/src/components/table/data-table.js +1 -68
  94. package/dist/src/components/table/order-table-head.js +1 -50
  95. package/dist/src/components/table/pagination.js +1 -122
  96. package/dist/src/components/tiptap/extension.js +1 -33
  97. package/dist/src/components/tiptap/toolbar/actions/alignment-action.js +1 -91
  98. package/dist/src/components/tiptap/toolbar/actions/bold-action.js +1 -39
  99. package/dist/src/components/tiptap/toolbar/actions/headings-action.js +1 -93
  100. package/dist/src/components/tiptap/toolbar/actions/italic-action.js +1 -38
  101. package/dist/src/components/tiptap/toolbar/actions/list-action.js +1 -61
  102. package/dist/src/components/tiptap/toolbar/actions/text-format-more/text-format-more.js +1 -59
  103. package/dist/src/components/tiptap/toolbar/actions/underline-action.js +1 -38
  104. package/dist/src/components/tiptap/toolbar/actions/undo-redo-actions.js +1 -63
  105. package/dist/src/components/tiptap/toolbar/actions/utils/tooltip-shortcut.js +1 -11
  106. package/dist/src/components/tiptap/toolbar/tiptap-toolbar.js +1 -55
  107. package/dist/src/components/tiptap/toolbar/use-toolbar-editor.js +1 -5
  108. package/dist/src/components/ui/accordion.js +1 -46
  109. package/dist/src/components/ui/alert-dialog.js +1 -123
  110. package/dist/src/components/ui/alert.js +1 -39
  111. package/dist/src/components/ui/badge.js +1 -28
  112. package/dist/src/components/ui/button-client.js +1 -57
  113. package/dist/src/components/ui/button.js +1 -32
  114. package/dist/src/components/ui/card.js +1 -52
  115. package/dist/src/components/ui/checkbox.js +1 -20
  116. package/dist/src/components/ui/collapsible.js +1 -22
  117. package/dist/src/components/ui/command.js +1 -98
  118. package/dist/src/components/ui/context-menu.js +1 -140
  119. package/dist/src/components/ui/dialog.js +1 -189
  120. package/dist/src/components/ui/drawer.js +1 -83
  121. package/dist/src/components/ui/dropdown-menu.js +1 -141
  122. package/dist/src/components/ui/editor-content.js +1 -10
  123. package/dist/src/components/ui/editor.js +1 -35
  124. package/dist/src/components/ui/form.js +1 -148
  125. package/dist/src/components/ui/header-content.js +1 -30
  126. package/dist/src/components/ui/hover-card.js +1 -29
  127. package/dist/src/components/ui/input-otp.js +1 -48
  128. package/dist/src/components/ui/input.js +1 -11
  129. package/dist/src/components/ui/label.js +1 -12
  130. package/dist/src/components/ui/loader.js +1 -16
  131. package/dist/src/components/ui/menubar.js +1 -151
  132. package/dist/src/components/ui/navigation-menu.js +1 -82
  133. package/dist/src/components/ui/popover.js +1 -35
  134. package/dist/src/components/ui/progress.js +1 -19
  135. package/dist/src/components/ui/radio-group.js +1 -27
  136. package/dist/src/components/ui/scroll-area.js +1 -33
  137. package/dist/src/components/ui/select.js +1 -113
  138. package/dist/src/components/ui/separator.js +1 -14
  139. package/dist/src/components/ui/sheet.js +1 -92
  140. package/dist/src/components/ui/sidebar.js +1 -433
  141. package/dist/src/components/ui/skeleton.js +1 -10
  142. package/dist/src/components/ui/slider.js +1 -50
  143. package/dist/src/components/ui/sonner.js +1 -26
  144. package/dist/src/components/ui/switch.js +1 -16
  145. package/dist/src/components/ui/table.js +1 -63
  146. package/dist/src/components/ui/tabs.js +1 -33
  147. package/dist/src/components/ui/textarea.js +1 -10
  148. package/dist/src/components/ui/toggle-group.js +1 -45
  149. package/dist/src/components/ui/toggle.js +1 -34
  150. package/dist/src/components/ui/tooltip.js +1 -57
  151. package/dist/src/config.js +1 -4
  152. package/dist/src/database/admins.js +1 -74
  153. package/dist/src/database/cron.js +1 -22
  154. package/dist/src/database/languages.js +1 -52
  155. package/dist/src/database/logs.js +1 -34
  156. package/dist/src/database/moderators.js +1 -37
  157. package/dist/src/database/roles.js +1 -13
  158. package/dist/src/database/sessions.js +1 -60
  159. package/dist/src/database/users.js +1 -145
  160. package/dist/src/drizzle.config.js +1 -67
  161. package/dist/src/emails/default-template.js +1 -99
  162. package/dist/src/emails/reset-password.js +1 -132
  163. package/dist/src/emails/ui/button.js +1 -36
  164. package/dist/src/emails/ui/card.js +1 -39
  165. package/dist/src/hooks/use-before-unload.js +1 -30
  166. package/dist/src/hooks/use-captcha.js +1 -122
  167. package/dist/src/hooks/use-mobile.js +1 -16
  168. package/dist/src/lib/api/get-middleware-api.js +1 -13
  169. package/dist/src/lib/api/get-next-cron-run-date.js +1 -14
  170. package/dist/src/lib/api/get-next-cron-run-date.test.js +1 -55
  171. package/dist/src/lib/api/get-session-admin-api.js +1 -19
  172. package/dist/src/lib/api/get-session-api.js +1 -14
  173. package/dist/src/lib/api/should-cron-job-run.js +1 -16
  174. package/dist/src/lib/api/should-cron-job-run.test.js +1 -213
  175. package/dist/src/lib/api/validate-cron-schedule.d.ts +2 -0
  176. package/dist/src/lib/api/validate-cron-schedule.d.ts.map +1 -0
  177. package/dist/src/lib/api/validate-cron-schedule.js +1 -0
  178. package/dist/src/lib/api/validate-cron-schedule.test.d.ts +2 -0
  179. package/dist/src/lib/api/validate-cron-schedule.test.d.ts.map +1 -0
  180. package/dist/src/lib/api/validate-cron-schedule.test.js +1 -0
  181. package/dist/src/lib/colors.js +1 -140
  182. package/dist/src/lib/colors.test.js +1 -173
  183. package/dist/src/lib/config.js +1 -14
  184. package/dist/src/lib/ctrl-or-command-character.js +1 -5
  185. package/dist/src/lib/fetcher/cookie-from-string-to-object.js +1 -12
  186. package/dist/src/lib/fetcher/cookie-from-string-to-object.test.js +1 -78
  187. package/dist/src/lib/fetcher/core.js +3 -48
  188. package/dist/src/lib/fetcher/helpers-server.js +1 -18
  189. package/dist/src/lib/fetcher/helpers.js +1 -16
  190. package/dist/src/lib/fetcher/helpers.test.js +1 -37
  191. package/dist/src/lib/fetcher/types.js +1 -1
  192. package/dist/src/lib/fetcher-client.js +1 -17
  193. package/dist/src/lib/fetcher.js +1 -33
  194. package/dist/src/lib/helpers/auto-form.js +1 -98
  195. package/dist/src/lib/helpers/auto-form.test.js +1 -336
  196. package/dist/src/lib/navigation.js +1 -11
  197. package/dist/src/lib/plugin.js +1 -3
  198. package/dist/src/lib/special-characters.js +1 -4
  199. package/dist/src/lib/special-characters.test.js +1 -56
  200. package/dist/src/lib/utils.js +1 -5
  201. package/dist/src/locales/en.json +308 -0
  202. package/dist/src/tests/setup.js +1 -6
  203. package/dist/src/views/admin/layouts/admin-layout.js +1 -73
  204. package/dist/src/views/admin/layouts/sidebar/nav/item.js +1 -98
  205. package/dist/src/views/admin/layouts/sidebar/nav/nav.js +1 -60
  206. package/dist/src/views/admin/layouts/sidebar/sidebar.js +1 -28
  207. package/dist/src/views/admin/layouts/sidebar/sign-out.js +1 -14
  208. package/dist/src/views/admin/layouts/user-bar/client.js +1 -69
  209. package/dist/src/views/admin/layouts/user-bar/user-bar.js +1 -32
  210. package/dist/src/views/admin/sign-in/sign-in-admin-view.js +1 -27
  211. package/dist/src/views/admin/views/core/advanced/cron/cron-table-view.js +1 -97
  212. package/dist/src/views/admin/views/core/advanced/cron/run-action/mutation-api.js +1 -23
  213. package/dist/src/views/admin/views/core/advanced/cron/run-action/run-action.js +1 -38
  214. package/dist/src/views/admin/views/core/dashboard/dashboard-admin-view.js +1 -44
  215. package/dist/src/views/admin/views/core/debug/actions/clear-cache/clear-cache.js +1 -35
  216. package/dist/src/views/admin/views/core/debug/actions/clear-cache/mutation-api.js +1 -5
  217. package/dist/src/views/admin/views/core/debug/system-logs/actions/more/content.js +1 -281
  218. package/dist/src/views/admin/views/core/debug/system-logs/actions/more/more.js +1 -67
  219. package/dist/src/views/admin/views/core/debug/system-logs/badges/badge-status.js +1 -14
  220. package/dist/src/views/admin/views/core/debug/system-logs/badges/badge-type-log.js +1 -30
  221. package/dist/src/views/admin/views/core/debug/system-logs/system-logs-view.js +1 -96
  222. package/dist/src/views/admin/views/core/test.js +1 -161
  223. package/dist/src/views/admin/views/core/users/users-admin-view.js +1 -89
  224. package/dist/src/views/auth/password-reset/change-password-form/form.js +1 -48
  225. package/dist/src/views/auth/password-reset/change-password-form/mutation-api.js +1 -22
  226. package/dist/src/views/auth/password-reset/change-password-form/use-form.js +1 -36
  227. package/dist/src/views/auth/password-reset/form/form.js +1 -104
  228. package/dist/src/views/auth/password-reset/form/mutation-api.js +1 -21
  229. package/dist/src/views/auth/password-reset/form/use-form.js +1 -33
  230. package/dist/src/views/auth/password-reset/password-reset-view.js +1 -37
  231. package/dist/src/views/auth/sign-in/form/form.js +1 -64
  232. package/dist/src/views/auth/sign-in/form/mutation-api.js +1 -33
  233. package/dist/src/views/auth/sign-in/form/use-form.js +1 -38
  234. package/dist/src/views/auth/sign-in/sign-in-view.js +1 -61
  235. package/dist/src/views/auth/sign-up/components/password-input.js +1 -96
  236. package/dist/src/views/auth/sign-up/email-confirmation-view.js +1 -55
  237. package/dist/src/views/auth/sign-up/form/form.js +1 -89
  238. package/dist/src/views/auth/sign-up/form/mutation-api.js +1 -30
  239. package/dist/src/views/auth/sign-up/form/use-form.js +1 -70
  240. package/dist/src/views/auth/sign-up/sign-up-view.js +1 -65
  241. package/dist/src/views/auth/sign-up/wrapper.js +1 -22
  242. package/dist/src/views/auth/sso/buttons/client.js +1 -22
  243. package/dist/src/views/auth/sso/buttons/mutation-api.js +1 -24
  244. package/dist/src/views/auth/sso/buttons/sso-buttons.js +1 -56
  245. package/dist/src/views/auth/sso/callback/callback-sso-view.js +1 -32
  246. package/dist/src/views/auth/sso/callback/client/client.js +1 -68
  247. package/dist/src/views/auth/sso/callback/client/mutation-api.js +1 -32
  248. package/dist/src/views/error/back-button.js +1 -14
  249. package/dist/src/views/error/error-view.js +1 -58
  250. package/dist/src/views/error/global-error-view.js +1 -50
  251. package/dist/src/views/layouts/provider.js +1 -44
  252. package/dist/src/views/layouts/root-layout.js +1 -25
  253. package/dist/src/views/layouts/theme/header/header.js +1 -38
  254. package/dist/src/views/layouts/theme/header/user/auth/auth.js +1 -33
  255. package/dist/src/views/layouts/theme/header/user/auth/client.js +1 -47
  256. package/dist/src/views/layouts/theme/header/user/auth/log-out-mutation-api.js +1 -27
  257. package/dist/src/views/layouts/theme/header/user/user.js +1 -32
  258. package/dist/src/views/layouts/theme/layout.js +1 -16
  259. package/dist/src/vitnode.config.js +1 -42
  260. package/dist/tsconfig.tsbuildinfo +1 -1
  261. package/dist/tsup.config.js +18 -0
  262. package/dist/vitest.config.d.ts.map +1 -1
  263. package/dist/vitest.config.js +49 -0
  264. package/eslint.config.mjs +2 -0
  265. package/package.json +6 -10
  266. package/dist/src/api/adapters/cron/node-cron.adapter.d.ts +0 -3
  267. package/dist/src/api/adapters/cron/node-cron.adapter.d.ts.map +0 -1
  268. package/dist/src/api/adapters/cron/node-cron.adapter.js +0 -11
  269. package/dist/src/api/adapters/email/nodemailer.d.ts +0 -10
  270. package/dist/src/api/adapters/email/nodemailer.d.ts.map +0 -1
  271. package/dist/src/api/adapters/email/nodemailer.js +0 -30
  272. package/dist/src/api/adapters/email/resend.d.ts +0 -6
  273. package/dist/src/api/adapters/email/resend.d.ts.map +0 -1
  274. package/dist/src/api/adapters/email/resend.js +0 -21
@@ -1,281 +1 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
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 { jsx as _jsx } from "react/jsx-runtime";
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 { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
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 { jsx as _jsx } from "react/jsx-runtime";
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})};