diff --git a/src/client/components/WebhookPlayground.tsx b/src/client/components/WebhookPlayground.tsx index 81b47df..e185fab 100644 --- a/src/client/components/WebhookPlayground.tsx +++ b/src/client/components/WebhookPlayground.tsx @@ -26,6 +26,7 @@ import { } from './ui/dropdown-menu'; import { useEvent } from '@/hooks/useEvent'; import { useSocketSubscribeList } from '@/api/socketio'; +import { Spinner } from './ui/spinner'; export const WebhookPlayground: React.FC = React.memo(() => { const { t } = useTranslation(); @@ -68,7 +69,17 @@ export const WebhookPlayground: React.FC = React.memo(() => {
{requestList.length === 0 && ( - +
+ + +
+ +
+
)} {reverse(requestList).map((item) => { @@ -106,11 +117,12 @@ export const WebhookPlayground: React.FC = React.memo(() => { const webhookUrl = `${window.location.origin}/open/feed/playground/${workspaceId}`; const emptyContentFallback = ( -
+
- Set webhook url with , and keep this - window actived, then you can get webhook request here. + Set the webhook URL to , and keep this + window active. Once done, you will start receiving webhook requests + here.
); diff --git a/src/client/components/feed/FeedIntegration.tsx b/src/client/components/feed/FeedIntegration.tsx index f08af0b..879e1e7 100644 --- a/src/client/components/feed/FeedIntegration.tsx +++ b/src/client/components/feed/FeedIntegration.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { LuGithub, LuPlug } from 'react-icons/lu'; +import { LuGithub, LuPlug, LuTestTube2 } from 'react-icons/lu'; import { Popover, PopoverContent, PopoverTrigger } from '../ui/popover'; import { CodeBlock } from '../CodeBlock'; import { useTranslation } from '@i18next-toolkit/react'; @@ -57,9 +57,16 @@ export const FeedIntegration: React.FC<{ } /> +
window.open('/feed/playground', '_blank')}> + } + label={t('Playground')} + /> +
+ } - label="Custom" + label={t('Custom')} content={
{t('Custom Request')}
@@ -96,10 +103,7 @@ const FeedIntegrationItem: React.FC<{ return ( -
-
{props.icon}
-
{props.label}
-
+
{props.content} @@ -108,3 +112,16 @@ const FeedIntegrationItem: React.FC<{ ); }); FeedIntegrationItem.displayName = 'FeedIntegrationItem'; + +const FeedIntegrationItemTrigger: React.FC<{ + icon: React.ReactNode; + label: string; +}> = React.memo((props) => { + return ( +
+
{props.icon}
+
{props.label}
+
+ ); +}); +FeedIntegrationItemTrigger.displayName = 'FeedIntegrationItemTrigger'; diff --git a/src/client/routeTree.gen.ts b/src/client/routeTree.gen.ts index 7cd408e..5ddfaf4 100644 --- a/src/client/routeTree.gen.ts +++ b/src/client/routeTree.gen.ts @@ -38,6 +38,7 @@ import { Route as SettingsAuditLogImport } from './routes/settings/auditLog' import { Route as PageAddImport } from './routes/page/add' import { Route as PageSlugImport } from './routes/page/$slug' import { Route as MonitorAddImport } from './routes/monitor/add' +import { Route as FeedPlaygroundImport } from './routes/feed_/playground' import { Route as FeedAddImport } from './routes/feed/add' import { Route as WebsiteWebsiteIdIndexImport } from './routes/website/$websiteId/index' import { Route as SurveySurveyIdIndexImport } from './routes/survey/$surveyId/index' @@ -185,6 +186,11 @@ const MonitorAddRoute = MonitorAddImport.update({ getParentRoute: () => MonitorRoute, } as any) +const FeedPlaygroundRoute = FeedPlaygroundImport.update({ + path: '/feed/playground', + getParentRoute: () => rootRoute, +} as any) + const FeedAddRoute = FeedAddImport.update({ path: '/add', getParentRoute: () => FeedRoute, @@ -290,6 +296,10 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof FeedAddImport parentRoute: typeof FeedImport } + '/feed/playground': { + preLoaderRoute: typeof FeedPlaygroundImport + parentRoute: typeof rootRoute + } '/monitor/add': { preLoaderRoute: typeof MonitorAddImport parentRoute: typeof MonitorImport @@ -420,6 +430,7 @@ export const routeTree = rootRoute.addChildren([ WebsiteWebsiteIdConfigRoute, WebsiteWebsiteIdIndexRoute, ]), + FeedPlaygroundRoute, StatusSlugRoute, ]) diff --git a/src/client/routes/feed_/playground.tsx b/src/client/routes/feed_/playground.tsx new file mode 100644 index 0000000..b01a39b --- /dev/null +++ b/src/client/routes/feed_/playground.tsx @@ -0,0 +1,12 @@ +import { createFileRoute } from '@tanstack/react-router'; +import { routeAuthBeforeLoad } from '@/utils/route'; +import { WebhookPlayground } from '@/components/WebhookPlayground'; + +export const Route = createFileRoute('/feed/playground')({ + beforeLoad: routeAuthBeforeLoad, + component: PageComponent, +}); + +function PageComponent() { + return ; +}