Redesign settings page with sectioned layout, side navigation and choice cards
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6b9bf3cd5f
commit
de22f035dc
11 files changed
+934
-294
No files matched your search
@@ -5,74 +5,76 @@
|
||||
@inject McpTokenStore Store
|
||||
@inject NavigationManager Navigation
|
||||
|
||||
<section class="card form" id="mcp">
|
||||
<h2>MCP-Zugriff</h2>
|
||||
<p class="muted">
|
||||
KI-Assistenten wie Claude lesen die Fänge über <code>@Endpoint</code> (nur lesend, nur im LAN).
|
||||
Jeder Zugriff braucht einen Token im Header <code>Authorization: Bearer …</code>.
|
||||
</p>
|
||||
|
||||
<SettingsSection Id="mcp" Title="MCP-Zugriff" Description="KI-Assistenten wie Claude lesen die Fänge über das Model Context Protocol. Nur lesend und nur im LAN.">
|
||||
@if (Revoked == "revoked")
|
||||
{
|
||||
<div class="banner ok">Token widerrufen.</div>
|
||||
<Notice>Token widerrufen.</Notice>
|
||||
}
|
||||
|
||||
@if (_newToken is not null)
|
||||
{
|
||||
<div class="banner ok">
|
||||
<strong>Token für „@_newTokenName“ erstellt.</strong> Jetzt kopieren, er wird nicht noch einmal angezeigt:
|
||||
<Notice>
|
||||
<strong>Token für „@_newTokenName“ erstellt.</strong> Jetzt kopieren, er wird nicht noch einmal angezeigt.
|
||||
<code class="token">@_newToken</code>
|
||||
</div>
|
||||
</Notice>
|
||||
}
|
||||
|
||||
@if (Tokens.UsesEnvironmentToken)
|
||||
{
|
||||
<p class="muted">Zusätzlich gilt ein fester Token aus der Umgebungsvariable <code>Flypaper__Mcp__Token</code>.</p>
|
||||
}
|
||||
<div class="s-body">
|
||||
<dl class="kv">
|
||||
<div><dt>Endpunkt</dt><dd class="mono">@Endpoint</dd></div>
|
||||
<div><dt>Header</dt><dd class="mono">Authorization: Bearer <Token></dd></div>
|
||||
@if (Tokens.UsesEnvironmentToken)
|
||||
{
|
||||
<div><dt>Fester Token</dt><dd>per Umgebungsvariable <code>Flypaper__Mcp__Token</code></dd></div>
|
||||
}
|
||||
</dl>
|
||||
|
||||
@if (_tokens.Count > 0)
|
||||
{
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Erstellt</th>
|
||||
<th>Zuletzt genutzt</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var token in _tokens)
|
||||
{
|
||||
@if (_tokens.Count > 0)
|
||||
{
|
||||
<table class="s-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>@token.Name</td>
|
||||
<td class="nowrap">@token.CreatedAt.ToLocalTime().ToString("dd.MM.yyyy HH:mm")</td>
|
||||
<td class="nowrap">@(token.LastUsedAt?.ToLocalTime().ToString("dd.MM.yyyy HH:mm") ?? "nie")</td>
|
||||
<td class="num">
|
||||
<form method="post" action="/mcp-tokens/@token.Id/revoke" onsubmit="return confirm('Token „@token.Name“ widerrufen?')">
|
||||
<AntiforgeryToken />
|
||||
<button type="submit" class="secondary">Widerrufen</button>
|
||||
</form>
|
||||
</td>
|
||||
<th>Name</th>
|
||||
<th>Erstellt</th>
|
||||
<th>Zuletzt genutzt</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
else
|
||||
{
|
||||
<p class="muted">Noch keine Tokens.</p>
|
||||
}
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var token in _tokens)
|
||||
{
|
||||
<tr>
|
||||
<td>@token.Name</td>
|
||||
<td class="nowrap">@token.CreatedAt.ToLocalTime().ToString("dd.MM.yyyy HH:mm")</td>
|
||||
<td class="nowrap">@(token.LastUsedAt?.ToLocalTime().ToString("dd.MM.yyyy HH:mm") ?? "nie")</td>
|
||||
<td class="num">
|
||||
<form method="post" action="/mcp-tokens/@token.Id/revoke" onsubmit="return confirm('Token „@token.Name“ widerrufen?')">
|
||||
<AntiforgeryToken />
|
||||
<button type="submit" class="ghost danger-text">Widerrufen</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
else
|
||||
{
|
||||
<p class="empty">Noch keine Tokens.</p>
|
||||
}
|
||||
</div>
|
||||
|
||||
<EditForm Model="Model" FormName="mcp-create" OnSubmit="CreateAsync" action="/settings" class="danger-zone">
|
||||
<label for="mcp-token-name">Neuer Token <span class="muted">(Name, z. B. Claude Desktop)</span></label>
|
||||
<InputText id="mcp-token-name" @bind-Value="Model!.Name" autocomplete="off" maxlength="100" />
|
||||
<FieldError Errors="_errors" Field="@nameof(McpTokenModel.Name)" />
|
||||
<div class="actions">
|
||||
<button type="submit">Token erzeugen</button>
|
||||
<EditForm Model="Model" FormName="mcp-create" OnSubmit="CreateAsync" action="/settings#mcp" class="s-foot">
|
||||
<div class="inline-field">
|
||||
<InputText id="mcp-token-name" @bind-Value="Model!.Name" autocomplete="off" maxlength="100" placeholder="Name, z. B. Claude Code" aria-label="Name des neuen Tokens" />
|
||||
@if (_errors.TryGetValue(nameof(McpTokenModel.Name), out var nameError))
|
||||
{
|
||||
<span class="field-error">@nameError</span>
|
||||
}
|
||||
</div>
|
||||
<button type="submit">Token erzeugen</button>
|
||||
</EditForm>
|
||||
</section>
|
||||
</SettingsSection>
|
||||
|
||||
@code {
|
||||
private IReadOnlyList<McpTokenEntity> _tokens = [];
|
||||
|
||||
Reference in new issue
Block a user