feat: settings page with connection tab, admin notices and site health test
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01At3V6SjwbMe6eMzVGW3Hs7
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace LIT\MCP\Admin;
|
||||
|
||||
final class ConnectionTab implements AdminTab
|
||||
{
|
||||
public function __construct(private ConnectionStatus $status)
|
||||
{
|
||||
}
|
||||
|
||||
public function slug(): string
|
||||
{
|
||||
return 'verbindung';
|
||||
}
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return __('Verbindung', 'wp-lit-mcp');
|
||||
}
|
||||
|
||||
public function registerSettings(): void
|
||||
{
|
||||
}
|
||||
|
||||
public function registerActions(): void
|
||||
{
|
||||
}
|
||||
|
||||
public function render(): void
|
||||
{
|
||||
echo '<h2>' . esc_html__('MCP-Server', 'wp-lit-mcp') . '</h2>';
|
||||
printf(
|
||||
'<p><label for="lit-mcp-url">%s</label><br>'
|
||||
. '<input id="lit-mcp-url" type="text" class="large-text code" readonly value="%s"></p>',
|
||||
esc_html__('Server-URL für den Connector', 'wp-lit-mcp'),
|
||||
esc_attr(ConnectionStatus::serverUrl())
|
||||
);
|
||||
echo '<p>' . esc_html__(
|
||||
'In claude.ai unter Einstellungen → Connectors → „Add custom connector“ eintragen;',
|
||||
'wp-lit-mcp'
|
||||
) . ' ' . esc_html__('Die Anmeldung läuft danach über diese Website.', 'wp-lit-mcp') . '</p>';
|
||||
|
||||
echo '<h2>' . esc_html__('Status', 'wp-lit-mcp') . '</h2><table class="widefat striped"><tbody>';
|
||||
foreach ($this->status->checks(true) as $check) {
|
||||
$state = $check['ok'] === null ? '–' : ($check['ok'] ? '✔' : '✖');
|
||||
printf(
|
||||
'<tr><th scope="row">%s</th><td>%s</td><td>%s</td></tr>',
|
||||
esc_html($check['label']),
|
||||
esc_html($state),
|
||||
esc_html($check['message'])
|
||||
);
|
||||
}
|
||||
echo '</tbody></table>';
|
||||
echo '<p>' . esc_html__('Weitere Prüfungen unter Werkzeuge → Website-Zustand.', 'wp-lit-mcp') . '</p>';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user