feat(mcp): re-add the read/read-write token scope selector
Restore the scope Select on the MCP settings page and describe honestly that read & write tokens can create and edit data. Adds the two new strings to lang/es.json.
This commit is contained in:
parent
be4f363e9e
commit
575e7a148d
|
|
@ -2239,6 +2239,8 @@
|
|||
"Scope": "Alcance",
|
||||
"Read only": "Solo lectura",
|
||||
"Read & write": "Lectura y escritura",
|
||||
"Access": "Acceso",
|
||||
"Read-only tokens can analyse your data. Read & write tokens can also create, edit and delete transactions, categories, labels and automation rules.": "Los tokens de solo lectura pueden analizar tus datos. Los tokens de lectura y escritura también pueden crear, editar y eliminar transacciones, categorías, etiquetas y reglas de automatización.",
|
||||
"Create token": "Crear token",
|
||||
"Your tokens": "Tus tokens",
|
||||
"Rotate a token to replace a leaked secret, or revoke it to cut off access.": "Rota un token para reemplazar un secreto filtrado, o revócalo para cortar el acceso.",
|
||||
|
|
|
|||
|
|
@ -29,6 +29,13 @@ import {
|
|||
} from '@/components/ui/card';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { Label } from '@/components/ui/label';
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectItem,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from '@/components/ui/select';
|
||||
import { useClipboard } from '@/hooks/use-clipboard';
|
||||
import AppLayout from '@/layouts/app-layout';
|
||||
import SettingsLayout from '@/layouts/settings/layout';
|
||||
|
|
@ -67,7 +74,10 @@ export default function Mcp() {
|
|||
>().props;
|
||||
const [, copy] = useClipboard();
|
||||
|
||||
const form = useForm({ name: '' });
|
||||
const form = useForm<{ name: string; scope: 'read' | 'read_write' }>({
|
||||
name: '',
|
||||
scope: 'read',
|
||||
});
|
||||
|
||||
function createToken(event: React.FormEvent) {
|
||||
event.preventDefault();
|
||||
|
|
@ -168,7 +178,7 @@ export default function Mcp() {
|
|||
<CardTitle>{__('Create a token')}</CardTitle>
|
||||
<CardDescription>
|
||||
{__(
|
||||
'Tokens can read and analyse your data, but never change it.',
|
||||
'Read-only tokens can analyse your data. Read & write tokens can also create, edit and delete transactions, categories, labels and automation rules.',
|
||||
)}
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
|
|
@ -191,6 +201,35 @@ export default function Mcp() {
|
|||
required
|
||||
/>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="token-scope">
|
||||
{__('Access')}
|
||||
</Label>
|
||||
<Select
|
||||
value={form.data.scope}
|
||||
onValueChange={(value) =>
|
||||
form.setData(
|
||||
'scope',
|
||||
value as 'read' | 'read_write',
|
||||
)
|
||||
}
|
||||
>
|
||||
<SelectTrigger
|
||||
id="token-scope"
|
||||
className="w-full sm:w-48"
|
||||
>
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="read">
|
||||
{__('Read only')}
|
||||
</SelectItem>
|
||||
<SelectItem value="read_write">
|
||||
{__('Read & write')}
|
||||
</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
<Button
|
||||
type="submit"
|
||||
disabled={form.processing}
|
||||
|
|
|
|||
Loading…
Reference in New Issue