Skip to content

Commit 3278684

Browse files
Move server status and settings display into settings modal
- Remove server status and current settings from homepage for cleaner UI - Add current configuration display to settings modal showing all settings - Add server status component inside settings modal with health checks - Increase modal width to accommodate additional content - Add proper styling for settings status section with light/dark mode support - Clean up unused CSS from App.css This provides a cleaner homepage while keeping all configuration-related information organized in one place within the settings modal. Co-authored-by: openhands <openhands@all-hands.dev>
1 parent fa0f054 commit 3278684

File tree

4 files changed

+62
-34
lines changed

4 files changed

+62
-34
lines changed

example/src/App.css

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -79,27 +79,7 @@
7979
font-weight: 500;
8080
}
8181

82-
.settings-info {
83-
background-color: #f5f5f5;
84-
border-radius: 4px;
85-
padding: 1rem;
86-
margin-bottom: 1rem;
87-
}
8882

89-
.settings-info h3 {
90-
margin-top: 0;
91-
margin-bottom: 0.5rem;
92-
color: #333;
93-
}
94-
95-
.settings-info ul {
96-
margin: 0;
97-
padding-left: 1.5rem;
98-
}
99-
100-
.settings-info li {
101-
margin: 0.25rem 0;
102-
}
10383

10484
.card {
10585
padding: 2em;

example/src/App.tsx

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212

1313
// Import settings components
1414
import { SettingsModal } from './components/SettingsModal'
15-
import { ServerStatus } from './components/ServerStatus'
1615
import { useSettings } from './contexts/SettingsContext'
1716

1817
function App() {
@@ -69,18 +68,6 @@ function App() {
6968
</div>
7069
)}
7170

72-
<div className="settings-info">
73-
<h3>Current Settings:</h3>
74-
<ul>
75-
<li><strong>Agent Server URL:</strong> {settings.agentServerUrl}</li>
76-
<li><strong>Model:</strong> {settings.modelName}</li>
77-
<li><strong>LLM API Key:</strong> {settings.apiKey ? '***configured***' : 'not set'}</li>
78-
<li><strong>Agent Server API Key:</strong> {settings.agentServerApiKey ? '***configured***' : 'not set'}</li>
79-
</ul>
80-
</div>
81-
82-
<ServerStatus settings={settings} />
83-
8471
<div className="card">
8572
<h2>SDK Import Status</h2>
8673
<p className="status">{sdkStatus}</p>

example/src/components/SettingsModal.css

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
border-radius: 8px;
1717
padding: 0;
1818
width: 90%;
19-
max-width: 500px;
19+
max-width: 600px;
2020
max-height: 90vh;
2121
overflow-y: auto;
2222
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
@@ -57,6 +57,38 @@
5757
color: #333;
5858
}
5959

60+
.settings-status {
61+
padding: 1.5rem;
62+
border-bottom: 1px solid #e0e0e0;
63+
background-color: #f8f9fa;
64+
}
65+
66+
.current-settings {
67+
margin-bottom: 1.5rem;
68+
}
69+
70+
.current-settings h3 {
71+
margin: 0 0 1rem 0;
72+
color: #333;
73+
font-size: 1.1rem;
74+
}
75+
76+
.current-settings ul {
77+
list-style: none;
78+
padding: 0;
79+
margin: 0;
80+
}
81+
82+
.current-settings li {
83+
padding: 0.5rem 0;
84+
border-bottom: 1px solid #e0e0e0;
85+
font-size: 0.9rem;
86+
}
87+
88+
.current-settings li:last-child {
89+
border-bottom: none;
90+
}
91+
6092
.settings-form {
6193
padding: 1.5rem;
6294
}
@@ -160,6 +192,20 @@
160192
color: #fff;
161193
}
162194

195+
.settings-status {
196+
background-color: #2a2a2a;
197+
border-bottom-color: #333;
198+
}
199+
200+
.current-settings h3 {
201+
color: #fff;
202+
}
203+
204+
.current-settings li {
205+
border-bottom-color: #333;
206+
color: #ccc;
207+
}
208+
163209
.close-button {
164210
color: #ccc;
165211
}

example/src/components/SettingsModal.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, { useState, useEffect } from 'react';
22
import './SettingsModal.css';
3+
import { ServerStatus } from './ServerStatus';
34

45
export interface Settings {
56
agentServerUrl: string;
@@ -103,6 +104,20 @@ export const SettingsModal: React.FC<SettingsModalProps> = ({
103104
</button>
104105
</div>
105106

107+
<div className="settings-status">
108+
<div className="current-settings">
109+
<h3>Current Configuration:</h3>
110+
<ul>
111+
<li><strong>Agent Server URL:</strong> {initialSettings.agentServerUrl}</li>
112+
<li><strong>Model:</strong> {initialSettings.modelName}</li>
113+
<li><strong>LLM API Key:</strong> {initialSettings.apiKey ? '***configured***' : 'not set'}</li>
114+
<li><strong>Agent Server API Key:</strong> {initialSettings.agentServerApiKey ? '***configured***' : 'not set'}</li>
115+
</ul>
116+
</div>
117+
118+
<ServerStatus settings={initialSettings} />
119+
</div>
120+
106121
<form onSubmit={handleSubmit} className="settings-form">
107122
<div className="form-group">
108123
<label htmlFor="agentServerUrl">Agent Server URL</label>

0 commit comments

Comments
 (0)