@vitnode/core 1.2.0-canary.52 → 1.2.0-canary.54
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/config/next.config.ts +3 -3
- package/dist/scripts/get-config.d.ts +2 -2
- package/dist/scripts/get-config.d.ts.map +1 -1
- package/dist/scripts/plugin.d.ts.map +1 -1
- package/dist/scripts/prepare-database.d.ts +0 -1
- package/dist/scripts/prepare-database.d.ts.map +1 -1
- package/dist/scripts/prepare-plugins-files.d.ts.map +1 -1
- package/dist/scripts/scripts.js +3 -3
- package/dist/scripts/shared/file-utils.d.ts.map +1 -1
- package/dist/src/api/adapters/cron/node-cron.adapter.d.ts +3 -0
- package/dist/src/api/adapters/cron/node-cron.adapter.d.ts.map +1 -0
- package/dist/src/api/adapters/cron/node-cron.adapter.js +11 -0
- package/dist/src/api/adapters/email/nodemailer.d.ts +1 -1
- package/dist/src/api/adapters/email/nodemailer.js +3 -3
- package/dist/src/api/adapters/email/resend.d.ts +1 -1
- package/dist/src/api/adapters/email/resend.js +2 -2
- package/dist/src/api/adapters/sso/discord.d.ts +1 -1
- package/dist/src/api/adapters/sso/discord.d.ts.map +1 -1
- package/dist/src/api/adapters/sso/discord.js +21 -21
- package/dist/src/api/adapters/sso/facebook.d.ts +1 -1
- package/dist/src/api/adapters/sso/facebook.d.ts.map +1 -1
- package/dist/src/api/adapters/sso/facebook.js +23 -23
- package/dist/src/api/adapters/sso/google.d.ts +1 -1
- package/dist/src/api/adapters/sso/google.d.ts.map +1 -1
- package/dist/src/api/adapters/sso/google.js +21 -21
- package/dist/src/api/config.d.ts +3 -3
- package/dist/src/api/config.d.ts.map +1 -1
- package/dist/src/api/config.js +30 -18
- package/dist/src/api/lib/check-plugin-id.js +8 -8
- package/dist/src/api/lib/cron.d.ts +18 -0
- package/dist/src/api/lib/cron.d.ts.map +1 -0
- package/dist/src/api/lib/cron.js +22 -0
- package/dist/src/api/lib/logger-middleware.d.ts +1 -1
- package/dist/src/api/lib/logger-middleware.js +9 -9
- package/dist/src/api/lib/module.d.ts +6 -3
- package/dist/src/api/lib/module.d.ts.map +1 -1
- package/dist/src/api/lib/module.js +3 -2
- package/dist/src/api/lib/plugin.d.ts +4 -2
- package/dist/src/api/lib/plugin.d.ts.map +1 -1
- package/dist/src/api/lib/plugin.js +9 -1
- package/dist/src/api/lib/route.d.ts +2 -2
- package/dist/src/api/lib/route.d.ts.map +1 -1
- package/dist/src/api/lib/route.js +1 -1
- package/dist/src/api/lib/with-pagination.d.ts +7 -7
- package/dist/src/api/lib/with-pagination.d.ts.map +1 -1
- package/dist/src/api/lib/with-pagination.js +37 -24
- package/dist/src/api/middlewares/captcha.middleware.d.ts +1 -1
- package/dist/src/api/middlewares/captcha.middleware.d.ts.map +1 -1
- package/dist/src/api/middlewares/captcha.middleware.js +14 -13
- package/dist/src/api/middlewares/cron-auth.middleware.d.ts +3 -0
- package/dist/src/api/middlewares/cron-auth.middleware.d.ts.map +1 -0
- package/dist/src/api/middlewares/cron-auth.middleware.js +19 -0
- package/dist/src/api/middlewares/global.middleware.d.ts +18 -12
- package/dist/src/api/middlewares/global.middleware.d.ts.map +1 -1
- package/dist/src/api/middlewares/global.middleware.js +46 -34
- package/dist/src/api/middlewares/rate-limiter.middleware.d.ts +3 -3
- package/dist/src/api/middlewares/rate-limiter.middleware.d.ts.map +1 -1
- package/dist/src/api/middlewares/rate-limiter.middleware.js +4 -4
- package/dist/src/api/models/device.d.ts +1 -1
- package/dist/src/api/models/device.d.ts.map +1 -1
- package/dist/src/api/models/device.js +13 -13
- package/dist/src/api/models/email.d.ts +15 -15
- package/dist/src/api/models/email.d.ts.map +1 -1
- package/dist/src/api/models/email.js +11 -10
- package/dist/src/api/models/password.js +9 -9
- package/dist/src/api/models/session-admin.d.ts +1 -1
- package/dist/src/api/models/session-admin.d.ts.map +1 -1
- package/dist/src/api/models/session-admin.js +19 -19
- package/dist/src/api/models/session.d.ts +1 -1
- package/dist/src/api/models/session.d.ts.map +1 -1
- package/dist/src/api/models/session.js +17 -17
- package/dist/src/api/models/sso.d.ts +1 -1
- package/dist/src/api/models/sso.d.ts.map +1 -1
- package/dist/src/api/models/sso.js +22 -25
- package/dist/src/api/models/user/get-user-by-id.d.ts +1 -1
- package/dist/src/api/models/user/get-user-by-id.d.ts.map +1 -1
- package/dist/src/api/models/user/get-user-by-id.js +1 -1
- package/dist/src/api/models/user/sign-in-with-passwords.d.ts +1 -1
- package/dist/src/api/models/user/sign-in-with-passwords.d.ts.map +1 -1
- package/dist/src/api/models/user/sign-in-with-passwords.js +1 -1
- package/dist/src/api/models/user/sign-up.d.ts +2 -2
- package/dist/src/api/models/user/sign-up.d.ts.map +1 -1
- package/dist/src/api/models/user/sign-up.js +11 -12
- package/dist/src/api/models/user.d.ts +1 -1
- package/dist/src/api/models/user.d.ts.map +1 -1
- package/dist/src/api/modules/admin/admin.module.d.ts +166 -4
- package/dist/src/api/modules/admin/admin.module.d.ts.map +1 -1
- package/dist/src/api/modules/admin/admin.module.js +7 -4
- package/dist/src/api/modules/admin/advanced/advanced.admin.module.d.ts +164 -0
- package/dist/src/api/modules/admin/advanced/advanced.admin.module.d.ts.map +1 -0
- package/dist/src/api/modules/admin/advanced/advanced.admin.module.js +11 -0
- package/dist/src/api/modules/admin/advanced/cron/cron.admin.module.d.ts +164 -0
- package/dist/src/api/modules/admin/advanced/cron/cron.admin.module.d.ts.map +1 -0
- package/dist/src/api/modules/admin/advanced/cron/cron.admin.module.js +12 -0
- package/dist/src/api/modules/admin/advanced/cron/routes/get.route.d.ts +98 -0
- package/dist/src/api/modules/admin/advanced/cron/routes/get.route.d.ts.map +1 -0
- package/dist/src/api/modules/admin/advanced/cron/routes/get.route.js +66 -0
- package/dist/src/api/modules/admin/advanced/cron/routes/run.route.d.ts +70 -0
- package/dist/src/api/modules/admin/advanced/cron/routes/run.route.d.ts.map +1 -0
- package/dist/src/api/modules/admin/advanced/cron/routes/run.route.js +95 -0
- package/dist/src/api/modules/admin/debug/debug.admin.module.d.ts +1 -1
- package/dist/src/api/modules/admin/debug/debug.admin.module.js +2 -2
- package/dist/src/api/modules/admin/debug/routes/logs.route.d.ts +2 -2
- package/dist/src/api/modules/admin/debug/routes/logs.route.js +17 -17
- package/dist/src/api/modules/admin/routes/session.route.d.ts +2 -2
- package/dist/src/api/modules/admin/routes/session.route.js +8 -8
- package/dist/src/api/modules/admin/users/routes/list.route.d.ts +2 -2
- package/dist/src/api/modules/admin/users/routes/list.route.js +13 -13
- package/dist/src/api/modules/admin/users/routes/users.route.d.ts +5 -5
- package/dist/src/api/modules/admin/users/routes/users.route.js +16 -16
- package/dist/src/api/modules/admin/users/users.admin.module.d.ts +1 -1
- package/dist/src/api/modules/admin/users/users.admin.module.js +2 -2
- package/dist/src/api/modules/cron/cron/clean.cron.d.ts +2 -0
- package/dist/src/api/modules/cron/cron/clean.cron.d.ts.map +1 -0
- package/dist/src/api/modules/cron/cron/clean.cron.js +24 -0
- package/dist/src/api/modules/cron/cron.module.d.ts +26 -0
- package/dist/src/api/modules/cron/cron.module.d.ts.map +1 -0
- package/dist/src/api/modules/cron/cron.module.js +14 -0
- package/dist/src/api/modules/cron/helpers/process-cron-jobs.d.ts +36 -0
- package/dist/src/api/modules/cron/helpers/process-cron-jobs.d.ts.map +1 -0
- package/dist/src/api/modules/cron/helpers/process-cron-jobs.js +72 -0
- package/dist/src/api/modules/cron/routes/cron.route.d.ts +27 -0
- package/dist/src/api/modules/cron/routes/cron.route.d.ts.map +1 -0
- package/dist/src/api/modules/cron/routes/cron.route.js +95 -0
- package/dist/src/api/modules/middleware/middleware.module.d.ts +1 -1
- package/dist/src/api/modules/middleware/middleware.module.js +2 -2
- package/dist/src/api/modules/middleware/route.d.ts +2 -2
- package/dist/src/api/modules/middleware/route.js +13 -13
- package/dist/src/api/modules/users/routes/change-password.route.d.ts +2 -2
- package/dist/src/api/modules/users/routes/change-password.route.js +14 -14
- package/dist/src/api/modules/users/routes/reset-passowrd.route.d.ts +2 -2
- package/dist/src/api/modules/users/routes/reset-passowrd.route.js +18 -18
- package/dist/src/api/modules/users/routes/session.route.d.ts +2 -2
- package/dist/src/api/modules/users/routes/session.route.js +7 -7
- package/dist/src/api/modules/users/routes/sign-in.route.d.ts +3 -3
- package/dist/src/api/modules/users/routes/sign-in.route.js +11 -11
- package/dist/src/api/modules/users/routes/sign-out.route.d.ts +2 -2
- package/dist/src/api/modules/users/routes/sign-out.route.js +8 -8
- package/dist/src/api/modules/users/routes/sign-up.route.d.ts +3 -3
- package/dist/src/api/modules/users/routes/sign-up.route.js +15 -15
- package/dist/src/api/modules/users/routes/test.route.d.ts +3 -3
- package/dist/src/api/modules/users/routes/test.route.js +10 -10
- package/dist/src/api/modules/users/sso/routes/callback.route.d.ts +2 -2
- package/dist/src/api/modules/users/sso/routes/callback.route.js +9 -9
- package/dist/src/api/modules/users/sso/routes/create-url.route.d.ts +2 -2
- package/dist/src/api/modules/users/sso/routes/create-url.route.js +7 -7
- package/dist/src/api/modules/users/sso/sso.module.d.ts +2 -2
- package/dist/src/api/modules/users/sso/sso.module.js +2 -2
- package/dist/src/api/modules/users/users.module.d.ts +12 -12
- package/dist/src/api/modules/users/users.module.js +2 -2
- package/dist/src/api/plugin.d.ts.map +1 -1
- package/dist/src/api/plugin.js +4 -2
- package/dist/src/app/login/page.d.ts +1 -1
- package/dist/src/app/login/page.js +2 -2
- package/dist/src/app/login/reset-password/page.d.ts +2 -2
- package/dist/src/app/login/reset-password/page.js +2 -2
- package/dist/src/app/register/page.d.ts +1 -1
- package/dist/src/app/register/page.js +2 -2
- package/dist/src/app_admin/core/advanced/cron/page.d.ts +11 -0
- package/dist/src/app_admin/core/advanced/cron/page.d.ts.map +1 -0
- package/dist/src/app_admin/core/advanced/cron/page.js +42 -0
- package/dist/src/app_admin/core/debug/page.d.ts +1 -1
- package/dist/src/app_admin/core/debug/page.js +8 -8
- package/dist/src/app_admin/core/users/page.d.ts +2 -2
- package/dist/src/app_admin/core/users/page.d.ts.map +1 -1
- package/dist/src/app_admin/core/users/page.js +7 -7
- package/dist/src/components/avatar.d.ts +1 -1
- package/dist/src/components/avatar.js +1 -1
- package/dist/src/components/confirm-action/confirm-action-alert-dialog.d.ts +2 -2
- package/dist/src/components/confirm-action/confirm-action-alert-dialog.js +5 -5
- package/dist/src/components/confirm-action/content.d.ts.map +1 -1
- package/dist/src/components/confirm-action/content.js +3 -4
- package/dist/src/components/date-format.js +8 -8
- package/dist/src/components/form/auto-form.d.ts +16 -16
- package/dist/src/components/form/auto-form.d.ts.map +1 -1
- package/dist/src/components/form/auto-form.js +13 -12
- package/dist/src/components/form/common/desc.js +1 -1
- package/dist/src/components/form/common/label.d.ts +1 -1
- package/dist/src/components/form/common/label.js +1 -1
- package/dist/src/components/form/fields/checkbox.d.ts +2 -2
- package/dist/src/components/form/fields/checkbox.d.ts.map +1 -1
- package/dist/src/components/form/fields/combobox-async.d.ts +3 -3
- package/dist/src/components/form/fields/combobox-async.d.ts.map +1 -1
- package/dist/src/components/form/fields/combobox-async.js +29 -23
- package/dist/src/components/form/fields/combobox.d.ts +3 -3
- package/dist/src/components/form/fields/combobox.d.ts.map +1 -1
- package/dist/src/components/form/fields/combobox.js +6 -7
- package/dist/src/components/form/fields/input.d.ts +2 -2
- package/dist/src/components/form/fields/input.d.ts.map +1 -1
- package/dist/src/components/form/fields/input.js +2 -2
- package/dist/src/components/form/fields/radio-group.d.ts +3 -3
- package/dist/src/components/form/fields/radio-group.d.ts.map +1 -1
- package/dist/src/components/form/fields/radio-group.js +0 -1
- package/dist/src/components/form/fields/select.d.ts +3 -3
- package/dist/src/components/form/fields/select.d.ts.map +1 -1
- package/dist/src/components/form/fields/select.js +2 -3
- package/dist/src/components/form/fields/switch.d.ts +2 -2
- package/dist/src/components/form/fields/switch.d.ts.map +1 -1
- package/dist/src/components/form/fields/textarea.d.ts +3 -3
- package/dist/src/components/form/fields/textarea.d.ts.map +1 -1
- package/dist/src/components/form/fields/textarea.js +1 -2
- package/dist/src/components/i18n-provider.d.ts +2 -2
- package/dist/src/components/i18n-provider.js +3 -3
- package/dist/src/components/logo-vitnode.d.ts.map +1 -1
- package/dist/src/components/logo-vitnode.js +8 -2
- package/dist/src/components/switchers/langs/{language-swietcher.d.ts → language-switcher.d.ts} +2 -2
- package/dist/src/components/switchers/langs/language-switcher.d.ts.map +1 -0
- package/dist/src/components/switchers/langs/{language-swietcher.js → language-switcher.js} +3 -3
- package/dist/src/components/switchers/themes/theme-switcher.js +4 -4
- package/dist/src/components/table/content.d.ts +1 -1
- package/dist/src/components/table/content.d.ts.map +1 -1
- package/dist/src/components/table/content.js +5 -5
- package/dist/src/components/table/data-table.d.ts +7 -7
- package/dist/src/components/table/data-table.d.ts.map +1 -1
- package/dist/src/components/table/data-table.js +22 -15
- package/dist/src/components/table/order-table-head.d.ts +4 -4
- package/dist/src/components/table/order-table-head.d.ts.map +1 -1
- package/dist/src/components/table/order-table-head.js +20 -9
- package/dist/src/components/table/pagination.js +19 -19
- package/dist/src/components/tiptap/extension.d.ts +4 -0
- package/dist/src/components/tiptap/extension.d.ts.map +1 -0
- package/dist/src/components/tiptap/extension.js +26 -0
- package/dist/src/components/tiptap/toolbar/actions/bold-action.d.ts +2 -0
- package/dist/src/components/tiptap/toolbar/actions/bold-action.d.ts.map +1 -0
- package/dist/src/components/tiptap/toolbar/actions/bold-action.js +39 -0
- package/dist/src/components/tiptap/toolbar/actions/headings-action.d.ts +2 -0
- package/dist/src/components/tiptap/toolbar/actions/headings-action.d.ts.map +1 -0
- package/dist/src/components/tiptap/toolbar/actions/headings-action.js +94 -0
- package/dist/src/components/tiptap/toolbar/actions/italic-action.d.ts +2 -0
- package/dist/src/components/tiptap/toolbar/actions/italic-action.d.ts.map +1 -0
- package/dist/src/components/tiptap/toolbar/actions/italic-action.js +38 -0
- package/dist/src/components/tiptap/toolbar/actions/list-action.d.ts +2 -0
- package/dist/src/components/tiptap/toolbar/actions/list-action.d.ts.map +1 -0
- package/dist/src/components/tiptap/toolbar/actions/list-action.js +60 -0
- package/dist/src/components/tiptap/toolbar/actions/text-format-more/text-format-more.d.ts +2 -0
- package/dist/src/components/tiptap/toolbar/actions/text-format-more/text-format-more.d.ts.map +1 -0
- package/dist/src/components/tiptap/toolbar/actions/text-format-more/text-format-more.js +59 -0
- package/dist/src/components/tiptap/toolbar/actions/underline-action.d.ts +2 -0
- package/dist/src/components/tiptap/toolbar/actions/underline-action.d.ts.map +1 -0
- package/dist/src/components/tiptap/toolbar/actions/underline-action.js +38 -0
- package/dist/src/components/tiptap/toolbar/actions/undo-redo-actions.d.ts +2 -0
- package/dist/src/components/tiptap/toolbar/actions/undo-redo-actions.d.ts.map +1 -0
- package/dist/src/components/tiptap/toolbar/actions/undo-redo-actions.js +63 -0
- package/dist/src/components/tiptap/toolbar/actions/utils/tooltip-shortcut.d.ts +4 -0
- package/dist/src/components/tiptap/toolbar/actions/utils/tooltip-shortcut.d.ts.map +1 -0
- package/dist/src/components/tiptap/toolbar/actions/utils/tooltip-shortcut.js +11 -0
- package/dist/src/components/tiptap/toolbar/tiptap-toolbar.d.ts +5 -0
- package/dist/src/components/tiptap/toolbar/tiptap-toolbar.d.ts.map +1 -0
- package/dist/src/components/tiptap/toolbar/tiptap-toolbar.js +35 -0
- package/dist/src/components/tiptap/toolbar/use-toolbar-editor.d.ts +9 -0
- package/dist/src/components/tiptap/toolbar/use-toolbar-editor.d.ts.map +1 -0
- package/dist/src/components/tiptap/toolbar/use-toolbar-editor.js +5 -0
- package/dist/src/components/ui/accordion.d.ts +2 -2
- package/dist/src/components/ui/accordion.d.ts.map +1 -1
- package/dist/src/components/ui/accordion.js +4 -5
- package/dist/src/components/ui/alert-dialog.d.ts +7 -7
- package/dist/src/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/src/components/ui/alert-dialog.js +12 -12
- package/dist/src/components/ui/alert.d.ts +5 -5
- package/dist/src/components/ui/alert.d.ts.map +1 -1
- package/dist/src/components/ui/alert.js +6 -7
- package/dist/src/components/ui/badge.d.ts +3 -3
- package/dist/src/components/ui/badge.d.ts.map +1 -1
- package/dist/src/components/ui/badge.js +7 -8
- package/dist/src/components/ui/button-client.d.ts +1 -1
- package/dist/src/components/ui/button-client.d.ts.map +1 -1
- package/dist/src/components/ui/button-client.js +10 -10
- package/dist/src/components/ui/button.d.ts +8 -8
- package/dist/src/components/ui/button.d.ts.map +1 -1
- package/dist/src/components/ui/button.js +14 -15
- package/dist/src/components/ui/card.d.ts +8 -8
- package/dist/src/components/ui/card.js +7 -7
- package/dist/src/components/ui/checkbox.d.ts +2 -2
- package/dist/src/components/ui/checkbox.d.ts.map +1 -1
- package/dist/src/components/ui/checkbox.js +2 -3
- package/dist/src/components/ui/collapsible.d.ts +1 -1
- package/dist/src/components/ui/collapsible.js +1 -1
- package/dist/src/components/ui/command.d.ts +4 -4
- package/dist/src/components/ui/command.d.ts.map +1 -1
- package/dist/src/components/ui/command.js +9 -10
- package/dist/src/components/ui/context-menu.d.ts +4 -4
- package/dist/src/components/ui/context-menu.d.ts.map +1 -1
- package/dist/src/components/ui/context-menu.js +7 -8
- package/dist/src/components/ui/dialog.d.ts +6 -6
- package/dist/src/components/ui/dialog.d.ts.map +1 -1
- package/dist/src/components/ui/dialog.js +16 -16
- package/dist/src/components/ui/drawer.d.ts +4 -4
- package/dist/src/components/ui/drawer.d.ts.map +1 -1
- package/dist/src/components/ui/drawer.js +7 -8
- package/dist/src/components/ui/dropdown-menu.d.ts +4 -4
- package/dist/src/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/src/components/ui/dropdown-menu.js +8 -9
- package/dist/src/components/ui/editor-content.d.ts +4 -0
- package/dist/src/components/ui/editor-content.d.ts.map +1 -0
- package/dist/src/components/ui/editor-content.js +10 -0
- package/dist/src/components/ui/editor.d.ts +6 -0
- package/dist/src/components/ui/editor.d.ts.map +1 -0
- package/dist/src/components/ui/editor.js +35 -0
- package/dist/src/components/ui/form.d.ts +10 -10
- package/dist/src/components/ui/form.d.ts.map +1 -1
- package/dist/src/components/ui/form.js +15 -15
- package/dist/src/components/ui/header-content.js +1 -1
- package/dist/src/components/ui/hover-card.d.ts +2 -2
- package/dist/src/components/ui/hover-card.d.ts.map +1 -1
- package/dist/src/components/ui/hover-card.js +3 -4
- package/dist/src/components/ui/input-otp.d.ts +5 -5
- package/dist/src/components/ui/input-otp.d.ts.map +1 -1
- package/dist/src/components/ui/input-otp.js +6 -7
- package/dist/src/components/ui/input.d.ts +2 -2
- package/dist/src/components/ui/input.d.ts.map +1 -1
- package/dist/src/components/ui/input.js +1 -2
- package/dist/src/components/ui/label.d.ts +2 -2
- package/dist/src/components/ui/label.d.ts.map +1 -1
- package/dist/src/components/ui/label.js +2 -3
- package/dist/src/components/ui/loader.js +3 -3
- package/dist/src/components/ui/menubar.d.ts +4 -4
- package/dist/src/components/ui/menubar.d.ts.map +1 -1
- package/dist/src/components/ui/menubar.js +11 -12
- package/dist/src/components/ui/navigation-menu.d.ts +2 -2
- package/dist/src/components/ui/navigation-menu.d.ts.map +1 -1
- package/dist/src/components/ui/navigation-menu.js +10 -11
- package/dist/src/components/ui/popover.d.ts +2 -2
- package/dist/src/components/ui/popover.d.ts.map +1 -1
- package/dist/src/components/ui/popover.js +3 -4
- package/dist/src/components/ui/progress.d.ts +2 -2
- package/dist/src/components/ui/progress.d.ts.map +1 -1
- package/dist/src/components/ui/progress.js +2 -3
- package/dist/src/components/ui/radio-group.d.ts +2 -2
- package/dist/src/components/ui/radio-group.d.ts.map +1 -1
- package/dist/src/components/ui/radio-group.js +3 -4
- package/dist/src/components/ui/select.d.ts +3 -3
- package/dist/src/components/ui/select.d.ts.map +1 -1
- package/dist/src/components/ui/select.js +9 -10
- package/dist/src/components/ui/separator.d.ts +2 -2
- package/dist/src/components/ui/separator.d.ts.map +1 -1
- package/dist/src/components/ui/separator.js +3 -4
- package/dist/src/components/ui/sheet.d.ts +5 -5
- package/dist/src/components/ui/sheet.d.ts.map +1 -1
- package/dist/src/components/ui/sheet.js +8 -9
- package/dist/src/components/ui/sidebar.d.ts +31 -31
- package/dist/src/components/ui/sidebar.d.ts.map +1 -1
- package/dist/src/components/ui/sidebar.js +78 -80
- package/dist/src/components/ui/skeleton.d.ts +1 -1
- package/dist/src/components/ui/skeleton.js +1 -1
- package/dist/src/components/ui/slider.d.ts +2 -2
- package/dist/src/components/ui/slider.d.ts.map +1 -1
- package/dist/src/components/ui/slider.js +16 -8
- package/dist/src/components/ui/sonner.d.ts +1 -1
- package/dist/src/components/ui/sonner.d.ts.map +1 -1
- package/dist/src/components/ui/sonner.js +6 -6
- package/dist/src/components/ui/switch.d.ts +2 -2
- package/dist/src/components/ui/switch.d.ts.map +1 -1
- package/dist/src/components/ui/switch.js +3 -4
- package/dist/src/components/ui/table.d.ts +9 -9
- package/dist/src/components/ui/table.d.ts.map +1 -1
- package/dist/src/components/ui/table.js +8 -9
- package/dist/src/components/ui/tabs.d.ts +2 -2
- package/dist/src/components/ui/tabs.d.ts.map +1 -1
- package/dist/src/components/ui/tabs.js +4 -5
- package/dist/src/components/ui/textarea.d.ts +2 -2
- package/dist/src/components/ui/textarea.d.ts.map +1 -1
- package/dist/src/components/ui/textarea.js +1 -2
- package/dist/src/components/ui/toggle-group.d.ts +4 -4
- package/dist/src/components/ui/toggle-group.d.ts.map +1 -1
- package/dist/src/components/ui/toggle-group.js +6 -6
- package/dist/src/components/ui/toggle.d.ts +3 -3
- package/dist/src/components/ui/toggle.d.ts.map +1 -1
- package/dist/src/components/ui/toggle.js +8 -9
- package/dist/src/components/ui/tooltip.d.ts +6 -3
- package/dist/src/components/ui/tooltip.d.ts.map +1 -1
- package/dist/src/components/ui/tooltip.js +20 -5
- package/dist/src/config.js +2 -2
- package/dist/src/database/admins.js +10 -10
- package/dist/src/database/cron.d.ts +171 -0
- package/dist/src/database/cron.d.ts.map +1 -0
- package/dist/src/database/cron.js +22 -0
- package/dist/src/database/languages.js +7 -7
- package/dist/src/database/logs.js +9 -9
- package/dist/src/database/moderators.js +5 -5
- package/dist/src/database/roles.js +1 -1
- package/dist/src/database/sessions.js +6 -6
- package/dist/src/database/users.d.ts +2 -2
- package/dist/src/database/users.js +14 -14
- package/dist/src/drizzle.config.d.ts +2 -2
- package/dist/src/drizzle.config.d.ts.map +1 -1
- package/dist/src/drizzle.config.js +19 -12
- package/dist/src/emails/default-template.d.ts +3 -3
- package/dist/src/emails/default-template.d.ts.map +1 -1
- package/dist/src/emails/default-template.js +39 -38
- package/dist/src/emails/reset-password.d.ts +1 -1
- package/dist/src/emails/reset-password.d.ts.map +1 -1
- package/dist/src/emails/reset-password.js +51 -51
- package/dist/src/emails/ui/button.d.ts +2 -2
- package/dist/src/emails/ui/button.js +13 -13
- package/dist/src/emails/ui/card.d.ts +1 -1
- package/dist/src/emails/ui/card.js +6 -6
- package/dist/src/hooks/use-before-unload.js +3 -3
- package/dist/src/hooks/use-captcha.d.ts +2 -2
- package/dist/src/hooks/use-captcha.d.ts.map +1 -1
- package/dist/src/hooks/use-captcha.js +29 -37
- package/dist/src/hooks/use-mobile.d.ts.map +1 -1
- package/dist/src/hooks/use-mobile.js +3 -4
- package/dist/src/lib/api/get-middleware-api.js +4 -4
- package/dist/src/lib/api/get-next-cron-run-date.d.ts +2 -0
- package/dist/src/lib/api/get-next-cron-run-date.d.ts.map +1 -0
- package/dist/src/lib/api/get-next-cron-run-date.js +14 -0
- package/dist/src/lib/api/get-next-cron-run-date.test.d.ts +2 -0
- package/dist/src/lib/api/get-next-cron-run-date.test.d.ts.map +1 -0
- package/dist/src/lib/api/get-next-cron-run-date.test.js +55 -0
- package/dist/src/lib/api/get-session-admin-api.js +5 -5
- package/dist/src/lib/api/get-session-api.js +4 -4
- package/dist/src/lib/api/should-cron-job-run.d.ts +2 -0
- package/dist/src/lib/api/should-cron-job-run.d.ts.map +1 -0
- package/dist/src/lib/api/should-cron-job-run.js +16 -0
- package/dist/src/lib/api/should-cron-job-run.test.d.ts +2 -0
- package/dist/src/lib/api/should-cron-job-run.test.d.ts.map +1 -0
- package/dist/src/lib/api/should-cron-job-run.test.js +213 -0
- package/dist/src/lib/colors.js +28 -19
- package/dist/src/lib/colors.test.js +60 -60
- package/dist/src/lib/config.d.ts +1 -0
- package/dist/src/lib/config.d.ts.map +1 -1
- package/dist/src/lib/config.js +8 -6
- package/dist/src/lib/ctrl-or-command-character.d.ts +2 -0
- package/dist/src/lib/ctrl-or-command-character.d.ts.map +1 -0
- package/dist/src/lib/ctrl-or-command-character.js +9 -0
- package/dist/src/lib/fetcher/cookie-from-string-to-object.d.ts.map +1 -1
- package/dist/src/lib/fetcher/cookie-from-string-to-object.js +1 -1
- package/dist/src/lib/fetcher/cookie-from-string-to-object.test.js +27 -27
- package/dist/src/lib/fetcher/core.d.ts +5 -5
- package/dist/src/lib/fetcher/core.d.ts.map +1 -1
- package/dist/src/lib/fetcher/core.js +11 -10
- package/dist/src/lib/fetcher/helpers-server.d.ts +1 -1
- package/dist/src/lib/fetcher/helpers-server.js +1 -1
- package/dist/src/lib/fetcher/helpers.test.js +17 -17
- package/dist/src/lib/fetcher/types.d.ts +26 -26
- package/dist/src/lib/fetcher/types.d.ts.map +1 -1
- package/dist/src/lib/fetcher-client.d.ts +4 -4
- package/dist/src/lib/fetcher-client.d.ts.map +1 -1
- package/dist/src/lib/fetcher-client.js +3 -3
- package/dist/src/lib/fetcher.d.ts +5 -5
- package/dist/src/lib/fetcher.d.ts.map +1 -1
- package/dist/src/lib/fetcher.js +4 -4
- package/dist/src/lib/helpers/auto-form.d.ts +3 -3
- package/dist/src/lib/helpers/auto-form.d.ts.map +1 -1
- package/dist/src/lib/helpers/auto-form.js +16 -15
- package/dist/src/lib/helpers/auto-form.test.js +129 -129
- package/dist/src/lib/navigation.d.ts +3 -3
- package/dist/src/lib/navigation.d.ts.map +1 -1
- package/dist/src/lib/plugin.d.ts +3 -3
- package/dist/src/lib/special-characters.js +1 -1
- package/dist/src/lib/special-characters.test.js +36 -36
- package/dist/src/lib/utils.d.ts +1 -1
- package/dist/src/tests/setup.d.ts +1 -1
- package/dist/src/views/admin/layouts/admin-layout.d.ts +1 -1
- package/dist/src/views/admin/layouts/admin-layout.d.ts.map +1 -1
- package/dist/src/views/admin/layouts/admin-layout.js +5 -9
- package/dist/src/views/admin/layouts/sidebar/nav/item.d.ts.map +1 -1
- package/dist/src/views/admin/layouts/sidebar/nav/item.js +8 -12
- package/dist/src/views/admin/layouts/sidebar/nav/nav.d.ts +1 -1
- package/dist/src/views/admin/layouts/sidebar/nav/nav.d.ts.map +1 -1
- package/dist/src/views/admin/layouts/sidebar/nav/nav.js +23 -12
- package/dist/src/views/admin/layouts/sidebar/sidebar.d.ts +1 -1
- package/dist/src/views/admin/layouts/sidebar/sidebar.d.ts.map +1 -1
- package/dist/src/views/admin/layouts/sidebar/sidebar.js +1 -2
- package/dist/src/views/admin/layouts/sidebar/sign-out.js +1 -1
- package/dist/src/views/admin/layouts/user-bar/client.js +5 -5
- package/dist/src/views/admin/layouts/user-bar/user-bar.d.ts +1 -1
- package/dist/src/views/admin/layouts/user-bar/user-bar.d.ts.map +1 -1
- package/dist/src/views/admin/layouts/user-bar/user-bar.js +1 -1
- package/dist/src/views/admin/sign-in/sign-in-admin-view.js +1 -1
- package/dist/src/views/admin/views/core/advanced/cron/cron-table-view.d.ts +5 -0
- package/dist/src/views/admin/views/core/advanced/cron/cron-table-view.d.ts.map +1 -0
- package/dist/src/views/admin/views/core/advanced/cron/cron-table-view.js +97 -0
- package/dist/src/views/admin/views/core/advanced/cron/run-action/mutation-api.d.ts +4 -0
- package/dist/src/views/admin/views/core/advanced/cron/run-action/mutation-api.d.ts.map +1 -0
- package/dist/src/views/admin/views/core/advanced/cron/run-action/mutation-api.js +23 -0
- package/dist/src/views/admin/views/core/advanced/cron/run-action/run-action.d.ts +4 -0
- package/dist/src/views/admin/views/core/advanced/cron/run-action/run-action.d.ts.map +1 -0
- package/dist/src/views/admin/views/core/advanced/cron/run-action/run-action.js +37 -0
- package/dist/src/views/admin/views/core/dashboard/dashboard-admin-view.js +3 -3
- package/dist/src/views/admin/views/core/debug/actions/clear-cache/clear-cache.js +10 -10
- package/dist/src/views/admin/views/core/debug/actions/clear-cache/mutation-api.js +2 -2
- package/dist/src/views/admin/views/core/debug/system-logs/actions/more/content.d.ts +1 -1
- package/dist/src/views/admin/views/core/debug/system-logs/actions/more/content.d.ts.map +1 -1
- package/dist/src/views/admin/views/core/debug/system-logs/actions/more/content.js +15 -15
- package/dist/src/views/admin/views/core/debug/system-logs/actions/more/more.d.ts +1 -1
- package/dist/src/views/admin/views/core/debug/system-logs/actions/more/more.d.ts.map +1 -1
- package/dist/src/views/admin/views/core/debug/system-logs/actions/more/more.js +16 -25
- package/dist/src/views/admin/views/core/debug/system-logs/badges/badge-status.d.ts.map +1 -1
- package/dist/src/views/admin/views/core/debug/system-logs/badges/badge-status.js +7 -1
- package/dist/src/views/admin/views/core/debug/system-logs/badges/badge-type-log.d.ts +1 -1
- package/dist/src/views/admin/views/core/debug/system-logs/badges/badge-type-log.js +3 -3
- package/dist/src/views/admin/views/core/debug/system-logs/system-logs-view.js +25 -25
- package/dist/src/views/admin/views/core/test.d.ts.map +1 -1
- package/dist/src/views/admin/views/core/test.js +134 -124
- package/dist/src/views/admin/views/core/users/users-admin-view.d.ts.map +1 -1
- package/dist/src/views/admin/views/core/users/users-admin-view.js +13 -14
- package/dist/src/views/auth/password-reset/change-password-form/form.js +9 -9
- package/dist/src/views/auth/password-reset/change-password-form/mutation-api.d.ts +2 -2
- package/dist/src/views/auth/password-reset/change-password-form/mutation-api.js +5 -5
- package/dist/src/views/auth/password-reset/change-password-form/use-form.d.ts +2 -2
- package/dist/src/views/auth/password-reset/change-password-form/use-form.d.ts.map +1 -1
- package/dist/src/views/auth/password-reset/change-password-form/use-form.js +7 -7
- package/dist/src/views/auth/password-reset/form/form.d.ts +2 -2
- package/dist/src/views/auth/password-reset/form/form.d.ts.map +1 -1
- package/dist/src/views/auth/password-reset/form/form.js +15 -15
- package/dist/src/views/auth/password-reset/form/mutation-api.js +5 -5
- package/dist/src/views/auth/password-reset/form/use-form.d.ts +2 -2
- package/dist/src/views/auth/password-reset/form/use-form.js +7 -7
- package/dist/src/views/auth/password-reset/password-reset-view.js +4 -4
- package/dist/src/views/auth/sign-in/form/form.js +9 -9
- package/dist/src/views/auth/sign-in/form/mutation-api.d.ts +2 -2
- package/dist/src/views/auth/sign-in/form/mutation-api.d.ts.map +1 -1
- package/dist/src/views/auth/sign-in/form/mutation-api.js +10 -10
- package/dist/src/views/auth/sign-in/form/use-form.d.ts +2 -2
- package/dist/src/views/auth/sign-in/form/use-form.js +11 -11
- package/dist/src/views/auth/sign-in/sign-in-view.js +5 -5
- package/dist/src/views/auth/sign-up/components/password-input.d.ts +3 -3
- package/dist/src/views/auth/sign-up/components/password-input.d.ts.map +1 -1
- package/dist/src/views/auth/sign-up/components/password-input.js +9 -10
- package/dist/src/views/auth/sign-up/email-confirmation-view.js +4 -4
- package/dist/src/views/auth/sign-up/form/form.d.ts +2 -2
- package/dist/src/views/auth/sign-up/form/form.d.ts.map +1 -1
- package/dist/src/views/auth/sign-up/form/form.js +18 -18
- package/dist/src/views/auth/sign-up/form/mutation-api.d.ts +2 -2
- package/dist/src/views/auth/sign-up/form/mutation-api.d.ts.map +1 -1
- package/dist/src/views/auth/sign-up/form/mutation-api.js +6 -6
- package/dist/src/views/auth/sign-up/form/use-form.d.ts +2 -2
- package/dist/src/views/auth/sign-up/form/use-form.js +21 -21
- package/dist/src/views/auth/sign-up/sign-up-view.js +5 -5
- package/dist/src/views/auth/sign-up/wrapper.d.ts +1 -1
- package/dist/src/views/auth/sign-up/wrapper.d.ts.map +1 -1
- package/dist/src/views/auth/sign-up/wrapper.js +5 -8
- package/dist/src/views/auth/sso/buttons/client.js +4 -4
- package/dist/src/views/auth/sso/buttons/mutation-api.js +5 -5
- package/dist/src/views/auth/sso/buttons/sso-buttons.js +2 -2
- package/dist/src/views/auth/sso/callback/callback-sso-view.js +6 -6
- package/dist/src/views/auth/sso/callback/client/client.d.ts +1 -1
- package/dist/src/views/auth/sso/callback/client/client.d.ts.map +1 -1
- package/dist/src/views/auth/sso/callback/client/client.js +9 -9
- package/dist/src/views/auth/sso/callback/client/mutation-api.js +7 -7
- package/dist/src/views/error/back-button.js +1 -1
- package/dist/src/views/error/error-view.js +4 -4
- package/dist/src/views/error/global-error-view.d.ts +3 -3
- package/dist/src/views/error/global-error-view.d.ts.map +1 -1
- package/dist/src/views/error/global-error-view.js +36 -44
- package/dist/src/views/layouts/provider.d.ts +4 -4
- package/dist/src/views/layouts/provider.d.ts.map +1 -1
- package/dist/src/views/layouts/provider.js +3 -3
- package/dist/src/views/layouts/root-layout.d.ts +3 -3
- package/dist/src/views/layouts/root-layout.d.ts.map +1 -1
- package/dist/src/views/layouts/root-layout.js +1 -2
- package/dist/src/views/layouts/theme/header/header.d.ts +2 -2
- package/dist/src/views/layouts/theme/header/header.d.ts.map +1 -1
- package/dist/src/views/layouts/theme/header/header.js +2 -2
- package/dist/src/views/layouts/theme/header/user/auth/client.d.ts +1 -1
- package/dist/src/views/layouts/theme/header/user/auth/client.d.ts.map +1 -1
- package/dist/src/views/layouts/theme/header/user/auth/client.js +4 -4
- package/dist/src/views/layouts/theme/header/user/auth/log-out-mutation-api.js +8 -8
- package/dist/src/views/layouts/theme/header/user/user.js +4 -4
- package/dist/src/views/layouts/theme/layout.d.ts +2 -2
- package/dist/src/views/layouts/theme/layout.js +1 -1
- package/dist/src/vitnode.config.d.ts +18 -16
- package/dist/src/vitnode.config.d.ts.map +1 -1
- package/dist/src/vitnode.config.js +3 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +32 -29
- package/src/app/login/page.tsx +5 -5
- package/src/app/login/reset-password/page.tsx +5 -5
- package/src/app/login/sso/[providerId]/page.tsx +1 -1
- package/src/app/register/page.tsx +5 -5
- package/src/app_admin/core/advanced/cron/page.tsx +41 -0
- package/src/app_admin/core/debug/page.tsx +14 -14
- package/src/app_admin/core/page.tsx +1 -1
- package/src/app_admin/core/test/page.tsx +1 -1
- package/src/app_admin/core/users/page.tsx +12 -13
- package/src/locales/en.json +43 -0
- package/src/tiptap.css +20 -0
- package/dist/src/components/switchers/langs/language-swietcher.d.ts.map +0 -1
|
@@ -1,56 +1,56 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
2
|
import { checkSpecialCharacters, removeSpecialCharacters } from "./special-characters.js";
|
|
3
|
-
describe(
|
|
4
|
-
it(
|
|
5
|
-
expect(removeSpecialCharacters(
|
|
3
|
+
describe("removeSpecialCharacters", ()=>{
|
|
4
|
+
it("should remove diacritics and replace spaces with hyphens", ()=>{
|
|
5
|
+
expect(removeSpecialCharacters("héllo wörld")).toBe("hello-world");
|
|
6
6
|
});
|
|
7
|
-
it(
|
|
8
|
-
expect(removeSpecialCharacters(
|
|
7
|
+
it("should keep spaces when replaceSpace is false", ()=>{
|
|
8
|
+
expect(removeSpecialCharacters("hello world", false)).toBe("hello world");
|
|
9
9
|
});
|
|
10
|
-
it(
|
|
11
|
-
expect(removeSpecialCharacters(
|
|
10
|
+
it("should remove special characters", ()=>{
|
|
11
|
+
expect(removeSpecialCharacters("hello#world%123")).toBe("helloworld123");
|
|
12
12
|
});
|
|
13
|
-
it(
|
|
14
|
-
expect(removeSpecialCharacters(
|
|
13
|
+
it("should replace @ with -at-", ()=>{
|
|
14
|
+
expect(removeSpecialCharacters("user@example.com")).toBe("user-at-example-com");
|
|
15
15
|
});
|
|
16
|
-
it(
|
|
17
|
-
expect(removeSpecialCharacters(
|
|
16
|
+
it("should replace dots with hyphens", ()=>{
|
|
17
|
+
expect(removeSpecialCharacters("file.name.txt")).toBe("file-name-txt");
|
|
18
18
|
});
|
|
19
|
-
it(
|
|
20
|
-
expect(removeSpecialCharacters(
|
|
19
|
+
it("should replace Polish ł with l", ()=>{
|
|
20
|
+
expect(removeSpecialCharacters("Łódź")).toBe("lodz");
|
|
21
21
|
});
|
|
22
|
-
it(
|
|
23
|
-
expect(removeSpecialCharacters(
|
|
22
|
+
it("should trim whitespace from start and end", ()=>{
|
|
23
|
+
expect(removeSpecialCharacters(" hello world ")).toBe("hello-world");
|
|
24
24
|
});
|
|
25
|
-
it(
|
|
26
|
-
expect(removeSpecialCharacters(
|
|
25
|
+
it("should handle empty string", ()=>{
|
|
26
|
+
expect(removeSpecialCharacters("")).toBe("");
|
|
27
27
|
});
|
|
28
|
-
it(
|
|
29
|
-
expect(removeSpecialCharacters(
|
|
28
|
+
it("should handle multiple special characters and spaces", ()=>{
|
|
29
|
+
expect(removeSpecialCharacters("Hello & World #123 {test}")).toBe("Hello-World-123-test");
|
|
30
30
|
});
|
|
31
31
|
});
|
|
32
|
-
describe(
|
|
33
|
-
it(
|
|
34
|
-
expect(checkSpecialCharacters(
|
|
32
|
+
describe("checkSpecialCharacters", ()=>{
|
|
33
|
+
it("should return true for alphanumeric characters and hyphens", ()=>{
|
|
34
|
+
expect(checkSpecialCharacters("hello-world-123")).toBe(true);
|
|
35
35
|
});
|
|
36
|
-
it(
|
|
37
|
-
expect(checkSpecialCharacters(
|
|
36
|
+
it("should return false for special characters", ()=>{
|
|
37
|
+
expect(checkSpecialCharacters("hello@world")).toBe(false);
|
|
38
38
|
});
|
|
39
|
-
it(
|
|
40
|
-
expect(checkSpecialCharacters(
|
|
39
|
+
it("should return false for spaces", ()=>{
|
|
40
|
+
expect(checkSpecialCharacters("hello world")).toBe(false);
|
|
41
41
|
});
|
|
42
|
-
it(
|
|
43
|
-
expect(checkSpecialCharacters(
|
|
42
|
+
it("should return true for uppercase letters", ()=>{
|
|
43
|
+
expect(checkSpecialCharacters("HelloWorld")).toBe(true);
|
|
44
44
|
});
|
|
45
|
-
it(
|
|
46
|
-
expect(checkSpecialCharacters(
|
|
45
|
+
it("should return true for numbers only", ()=>{
|
|
46
|
+
expect(checkSpecialCharacters("123")).toBe(true);
|
|
47
47
|
});
|
|
48
|
-
it(
|
|
49
|
-
expect(checkSpecialCharacters(
|
|
48
|
+
it("should return true for hyphens only", ()=>{
|
|
49
|
+
expect(checkSpecialCharacters("-")).toBe(true);
|
|
50
50
|
});
|
|
51
|
-
it(
|
|
52
|
-
expect(checkSpecialCharacters(
|
|
53
|
-
expect(checkSpecialCharacters(
|
|
54
|
-
expect(checkSpecialCharacters(
|
|
51
|
+
it("should return false for other special characters", ()=>{
|
|
52
|
+
expect(checkSpecialCharacters("hello#world")).toBe(false);
|
|
53
|
+
expect(checkSpecialCharacters("test.com")).toBe(false);
|
|
54
|
+
expect(checkSpecialCharacters("user&name")).toBe(false);
|
|
55
55
|
});
|
|
56
56
|
});
|
package/dist/src/lib/utils.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "@testing-library/react";
|
|
2
2
|
//# sourceMappingURL=setup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-layout.d.ts","sourceRoot":"","sources":["../../../../../src/views/admin/layouts/admin-layout.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"admin-layout.d.ts","sourceRoot":"","sources":["../../../../../src/views/admin/layouts/admin-layout.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAK7D,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,WAAW,GAAU,8BAG/B,gBAAgB,GAAG;IACpB,aAAa,EAAE,aAAa,CAAC;CAC9B,4DAiDA,CAAC"}
|
|
@@ -1,33 +1,29 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { getTranslations } from "next-intl/server";
|
|
3
2
|
import { cookies } from "next/headers";
|
|
3
|
+
import { getTranslations } from "next-intl/server";
|
|
4
4
|
import { ThemeSwitcher } from "../../../components/switchers/themes/theme-switcher.js";
|
|
5
|
-
import { SidebarProvider, SidebarTrigger } from "../../../components/ui/sidebar.js";
|
|
6
|
-
import { SidebarInset } from "../../../components/ui/sidebar.js";
|
|
5
|
+
import { SidebarInset, SidebarProvider, SidebarTrigger } from "../../../components/ui/sidebar.js";
|
|
7
6
|
import { getSessionAdminApi } from "../../../lib/api/get-session-admin-api.js";
|
|
8
7
|
import { I18nProvider } from "../../../components/i18n-provider.js";
|
|
9
|
-
import { LanguageSwitcher } from "../../../components/switchers/langs/language-
|
|
8
|
+
import { LanguageSwitcher } from "../../../components/switchers/langs/language-switcher.js";
|
|
10
9
|
import { SidebarAdmin } from "./sidebar/sidebar.js";
|
|
11
10
|
import { UserBarAdmin } from "./user-bar/user-bar.js";
|
|
12
11
|
export const AdminLayout = async ({ children, vitNodeConfig })=>{
|
|
13
12
|
const t = await getTranslations();
|
|
14
13
|
const session = await getSessionAdminApi();
|
|
15
14
|
const cookieStore = await cookies();
|
|
16
|
-
const defaultOpen = !cookieStore.get(
|
|
15
|
+
const defaultOpen = !cookieStore.get("vitnode_admin_sidebar_state") || cookieStore.get("vitnode_admin_sidebar_state")?.value === "true";
|
|
17
16
|
if (!session) return null;
|
|
18
17
|
const pluginNav = vitNodeConfig.plugins.filter((plugin)=>plugin.admin?.nav).map((plugin)=>({
|
|
19
18
|
id: plugin.pluginId,
|
|
20
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
21
19
|
// @ts-expect-error
|
|
22
20
|
title: t(`${plugin.pluginId}.title`),
|
|
23
21
|
items: (plugin.admin?.nav ?? []).map((item)=>({
|
|
24
22
|
...item,
|
|
25
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
26
23
|
// @ts-expect-error
|
|
27
24
|
title: t(`${plugin.pluginId}.admin.nav.${item.id}`),
|
|
28
25
|
items: item.items?.map((subItem)=>({
|
|
29
26
|
...subItem,
|
|
30
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
31
27
|
// @ts-expect-error
|
|
32
28
|
title: t(`${plugin.pluginId}.admin.nav.${item.id}.${subItem.id}`)
|
|
33
29
|
})) ?? []
|
|
@@ -35,7 +31,7 @@ export const AdminLayout = async ({ children, vitNodeConfig })=>{
|
|
|
35
31
|
}));
|
|
36
32
|
return /*#__PURE__*/ _jsx(I18nProvider, {
|
|
37
33
|
namespaces: [
|
|
38
|
-
|
|
34
|
+
"admin.global"
|
|
39
35
|
],
|
|
40
36
|
children: /*#__PURE__*/ _jsxs(SidebarProvider, {
|
|
41
37
|
defaultOpen: defaultOpen,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../../../../../../src/views/admin/layouts/sidebar/nav/item.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../../../../../../src/views/admin/layouts/sidebar/nav/item.tsx"],"names":[],"mappings":"AAqBA,UAAU,iBAAiB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,YAAY,GAAI,+CAM1B,iBAAiB,GAAG;IACrB,KAAK,CAAC,EAAE,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,EAAE,CAAC;CAC3C,4CAsGA,CAAC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { ChevronRight, MenuIcon } from "lucide-react";
|
|
4
4
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../../../../../components/ui/collapsible.js";
|
|
5
|
-
import { SidebarMenuButton, useSidebar } from "../../../../../components/ui/sidebar.js";
|
|
6
|
-
import { SidebarMenuItem, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem } from "../../../../../components/ui/sidebar.js";
|
|
5
|
+
import { SidebarMenuButton, SidebarMenuItem, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, useSidebar } from "../../../../../components/ui/sidebar.js";
|
|
7
6
|
import { useIsMobile } from "../../../../../hooks/use-mobile.js";
|
|
8
7
|
import { Link, usePathname } from "../../../../../lib/navigation.js";
|
|
9
8
|
import { cn } from "../../../../../lib/utils.js";
|
|
@@ -13,7 +12,7 @@ export const ItemNavAdmin = ({ href, title, icon, items = [], isOpenInNewTab })=
|
|
|
13
12
|
const pathname = usePathname();
|
|
14
13
|
// Helper function to normalize URLs for comparison
|
|
15
14
|
const normalizeUrl = (url)=>{
|
|
16
|
-
return url.endsWith(
|
|
15
|
+
return url.endsWith("/") && url.length > 1 ? url.slice(0, -1) : url;
|
|
17
16
|
};
|
|
18
17
|
// Check if current path matches href (with normalization)
|
|
19
18
|
const isActive = normalizeUrl(pathname) === normalizeUrl(href);
|
|
@@ -36,15 +35,14 @@ export const ItemNavAdmin = ({ href, title, icon, items = [], isOpenInNewTab })=
|
|
|
36
35
|
isActive: isActive,
|
|
37
36
|
tooltip: title,
|
|
38
37
|
children: /*#__PURE__*/ _jsx(Link, {
|
|
39
|
-
className: cn('relative', isActive && 'before:bg-primary before:absolute before:bottom-1 before:left-0 before:top-1 before:h-auto before:w-1 before:rounded-r-sm'),
|
|
40
38
|
href: href,
|
|
41
39
|
onClick: ()=>{
|
|
42
40
|
if (isMobile) {
|
|
43
41
|
toggleSidebar();
|
|
44
42
|
}
|
|
45
43
|
},
|
|
46
|
-
rel: isOpenInNewTab ?
|
|
47
|
-
target: isOpenInNewTab ?
|
|
44
|
+
rel: isOpenInNewTab ? "noopener noreferrer" : undefined,
|
|
45
|
+
target: isOpenInNewTab ? "_blank" : undefined,
|
|
48
46
|
children: content
|
|
49
47
|
})
|
|
50
48
|
})
|
|
@@ -59,7 +57,6 @@ export const ItemNavAdmin = ({ href, title, icon, items = [], isOpenInNewTab })=
|
|
|
59
57
|
/*#__PURE__*/ _jsx(CollapsibleTrigger, {
|
|
60
58
|
asChild: true,
|
|
61
59
|
children: /*#__PURE__*/ _jsxs(SidebarMenuButton, {
|
|
62
|
-
className: cn('relative', (isActive || hasActiveChild) && 'before:bg-primary before:absolute before:bottom-1 before:left-0 before:top-1 before:h-auto before:w-1 before:rounded-r-sm'),
|
|
63
60
|
isActive: isActive || hasActiveChild,
|
|
64
61
|
tooltip: title,
|
|
65
62
|
children: [
|
|
@@ -71,7 +68,7 @@ export const ItemNavAdmin = ({ href, title, icon, items = [], isOpenInNewTab })=
|
|
|
71
68
|
})
|
|
72
69
|
}),
|
|
73
70
|
/*#__PURE__*/ _jsx(CollapsibleContent, {
|
|
74
|
-
className: cn(
|
|
71
|
+
className: cn("text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 outline-none"),
|
|
75
72
|
children: /*#__PURE__*/ _jsx(SidebarMenuSub, {
|
|
76
73
|
children: items.map((item)=>{
|
|
77
74
|
const isChildActive = normalizeUrl(pathname) === normalizeUrl(item.href);
|
|
@@ -80,15 +77,14 @@ export const ItemNavAdmin = ({ href, title, icon, items = [], isOpenInNewTab })=
|
|
|
80
77
|
asChild: true,
|
|
81
78
|
isActive: isChildActive,
|
|
82
79
|
children: /*#__PURE__*/ _jsx(Link, {
|
|
83
|
-
className: cn('relative', isChildActive && 'before:bg-primary before:absolute before:bottom-1 before:left-0 before:top-1 before:h-auto before:w-1 before:rounded-r-sm'),
|
|
84
80
|
href: item.href,
|
|
85
81
|
onClick: ()=>{
|
|
86
82
|
if (isMobile) {
|
|
87
83
|
toggleSidebar();
|
|
88
84
|
}
|
|
89
85
|
},
|
|
90
|
-
rel: item.isOpenInNewTab ?
|
|
91
|
-
target: item.isOpenInNewTab ?
|
|
86
|
+
rel: item.isOpenInNewTab ? "noopener noreferrer" : undefined,
|
|
87
|
+
target: item.isOpenInNewTab ? "_blank" : undefined,
|
|
92
88
|
children: item.title
|
|
93
89
|
})
|
|
94
90
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nav.d.ts","sourceRoot":"","sources":["../../../../../../../src/views/admin/layouts/sidebar/nav/nav.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,YAAY,CAAC,EAAE,CAAC;IACnD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,eAAe,GAAU,gBAEnC;IACD,SAAS,EAAE,cAAc,EAAE,CAAC;CAC7B,
|
|
1
|
+
{"version":3,"file":"nav.d.ts","sourceRoot":"","sources":["../../../../../../../src/views/admin/layouts/sidebar/nav/nav.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,YAAY,CAAC,EAAE,CAAC;IACnD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,eAAe,GAAU,gBAEnC;IACD,SAAS,EAAE,cAAc,EAAE,CAAC;CAC7B,uDAqDA,CAAC"}
|
|
@@ -1,32 +1,43 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { LayoutDashboardIcon, UsersRoundIcon } from "lucide-react";
|
|
2
|
+
import { LayoutDashboardIcon, UsersRoundIcon, WrenchIcon } from "lucide-react";
|
|
3
3
|
import { getTranslations } from "next-intl/server";
|
|
4
4
|
import { SidebarGroup, SidebarGroupLabel, SidebarMenu } from "../../../../../components/ui/sidebar.js";
|
|
5
5
|
import { ItemNavAdmin } from "./item.js";
|
|
6
6
|
export const NavSidebarAdmin = async ({ pluginNav })=>{
|
|
7
|
-
const t = await getTranslations(
|
|
7
|
+
const t = await getTranslations("admin.global.nav");
|
|
8
8
|
const rootItems = [
|
|
9
9
|
{
|
|
10
|
-
id:
|
|
11
|
-
title: t(
|
|
10
|
+
id: "core",
|
|
11
|
+
title: t("core"),
|
|
12
12
|
items: [
|
|
13
13
|
{
|
|
14
|
-
href:
|
|
14
|
+
href: "/admin/core/",
|
|
15
15
|
icon: /*#__PURE__*/ _jsx(LayoutDashboardIcon, {}),
|
|
16
|
-
title: t(
|
|
16
|
+
title: t("dashboard")
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
|
-
href:
|
|
20
|
-
title: t(
|
|
19
|
+
href: "/admin/core/users",
|
|
20
|
+
title: t("users.title"),
|
|
21
21
|
icon: /*#__PURE__*/ _jsx(UsersRoundIcon, {}),
|
|
22
22
|
items: [
|
|
23
23
|
{
|
|
24
|
-
title: t(
|
|
25
|
-
href:
|
|
24
|
+
title: t("users.list"),
|
|
25
|
+
href: "/admin/core/users"
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
|
-
title:
|
|
29
|
-
href:
|
|
28
|
+
title: "test",
|
|
29
|
+
href: "/admin/core/test"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
href: "/admin/core/advanced",
|
|
35
|
+
title: t("advanced.title"),
|
|
36
|
+
icon: /*#__PURE__*/ _jsx(WrenchIcon, {}),
|
|
37
|
+
items: [
|
|
38
|
+
{
|
|
39
|
+
title: t("advanced.cron"),
|
|
40
|
+
href: "/admin/core/advanced/cron"
|
|
30
41
|
}
|
|
31
42
|
]
|
|
32
43
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { NavSidebarAdmin } from
|
|
1
|
+
import { NavSidebarAdmin } from "./nav/nav";
|
|
2
2
|
export declare const SidebarAdmin: ({ pluginNav, }: React.ComponentProps<typeof NavSidebarAdmin>) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
//# sourceMappingURL=sidebar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../../../../../src/views/admin/layouts/sidebar/sidebar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../../../../../src/views/admin/layouts/sidebar/sidebar.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,eAAO,MAAM,YAAY,GAAI,gBAE1B,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,4CAa9C,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { LogoVitNode } from "../../../../components/logo-vitnode.js";
|
|
3
|
-
import { Sidebar } from "../../../../components/ui/sidebar.js";
|
|
4
|
-
import { SidebarContent, SidebarHeader } from "../../../../components/ui/sidebar.js";
|
|
3
|
+
import { Sidebar, SidebarContent, SidebarHeader } from "../../../../components/ui/sidebar.js";
|
|
5
4
|
import { Link } from "../../../../lib/navigation.js";
|
|
6
5
|
import { NavSidebarAdmin } from "./nav/nav.js";
|
|
7
6
|
export const SidebarAdmin = ({ pluginNav })=>{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { BugIcon, HomeIcon, LogOut } from "lucide-react";
|
|
4
4
|
import { useTranslations } from "next-intl";
|
|
@@ -6,7 +6,7 @@ import { DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSep
|
|
|
6
6
|
import { Link } from "../../../../lib/navigation.js";
|
|
7
7
|
import { logOutMutationApi } from "../../../layouts/theme/header/user/auth/log-out-mutation-api.js";
|
|
8
8
|
export const ClientUserBarAdmin = ({ user })=>{
|
|
9
|
-
const t = useTranslations(
|
|
9
|
+
const t = useTranslations("admin.global.nav.user_bar");
|
|
10
10
|
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
11
11
|
children: [
|
|
12
12
|
/*#__PURE__*/ _jsx(DropdownMenuLabel, {
|
|
@@ -35,7 +35,7 @@ export const ClientUserBarAdmin = ({ user })=>{
|
|
|
35
35
|
target: "_blank",
|
|
36
36
|
children: [
|
|
37
37
|
/*#__PURE__*/ _jsx(HomeIcon, {}),
|
|
38
|
-
t(
|
|
38
|
+
t("home_page")
|
|
39
39
|
]
|
|
40
40
|
})
|
|
41
41
|
}),
|
|
@@ -45,7 +45,7 @@ export const ClientUserBarAdmin = ({ user })=>{
|
|
|
45
45
|
href: "/admin/core/debug",
|
|
46
46
|
children: [
|
|
47
47
|
/*#__PURE__*/ _jsx(BugIcon, {}),
|
|
48
|
-
t(
|
|
48
|
+
t("debug")
|
|
49
49
|
]
|
|
50
50
|
})
|
|
51
51
|
})
|
|
@@ -61,7 +61,7 @@ export const ClientUserBarAdmin = ({ user })=>{
|
|
|
61
61
|
},
|
|
62
62
|
children: [
|
|
63
63
|
/*#__PURE__*/ _jsx(LogOut, {}),
|
|
64
|
-
t(
|
|
64
|
+
t("log_out")
|
|
65
65
|
]
|
|
66
66
|
})
|
|
67
67
|
]
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { getSessionAdminApi } from
|
|
1
|
+
import type { getSessionAdminApi } from "../../../../lib/api/get-session-admin-api";
|
|
2
2
|
export declare const UserBarAdmin: ({ user, }: Pick<NonNullable<Awaited<ReturnType<typeof getSessionAdminApi>>>, "user">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
//# sourceMappingURL=user-bar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-bar.d.ts","sourceRoot":"","sources":["../../../../../../src/views/admin/layouts/user-bar/user-bar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"user-bar.d.ts","sourceRoot":"","sources":["../../../../../../src/views/admin/layouts/user-bar/user-bar.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAI1E,eAAO,MAAM,YAAY,GAAI,WAE1B,IAAI,CACL,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC,CAAC,EAC3D,MAAM,CACP,4CAkBA,CAAC"}
|
|
@@ -6,7 +6,7 @@ import { FormSignIn } from "../../auth/sign-in/form/form.js";
|
|
|
6
6
|
export const SignInAdminView = ()=>{
|
|
7
7
|
return /*#__PURE__*/ _jsx(I18nProvider, {
|
|
8
8
|
namespaces: [
|
|
9
|
-
|
|
9
|
+
"core.auth.sign_in"
|
|
10
10
|
],
|
|
11
11
|
children: /*#__PURE__*/ _jsxs("div", {
|
|
12
12
|
className: "mx-auto flex min-h-screen max-w-md flex-col items-center justify-center gap-10 px-4 py-16",
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type SearchParamsDataTable } from "../../../../../../components/table/data-table";
|
|
2
|
+
export declare const CronTableView: ({ searchParams, }: {
|
|
3
|
+
searchParams: Promise<SearchParamsDataTable>;
|
|
4
|
+
}) => Promise<import("react/jsx-runtime").JSX.Element>;
|
|
5
|
+
//# sourceMappingURL=cron-table-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cron-table-view.d.ts","sourceRoot":"","sources":["../../../../../../../../src/views/admin/views/core/advanced/cron/cron-table-view.tsx"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,+BAA+B,CAAC;AAIvC,eAAO,MAAM,aAAa,GAAU,mBAEjC;IACD,YAAY,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;CAC9C,qDA8EA,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { getTranslations } from "next-intl/server";
|
|
3
|
+
import { cronAdminModule } from "../../../../../../api/modules/admin/advanced/cron/cron.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 { RunActionCronTable } from "./run-action/run-action.js";
|
|
8
|
+
export const CronTableView = async ({ searchParams })=>{
|
|
9
|
+
const query = await searchParams;
|
|
10
|
+
const res = await fetcher(cronAdminModule, {
|
|
11
|
+
path: "/",
|
|
12
|
+
method: "get",
|
|
13
|
+
module: "cron",
|
|
14
|
+
prefixPath: "/admin/advanced",
|
|
15
|
+
args: {
|
|
16
|
+
query
|
|
17
|
+
},
|
|
18
|
+
withPagination: true
|
|
19
|
+
});
|
|
20
|
+
const [data, t] = await Promise.all([
|
|
21
|
+
res.json(),
|
|
22
|
+
getTranslations("admin.advanced.cron")
|
|
23
|
+
]);
|
|
24
|
+
return /*#__PURE__*/ _jsx(DataTable, {
|
|
25
|
+
columns: [
|
|
26
|
+
{
|
|
27
|
+
id: "name",
|
|
28
|
+
label: t("list.name"),
|
|
29
|
+
cell: ({ row })=>/*#__PURE__*/ _jsxs("div", {
|
|
30
|
+
className: "flex flex-col max-w-sm",
|
|
31
|
+
children: [
|
|
32
|
+
/*#__PURE__*/ _jsx("span", {
|
|
33
|
+
children: row.name
|
|
34
|
+
}),
|
|
35
|
+
/*#__PURE__*/ _jsx("p", {
|
|
36
|
+
className: "text-sm text-muted-foreground",
|
|
37
|
+
children: row.description
|
|
38
|
+
})
|
|
39
|
+
]
|
|
40
|
+
})
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: "pluginId",
|
|
44
|
+
label: t("list.pluginId")
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
id: "module",
|
|
48
|
+
label: t("list.module")
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: "schedule",
|
|
52
|
+
label: t("list.schedule")
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
id: "lastRun",
|
|
56
|
+
label: t("list.lastRun.title"),
|
|
57
|
+
cell: ({ row })=>row.lastRun ? /*#__PURE__*/ _jsx(DateFormat, {
|
|
58
|
+
date: row.lastRun
|
|
59
|
+
}) : /*#__PURE__*/ _jsx("span", {
|
|
60
|
+
className: "italic text-muted-foreground",
|
|
61
|
+
children: t("list.lastRun.never")
|
|
62
|
+
})
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: "nextRun",
|
|
66
|
+
label: t("list.nextRun.title"),
|
|
67
|
+
cell: ({ row })=>row.nextRun ? /*#__PURE__*/ _jsx(DateFormat, {
|
|
68
|
+
date: row.nextRun,
|
|
69
|
+
showFullDate: true
|
|
70
|
+
}) : /*#__PURE__*/ _jsx("span", {
|
|
71
|
+
className: "italic text-muted-foreground",
|
|
72
|
+
children: t("list.nextRun.never")
|
|
73
|
+
})
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
id: "actions",
|
|
77
|
+
label: "",
|
|
78
|
+
cell: ({ row })=>/*#__PURE__*/ _jsx(RunActionCronTable, {
|
|
79
|
+
id: row.id
|
|
80
|
+
})
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
edges: data.edges,
|
|
84
|
+
order: {
|
|
85
|
+
columns: [
|
|
86
|
+
"lastRun",
|
|
87
|
+
"createdAt",
|
|
88
|
+
"nextRun"
|
|
89
|
+
],
|
|
90
|
+
defaultOrder: {
|
|
91
|
+
column: "lastRun",
|
|
92
|
+
order: "desc"
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
pageInfo: data.pageInfo
|
|
96
|
+
});
|
|
97
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutation-api.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/views/admin/views/core/advanced/cron/run-action/mutation-api.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,WAAW,GAAU,IAAI,MAAM;;cAkB3C,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use server";
|
|
2
|
+
import { revalidatePath } from "next/cache";
|
|
3
|
+
import { cronAdminModule } from "../../../../../../../api/modules/admin/advanced/cron/cron.admin.module.js";
|
|
4
|
+
import { fetcher } from "../../../../../../../lib/fetcher.js";
|
|
5
|
+
export const mutationApi = async (id)=>{
|
|
6
|
+
const res = await fetcher(cronAdminModule, {
|
|
7
|
+
path: "/{id}",
|
|
8
|
+
method: "post",
|
|
9
|
+
module: "cron",
|
|
10
|
+
prefixPath: "/admin/advanced",
|
|
11
|
+
args: {
|
|
12
|
+
params: {
|
|
13
|
+
id: id.toString()
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
if (!res.ok) {
|
|
18
|
+
return {
|
|
19
|
+
error: "Failed to run cron job"
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
revalidatePath("[locale]/admin/(auth)/(plugins)/(vitnode-core)/core/advanced/cron");
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-action.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/views/admin/views/core/advanced/cron/run-action/run-action.tsx"],"names":[],"mappings":"AAUA,eAAO,MAAM,kBAAkB,GAAI,QAAQ;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,4CA+BxD,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { PlayIcon } from "lucide-react";
|
|
4
|
+
import { useTranslations } from "next-intl";
|
|
5
|
+
import { useActionState } from "react";
|
|
6
|
+
import { toast } from "sonner";
|
|
7
|
+
import { Button } from "../../../../../../../components/ui/button.js";
|
|
8
|
+
import { TooltipWithContent } from "../../../../../../../components/ui/tooltip.js";
|
|
9
|
+
import { mutationApi } from "./mutation-api.js";
|
|
10
|
+
export const RunActionCronTable = ({ id })=>{
|
|
11
|
+
const t = useTranslations("admin.advanced.cron.list.actions.runNow");
|
|
12
|
+
const tError = useTranslations("core.global.errors");
|
|
13
|
+
const [_, formAction, isPending] = useActionState(async ()=>{
|
|
14
|
+
const mutation = await mutationApi(id);
|
|
15
|
+
if (mutation?.error) {
|
|
16
|
+
toast.error(tError("title"), {
|
|
17
|
+
description: tError("internal_server_error")
|
|
18
|
+
});
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
toast.success(t("success"));
|
|
22
|
+
}, null);
|
|
23
|
+
return /*#__PURE__*/ _jsx("form", {
|
|
24
|
+
action: formAction,
|
|
25
|
+
children: /*#__PURE__*/ _jsx(TooltipWithContent, {
|
|
26
|
+
text: t("label"),
|
|
27
|
+
children: /*#__PURE__*/ _jsx(Button, {
|
|
28
|
+
variant: "ghost",
|
|
29
|
+
type: "submit",
|
|
30
|
+
size: "icon",
|
|
31
|
+
"aria-label": t("label"),
|
|
32
|
+
isLoading: isPending,
|
|
33
|
+
children: /*#__PURE__*/ _jsx(PlayIcon, {})
|
|
34
|
+
})
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
};
|