@meith/web 0.16.0
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/LICENSE.md +165 -0
- package/app/(auth)/layout.tsx +6 -0
- package/app/(auth)/login/page.tsx +106 -0
- package/app/(auth)/login/verify/page.tsx +55 -0
- package/app/(auth)/register/page.tsx +83 -0
- package/app/(auth)/reset/confirm/page.tsx +45 -0
- package/app/(auth)/reset/page.tsx +22 -0
- package/app/(auth)/verify/page.tsx +44 -0
- package/app/(auth)/verify/resend/page.tsx +51 -0
- package/app/(board)/[slug]/feed.xml/route.ts +48 -0
- package/app/(board)/[slug]/new/page.tsx +112 -0
- package/app/(board)/[slug]/page.tsx +403 -0
- package/app/(board)/discover/[view]/page.tsx +115 -0
- package/app/(board)/discover/page.tsx +5 -0
- package/app/(board)/layout.tsx +22 -0
- package/app/(board)/member/[id]/page.tsx +187 -0
- package/app/(board)/member/[id]/reputation/page.tsx +195 -0
- package/app/(board)/member/by-name/[name]/page.tsx +32 -0
- package/app/(board)/messages/[id]/page.tsx +103 -0
- package/app/(board)/messages/compose/page.tsx +60 -0
- package/app/(board)/messages/layout.tsx +5 -0
- package/app/(board)/messages/page.tsx +179 -0
- package/app/(board)/modcp/forums/page.tsx +59 -0
- package/app/(board)/modcp/ip/page.tsx +158 -0
- package/app/(board)/modcp/layout.tsx +5 -0
- package/app/(board)/modcp/log/page.tsx +98 -0
- package/app/(board)/modcp/page.tsx +112 -0
- package/app/(board)/moderation/layout.tsx +5 -0
- package/app/(board)/moderation/page.tsx +111 -0
- package/app/(board)/moderation/reports/page.tsx +193 -0
- package/app/(board)/moderation/warn/page.tsx +158 -0
- package/app/(board)/notifications/layout.tsx +5 -0
- package/app/(board)/notifications/page.tsx +144 -0
- package/app/(board)/notifications/preferences/page.tsx +65 -0
- package/app/(board)/online/page.tsx +119 -0
- package/app/(board)/page.tsx +195 -0
- package/app/(board)/plugins/[key]/[[...path]]/page.tsx +72 -0
- package/app/(board)/privacy/page.tsx +12 -0
- package/app/(board)/report/page.tsx +71 -0
- package/app/(board)/rules/page.tsx +12 -0
- package/app/(board)/search/[token]/page.tsx +130 -0
- package/app/(board)/search/page.tsx +289 -0
- package/app/(board)/stats/page.tsx +202 -0
- package/app/(board)/subscriptions/layout.tsx +5 -0
- package/app/(board)/subscriptions/page.tsx +142 -0
- package/app/(board)/terms/page.tsx +12 -0
- package/app/(board)/thread/[slug]/edit/page.tsx +107 -0
- package/app/(board)/thread/[slug]/feed.xml/route.ts +42 -0
- package/app/(board)/thread/[slug]/page.tsx +707 -0
- package/app/(board)/thread/[slug]/poll/page.tsx +41 -0
- package/app/(board)/thread/[slug]/post/[postId]/history/page.tsx +160 -0
- package/app/(board)/thread/[slug]/reply/page.tsx +136 -0
- package/app/(board)/unsubscribe/page.tsx +73 -0
- package/app/(board)/usercp/avatar/page.tsx +56 -0
- package/app/(board)/usercp/contacts/page.tsx +141 -0
- package/app/(board)/usercp/email/confirm/page.tsx +52 -0
- package/app/(board)/usercp/layout.tsx +23 -0
- package/app/(board)/usercp/options/page.tsx +56 -0
- package/app/(board)/usercp/page.tsx +71 -0
- package/app/(board)/usercp/profile/page.tsx +81 -0
- package/app/(board)/usercp/security/page.tsx +238 -0
- package/app/(board)/usercp/security/verify/page.tsx +92 -0
- package/app/(board)/usercp/signature/page.tsx +67 -0
- package/app/admin/antispam/page.tsx +155 -0
- package/app/admin/api/marketplace/screenshot/route.ts +68 -0
- package/app/admin/api/plugins/[key]/[...path]/route.ts +27 -0
- package/app/admin/api-tokens/page.tsx +129 -0
- package/app/admin/content/announcements/page.tsx +110 -0
- package/app/admin/content/attachments/page.tsx +199 -0
- package/app/admin/content/navigation/page.tsx +123 -0
- package/app/admin/content/page.tsx +170 -0
- package/app/admin/forums/[id]/page.tsx +96 -0
- package/app/admin/forums/[id]/permissions/page.tsx +108 -0
- package/app/admin/forums/page.tsx +45 -0
- package/app/admin/groups/[id]/page.tsx +133 -0
- package/app/admin/groups/memberships/page.tsx +56 -0
- package/app/admin/groups/page.tsx +104 -0
- package/app/admin/groups/promotions/page.tsx +143 -0
- package/app/admin/layout.tsx +86 -0
- package/app/admin/log/page.tsx +116 -0
- package/app/admin/page.tsx +206 -0
- package/app/admin/plugins/[key]/[[...path]]/page.tsx +276 -0
- package/app/admin/plugins/browse/page.tsx +70 -0
- package/app/admin/plugins/page.tsx +165 -0
- package/app/admin/security/page.tsx +124 -0
- package/app/admin/settings/page.tsx +190 -0
- package/app/admin/system/page.tsx +303 -0
- package/app/admin/themes/[key]/page.tsx +110 -0
- package/app/admin/themes/browse/page.tsx +70 -0
- package/app/admin/themes/page.tsx +163 -0
- package/app/admin/users/[id]/merge/page.tsx +136 -0
- package/app/admin/users/[id]/page.tsx +208 -0
- package/app/admin/users/mail/page.tsx +68 -0
- package/app/admin/users/page.tsx +260 -0
- package/app/admin/users/prune/page.tsx +186 -0
- package/app/api/health/route.ts +11 -0
- package/app/api/metrics/route.ts +66 -0
- package/app/api/plugins/[key]/[...path]/route.ts +27 -0
- package/app/api/read/all/route.ts +15 -0
- package/app/api/read/forum/[id]/route.ts +29 -0
- package/app/api/read/thread/[id]/route.ts +40 -0
- package/app/api/ready/route.ts +63 -0
- package/app/api/system/tick/route.ts +77 -0
- package/app/api/v1/[...path]/route.ts +208 -0
- package/app/api/v1/openapi.json/route.ts +12 -0
- package/app/apple-icon.ts +11 -0
- package/app/atom.xml/route.ts +7 -0
- package/app/attachment/[id]/route.ts +10 -0
- package/app/attachment/[id]/thumb/route.ts +10 -0
- package/app/auth/passkey/options/route.ts +145 -0
- package/app/auth/passkey/verify/route.ts +241 -0
- package/app/auth/resume/route.ts +55 -0
- package/app/auth/sso/[provider]/callback/route.ts +173 -0
- package/app/auth/sso/[provider]/go/route.ts +57 -0
- package/app/auth/sso/[provider]/route.ts +105 -0
- package/app/avatar/[id]/route.ts +31 -0
- package/app/brand/icon-192.png/route.ts +7 -0
- package/app/brand/icon-512.png/route.ts +7 -0
- package/app/brand/icon-maskable.png/route.ts +7 -0
- package/app/demo/stripe/[[...path]]/route.ts +27 -0
- package/app/error.tsx +15 -0
- package/app/feed.xml/route.ts +7 -0
- package/app/forumdisplay.php/page.tsx +11 -0
- package/app/group/[id]/badge/[scheme]/route.ts +26 -0
- package/app/icon.ts +13 -0
- package/app/install/page.tsx +221 -0
- package/app/jump/page.tsx +28 -0
- package/app/layout.tsx +124 -0
- package/app/logo/[scheme]/route.ts +24 -0
- package/app/manifest.ts +43 -0
- package/app/member.php/page.tsx +11 -0
- package/app/memberlist.php/page.tsx +11 -0
- package/app/not-found.tsx +14 -0
- package/app/opengraph-image.ts +11 -0
- package/app/redirect/page.tsx +44 -0
- package/app/robots.txt/route.ts +35 -0
- package/app/showthread.php/page.tsx +11 -0
- package/app/sitemap/[page]/route.ts +64 -0
- package/app/sitemap.xml/route.ts +31 -0
- package/app/twitter-image.ts +11 -0
- package/app/viewforum.php/page.tsx +11 -0
- package/app/viewtopic.php/page.tsx +11 -0
- package/bin/forum-web.mjs +241 -0
- package/components.json +21 -0
- package/instrumentation.ts +18 -0
- package/next.config.mjs +182 -0
- package/package.json +99 -0
- package/postcss.config.mjs +7 -0
- package/proxy.ts +160 -0
- package/src/components/account/active-sessions.tsx +87 -0
- package/src/components/account/avatar-form.tsx +119 -0
- package/src/components/account/credential-proof-form.tsx +76 -0
- package/src/components/account/logout-form.tsx +14 -0
- package/src/components/account/notification-forms.tsx +157 -0
- package/src/components/account/passkey-enrol.tsx +81 -0
- package/src/components/account/passkey-proof-button.tsx +47 -0
- package/src/components/account/push-device-form.tsx +193 -0
- package/src/components/account/relation-forms.tsx +69 -0
- package/src/components/account/reputation-forms.tsx +124 -0
- package/src/components/account/security-activity.tsx +46 -0
- package/src/components/account/sign-in-methods.tsx +166 -0
- package/src/components/account/subscription-forms.tsx +151 -0
- package/src/components/account/two-factor-forms.tsx +226 -0
- package/src/components/account/usercp-forms.tsx +387 -0
- package/src/components/account/usercp-nav.tsx +14 -0
- package/src/components/account/usercp-shell.tsx +34 -0
- package/src/components/admin/admin-forms.tsx +92 -0
- package/src/components/admin/admin-nav.tsx +52 -0
- package/src/components/admin/admin-undo.tsx +32 -0
- package/src/components/admin/api-token-forms.tsx +89 -0
- package/src/components/admin/badge-forms.tsx +97 -0
- package/src/components/admin/branding-forms.tsx +102 -0
- package/src/components/admin/content-forms.tsx +712 -0
- package/src/components/admin/form-bits.tsx +11 -0
- package/src/components/admin/forum-forms.tsx +524 -0
- package/src/components/admin/forum-tree.tsx +454 -0
- package/src/components/admin/group-forms.tsx +646 -0
- package/src/components/admin/mail-test-card.tsx +90 -0
- package/src/components/admin/marketplace-forms.tsx +30 -0
- package/src/components/admin/marketplace-listing.tsx +123 -0
- package/src/components/admin/navigation-forms.tsx +229 -0
- package/src/components/admin/navigation-tree.tsx +442 -0
- package/src/components/admin/oklch-picker.tsx +180 -0
- package/src/components/admin/plugin-forms.tsx +225 -0
- package/src/components/admin/settings-form.tsx +148 -0
- package/src/components/admin/system-forms.tsx +169 -0
- package/src/components/admin/theme-changes.tsx +354 -0
- package/src/components/admin/theme-forms.tsx +636 -0
- package/src/components/admin/theme-palette.tsx +119 -0
- package/src/components/admin/theme-preview.tsx +461 -0
- package/src/components/admin/user-bulk-toolbar.tsx +99 -0
- package/src/components/admin/user-forms.tsx +488 -0
- package/src/components/auth/auth-page.tsx +45 -0
- package/src/components/auth/form-controls.tsx +117 -0
- package/src/components/auth/login-form.tsx +47 -0
- package/src/components/auth/passkey-client.ts +171 -0
- package/src/components/auth/passkey-second-factor.tsx +69 -0
- package/src/components/auth/passkey-sign-in.tsx +61 -0
- package/src/components/auth/register-form.tsx +136 -0
- package/src/components/auth/resend-verification-form.tsx +34 -0
- package/src/components/auth/reset-confirm-form.tsx +43 -0
- package/src/components/auth/reset-request-form.tsx +35 -0
- package/src/components/auth/second-factor-form.tsx +51 -0
- package/src/components/auth/sso-buttons.tsx +47 -0
- package/src/components/board/live-region.tsx +74 -0
- package/src/components/board/search-off-notice.tsx +18 -0
- package/src/components/board/section-page.tsx +114 -0
- package/src/components/content/attachment-field.tsx +51 -0
- package/src/components/content/composer-field.ts +31 -0
- package/src/components/content/composer-ids.ts +6 -0
- package/src/components/content/composer-intents.tsx +27 -0
- package/src/components/content/composer-recovery.tsx +215 -0
- package/src/components/content/edit-post-form.tsx +121 -0
- package/src/components/content/markdown-editor.tsx +590 -0
- package/src/components/content/markdown-syntax.ts +53 -0
- package/src/components/content/mention-token.ts +23 -0
- package/src/components/content/multiquote-button.tsx +32 -0
- package/src/components/content/multiquote-selection.tsx +105 -0
- package/src/components/content/multiquote.ts +125 -0
- package/src/components/content/new-thread-form.tsx +169 -0
- package/src/components/content/poll-edit-form.tsx +96 -0
- package/src/components/content/poll.tsx +89 -0
- package/src/components/content/quote-in-place.tsx +51 -0
- package/src/components/content/reply-form.tsx +113 -0
- package/src/components/content/thanks-button.tsx +65 -0
- package/src/components/content/thread-rating.tsx +143 -0
- package/src/components/install/install-form.tsx +497 -0
- package/src/components/legal/legal-document.tsx +22 -0
- package/src/components/messages/message-forms.tsx +152 -0
- package/src/components/moderation/inline-moderation-form.tsx +158 -0
- package/src/components/moderation/modcp-nav.tsx +15 -0
- package/src/components/moderation/modcp-shell.tsx +41 -0
- package/src/components/moderation/queue-form.tsx +96 -0
- package/src/components/moderation/report-forms.tsx +120 -0
- package/src/components/moderation/signature-lock-form.tsx +83 -0
- package/src/components/moderation/thread-surgery-form.tsx +96 -0
- package/src/components/moderation/thread-tools-form.tsx +137 -0
- package/src/components/moderation/warning-forms.tsx +125 -0
- package/src/components/profile/custom-field.tsx +79 -0
- package/src/components/shell/appearance-icons.tsx +35 -0
- package/src/components/shell/board-notice.tsx +21 -0
- package/src/components/shell/copy-record.ts +20 -0
- package/src/components/shell/copy.tsx +17 -0
- package/src/components/shell/crash-notice.tsx +86 -0
- package/src/components/shell/demo-banner.tsx +49 -0
- package/src/components/shell/group-name-style.tsx +6 -0
- package/src/components/shell/measure.ts +1 -0
- package/src/components/shell/notification-menu.tsx +361 -0
- package/src/components/shell/offline-notice.tsx +29 -0
- package/src/components/shell/onboarding-banner.tsx +39 -0
- package/src/components/shell/page-shell.tsx +167 -0
- package/src/components/shell/panel-list.tsx +95 -0
- package/src/components/shell/panel-nav.tsx +40 -0
- package/src/components/shell/panel-overview.tsx +81 -0
- package/src/components/shell/panel-page.tsx +96 -0
- package/src/components/shell/panel-pagination.tsx +28 -0
- package/src/components/shell/panel-shell.tsx +31 -0
- package/src/components/shell/theme-runtime-style.tsx +6 -0
- package/src/components/shell/theme-switcher.tsx +97 -0
- package/src/components/shell/timezone-probe.tsx +45 -0
- package/src/components/shell/view-tabs.tsx +60 -0
- package/src/config.ts +13 -0
- package/src/server/absent-services.ts +29 -0
- package/src/server/admin-actions.ts +171 -0
- package/src/server/admin-settings-actions.ts +83 -0
- package/src/server/admin-undo-actions.ts +70 -0
- package/src/server/admin-undo.ts +75 -0
- package/src/server/admin.ts +112 -0
- package/src/server/announcements.ts +82 -0
- package/src/server/antispam.ts +310 -0
- package/src/server/api/content.ts +486 -0
- package/src/server/api/http.ts +119 -0
- package/src/server/api/members.ts +109 -0
- package/src/server/api/messages.ts +113 -0
- package/src/server/api/registry.ts +30 -0
- package/src/server/api/search.ts +98 -0
- package/src/server/api/subscriptions.ts +106 -0
- package/src/server/api-auth.ts +66 -0
- package/src/server/api-token-actions.ts +85 -0
- package/src/server/api-tokens-admin.ts +95 -0
- package/src/server/appearance-actions.ts +39 -0
- package/src/server/attachment-download.ts +43 -0
- package/src/server/attachment-embed.ts +63 -0
- package/src/server/attachment-upload-actions.ts +92 -0
- package/src/server/attachments.ts +257 -0
- package/src/server/auth-actions.ts +479 -0
- package/src/server/auth-config.ts +61 -0
- package/src/server/auth-events.ts +92 -0
- package/src/server/auth-form-state.ts +14 -0
- package/src/server/auth-mail.ts +104 -0
- package/src/server/avatars.ts +83 -0
- package/src/server/board-latest-actions.ts +7 -0
- package/src/server/board-latest.tsx +103 -0
- package/src/server/board-offline.ts +23 -0
- package/src/server/board-url.ts +14 -0
- package/src/server/brand-assets.ts +151 -0
- package/src/server/brand-mark.tsx +110 -0
- package/src/server/branding-actions.ts +53 -0
- package/src/server/branding.ts +101 -0
- package/src/server/cache-targets.ts +13 -0
- package/src/server/code-highlighting.ts +33 -0
- package/src/server/container.ts +402 -0
- package/src/server/content-actions.ts +459 -0
- package/src/server/content-admin-actions.ts +492 -0
- package/src/server/content-admin.ts +95 -0
- package/src/server/content-security-policy.ts +35 -0
- package/src/server/context.ts +32 -0
- package/src/server/cookies.ts +139 -0
- package/src/server/credential-proof-actions.ts +42 -0
- package/src/server/credential-proof.ts +35 -0
- package/src/server/current-location.ts +19 -0
- package/src/server/demo-stripe.ts +104 -0
- package/src/server/demo-uploads.ts +28 -0
- package/src/server/demo.ts +80 -0
- package/src/server/discovery.ts +104 -0
- package/src/server/embeds.ts +113 -0
- package/src/server/error-notice.tsx +41 -0
- package/src/server/federation-actions.ts +113 -0
- package/src/server/federation.ts +138 -0
- package/src/server/feed-builder.ts +72 -0
- package/src/server/feed-routes.ts +122 -0
- package/src/server/fixture-actor-source.ts +62 -0
- package/src/server/fixture-forum-repo.ts +59 -0
- package/src/server/fixture-member-profile-repo.ts +30 -0
- package/src/server/fixture-post-repo.ts +108 -0
- package/src/server/fixture-thread-repo.ts +98 -0
- package/src/server/form-state-reporter.ts +34 -0
- package/src/server/form-values.ts +23 -0
- package/src/server/forum-admin-actions.ts +353 -0
- package/src/server/forum-admin.ts +98 -0
- package/src/server/group-admin-actions.ts +341 -0
- package/src/server/group-admin.ts +98 -0
- package/src/server/group-badge-actions.ts +61 -0
- package/src/server/group-badge.ts +62 -0
- package/src/server/group-identity.ts +104 -0
- package/src/server/i18n-catalogs.ts +42 -0
- package/src/server/i18n.ts +69 -0
- package/src/server/image-upload.ts +109 -0
- package/src/server/inline-moderation-actions.ts +129 -0
- package/src/server/install-actions.ts +124 -0
- package/src/server/install.ts +281 -0
- package/src/server/legacy-redirect.ts +83 -0
- package/src/server/legal.ts +43 -0
- package/src/server/location-header.ts +37 -0
- package/src/server/mail-brand.ts +43 -0
- package/src/server/mail-health.ts +41 -0
- package/src/server/mail-send.ts +44 -0
- package/src/server/mail-test-actions.ts +67 -0
- package/src/server/mail-test.ts +56 -0
- package/src/server/markdown-pipeline.ts +31 -0
- package/src/server/marketplace-actions.ts +47 -0
- package/src/server/marketplace-admin.ts +260 -0
- package/src/server/mention-actions.ts +21 -0
- package/src/server/mention-search.ts +35 -0
- package/src/server/message-actions.ts +110 -0
- package/src/server/messages.ts +141 -0
- package/src/server/modcp.ts +125 -0
- package/src/server/moderation-actions.ts +165 -0
- package/src/server/navigation-admin-actions.ts +217 -0
- package/src/server/navigation.ts +112 -0
- package/src/server/nonce.ts +13 -0
- package/src/server/notification-actions.ts +84 -0
- package/src/server/notification-audience.ts +10 -0
- package/src/server/notification-menu-actions.ts +82 -0
- package/src/server/notification-menu.ts +96 -0
- package/src/server/notifications.ts +93 -0
- package/src/server/onboarding-actions.ts +27 -0
- package/src/server/onboarding.ts +89 -0
- package/src/server/page-metadata.ts +14 -0
- package/src/server/passkey-challenge.ts +42 -0
- package/src/server/plugin-admin-actions.ts +232 -0
- package/src/server/plugin-admin.ts +276 -0
- package/src/server/plugin-host.ts +143 -0
- package/src/server/plugin-pages.ts +192 -0
- package/src/server/plugin-panel.ts +49 -0
- package/src/server/plugin-routes.ts +298 -0
- package/src/server/plugin-view.tsx +58 -0
- package/src/server/poll-actions.ts +104 -0
- package/src/server/poll-scope.ts +52 -0
- package/src/server/post-notifications.ts +71 -0
- package/src/server/post-scope.ts +86 -0
- package/src/server/presence.ts +177 -0
- package/src/server/profile-fields.ts +112 -0
- package/src/server/push-actions.ts +113 -0
- package/src/server/push.ts +40 -0
- package/src/server/redirect-back.ts +15 -0
- package/src/server/registration.ts +7 -0
- package/src/server/relation-actions.ts +89 -0
- package/src/server/relations.ts +45 -0
- package/src/server/reply-core.ts +173 -0
- package/src/server/report-actions.ts +165 -0
- package/src/server/report-scope.ts +21 -0
- package/src/server/reputation-actions.ts +146 -0
- package/src/server/reputation-target.ts +49 -0
- package/src/server/reputation.ts +70 -0
- package/src/server/request-fingerprint.ts +65 -0
- package/src/server/safe-path.ts +16 -0
- package/src/server/same-origin.ts +45 -0
- package/src/server/search-page.ts +313 -0
- package/src/server/search.ts +45 -0
- package/src/server/secret-auth.ts +20 -0
- package/src/server/see-other.ts +11 -0
- package/src/server/seed-board.ts +417 -0
- package/src/server/session-actions.ts +78 -0
- package/src/server/session-cookies.ts +124 -0
- package/src/server/session-key.ts +17 -0
- package/src/server/settings.ts +47 -0
- package/src/server/signatures.ts +62 -0
- package/src/server/sso-handshake.ts +79 -0
- package/src/server/stats.ts +63 -0
- package/src/server/subscription-actions.ts +161 -0
- package/src/server/surgery-actions.ts +180 -0
- package/src/server/syndication.ts +77 -0
- package/src/server/system-admin-actions.ts +134 -0
- package/src/server/system-admin.ts +90 -0
- package/src/server/test-container.ts +114 -0
- package/src/server/theme-admin-actions.ts +242 -0
- package/src/server/theme-admin.ts +203 -0
- package/src/server/theme-runtime.ts +89 -0
- package/src/server/theme-style.ts +279 -0
- package/src/server/theme.ts +52 -0
- package/src/server/thread-core.ts +207 -0
- package/src/server/thread-rating-actions.ts +55 -0
- package/src/server/thread-tool-actions.ts +154 -0
- package/src/server/two-factor-actions.ts +178 -0
- package/src/server/two-factor.ts +86 -0
- package/src/server/upgrade-notice.ts +41 -0
- package/src/server/user-admin-actions.ts +572 -0
- package/src/server/user-admin.ts +165 -0
- package/src/server/usercp-actions.ts +263 -0
- package/src/server/usercp-mail.ts +120 -0
- package/src/server/viewer-preferences.ts +64 -0
- package/src/server/warning-actions.ts +122 -0
- package/src/styles/globals.css +969 -0
- package/src/theme/contract.fixture.ts +793 -0
- package/src/view/account-copy.ts +351 -0
- package/src/view/admin-content-copy.ts +66 -0
- package/src/view/admin-copy.ts +106 -0
- package/src/view/admin-forum-tree-copy.ts +40 -0
- package/src/view/admin-group-copy.ts +80 -0
- package/src/view/admin-log.ts +58 -0
- package/src/view/admin-nav.ts +164 -0
- package/src/view/admin-navigation-copy.ts +58 -0
- package/src/view/admin-panel-copy.ts +194 -0
- package/src/view/admin-settings.ts +173 -0
- package/src/view/admin-theme-copy.ts +229 -0
- package/src/view/admin-user-copy.ts +96 -0
- package/src/view/attachments.ts +51 -0
- package/src/view/auth-copy.ts +147 -0
- package/src/view/board-index.ts +167 -0
- package/src/view/board-latest.ts +101 -0
- package/src/view/breadcrumb.ts +50 -0
- package/src/view/contacts.ts +85 -0
- package/src/view/content-copy.ts +118 -0
- package/src/view/contrast.ts +286 -0
- package/src/view/copy.ts +101 -0
- package/src/view/count.ts +8 -0
- package/src/view/discovery-view.ts +74 -0
- package/src/view/editor-toolbar.ts +84 -0
- package/src/view/error-notice.ts +52 -0
- package/src/view/feed.ts +130 -0
- package/src/view/forum-cursor.ts +54 -0
- package/src/view/forum-display.ts +152 -0
- package/src/view/forum-jump.ts +60 -0
- package/src/view/forum-notice.ts +24 -0
- package/src/view/inline-moderation.ts +87 -0
- package/src/view/install-copy.ts +95 -0
- package/src/view/legal.ts +58 -0
- package/src/view/locale.ts +40 -0
- package/src/view/marketplace-panel.ts +51 -0
- package/src/view/member-identity.ts +23 -0
- package/src/view/member-profile.ts +65 -0
- package/src/view/messages.ts +222 -0
- package/src/view/metadata.ts +75 -0
- package/src/view/modcp-nav.ts +76 -0
- package/src/view/moderation-copy.ts +84 -0
- package/src/view/moderation-queue.ts +67 -0
- package/src/view/navigation-arrange.ts +188 -0
- package/src/view/navigation.ts +173 -0
- package/src/view/notification-menu.ts +202 -0
- package/src/view/notifications.ts +84 -0
- package/src/view/onboarding.ts +26 -0
- package/src/view/pager.ts +191 -0
- package/src/view/panel-nav.ts +203 -0
- package/src/view/plugin-panel.ts +42 -0
- package/src/view/post-form.ts +61 -0
- package/src/view/post-link.ts +29 -0
- package/src/view/presence.ts +99 -0
- package/src/view/promotion-rules.ts +52 -0
- package/src/view/redirect-notice.ts +21 -0
- package/src/view/reputation.ts +107 -0
- package/src/view/search-controls.ts +103 -0
- package/src/view/search-results.ts +291 -0
- package/src/view/security-activity.ts +73 -0
- package/src/view/setting-groups.ts +43 -0
- package/src/view/shell.ts +164 -0
- package/src/view/slug-id.ts +12 -0
- package/src/view/sso-hand-off.ts +44 -0
- package/src/view/sso-notices.ts +48 -0
- package/src/view/subscriptions.ts +76 -0
- package/src/view/theme-draft.ts +167 -0
- package/src/view/theme-preference.ts +30 -0
- package/src/view/theme-tokens.ts +333 -0
- package/src/view/thread-view.ts +280 -0
- package/src/view/time.ts +31 -0
- package/src/view/timezone.ts +35 -0
- package/src/view/two-factor.ts +6 -0
- package/src/view/usercp-nav.ts +103 -0
- package/src/view/usercp.ts +196 -0
- package/src/view/warnings.ts +128 -0
- package/src/view/word-filter.ts +5 -0
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import type { Metadata } from 'next'
|
|
2
|
+
|
|
3
|
+
import { PANEL_LIST } from '@/components/shell/panel-list'
|
|
4
|
+
import { PanelPage } from '@/components/shell/panel-page'
|
|
5
|
+
import { PanelPagination } from '@/components/shell/panel-pagination'
|
|
6
|
+
import { adminPageContext } from '@/server/admin'
|
|
7
|
+
import { getContainer } from '@/server/container'
|
|
8
|
+
import { getTranslator, tr } from '@/server/i18n'
|
|
9
|
+
import { ADMIN_LOG_PAGE_SIZE, buildAdminLogView } from '@/view/admin-log'
|
|
10
|
+
import { offsetOf, readPage } from '@/view/pager'
|
|
11
|
+
|
|
12
|
+
export async function generateMetadata(): Promise<Metadata> {
|
|
13
|
+
return { title: await tr('page.admin-log') }
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default async function AdminLogPage({
|
|
17
|
+
searchParams,
|
|
18
|
+
}: {
|
|
19
|
+
searchParams: Promise<{ page?: string; action?: string }>
|
|
20
|
+
}) {
|
|
21
|
+
if ((await adminPageContext()) === null) return null
|
|
22
|
+
|
|
23
|
+
const query = await searchParams
|
|
24
|
+
const { adminLog } = getContainer()
|
|
25
|
+
if (adminLog === null) return null
|
|
26
|
+
|
|
27
|
+
const translator = await getTranslator()
|
|
28
|
+
const page = readPage(query)
|
|
29
|
+
const filter = query.action === undefined ? {} : { action: query.action }
|
|
30
|
+
|
|
31
|
+
const [rows, total, actions] = await Promise.all([
|
|
32
|
+
adminLog.list({
|
|
33
|
+
limit: ADMIN_LOG_PAGE_SIZE,
|
|
34
|
+
offset: offsetOf(page, ADMIN_LOG_PAGE_SIZE),
|
|
35
|
+
...filter,
|
|
36
|
+
}),
|
|
37
|
+
adminLog.count(filter),
|
|
38
|
+
adminLog.actions(),
|
|
39
|
+
])
|
|
40
|
+
|
|
41
|
+
const view = buildAdminLogView({
|
|
42
|
+
rows,
|
|
43
|
+
actions,
|
|
44
|
+
currentAction: query.action ?? '',
|
|
45
|
+
now: new Date(),
|
|
46
|
+
t: translator,
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<PanelPage
|
|
51
|
+
title={await tr('page.admin-log')}
|
|
52
|
+
lede={await tr('page.every-administrative-moderation-action-newest')}
|
|
53
|
+
width="wide"
|
|
54
|
+
>
|
|
55
|
+
<form method="get" className="flex flex-wrap items-end gap-2">
|
|
56
|
+
<label className="flex flex-col gap-1 text-sm">
|
|
57
|
+
<span className="font-medium">{translator.t('adminLog.action')}</span>
|
|
58
|
+
<select
|
|
59
|
+
name="action"
|
|
60
|
+
defaultValue={view.currentAction}
|
|
61
|
+
className="h-9 rounded-md border border-border bg-background px-2 text-sm"
|
|
62
|
+
>
|
|
63
|
+
<option value="">{translator.t('adminLog.everything')}</option>
|
|
64
|
+
{view.actions.map((action) => (
|
|
65
|
+
<option key={action} value={action}>
|
|
66
|
+
{action}
|
|
67
|
+
</option>
|
|
68
|
+
))}
|
|
69
|
+
</select>
|
|
70
|
+
</label>
|
|
71
|
+
<button
|
|
72
|
+
type="submit"
|
|
73
|
+
className="inline-flex h-9 items-center rounded-md border border-border px-3 text-sm hover:bg-muted"
|
|
74
|
+
>
|
|
75
|
+
{translator.t('adminLog.filter')}
|
|
76
|
+
</button>
|
|
77
|
+
</form>
|
|
78
|
+
|
|
79
|
+
{view.rows.length === 0 ? (
|
|
80
|
+
<p className="text-sm text-muted-foreground">{await tr('page.nothing-logged')}</p>
|
|
81
|
+
) : (
|
|
82
|
+
<ul className={PANEL_LIST}>
|
|
83
|
+
{view.rows.map((row) => (
|
|
84
|
+
<li key={row.id} className="flex flex-col gap-1 px-4 py-3">
|
|
85
|
+
<div className="flex flex-wrap items-baseline gap-2 text-sm">
|
|
86
|
+
<code className="text-xs font-medium">{row.action}</code>
|
|
87
|
+
<span>{row.actor}</span>
|
|
88
|
+
{row.ipPrefix !== null && (
|
|
89
|
+
<span className="text-xs text-muted-foreground">
|
|
90
|
+
{translator.t('adminLog.from', { address: row.ipPrefix })}
|
|
91
|
+
</span>
|
|
92
|
+
)}
|
|
93
|
+
<time dateTime={row.at.iso} className="ml-auto text-xs text-muted-foreground">
|
|
94
|
+
{row.at.label}
|
|
95
|
+
</time>
|
|
96
|
+
</div>
|
|
97
|
+
{row.detail !== '' && (
|
|
98
|
+
<p className="whitespace-pre-wrap break-words text-xs text-muted-foreground">
|
|
99
|
+
{row.detail}
|
|
100
|
+
</p>
|
|
101
|
+
)}
|
|
102
|
+
</li>
|
|
103
|
+
))}
|
|
104
|
+
</ul>
|
|
105
|
+
)}
|
|
106
|
+
|
|
107
|
+
<PanelPagination
|
|
108
|
+
path="/admin/log"
|
|
109
|
+
params={query}
|
|
110
|
+
page={page}
|
|
111
|
+
pageSize={ADMIN_LOG_PAGE_SIZE}
|
|
112
|
+
total={total}
|
|
113
|
+
/>
|
|
114
|
+
</PanelPage>
|
|
115
|
+
)
|
|
116
|
+
}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { ModerationQueue } from '@meith/moderation'
|
|
2
|
+
import {
|
|
3
|
+
Alert,
|
|
4
|
+
AlertDescription,
|
|
5
|
+
AlertTitle,
|
|
6
|
+
buttonVariants,
|
|
7
|
+
Card,
|
|
8
|
+
CardContent,
|
|
9
|
+
CardFooter,
|
|
10
|
+
CardRows,
|
|
11
|
+
cn,
|
|
12
|
+
Empty,
|
|
13
|
+
EmptyDescription,
|
|
14
|
+
EmptyTitle,
|
|
15
|
+
} from '@meith/ui'
|
|
16
|
+
|
|
17
|
+
import { PanelSectionGrid, PanelWaitingList } from '@/components/shell/panel-overview'
|
|
18
|
+
import { PanelPage, PanelSection } from '@/components/shell/panel-page'
|
|
19
|
+
import { adminPageContext } from '@/server/admin'
|
|
20
|
+
import { getContainer } from '@/server/container'
|
|
21
|
+
import { getActor } from '@/server/context'
|
|
22
|
+
import { getTranslator, tr } from '@/server/i18n'
|
|
23
|
+
import { hasReportScope, resolveReportScope } from '@/server/report-scope'
|
|
24
|
+
import { readTotals } from '@/server/stats'
|
|
25
|
+
import { pendingUpgradeNotice } from '@/server/upgrade-notice'
|
|
26
|
+
import { ADMIN_SECTIONS } from '@/view/admin-nav'
|
|
27
|
+
import { panelSectionCopy } from '@/view/panel-nav'
|
|
28
|
+
import { formatTime } from '@/view/time'
|
|
29
|
+
|
|
30
|
+
export default async function AdminHomePage() {
|
|
31
|
+
const context = await adminPageContext()
|
|
32
|
+
if (context === null) return null
|
|
33
|
+
|
|
34
|
+
const actor = await getActor()
|
|
35
|
+
const { adminLog, authorizer, moderationQueue, reports } = getContainer()
|
|
36
|
+
|
|
37
|
+
const now = new Date()
|
|
38
|
+
const translator = await getTranslator()
|
|
39
|
+
|
|
40
|
+
const [recent, upgradeNotice, totals, pending, openReports] = await Promise.all([
|
|
41
|
+
adminLog === null ? Promise.resolve([]) : adminLog.list({ limit: 6 }),
|
|
42
|
+
pendingUpgradeNotice(),
|
|
43
|
+
readTotals(),
|
|
44
|
+
moderationQueue === null
|
|
45
|
+
? Promise.resolve(0)
|
|
46
|
+
: authorizer
|
|
47
|
+
.moderatedForumIds(actor)
|
|
48
|
+
.then((forumIds) =>
|
|
49
|
+
new ModerationQueue({ queue: moderationQueue }).countPending(forumIds),
|
|
50
|
+
),
|
|
51
|
+
reports === null
|
|
52
|
+
? Promise.resolve(0)
|
|
53
|
+
: resolveReportScope().then((scope) =>
|
|
54
|
+
hasReportScope(scope) ? reports.countOpen(scope) : 0,
|
|
55
|
+
),
|
|
56
|
+
])
|
|
57
|
+
|
|
58
|
+
const allClear = pending === 0 && openReports === 0 && upgradeNotice === null
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<PanelPage
|
|
62
|
+
title={await tr('page.overview')}
|
|
63
|
+
lede={
|
|
64
|
+
<>
|
|
65
|
+
Signed in to the control panel since{' '}
|
|
66
|
+
<time dateTime={context.session.createdAt.toISOString()}>
|
|
67
|
+
{formatTime(context.session.createdAt, now, translator).label}
|
|
68
|
+
</time>
|
|
69
|
+
{context.session.ipPrefix === null
|
|
70
|
+
? translator.t('adminHome.sessionEnd')
|
|
71
|
+
: translator.t('adminHome.sessionFrom', { address: context.session.ipPrefix })}
|
|
72
|
+
</>
|
|
73
|
+
}
|
|
74
|
+
gap="loose"
|
|
75
|
+
>
|
|
76
|
+
<PanelSection id="waiting-heading" title={await tr('page.waiting-for')}>
|
|
77
|
+
{upgradeNotice !== null && (
|
|
78
|
+
<Alert tone="warning">
|
|
79
|
+
<AlertDescription>
|
|
80
|
+
<AlertTitle>{await tr('page.upgrade-pending')}</AlertTitle> {upgradeNotice}
|
|
81
|
+
</AlertDescription>
|
|
82
|
+
<a
|
|
83
|
+
href="/admin/system"
|
|
84
|
+
className={cn(buttonVariants({ variant: 'outline', size: 'sm' }), 'shrink-0')}
|
|
85
|
+
>
|
|
86
|
+
System
|
|
87
|
+
</a>
|
|
88
|
+
</Alert>
|
|
89
|
+
)}
|
|
90
|
+
|
|
91
|
+
<PanelWaitingList
|
|
92
|
+
items={[
|
|
93
|
+
{
|
|
94
|
+
count: pending,
|
|
95
|
+
one: translator.t('adminHome.postHeld'),
|
|
96
|
+
many: translator.t('adminHome.postsHeld'),
|
|
97
|
+
href: '/moderation',
|
|
98
|
+
action: translator.t('adminHome.review'),
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
count: openReports,
|
|
102
|
+
one: translator.t('adminHome.openReport'),
|
|
103
|
+
many: translator.t('adminHome.openReports'),
|
|
104
|
+
href: '/moderation/reports',
|
|
105
|
+
action: translator.t('adminHome.open'),
|
|
106
|
+
},
|
|
107
|
+
]}
|
|
108
|
+
emptyTitle={translator.t('adminHome.emptyTitle')}
|
|
109
|
+
emptyDescription={
|
|
110
|
+
allClear ? translator.t('adminHome.allClear') : translator.t('adminHome.noPending')
|
|
111
|
+
}
|
|
112
|
+
/>
|
|
113
|
+
</PanelSection>
|
|
114
|
+
|
|
115
|
+
{totals !== null && (
|
|
116
|
+
<PanelSection id="totals-heading" title={await tr('page.board')}>
|
|
117
|
+
<Card>
|
|
118
|
+
{totals.computedAt === null ? (
|
|
119
|
+
<Empty className="py-8">
|
|
120
|
+
<EmptyTitle>{await tr('page.not-counted-yet')}</EmptyTitle>
|
|
121
|
+
<EmptyDescription>
|
|
122
|
+
{await tr('page.totals-rolled-up-by-scheduled')}
|
|
123
|
+
</EmptyDescription>
|
|
124
|
+
</Empty>
|
|
125
|
+
) : (
|
|
126
|
+
<>
|
|
127
|
+
<CardContent className="grid grid-cols-3 gap-4 p-5">
|
|
128
|
+
{[
|
|
129
|
+
{ label: translator.t('adminHome.threads'), value: totals.threadCount },
|
|
130
|
+
{ label: translator.t('adminHome.posts'), value: totals.postCount },
|
|
131
|
+
{ label: translator.t('adminHome.members'), value: totals.memberCount },
|
|
132
|
+
].map((figure) => (
|
|
133
|
+
<div key={figure.label}>
|
|
134
|
+
<p className="text-2xl font-semibold text-foreground tabular-nums">
|
|
135
|
+
{translator.number(figure.value)}
|
|
136
|
+
</p>
|
|
137
|
+
<p className="text-xs text-muted-foreground">{figure.label}</p>
|
|
138
|
+
</div>
|
|
139
|
+
))}
|
|
140
|
+
</CardContent>
|
|
141
|
+
<CardFooter className="justify-between">
|
|
142
|
+
<span>
|
|
143
|
+
{totals.newestUsername === null
|
|
144
|
+
? translator.t('adminHome.noMembers')
|
|
145
|
+
: translator.t('adminHome.newestMember', { username: totals.newestUsername })}
|
|
146
|
+
</span>
|
|
147
|
+
<span>
|
|
148
|
+
{translator.t('adminHome.counted')}{' '}
|
|
149
|
+
<time dateTime={totals.computedAt.toISOString()}>
|
|
150
|
+
{formatTime(totals.computedAt, now, translator).label}
|
|
151
|
+
</time>
|
|
152
|
+
</span>
|
|
153
|
+
</CardFooter>
|
|
154
|
+
</>
|
|
155
|
+
)}
|
|
156
|
+
</Card>
|
|
157
|
+
</PanelSection>
|
|
158
|
+
)}
|
|
159
|
+
|
|
160
|
+
<PanelSection id="activity-heading" title={await tr('page.latest-activity')}>
|
|
161
|
+
<Card>
|
|
162
|
+
{recent.length === 0 ? (
|
|
163
|
+
<Empty className="py-8">
|
|
164
|
+
<EmptyTitle>{await tr('page.nothing-logged-yet')}</EmptyTitle>
|
|
165
|
+
<EmptyDescription>
|
|
166
|
+
{await tr('page.administrative-moderation-actions-appear-here')}
|
|
167
|
+
</EmptyDescription>
|
|
168
|
+
</Empty>
|
|
169
|
+
) : (
|
|
170
|
+
<>
|
|
171
|
+
<CardRows>
|
|
172
|
+
{recent.map((row) => (
|
|
173
|
+
<li
|
|
174
|
+
key={row.id}
|
|
175
|
+
className="flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1 px-4 py-2.5"
|
|
176
|
+
>
|
|
177
|
+
<code className="font-mono text-xs text-foreground">{row.action}</code>
|
|
178
|
+
<span className="text-xs text-muted-foreground">
|
|
179
|
+
{row.username ?? translator.t('adminHome.system')}
|
|
180
|
+
{' · '}
|
|
181
|
+
<time dateTime={row.createdAt.toISOString()}>
|
|
182
|
+
{formatTime(row.createdAt, now, translator).label}
|
|
183
|
+
</time>
|
|
184
|
+
</span>
|
|
185
|
+
</li>
|
|
186
|
+
))}
|
|
187
|
+
</CardRows>
|
|
188
|
+
<CardFooter>
|
|
189
|
+
<a
|
|
190
|
+
href="/admin/log"
|
|
191
|
+
className="font-medium text-foreground underline decoration-border underline-offset-2 hover:decoration-foreground"
|
|
192
|
+
>
|
|
193
|
+
{await tr('page.whole-log')}
|
|
194
|
+
</a>
|
|
195
|
+
</CardFooter>
|
|
196
|
+
</>
|
|
197
|
+
)}
|
|
198
|
+
</Card>
|
|
199
|
+
</PanelSection>
|
|
200
|
+
|
|
201
|
+
<PanelSection id="sections-heading" title={await tr('page.sections')}>
|
|
202
|
+
<PanelSectionGrid sections={panelSectionCopy(ADMIN_SECTIONS, translator)} />
|
|
203
|
+
</PanelSection>
|
|
204
|
+
</PanelPage>
|
|
205
|
+
)
|
|
206
|
+
}
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import type { Metadata } from 'next'
|
|
2
|
+
import { notFound } from 'next/navigation'
|
|
3
|
+
|
|
4
|
+
import { PluginEnableForm, PluginSettingsForm } from '@/components/admin/plugin-forms'
|
|
5
|
+
import { PANEL_CARD, PANEL_NOTE } from '@/components/shell/panel-list'
|
|
6
|
+
import { PanelPage } from '@/components/shell/panel-page'
|
|
7
|
+
import { ViewTabs } from '@/components/shell/view-tabs'
|
|
8
|
+
import { adminPageContext } from '@/server/admin'
|
|
9
|
+
import { getTranslator, tr } from '@/server/i18n'
|
|
10
|
+
import { pluginRow } from '@/server/plugin-admin'
|
|
11
|
+
import { renderPluginAdminPage } from '@/server/plugin-pages'
|
|
12
|
+
import { pluginFormsCopy } from '@/view/admin-panel-copy'
|
|
13
|
+
import { pluginPanelTabs } from '@/view/plugin-panel'
|
|
14
|
+
|
|
15
|
+
export async function generateMetadata(): Promise<Metadata> {
|
|
16
|
+
return { title: await tr('page.plugin') }
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default async function AdminPluginPage({
|
|
20
|
+
params,
|
|
21
|
+
searchParams,
|
|
22
|
+
}: {
|
|
23
|
+
params: Promise<{ key: string; path?: string[] }>
|
|
24
|
+
searchParams: Promise<Record<string, string | string[] | undefined>>
|
|
25
|
+
}) {
|
|
26
|
+
if ((await adminPageContext()) === null) return null
|
|
27
|
+
|
|
28
|
+
const { key, path } = await params
|
|
29
|
+
const t = await getTranslator()
|
|
30
|
+
const plugin = await pluginRow(key, t)
|
|
31
|
+
if (plugin === null) notFound()
|
|
32
|
+
|
|
33
|
+
const segments = path ?? []
|
|
34
|
+
|
|
35
|
+
if (segments.length > 1) notFound()
|
|
36
|
+
|
|
37
|
+
if (segments.length === 1) {
|
|
38
|
+
const query: Record<string, string> = {}
|
|
39
|
+
for (const [name, value] of Object.entries(await searchParams)) {
|
|
40
|
+
if (typeof value === 'string') query[name] = value
|
|
41
|
+
else if (Array.isArray(value) && typeof value[0] === 'string') query[name] = value[0]
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const rendered = await renderPluginAdminPage(key, segments[0] as string, query)
|
|
45
|
+
if (rendered === null) notFound()
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<PanelPage
|
|
49
|
+
back={{
|
|
50
|
+
href: `/admin/plugins/${key}`,
|
|
51
|
+
label: plugin.name ?? plugin.key,
|
|
52
|
+
}}
|
|
53
|
+
title={rendered.title}
|
|
54
|
+
meta={
|
|
55
|
+
<>
|
|
56
|
+
{t.t('adminPluginDetail.pluginPageMetaBefore')} <code className="font-mono">{key}</code>{' '}
|
|
57
|
+
{t.t('adminPluginDetail.pluginPageMetaAfter')}
|
|
58
|
+
</>
|
|
59
|
+
}
|
|
60
|
+
>
|
|
61
|
+
<ViewTabs
|
|
62
|
+
label={t.t('adminPluginDetail.screens', { plugin: plugin.name ?? plugin.key })}
|
|
63
|
+
tabs={pluginPanelTabs({
|
|
64
|
+
pluginKey: key,
|
|
65
|
+
pages: plugin.pages,
|
|
66
|
+
current: segments[0] as string,
|
|
67
|
+
})}
|
|
68
|
+
/>
|
|
69
|
+
|
|
70
|
+
{rendered.node === null ? (
|
|
71
|
+
<p className={PANEL_NOTE}>{t.t('adminPluginDetail.pluginPageError')}</p>
|
|
72
|
+
) : (
|
|
73
|
+
<section className="rounded-xl border border-border bg-surface p-4">
|
|
74
|
+
{rendered.node}
|
|
75
|
+
</section>
|
|
76
|
+
)}
|
|
77
|
+
</PanelPage>
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const visibleSettings = plugin.settings
|
|
82
|
+
const pendingMigrations = plugin.migrations.filter((migration) => !migration.applied)
|
|
83
|
+
const copy = pluginFormsCopy(t)
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<PanelPage
|
|
87
|
+
back={{ href: '/admin/plugins', label: t.t('adminPluginDetail.allPlugins') }}
|
|
88
|
+
title={plugin.name ?? plugin.key}
|
|
89
|
+
gap="loose"
|
|
90
|
+
lede={
|
|
91
|
+
<>
|
|
92
|
+
<code className="font-mono text-xs">{plugin.key}</code>
|
|
93
|
+
{plugin.version !== null && ` · ${plugin.version}`}
|
|
94
|
+
{plugin.description !== null && ` — ${plugin.description}`}
|
|
95
|
+
</>
|
|
96
|
+
}
|
|
97
|
+
{...(plugin.dependsOn.length > 0
|
|
98
|
+
? {
|
|
99
|
+
meta: t.t('adminPluginDetail.dependsOn', { plugins: plugin.dependsOn.join(', ') }),
|
|
100
|
+
}
|
|
101
|
+
: {})}
|
|
102
|
+
>
|
|
103
|
+
<ViewTabs
|
|
104
|
+
label={t.t('adminPluginDetail.screens', { plugin: plugin.name ?? plugin.key })}
|
|
105
|
+
tabs={pluginPanelTabs({ pluginKey: key, pages: plugin.pages, current: null })}
|
|
106
|
+
/>
|
|
107
|
+
|
|
108
|
+
<section className={PANEL_CARD}>
|
|
109
|
+
<h2 className="font-heading text-lg font-semibold">{t.t('adminPluginDetail.status')}</h2>
|
|
110
|
+
<dl className="flex flex-col gap-2 text-sm">
|
|
111
|
+
<div className="flex flex-wrap justify-between gap-2">
|
|
112
|
+
<dt className="text-muted-foreground">{await tr('page.this-build')}</dt>
|
|
113
|
+
<dd>
|
|
114
|
+
{plugin.hasDefinition
|
|
115
|
+
? plugin.configuredEnabled
|
|
116
|
+
? t.t('adminPluginDetail.yes')
|
|
117
|
+
: t.t('adminPluginDetail.runningRegisteredDisabled')
|
|
118
|
+
: t.t('adminPluginDetail.runningUndefined')}
|
|
119
|
+
</dd>
|
|
120
|
+
</div>
|
|
121
|
+
<div className="flex flex-wrap justify-between gap-2">
|
|
122
|
+
<dt className="text-muted-foreground">{await tr('page.switched-here')}</dt>
|
|
123
|
+
<dd>
|
|
124
|
+
{plugin.operatorEnabled
|
|
125
|
+
? t.t('adminPluginDetail.yes')
|
|
126
|
+
: t.t('adminPluginDetail.runningNoDisabled')}
|
|
127
|
+
</dd>
|
|
128
|
+
</div>
|
|
129
|
+
<div className="flex flex-wrap justify-between gap-2">
|
|
130
|
+
<dt className="text-muted-foreground">{await tr('page.running-this-server')}</dt>
|
|
131
|
+
<dd>
|
|
132
|
+
{plugin.running
|
|
133
|
+
? t.t('adminPluginDetail.yes')
|
|
134
|
+
: (plugin.health?.disabledReason ?? t.t('adminPluginDetail.runningNo'))}
|
|
135
|
+
</dd>
|
|
136
|
+
</div>
|
|
137
|
+
</dl>
|
|
138
|
+
|
|
139
|
+
{plugin.configuredEnabled && plugin.hasDefinition && (
|
|
140
|
+
<div className="max-w-40">
|
|
141
|
+
<PluginEnableForm pluginKey={plugin.key} enabled={plugin.operatorEnabled} copy={copy} />
|
|
142
|
+
</div>
|
|
143
|
+
)}
|
|
144
|
+
</section>
|
|
145
|
+
|
|
146
|
+
{plugin.health !== null && (
|
|
147
|
+
<section className={PANEL_CARD}>
|
|
148
|
+
<h2 className="font-heading text-lg font-semibold">{t.t('adminPluginDetail.health')}</h2>
|
|
149
|
+
<p className="text-sm text-muted-foreground">{t.t('adminPluginDetail.healthHint')}</p>
|
|
150
|
+
<dl className="grid grid-cols-2 gap-3 text-sm sm:grid-cols-4">
|
|
151
|
+
<div>
|
|
152
|
+
<dt className="text-xs text-muted-foreground">{t.t('adminPluginDetail.calls')}</dt>
|
|
153
|
+
<dd className="text-lg">{plugin.health.calls}</dd>
|
|
154
|
+
</div>
|
|
155
|
+
<div>
|
|
156
|
+
<dt className="text-xs text-muted-foreground">{t.t('adminPluginDetail.failures')}</dt>
|
|
157
|
+
<dd className="text-lg">{plugin.health.failures}</dd>
|
|
158
|
+
</div>
|
|
159
|
+
<div>
|
|
160
|
+
<dt className="text-xs text-muted-foreground">{await tr('page.slow-calls')}</dt>
|
|
161
|
+
<dd className="text-lg">{plugin.health.slowCalls}</dd>
|
|
162
|
+
</div>
|
|
163
|
+
<div>
|
|
164
|
+
<dt className="text-xs text-muted-foreground">{await tr('page.total-time')}</dt>
|
|
165
|
+
<dd className="text-lg">{plugin.health.totalMs} ms</dd>
|
|
166
|
+
</div>
|
|
167
|
+
</dl>
|
|
168
|
+
{plugin.health.lastError !== null && (
|
|
169
|
+
<p className="rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm">
|
|
170
|
+
{t.t('adminPluginDetail.lastFailure', {
|
|
171
|
+
hook: plugin.health.lastError.hook,
|
|
172
|
+
message: plugin.health.lastError.message,
|
|
173
|
+
})}
|
|
174
|
+
</p>
|
|
175
|
+
)}
|
|
176
|
+
</section>
|
|
177
|
+
)}
|
|
178
|
+
|
|
179
|
+
{visibleSettings.length > 0 && (
|
|
180
|
+
<section className={PANEL_CARD}>
|
|
181
|
+
<h2 className="font-heading text-lg font-semibold">
|
|
182
|
+
{t.t('adminPluginDetail.settings')}
|
|
183
|
+
</h2>
|
|
184
|
+
<p className="text-sm text-muted-foreground">{t.t('adminPluginDetail.settingsHint')}</p>
|
|
185
|
+
<PluginSettingsForm pluginKey={plugin.key} settings={visibleSettings} copy={copy} />
|
|
186
|
+
</section>
|
|
187
|
+
)}
|
|
188
|
+
|
|
189
|
+
{plugin.migrations.length > 0 && (
|
|
190
|
+
<section className={PANEL_CARD}>
|
|
191
|
+
<h2 className="font-heading text-lg font-semibold">
|
|
192
|
+
{t.t('adminPluginDetail.migrations')}
|
|
193
|
+
</h2>
|
|
194
|
+
<p className="text-sm text-muted-foreground">{t.t('adminPluginDetail.migrationsHint')}</p>
|
|
195
|
+
<ul className="flex flex-col divide-y divide-border text-sm">
|
|
196
|
+
{plugin.migrations.map((migration) => (
|
|
197
|
+
<li key={migration.id} className="flex justify-between gap-3 py-2">
|
|
198
|
+
<code className="text-xs">{migration.id}</code>
|
|
199
|
+
<span
|
|
200
|
+
className={
|
|
201
|
+
migration.applied ? 'text-xs text-muted-foreground' : 'text-xs text-destructive'
|
|
202
|
+
}
|
|
203
|
+
>
|
|
204
|
+
{migration.applied
|
|
205
|
+
? t.t('adminPluginDetail.applied')
|
|
206
|
+
: t.t('adminPluginDetail.notApplied')}
|
|
207
|
+
</span>
|
|
208
|
+
</li>
|
|
209
|
+
))}
|
|
210
|
+
</ul>
|
|
211
|
+
{pendingMigrations.length > 0 && (
|
|
212
|
+
<p className="text-sm text-destructive">{t.t('adminPluginDetail.runUpgrade')}</p>
|
|
213
|
+
)}
|
|
214
|
+
</section>
|
|
215
|
+
)}
|
|
216
|
+
|
|
217
|
+
{plugin.tasks.length > 0 && (
|
|
218
|
+
<section className={PANEL_CARD}>
|
|
219
|
+
<h2 className="font-heading text-lg font-semibold">{await tr('page.scheduled-tasks')}</h2>
|
|
220
|
+
<p className="text-sm text-muted-foreground">
|
|
221
|
+
{t.t('adminPluginDetail.tasksHintBefore')}{' '}
|
|
222
|
+
<a
|
|
223
|
+
href="/admin/system"
|
|
224
|
+
className="font-medium text-foreground underline decoration-border underline-offset-2 hover:decoration-foreground"
|
|
225
|
+
>
|
|
226
|
+
{t.t('page.system-health')}
|
|
227
|
+
</a>{' '}
|
|
228
|
+
{t.t('adminPluginDetail.tasksHintAfter')}
|
|
229
|
+
</p>
|
|
230
|
+
<ul className="flex flex-col divide-y divide-border text-sm">
|
|
231
|
+
{plugin.tasks.map((task) => (
|
|
232
|
+
<li key={task.id} className="flex justify-between gap-3 py-2">
|
|
233
|
+
<code className="text-xs">{task.registeredId}</code>
|
|
234
|
+
<span className="text-xs text-muted-foreground">
|
|
235
|
+
{t.t('adminPluginDetail.every', { seconds: task.intervalSeconds })}
|
|
236
|
+
</span>
|
|
237
|
+
</li>
|
|
238
|
+
))}
|
|
239
|
+
</ul>
|
|
240
|
+
</section>
|
|
241
|
+
)}
|
|
242
|
+
|
|
243
|
+
{(plugin.hooks.length > 0 || plugin.regions.length > 0) && (
|
|
244
|
+
<section className={PANEL_CARD}>
|
|
245
|
+
<h2 className="font-heading text-lg font-semibold">
|
|
246
|
+
{t.t('adminPluginDetail.whatItAttaches')}
|
|
247
|
+
</h2>
|
|
248
|
+
{plugin.hooks.length > 0 && (
|
|
249
|
+
<div className="flex flex-col gap-1">
|
|
250
|
+
<h3 className="text-sm font-medium">{t.t('adminPluginDetail.hooks')}</h3>
|
|
251
|
+
<p className="flex flex-wrap gap-x-3 gap-y-1">
|
|
252
|
+
{plugin.hooks.map((hook) => (
|
|
253
|
+
<code key={hook} className="text-xs text-muted-foreground">
|
|
254
|
+
{hook}
|
|
255
|
+
</code>
|
|
256
|
+
))}
|
|
257
|
+
</p>
|
|
258
|
+
</div>
|
|
259
|
+
)}
|
|
260
|
+
{plugin.regions.length > 0 && (
|
|
261
|
+
<div className="flex flex-col gap-1">
|
|
262
|
+
<h3 className="text-sm font-medium">{t.t('adminPluginDetail.regions')}</h3>
|
|
263
|
+
<p className="flex flex-wrap gap-x-3 gap-y-1">
|
|
264
|
+
{plugin.regions.map((region) => (
|
|
265
|
+
<code key={region} className="text-xs text-muted-foreground">
|
|
266
|
+
{region}
|
|
267
|
+
</code>
|
|
268
|
+
))}
|
|
269
|
+
</p>
|
|
270
|
+
</div>
|
|
271
|
+
)}
|
|
272
|
+
</section>
|
|
273
|
+
)}
|
|
274
|
+
</PanelPage>
|
|
275
|
+
)
|
|
276
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { Metadata } from 'next'
|
|
2
|
+
|
|
3
|
+
import { MarketplaceRefreshForm } from '@/components/admin/marketplace-forms'
|
|
4
|
+
import { MarketplaceListingCard } from '@/components/admin/marketplace-listing'
|
|
5
|
+
import { PANEL_NOTE } from '@/components/shell/panel-list'
|
|
6
|
+
import { PanelPage } from '@/components/shell/panel-page'
|
|
7
|
+
import { ViewTabs } from '@/components/shell/view-tabs'
|
|
8
|
+
import { adminPageContext } from '@/server/admin'
|
|
9
|
+
import { getTranslator, tr } from '@/server/i18n'
|
|
10
|
+
import { marketplaceCatalog } from '@/server/marketplace-admin'
|
|
11
|
+
import { marketplaceFormsCopy } from '@/view/admin-panel-copy'
|
|
12
|
+
import { catalogTabs } from '@/view/marketplace-panel'
|
|
13
|
+
import { formatTime } from '@/view/time'
|
|
14
|
+
|
|
15
|
+
export async function generateMetadata(): Promise<Metadata> {
|
|
16
|
+
return { title: await tr('adminMarketplace.browsePluginsTitle') }
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default async function AdminPluginsBrowsePage() {
|
|
20
|
+
if ((await adminPageContext()) === null) return null
|
|
21
|
+
|
|
22
|
+
const t = await getTranslator()
|
|
23
|
+
const catalog = await marketplaceCatalog('plugin')
|
|
24
|
+
const copy = marketplaceFormsCopy(t)
|
|
25
|
+
const now = new Date()
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<PanelPage
|
|
29
|
+
title={t.t('adminMarketplace.browsePluginsTitle')}
|
|
30
|
+
lede={t.t('adminMarketplace.browseLede')}
|
|
31
|
+
>
|
|
32
|
+
<ViewTabs
|
|
33
|
+
label={t.t('adminMarketplace.tabsLabel')}
|
|
34
|
+
tabs={catalogTabs({
|
|
35
|
+
installedHref: '/admin/plugins',
|
|
36
|
+
browseHref: '/admin/plugins/browse',
|
|
37
|
+
current: 'browse',
|
|
38
|
+
t,
|
|
39
|
+
})}
|
|
40
|
+
aside={
|
|
41
|
+
catalog.fetchedAt !== null
|
|
42
|
+
? t.t('adminMarketplace.lastFetched', {
|
|
43
|
+
time: formatTime(catalog.fetchedAt, now, t).label,
|
|
44
|
+
})
|
|
45
|
+
: undefined
|
|
46
|
+
}
|
|
47
|
+
/>
|
|
48
|
+
|
|
49
|
+
<MarketplaceRefreshForm copy={copy} />
|
|
50
|
+
|
|
51
|
+
{catalog.unreachable && <p className={PANEL_NOTE}>{t.t('adminMarketplace.unreachable')}</p>}
|
|
52
|
+
|
|
53
|
+
{!catalog.unreachable && !catalog.hasEverFetched && (
|
|
54
|
+
<p className={PANEL_NOTE}>{t.t('adminMarketplace.neverFetched')}</p>
|
|
55
|
+
)}
|
|
56
|
+
|
|
57
|
+
{catalog.hasEverFetched && catalog.listings.length === 0 && (
|
|
58
|
+
<p className={PANEL_NOTE}>{t.t('adminMarketplace.emptyPlugins')}</p>
|
|
59
|
+
)}
|
|
60
|
+
|
|
61
|
+
{catalog.listings.length > 0 && (
|
|
62
|
+
<ul className="flex flex-col gap-4">
|
|
63
|
+
{catalog.listings.map((listing) => (
|
|
64
|
+
<MarketplaceListingCard key={listing.key} listing={listing} t={t} />
|
|
65
|
+
))}
|
|
66
|
+
</ul>
|
|
67
|
+
)}
|
|
68
|
+
</PanelPage>
|
|
69
|
+
)
|
|
70
|
+
}
|