-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix(web,server): show real platform connection status in Settings (closes #1031) #1061
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -607,16 +607,19 @@ function AssistantConfigSection({ config }: { config: SafeConfigResponse }): Rea | |
| } | ||
|
|
||
| function PlatformConnectionsSection({ | ||
| adapter, | ||
| activePlatforms, | ||
| }: { | ||
| adapter: string | undefined; | ||
| activePlatforms: string[] | undefined; | ||
| }): React.ReactElement { | ||
| const active = new Set(activePlatforms ?? []); | ||
| const platforms = [ | ||
| { name: 'Web', connected: adapter === 'web' }, | ||
| { name: 'Slack', connected: false }, | ||
| { name: 'Telegram', connected: false }, | ||
| { name: 'Discord', connected: false }, | ||
| { name: 'GitHub', connected: false }, | ||
| { name: 'Web', connected: active.has('Web') }, | ||
| { name: 'Slack', connected: active.has('Slack') }, | ||
| { name: 'Telegram', connected: active.has('Telegram') }, | ||
| { name: 'Discord', connected: active.has('Discord') }, | ||
| { name: 'GitHub', connected: active.has('GitHub') }, | ||
| { name: 'Gitea', connected: active.has('Gitea') }, | ||
| { name: 'GitLab', connected: active.has('GitLab') }, | ||
| ]; | ||
|
|
||
|
Comment on lines
609
to
624
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid showing “Not configured” before health data exists. When 💡 Suggested tweak function PlatformConnectionsSection({
activePlatforms,
}: {
activePlatforms: string[] | undefined;
}): React.ReactElement {
+ const hasHealthData = activePlatforms !== undefined;
const active = new Set(activePlatforms ?? []);
const platforms = [
{ name: 'Web', connected: active.has('Web') },
{ name: 'Slack', connected: active.has('Slack') },
{ name: 'Telegram', connected: active.has('Telegram') },
@@
{platforms.map(p => (
<div key={p.name} className="flex items-center justify-between text-sm">
<span>{p.name}</span>
- <Badge variant={p.connected ? 'default' : 'secondary'}>
- {p.connected ? 'Connected' : 'Not configured'}
+ <Badge variant={hasHealthData && p.connected ? 'default' : 'secondary'}>
+ {!hasHealthData ? 'Unknown' : p.connected ? 'Connected' : 'Not configured'}
</Badge>
</div>
))}🤖 Prompt for AI Agents |
||
| return ( | ||
|
|
@@ -717,7 +720,7 @@ export function SettingsPage(): React.ReactElement { | |
|
|
||
| <div className="grid grid-cols-1 gap-6 lg:grid-cols-2"> | ||
| {configData && <AssistantConfigSection config={configData.config} />} | ||
| <PlatformConnectionsSection adapter={health?.adapter} /> | ||
| <PlatformConnectionsSection activePlatforms={health?.activePlatforms} /> | ||
| </div> | ||
|
|
||
| <ProjectsSection /> | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.