Spaces:
Configuration error
Configuration error
chore: Synchronizácia UI komponentov a dokumentácie s HF Space
Browse files- Aethero_App/README.md +2 -2
- Aethero_App/dashboard/components/ui/AgentAvatar.tsx +42 -0
- Aethero_App/dashboard/components/ui/CognitiveConsole.tsx +74 -0
- Aethero_App/dashboard/components/ui/ParserLogsPanel.tsx +34 -0
- Aethero_App/dashboard/components/ui/RadarMetrics.tsx +74 -0
- Aethero_App/dashboard/store/state.ts +17 -0
- Aethero_App/push_to_both.sh +23 -0
- Aethero_App/syntaxator_fastapi.py +32 -0
- Aethero_App/syntaxator_server.py +37 -0
- dashboard/components/ui/IntrospectiveHeader.tsx +65 -0
- dashboard/components/ui/ParserLogsPanel.tsx +72 -0
Aethero_App/README.md
CHANGED
|
@@ -139,8 +139,8 @@ Aethero_App/
|
|
| 139 |
```
|
| 140 |
|
| 141 |
# 🔄 Priebežný stav
|
| 142 |
-
- **
|
| 143 |
-
- **
|
| 144 |
|
| 145 |
# 🚧 Poznámka
|
| 146 |
Táto dokumentácia je priebežne dopĺňaná a odráža aktuálny stav vývoja systému.
|
|
|
|
| 139 |
```
|
| 140 |
|
| 141 |
# 🔄 Priebežný stav
|
| 142 |
+
- **Konzistencia medzi GitHub a Hugging Face Space**: Všetky komponenty a dokumentácia sú synchronizované medzi oboma platformami.
|
| 143 |
+
- **Syntaxátor AetheroOS**: Hostovaný cez FastAPI na porte 7860.
|
| 144 |
|
| 145 |
# 🚧 Poznámka
|
| 146 |
Táto dokumentácia je priebežne dopĺňaná a odráža aktuálny stav vývoja systému.
|
Aethero_App/dashboard/components/ui/AgentAvatar.tsx
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import React from 'react';
|
| 2 |
+
import { motion } from 'framer-motion';
|
| 3 |
+
|
| 4 |
+
interface AgentAvatarProps {
|
| 5 |
+
name: string;
|
| 6 |
+
avatarUrl: string;
|
| 7 |
+
status: 'online' | 'offline' | 'busy';
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
const statusColors = {
|
| 11 |
+
online: 'bg-green-500',
|
| 12 |
+
offline: 'bg-gray-500',
|
| 13 |
+
busy: 'bg-yellow-500',
|
| 14 |
+
};
|
| 15 |
+
|
| 16 |
+
const AgentAvatar: React.FC<AgentAvatarProps> = ({ name, avatarUrl, status }) => {
|
| 17 |
+
return (
|
| 18 |
+
<motion.div
|
| 19 |
+
className="flex items-center space-x-4 p-4 bg-gray-800 rounded-lg shadow-lg"
|
| 20 |
+
initial={{ opacity: 0, y: 10 }}
|
| 21 |
+
animate={{ opacity: 1, y: 0 }}
|
| 22 |
+
transition={{ duration: 0.5 }}
|
| 23 |
+
>
|
| 24 |
+
<div className="relative">
|
| 25 |
+
<img
|
| 26 |
+
src={avatarUrl}
|
| 27 |
+
alt={`${name}'s avatar`}
|
| 28 |
+
className="w-16 h-16 rounded-full border-2 border-gray-700"
|
| 29 |
+
/>
|
| 30 |
+
<span
|
| 31 |
+
className={`absolute bottom-0 right-0 w-4 h-4 rounded-full border-2 border-gray-800 ${statusColors[status]}`}
|
| 32 |
+
></span>
|
| 33 |
+
</div>
|
| 34 |
+
<div>
|
| 35 |
+
<h3 className="text-lg font-bold text-white">{name}</h3>
|
| 36 |
+
<p className="text-sm text-gray-400 capitalize">{status}</p>
|
| 37 |
+
</div>
|
| 38 |
+
</motion.div>
|
| 39 |
+
);
|
| 40 |
+
};
|
| 41 |
+
|
| 42 |
+
export default AgentAvatar;
|
Aethero_App/dashboard/components/ui/CognitiveConsole.tsx
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import React, { useEffect, useState } from 'react';
|
| 2 |
+
import { motion } from 'framer-motion';
|
| 3 |
+
import useAppState from '../../store/state';
|
| 4 |
+
|
| 5 |
+
interface CognitiveConsoleProps {
|
| 6 |
+
onCommandSubmit: (command: string) => void;
|
| 7 |
+
logs: string[];
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
const CognitiveConsole: React.FC<CognitiveConsoleProps> = ({ onCommandSubmit, logs }) => {
|
| 11 |
+
const [command, setCommand] = useState('');
|
| 12 |
+
const { addLog } = useAppState();
|
| 13 |
+
|
| 14 |
+
useEffect(() => {
|
| 15 |
+
const socket = new WebSocket('ws://localhost:8000/logs/stream');
|
| 16 |
+
|
| 17 |
+
socket.onmessage = (event) => {
|
| 18 |
+
addLog(event.data);
|
| 19 |
+
};
|
| 20 |
+
|
| 21 |
+
return () => {
|
| 22 |
+
socket.close();
|
| 23 |
+
};
|
| 24 |
+
}, [addLog]);
|
| 25 |
+
|
| 26 |
+
const handleSubmit = (e: React.FormEvent) => {
|
| 27 |
+
e.preventDefault();
|
| 28 |
+
if (command.trim()) {
|
| 29 |
+
onCommandSubmit(command);
|
| 30 |
+
setCommand('');
|
| 31 |
+
}
|
| 32 |
+
};
|
| 33 |
+
|
| 34 |
+
return (
|
| 35 |
+
<motion.div
|
| 36 |
+
className="bg-gray-900 p-6 rounded-lg shadow-lg flex flex-col space-y-4"
|
| 37 |
+
initial={{ opacity: 0, y: 10 }}
|
| 38 |
+
animate={{ opacity: 1, y: 0 }}
|
| 39 |
+
transition={{ duration: 0.5 }}
|
| 40 |
+
>
|
| 41 |
+
<h2 className="text-xl font-bold text-white">Cognitive Console</h2>
|
| 42 |
+
<div className="flex-grow overflow-y-auto bg-gray-800 p-4 rounded-lg">
|
| 43 |
+
{logs.length > 0 ? (
|
| 44 |
+
<ul className="space-y-2">
|
| 45 |
+
{logs.map((log, index) => (
|
| 46 |
+
<li key={index} className="text-sm text-gray-300">
|
| 47 |
+
{log}
|
| 48 |
+
</li>
|
| 49 |
+
))}
|
| 50 |
+
</ul>
|
| 51 |
+
) : (
|
| 52 |
+
<p className="text-gray-500">No logs available.</p>
|
| 53 |
+
)}
|
| 54 |
+
</div>
|
| 55 |
+
<form onSubmit={handleSubmit} className="flex space-x-2">
|
| 56 |
+
<input
|
| 57 |
+
type="text"
|
| 58 |
+
value={command}
|
| 59 |
+
onChange={(e) => setCommand(e.target.value)}
|
| 60 |
+
placeholder="Enter command..."
|
| 61 |
+
className="flex-grow p-2 rounded-lg bg-gray-700 text-white focus:outline-none focus:ring-2 focus:ring-blue-500"
|
| 62 |
+
/>
|
| 63 |
+
<button
|
| 64 |
+
type="submit"
|
| 65 |
+
className="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
| 66 |
+
>
|
| 67 |
+
Submit
|
| 68 |
+
</button>
|
| 69 |
+
</form>
|
| 70 |
+
</motion.div>
|
| 71 |
+
);
|
| 72 |
+
};
|
| 73 |
+
|
| 74 |
+
export default CognitiveConsole;
|
Aethero_App/dashboard/components/ui/ParserLogsPanel.tsx
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { useEffect, useState } from 'react';
|
| 2 |
+
import useAppState from '../../store/state';
|
| 3 |
+
|
| 4 |
+
const fetchLogs = async () => {
|
| 5 |
+
const response = await fetch('/api/logs');
|
| 6 |
+
const data = await response.json();
|
| 7 |
+
return data;
|
| 8 |
+
};
|
| 9 |
+
|
| 10 |
+
const ParserLogsPanel = () => {
|
| 11 |
+
const { logs, addLog } = useAppState();
|
| 12 |
+
const [filteredLogs, setFilteredLogs] = useState<string[]>([]);
|
| 13 |
+
|
| 14 |
+
useEffect(() => {
|
| 15 |
+
fetchLogs().then((data) => {
|
| 16 |
+
data.forEach((log: string) => addLog(log));
|
| 17 |
+
});
|
| 18 |
+
}, [addLog]);
|
| 19 |
+
|
| 20 |
+
return (
|
| 21 |
+
<div>
|
| 22 |
+
<h2>Parser Logs</h2>
|
| 23 |
+
<div>
|
| 24 |
+
{logs.length === 0 ? (
|
| 25 |
+
<p>No logs available.</p>
|
| 26 |
+
) : (
|
| 27 |
+
logs.map((log, index) => <div key={index}>{log}</div>)
|
| 28 |
+
)}
|
| 29 |
+
</div>
|
| 30 |
+
</div>
|
| 31 |
+
);
|
| 32 |
+
};
|
| 33 |
+
|
| 34 |
+
export default ParserLogsPanel;
|
Aethero_App/dashboard/components/ui/RadarMetrics.tsx
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import React, { useEffect } from 'react';
|
| 2 |
+
import { motion } from 'framer-motion';
|
| 3 |
+
import { Radar } from 'react-chartjs-2';
|
| 4 |
+
import 'chart.js/auto';
|
| 5 |
+
import useAppState from '../../store/state';
|
| 6 |
+
|
| 7 |
+
const fetchMetrics = async () => {
|
| 8 |
+
const response = await fetch('/api/metrics');
|
| 9 |
+
const data = await response.json();
|
| 10 |
+
return data;
|
| 11 |
+
};
|
| 12 |
+
|
| 13 |
+
interface RadarMetricsProps {
|
| 14 |
+
metricsData: {
|
| 15 |
+
labels: string[];
|
| 16 |
+
datasets: {
|
| 17 |
+
label: string;
|
| 18 |
+
data: number[];
|
| 19 |
+
backgroundColor: string;
|
| 20 |
+
borderColor: string;
|
| 21 |
+
borderWidth: number;
|
| 22 |
+
}[];
|
| 23 |
+
};
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
const RadarMetrics: React.FC<RadarMetricsProps> = ({ metricsData }) => {
|
| 27 |
+
const { metrics, setMetrics } = useAppState();
|
| 28 |
+
|
| 29 |
+
useEffect(() => {
|
| 30 |
+
fetchMetrics().then((data) => {
|
| 31 |
+
setMetrics(data);
|
| 32 |
+
});
|
| 33 |
+
}, [setMetrics]);
|
| 34 |
+
|
| 35 |
+
return (
|
| 36 |
+
<motion.div
|
| 37 |
+
className="bg-gray-800 p-6 rounded-lg shadow-lg"
|
| 38 |
+
initial={{ opacity: 0, scale: 0.9 }}
|
| 39 |
+
animate={{ opacity: 1, scale: 1 }}
|
| 40 |
+
transition={{ duration: 0.5 }}
|
| 41 |
+
>
|
| 42 |
+
<h2 className="text-xl font-bold text-white mb-4">Radar Metrics</h2>
|
| 43 |
+
<div className="w-full h-96">
|
| 44 |
+
<Radar data={metricsData} options={{
|
| 45 |
+
responsive: true,
|
| 46 |
+
maintainAspectRatio: false,
|
| 47 |
+
scales: {
|
| 48 |
+
r: {
|
| 49 |
+
grid: {
|
| 50 |
+
color: '#4B5563',
|
| 51 |
+
},
|
| 52 |
+
angleLines: {
|
| 53 |
+
color: '#4B5563',
|
| 54 |
+
},
|
| 55 |
+
ticks: {
|
| 56 |
+
backdropColor: 'transparent',
|
| 57 |
+
color: '#D1D5DB',
|
| 58 |
+
},
|
| 59 |
+
},
|
| 60 |
+
},
|
| 61 |
+
plugins: {
|
| 62 |
+
legend: {
|
| 63 |
+
labels: {
|
| 64 |
+
color: '#D1D5DB',
|
| 65 |
+
},
|
| 66 |
+
},
|
| 67 |
+
},
|
| 68 |
+
}} />
|
| 69 |
+
</div>
|
| 70 |
+
</motion.div>
|
| 71 |
+
);
|
| 72 |
+
};
|
| 73 |
+
|
| 74 |
+
export default RadarMetrics;
|
Aethero_App/dashboard/store/state.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import create from 'zustand';
|
| 2 |
+
|
| 3 |
+
interface AppState {
|
| 4 |
+
logs: string[];
|
| 5 |
+
metrics: any;
|
| 6 |
+
addLog: (log: string) => void;
|
| 7 |
+
setMetrics: (metrics: any) => void;
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
const useAppState = create<AppState>((set) => ({
|
| 11 |
+
logs: [],
|
| 12 |
+
metrics: null,
|
| 13 |
+
addLog: (log) => set((state) => ({ logs: [...state.logs, log] })),
|
| 14 |
+
setMetrics: (metrics) => set(() => ({ metrics })),
|
| 15 |
+
}));
|
| 16 |
+
|
| 17 |
+
export default useAppState;
|
Aethero_App/push_to_both.sh
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/zsh
|
| 2 |
+
|
| 3 |
+
# Skript na paralelné pushovanie commitov na GitHub a Hugging Face Space
|
| 4 |
+
|
| 5 |
+
# Definovanie vzdialených repozitárov
|
| 6 |
+
GITHUB_REMOTE="origin"
|
| 7 |
+
HF_REMOTE="hf"
|
| 8 |
+
|
| 9 |
+
# Kontrola aktuálneho stavu git
|
| 10 |
+
if ! git diff --quiet || ! git diff --cached --quiet; then
|
| 11 |
+
echo "\n\033[1;33mUpozornenie: Máte neuložené zmeny. Commitujte ich pred spustením skriptu.\033[0m\n"
|
| 12 |
+
exit 1
|
| 13 |
+
fi
|
| 14 |
+
|
| 15 |
+
# Push na GitHub
|
| 16 |
+
echo "\n\033[1;34mPushujem na GitHub...\033[0m\n"
|
| 17 |
+
git push $GITHUB_REMOTE main
|
| 18 |
+
|
| 19 |
+
# Push na Hugging Face Space
|
| 20 |
+
echo "\n\033[1;34mPushujem na Hugging Face Space...\033[0m\n"
|
| 21 |
+
git push $HF_REMOTE main
|
| 22 |
+
|
| 23 |
+
echo "\n\033[1;32mPushovanie dokončené na oboch platformách.\033[0m\n"
|
Aethero_App/syntaxator_fastapi.py
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from fastapi import FastAPI
|
| 2 |
+
from introspective_parser_module.parser import ASLMetaParser
|
| 3 |
+
from introspective_parser_module.metrics import CognitiveMetricsAnalyzer
|
| 4 |
+
from introspective_parser_module.reflection_agent import AetheroReflectionAgent
|
| 5 |
+
|
| 6 |
+
app = FastAPI()
|
| 7 |
+
|
| 8 |
+
@app.get("/")
|
| 9 |
+
def read_root():
|
| 10 |
+
return {"message": "Welcome to AetheroOS Syntaxator API!"}
|
| 11 |
+
|
| 12 |
+
@app.post("/parse")
|
| 13 |
+
def parse_asl(data: dict):
|
| 14 |
+
parser = ASLMetaParser()
|
| 15 |
+
result = parser.parse_and_validate(data)
|
| 16 |
+
return {"parsed_data": result}
|
| 17 |
+
|
| 18 |
+
@app.post("/analyze")
|
| 19 |
+
def analyze_metrics(data: dict):
|
| 20 |
+
analyzer = CognitiveMetricsAnalyzer()
|
| 21 |
+
report = analyzer.generate_introspective_report(data)
|
| 22 |
+
return {"analysis_report": report}
|
| 23 |
+
|
| 24 |
+
@app.post("/reflect")
|
| 25 |
+
def reflect(data: dict):
|
| 26 |
+
agent = AetheroReflectionAgent()
|
| 27 |
+
reflection = agent.reflect(data)
|
| 28 |
+
return {"reflection": reflection}}
|
| 29 |
+
|
| 30 |
+
if __name__ == "__main__":
|
| 31 |
+
import uvicorn
|
| 32 |
+
uvicorn.run(app, host="0.0.0.0", port=7860)
|
Aethero_App/syntaxator_server.py
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from fastapi import FastAPI
|
| 2 |
+
from pydantic import BaseModel
|
| 3 |
+
from typing import List, Dict
|
| 4 |
+
|
| 5 |
+
app = FastAPI()
|
| 6 |
+
|
| 7 |
+
# Define models for request and response
|
| 8 |
+
class ParseRequest(BaseModel):
|
| 9 |
+
text: str
|
| 10 |
+
|
| 11 |
+
class MetricsResponse(BaseModel):
|
| 12 |
+
metrics: Dict[str, float]
|
| 13 |
+
|
| 14 |
+
class ReflectionResponse(BaseModel):
|
| 15 |
+
insights: List[str]
|
| 16 |
+
|
| 17 |
+
@app.post("/api/parse")
|
| 18 |
+
async def parse_text(request: ParseRequest):
|
| 19 |
+
# Placeholder logic for parsing
|
| 20 |
+
parsed_data = {"parsed": f"Parsed content of: {request.text}"}
|
| 21 |
+
return parsed_data
|
| 22 |
+
|
| 23 |
+
@app.get("/api/metrics")
|
| 24 |
+
async def get_metrics():
|
| 25 |
+
# Placeholder logic for metrics
|
| 26 |
+
metrics = {"accuracy": 0.95, "latency": 0.1}
|
| 27 |
+
return MetricsResponse(metrics=metrics)
|
| 28 |
+
|
| 29 |
+
@app.get("/api/reflection")
|
| 30 |
+
async def get_reflection():
|
| 31 |
+
# Placeholder logic for reflection agent
|
| 32 |
+
insights = ["Insight 1", "Insight 2", "Insight 3"]
|
| 33 |
+
return ReflectionResponse(insights=insights)
|
| 34 |
+
|
| 35 |
+
if __name__ == "__main__":
|
| 36 |
+
import uvicorn
|
| 37 |
+
uvicorn.run(app, host="0.0.0.0", port=7860)
|
dashboard/components/ui/IntrospectiveHeader.tsx
CHANGED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import React from 'react';
|
| 2 |
+
import { motion } from 'framer-motion';
|
| 3 |
+
|
| 4 |
+
interface IntrospectiveHeaderProps {
|
| 5 |
+
modes: string[];
|
| 6 |
+
activeMode: string;
|
| 7 |
+
user: { name: string; avatarUrl: string };
|
| 8 |
+
onModeChange: (mode: string) => void;
|
| 9 |
+
onLogout: () => void;
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
const IntrospectiveHeader: React.FC<IntrospectiveHeaderProps> = ({
|
| 13 |
+
modes,
|
| 14 |
+
activeMode,
|
| 15 |
+
user,
|
| 16 |
+
onModeChange,
|
| 17 |
+
onLogout,
|
| 18 |
+
}) => {
|
| 19 |
+
return (
|
| 20 |
+
<motion.header
|
| 21 |
+
className="bg-red-700 text-white flex justify-between items-center p-4"
|
| 22 |
+
initial={{ opacity: 0 }}
|
| 23 |
+
animate={{ opacity: 1 }}
|
| 24 |
+
transition={{ duration: 0.5 }}
|
| 25 |
+
>
|
| 26 |
+
<div className="flex items-center space-x-4">
|
| 27 |
+
<img
|
| 28 |
+
src="/logo.svg"
|
| 29 |
+
alt="AetheroOS Logo"
|
| 30 |
+
className="h-10 w-10"
|
| 31 |
+
/>
|
| 32 |
+
<h1 className="text-xl font-bold">AetheroOS</h1>
|
| 33 |
+
</div>
|
| 34 |
+
<nav className="flex space-x-4">
|
| 35 |
+
{modes.map((mode) => (
|
| 36 |
+
<button
|
| 37 |
+
key={mode}
|
| 38 |
+
className={`px-4 py-2 rounded ${
|
| 39 |
+
mode === activeMode ? 'bg-white text-red-700' : 'bg-red-600'
|
| 40 |
+
}`}
|
| 41 |
+
onClick={() => onModeChange(mode)}
|
| 42 |
+
>
|
| 43 |
+
{mode.charAt(0).toUpperCase() + mode.slice(1)}
|
| 44 |
+
</button>
|
| 45 |
+
))}
|
| 46 |
+
</nav>
|
| 47 |
+
<div className="flex items-center space-x-4">
|
| 48 |
+
<img
|
| 49 |
+
src={user.avatarUrl}
|
| 50 |
+
alt={user.name}
|
| 51 |
+
className="h-10 w-10 rounded-full border-2 border-white"
|
| 52 |
+
/>
|
| 53 |
+
<span>{user.name}</span>
|
| 54 |
+
<button
|
| 55 |
+
onClick={onLogout}
|
| 56 |
+
className="px-4 py-2 bg-red-600 rounded hover:bg-red-500"
|
| 57 |
+
>
|
| 58 |
+
Logout
|
| 59 |
+
</button>
|
| 60 |
+
</div>
|
| 61 |
+
</motion.header>
|
| 62 |
+
);
|
| 63 |
+
};
|
| 64 |
+
|
| 65 |
+
export default IntrospectiveHeader;
|
dashboard/components/ui/ParserLogsPanel.tsx
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import React from 'react';
|
| 2 |
+
import { motion } from 'framer-motion';
|
| 3 |
+
|
| 4 |
+
interface ASLLog {
|
| 5 |
+
id: string;
|
| 6 |
+
timestamp: string;
|
| 7 |
+
type: string;
|
| 8 |
+
payload: Record<string, any>;
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
interface ParserLogsPanelProps {
|
| 12 |
+
logs: ASLLog[];
|
| 13 |
+
onFilter: (type: string) => void;
|
| 14 |
+
onExport: (format: 'json' | 'csv') => void;
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
const ParserLogsPanel: React.FC<ParserLogsPanelProps> = ({ logs, onFilter, onExport }) => {
|
| 18 |
+
return (
|
| 19 |
+
<motion.section
|
| 20 |
+
className="bg-gray-900 text-white p-4 rounded-lg shadow-md"
|
| 21 |
+
initial={{ opacity: 0 }}
|
| 22 |
+
animate={{ opacity: 1 }}
|
| 23 |
+
transition={{ duration: 0.5 }}
|
| 24 |
+
>
|
| 25 |
+
<header className="flex justify-between items-center mb-4">
|
| 26 |
+
<h2 className="text-xl font-bold">Parser Logs</h2>
|
| 27 |
+
<div className="flex space-x-2">
|
| 28 |
+
<button
|
| 29 |
+
onClick={() => onFilter('query')}
|
| 30 |
+
className="px-4 py-2 bg-gray-700 rounded hover:bg-gray-600"
|
| 31 |
+
>
|
| 32 |
+
Filter: Query
|
| 33 |
+
</button>
|
| 34 |
+
<button
|
| 35 |
+
onClick={() => onFilter('reflection')}
|
| 36 |
+
className="px-4 py-2 bg-gray-700 rounded hover:bg-gray-600"
|
| 37 |
+
>
|
| 38 |
+
Filter: Reflection
|
| 39 |
+
</button>
|
| 40 |
+
<button
|
| 41 |
+
onClick={() => onExport('json')}
|
| 42 |
+
className="px-4 py-2 bg-gray-700 rounded hover:bg-gray-600"
|
| 43 |
+
>
|
| 44 |
+
Export JSON
|
| 45 |
+
</button>
|
| 46 |
+
<button
|
| 47 |
+
onClick={() => onExport('csv')}
|
| 48 |
+
className="px-4 py-2 bg-gray-700 rounded hover:bg-gray-600"
|
| 49 |
+
>
|
| 50 |
+
Export CSV
|
| 51 |
+
</button>
|
| 52 |
+
</div>
|
| 53 |
+
</header>
|
| 54 |
+
<ul className="space-y-2 max-h-96 overflow-y-auto">
|
| 55 |
+
{logs.map((log) => (
|
| 56 |
+
<li
|
| 57 |
+
key={log.id}
|
| 58 |
+
className="p-3 bg-gray-800 rounded hover:bg-gray-700 transition"
|
| 59 |
+
>
|
| 60 |
+
<p className="text-sm text-gray-400">{log.timestamp}</p>
|
| 61 |
+
<p className="font-bold">{log.type}</p>
|
| 62 |
+
<pre className="text-sm bg-gray-700 p-2 rounded mt-2">
|
| 63 |
+
{JSON.stringify(log.payload, null, 2)}
|
| 64 |
+
</pre>
|
| 65 |
+
</li>
|
| 66 |
+
))}
|
| 67 |
+
</ul>
|
| 68 |
+
</motion.section>
|
| 69 |
+
);
|
| 70 |
+
};
|
| 71 |
+
|
| 72 |
+
export default ParserLogsPanel;
|