All checks were successful
Beta Release / beta (push) Successful in 36s
Add full internationalization system with React context, French/English translations, and AZERTY/QWERTY keyboard layout support. Dashboard now uses a tabbed layout (Tools, Notifications, Workflows). Config page exposes language and keyboard preferences persisted via new /api/preferences endpoint. 💕 Generated with Crush Assisted-by: GLM-5-Turbo via Crush <crush@charm.land>
33 lines
1.2 KiB
JavaScript
33 lines
1.2 KiB
JavaScript
const API_BASE = '/api'
|
|
|
|
async function request(path, options = {}) {
|
|
const res = await fetch(`${API_BASE}${path}`, {
|
|
headers: { 'Content-Type': 'application/json' },
|
|
...options,
|
|
})
|
|
if (!res.ok) {
|
|
const err = await res.json().catch(() => ({ error: res.statusText }))
|
|
throw new Error(err.error || res.statusText)
|
|
}
|
|
return res.json()
|
|
}
|
|
|
|
const api = {
|
|
getInfo: () => request('/info'),
|
|
getSystem: () => request('/system'),
|
|
getTools: () => request('/tools'),
|
|
getConfig: () => request('/config'),
|
|
getProviders: () => request('/providers'),
|
|
getSkills: () => request('/skills'),
|
|
getLSP: () => request('/lsp'),
|
|
getMCP: () => request('/mcp'),
|
|
getUpdates: () => request('/updates'),
|
|
runScan: () => request('/scan', { method: 'POST' }),
|
|
installTools: (tools) => request('/install', { method: 'POST', body: JSON.stringify({ tools }) }),
|
|
configureMCP: () => request('/mcp/configure', { method: 'POST' }),
|
|
savePreferences: (prefs) => request('/preferences', { method: 'PUT', body: JSON.stringify(prefs) }),
|
|
runCommand: (command, cwd) => request('/terminal', { method: 'POST', body: JSON.stringify({ command, cwd }) }),
|
|
}
|
|
|
|
export default api
|