fix: profile import file upload, startup health check, sidebar scroll, node-pty fallback
- Change profile import from server path input to browser file upload (multipart) - Fix startup script to wait for health check before opening browser - Add overflow scroll with hidden scrollbar to sidebar nav - Graceful degradation when node-pty fails to load (WSL compatibility) - Remove rename button from profile cards - Restrict profile name input to English letters, numbers, hyphens - Use raw.githubusercontent.com URLs in README setup script Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -100,13 +100,22 @@ export async function exportProfile(name: string): Promise<boolean> {
|
||||
}
|
||||
}
|
||||
|
||||
export async function importProfile(archive: string, name?: string): Promise<boolean> {
|
||||
export async function importProfile(file: File): Promise<boolean> {
|
||||
try {
|
||||
await request('/api/hermes/profiles/import', {
|
||||
const baseUrl = getBaseUrlValue()
|
||||
const token = getApiKey()
|
||||
const headers: Record<string, string> = {}
|
||||
if (token) headers['Authorization'] = `Bearer ${token}`
|
||||
|
||||
const formData = new FormData()
|
||||
formData.append('file', file)
|
||||
|
||||
const res = await fetch(`${baseUrl}/api/hermes/profiles/import`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ archive, name }),
|
||||
headers,
|
||||
body: formData,
|
||||
})
|
||||
return true
|
||||
return res.ok
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user