mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
Sentry
This commit is contained in:
16 files changed
+494
-37
No files matched your search
@@ -3,15 +3,17 @@ import { useTranslation } from 'react-i18next';
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { ThemePicker } from "@/components/ThemePicker";
|
||||
import { LanguagePicker } from "@/components/LanguagePicker";
|
||||
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { useIsMobile } from "@/hooks/useIsMobile";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useAppContext } from "@/hooks/useAppContext";
|
||||
|
||||
export function Preferences() {
|
||||
const { t } = useTranslation();
|
||||
const isMobile = useIsMobile();
|
||||
const navigate = useNavigate();
|
||||
const { config, updateConfig } = useAppContext();
|
||||
|
||||
return (
|
||||
<div className="p-6 space-y-6">
|
||||
@@ -70,6 +72,29 @@ export function Preferences() {
|
||||
{t('languageDescription')}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<div className="flex items-center justify-between max-w-xs">
|
||||
<div className="space-y-0.5">
|
||||
<Label htmlFor="sentry-enabled" className="text-sm font-medium">
|
||||
{t('shareErrorReports')}
|
||||
</Label>
|
||||
</div>
|
||||
<Switch
|
||||
id="sentry-enabled"
|
||||
checked={config.sentryEnabled}
|
||||
onCheckedChange={(checked) => {
|
||||
updateConfig((current) => ({
|
||||
...current,
|
||||
sentryEnabled: checked,
|
||||
}));
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<p className="text-sm text-muted-foreground max-w-xs">
|
||||
{t('shareErrorReportsDescription')}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -29,6 +29,7 @@ export function SystemSettings() {
|
||||
const [fsPathProjectsInput, setFsPathProjectsInput] = useState(config.fsPathProjects);
|
||||
const [fsPathConfigInput, setFsPathConfigInput] = useState(config.fsPathConfig);
|
||||
const [fsPathTmpInput, setFsPathTmpInput] = useState(config.fsPathTmp);
|
||||
const [sentryDsnInput, setSentryDsnInput] = useState(config.sentryDsn);
|
||||
|
||||
// Service Worker state
|
||||
const [swState, setSwState] = useState<string>('');
|
||||
@@ -464,6 +465,36 @@ export function SystemSettings() {
|
||||
</AccordionItem>
|
||||
</Accordion>
|
||||
|
||||
{/* Sentry DSN Configuration */}
|
||||
<Accordion type="single" collapsible className="w-full">
|
||||
<AccordionItem value="sentry-dsn" className="border rounded-lg">
|
||||
<AccordionTrigger className="px-4 py-3 hover:no-underline">
|
||||
<h4 className="text-sm font-medium">{t('sentryDsn')}</h4>
|
||||
</AccordionTrigger>
|
||||
<AccordionContent className="px-4 pb-4">
|
||||
<div className="py-1 space-y-2">
|
||||
<Input
|
||||
id="sentry-dsn"
|
||||
type="text"
|
||||
placeholder="https://..."
|
||||
value={sentryDsnInput}
|
||||
onChange={(e) => {
|
||||
const value = e.target.value;
|
||||
setSentryDsnInput(value);
|
||||
updateConfig((current) => ({
|
||||
...current,
|
||||
sentryDsn: value,
|
||||
}));
|
||||
}}
|
||||
/>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
{t('sentryDsnDescription')}
|
||||
</p>
|
||||
</div>
|
||||
</AccordionContent>
|
||||
</AccordionItem>
|
||||
</Accordion>
|
||||
|
||||
{/* Filesystem Paths Configuration */}
|
||||
<Accordion type="single" collapsible className="w-full">
|
||||
<AccordionItem value="filesystem-paths" className="border rounded-lg">
|
||||
|
||||
Reference in new issue
Block a user