chore: Fix lint warnings in SetupWizard and add AI API docs

- Fixed unused variables in wizard components
- Fixed invalid aiEnabled field in FeaturesStep (AI uses separate API)
- Added AI endpoints section to API.md
This commit is contained in:
rcourtman
2025-12-13 15:36:40 +00:00
parent 3497780426
commit 5e2311035b
5 changed files with 40 additions and 9 deletions

View File

@@ -140,6 +140,37 @@ Initiate OIDC login flow.
---
## 🤖 Pulse AI *(New in 5.0)*
### Get AI Settings
`GET /api/settings/ai`
Returns current AI configuration (providers, models, patrol status).
### Update AI Settings
`PUT /api/settings/ai`
Configure AI providers, API keys, and preferences.
### Chat
`POST /api/ai/chat`
Send a message to the AI assistant.
```json
{ "message": "What VMs are using the most CPU?", "context": ["vm-100", "vm-101"] }
```
### Patrol Status
`GET /api/ai/patrol/status`
Get current patrol status and recent findings.
### Patrol Findings
`GET /api/ai/patrol/findings`
List all patrol findings with severity and recommendations.
### Cost Tracking
`GET /api/ai/cost?period=30d`
Get AI usage statistics and costs.
---
## 🤖 Agent Endpoints
### Unified Agent (Recommended)

View File

@@ -1,4 +1,4 @@
import { Component, createSignal, Show, onMount } from 'solid-js';
import { Component, createSignal, Show } from 'solid-js';
import { WelcomeStep } from './steps/WelcomeStep';
import { SecurityStep } from './steps/SecurityStep';
import { ConnectStep } from './steps/ConnectStep';

View File

@@ -28,7 +28,7 @@ export const ConnectStep: Component<ConnectStepProps> = (props) => {
// Manual form fields
const [host, setHost] = createSignal('');
const [port, setPort] = createSignal('8006');
const [port, _setPort] = createSignal('8006');
const [tokenId, setTokenId] = createSignal('');
const [tokenSecret, setTokenSecret] = createSignal('');
@@ -69,7 +69,7 @@ export const ConnectStep: Component<ConnectStepProps> = (props) => {
if (discoveredNodes().length === 0) {
showSuccess('Scan complete - no nodes found. Try manual setup.');
}
} catch (error) {
} catch (_error) {
showError('Discovery failed. Try manual setup.');
} finally {
setIsScanning(false);

View File

@@ -40,9 +40,9 @@ export const FeaturesStep: Component<FeaturesStepProps> = (props) => {
setIsSaving(true);
try {
// Save feature preferences
// Only save auto-update setting through SystemConfig
// AI settings are configured separately via Settings → AI
await SettingsAPI.updateSystemSettings({
aiEnabled: aiEnabled(),
autoUpdateEnabled: autoUpdates(),
});
@@ -53,7 +53,7 @@ export const FeaturesStep: Component<FeaturesStepProps> = (props) => {
showSuccess('Preferences saved!');
props.onNext();
} catch (error) {
} catch (_error) {
// Continue anyway - settings can be changed later
props.onNext();
} finally {
@@ -73,8 +73,8 @@ export const FeaturesStep: Component<FeaturesStepProps> = (props) => {
<button
onClick={() => feature.setEnabled(!feature.enabled())}
class={`w-full p-4 rounded-xl border transition-all text-left flex items-start gap-4 ${feature.enabled()
? 'bg-blue-500/20 border-blue-400/40'
: 'bg-white/5 border-white/10 hover:bg-white/10'
? 'bg-blue-500/20 border-blue-400/40'
: 'bg-white/5 border-white/10 hover:bg-white/10'
}`}
>
<div class="text-3xl">{feature.icon}</div>

View File

@@ -58,7 +58,7 @@ export const WelcomeStep: Component<WelcomeStepProps> = (props) => {
props.setIsUnlocked(true);
showSuccess('Token verified!');
props.onNext();
} catch (error) {
} catch (_error) {
showError('Invalid bootstrap token. Please check and try again.');
} finally {
setIsValidating(false);