Initial commit with CI workflow
All checks were successful
Build Container / build (push) Successful in 1m18s

- Flask backend with SSH discovery and Claude AI integration
- React/Vite frontend with Tailwind CSS
- Docker multi-stage build
- Gitea Actions workflow for container builds

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Debian
2026-01-04 21:38:50 +00:00
commit ea49143a13
31 changed files with 3037 additions and 0 deletions

View File

@@ -0,0 +1,64 @@
const API_BASE = '/api';
export async function fetchApi(endpoint, options = {}) {
const url = `${API_BASE}${endpoint}`;
const response = await fetch(url, {
headers: {
'Content-Type': 'application/json',
...options.headers,
},
...options,
});
if (!response.ok) {
const error = await response.json().catch(() => ({ error: 'Unknown error' }));
throw new Error(error.error || `HTTP ${response.status}`);
}
return response.json();
}
export const api = {
// Settings
getSettings: () => fetchApi('/settings'),
updateSettings: (settings) => fetchApi('/settings', {
method: 'PUT',
body: JSON.stringify(settings),
}),
// Scanning
startScan: (hostname, username = 'root', port = 22) => fetchApi('/scan', {
method: 'POST',
body: JSON.stringify({ hostname, username, port }),
}),
getScan: (scanId) => fetchApi(`/scan/${scanId}`),
// Commands
runCommand: (scanId, command, reason) => fetchApi(`/scan/${scanId}/command`, {
method: 'POST',
body: JSON.stringify({ command, reason }),
}),
// Approvals
getPendingApprovals: () => fetchApi('/approvals'),
approveRequest: (approvalId) => fetchApi(`/approvals/${approvalId}/approve`, {
method: 'POST',
}),
rejectRequest: (approvalId) => fetchApi(`/approvals/${approvalId}/reject`, {
method: 'POST',
}),
// Monitors
getMonitors: () => fetchApi('/monitors'),
createDefaultMonitors: (scanId) => fetchApi('/monitors/create-defaults', {
method: 'POST',
body: JSON.stringify({ scan_id: scanId }),
}),
createSuggestedMonitors: (scanId, monitorIndices) => fetchApi('/monitors/create-suggested', {
method: 'POST',
body: JSON.stringify({ scan_id: scanId, monitors: monitorIndices }),
}),
// Uptime Kuma
testKumaConnection: () => fetchApi('/kuma/test'),
};