mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
Merge branch 'dev' into promptless/document-developer-tools
This commit is contained in:
commit
1972d298e8
@ -113,7 +113,7 @@ function EditDialog(props: {
|
||||
addWww: props.type === 'create',
|
||||
domain: props.type === 'update' ? props.defaultDomain.replace(/^https?:\/\//, "") : undefined,
|
||||
handlerPath: props.type === 'update' ? props.defaultHandlerPath : "/handler",
|
||||
insecureHttp: false,
|
||||
insecureHttp: props.type === 'update' ? props.defaultDomain.startsWith('http://') : false,
|
||||
}}
|
||||
onOpenChange={props.onOpenChange}
|
||||
trigger={props.trigger}
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
"use client";
|
||||
|
||||
import { SettingSwitch } from "@/components/settings";
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle, Switch, Typography } from "@/components/ui";
|
||||
import { useUpdateConfig } from "@/lib/config-update";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { ProhibitIcon } from "@phosphor-icons/react";
|
||||
import { PageLayout } from "../../page-layout";
|
||||
import { useAdminApp } from "../../use-admin-app";
|
||||
import { PaymentMethods } from "./payment-methods";
|
||||
@ -14,6 +16,14 @@ export default function PageClient() {
|
||||
const paymentsConfig = project.useConfig().payments;
|
||||
const updateConfig = useUpdateConfig();
|
||||
|
||||
const handleBlockNewPurchasesToggle = async (checked: boolean) => {
|
||||
await updateConfig({
|
||||
adminApp,
|
||||
configUpdate: { "payments.blockNewPurchases": checked },
|
||||
pushable: true,
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<PageLayout
|
||||
title="Settings"
|
||||
@ -23,17 +33,41 @@ export default function PageClient() {
|
||||
<StripeConnectionCheck />
|
||||
<TestModeToggle />
|
||||
<PaymentMethods />
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Block New Purchases</CardTitle>
|
||||
<CardDescription>
|
||||
Stops new checkouts while keeping existing subscriptions active.
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="flex items-center gap-3">
|
||||
<div className={cn(
|
||||
"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg",
|
||||
paymentsConfig.blockNewPurchases
|
||||
? "bg-red-500/15 dark:bg-red-400/15"
|
||||
: "bg-muted"
|
||||
)}>
|
||||
<ProhibitIcon className={cn(
|
||||
"h-4 w-4",
|
||||
paymentsConfig.blockNewPurchases
|
||||
? "text-red-600 dark:text-red-400"
|
||||
: "text-muted-foreground"
|
||||
)} />
|
||||
</div>
|
||||
<Typography className="font-medium">
|
||||
Block new purchases
|
||||
</Typography>
|
||||
</div>
|
||||
<Switch
|
||||
checked={paymentsConfig.blockNewPurchases}
|
||||
onCheckedChange={handleBlockNewPurchasesToggle}
|
||||
/>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
<SettingSwitch
|
||||
label="Block new purchases"
|
||||
checked={paymentsConfig.blockNewPurchases}
|
||||
onCheckedChange={async (checked) => void await updateConfig({
|
||||
adminApp,
|
||||
configUpdate: { "payments.blockNewPurchases": checked },
|
||||
pushable: true,
|
||||
})}
|
||||
hint="Stops new checkouts while keeping existing subscriptions active."
|
||||
/>
|
||||
</PageLayout>
|
||||
);
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@ import { DesignAlert, DesignBadge, DesignButton, DesignCard, DesignEditableGrid,
|
||||
import { CopyButton, Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui";
|
||||
import { getPublicEnvVar } from '@/lib/env';
|
||||
import { CaretLeftIcon, CaretRightIcon, InfoIcon, KeyIcon, LinkIcon, TextAlignLeftIcon } from "@phosphor-icons/react";
|
||||
import { useMemo, useState } from "react";
|
||||
import { useMemo } from "react";
|
||||
import { SvixProvider, useEndpoint, useEndpointMessageAttempts, useEndpointSecret } from "svix-react";
|
||||
import { AppEnabledGuard } from "../../app-enabled-guard";
|
||||
import { PageLayout } from "../../page-layout";
|
||||
@ -159,18 +159,11 @@ function MessageTable(props: { endpointId: string }) {
|
||||
export default function PageClient(props: { endpointId: string }) {
|
||||
const stackAdminApp = useAdminApp();
|
||||
const svixToken = stackAdminApp.useSvixToken();
|
||||
const [updateCounter, setUpdateCounter] = useState(0);
|
||||
|
||||
// This is a hack to make sure svix hooks update when content changes
|
||||
const svixTokenUpdated = useMemo(() => {
|
||||
return svixToken + '';
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [svixToken, updateCounter]);
|
||||
|
||||
return (
|
||||
<AppEnabledGuard appId="webhooks">
|
||||
<SvixProvider
|
||||
token={svixTokenUpdated}
|
||||
token={svixToken.token}
|
||||
appId={stackAdminApp.projectId}
|
||||
options={{ serverUrl: getPublicEnvVar('NEXT_PUBLIC_STACK_SVIX_SERVER_URL') }}
|
||||
>
|
||||
|
||||
@ -148,9 +148,11 @@ services:
|
||||
image: jaegertracing/all-in-one:latest
|
||||
environment:
|
||||
- COLLECTOR_OTLP_ENABLED=true
|
||||
- MEMORY_MAX_TRACES=50000
|
||||
ports:
|
||||
- "${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}07:16686" # Jaeger UI
|
||||
- "${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}31:4318" # OTLP Endpoint
|
||||
mem_limit: 1g
|
||||
restart: always
|
||||
|
||||
# ================= svix =================
|
||||
|
||||
Loading…
Reference in New Issue
Block a user