Simple React page
This commit is contained in:
34
app/page.tsx
34
app/page.tsx
@@ -1,11 +1,6 @@
|
|||||||
"use client";
|
|
||||||
|
|
||||||
import { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
|
|
||||||
type Task = { id: string; title: string; status: string; assignee: string };
|
export default function Page() {
|
||||||
type CronJob = { name: string; enabled: boolean; status: string };
|
|
||||||
|
|
||||||
export default function MissionControl() {
|
|
||||||
const [tab, setTab] = useState('tasks');
|
const [tab, setTab] = useState('tasks');
|
||||||
const [data, setData] = useState<any>(null);
|
const [data, setData] = useState<any>(null);
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
@@ -18,23 +13,22 @@ export default function MissionControl() {
|
|||||||
.catch(() => setLoading(false));
|
.catch(() => setLoading(false));
|
||||||
}, [tab]);
|
}, [tab]);
|
||||||
|
|
||||||
|
const tabs = ['tasks','crons','server','backups','agents','whatsapp','memory'];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{ minHeight: '100vh', background: '#0a0a0f', color: '#fff', padding: '20px', fontFamily: 'monospace' }}>
|
<div style={{background:'#000',minHeight:'100vh',color:'#fff',fontFamily:'monospace',padding:'20px'}}>
|
||||||
<h1 style={{ fontSize: '24px', marginBottom: '20px' }}>MISSION CONTROL</h1>
|
<h1 style={{fontSize:'20px',marginBottom:'15px'}}>MISSION CONTROL</h1>
|
||||||
|
<div style={{display:'flex',gap:'5px',flexWrap:'wrap',marginBottom:'15px'}}>
|
||||||
<div style={{ display: 'flex', gap: '10px', marginBottom: '20px', flexWrap: 'wrap' }}>
|
{tabs.map(t => (
|
||||||
{['tasks', 'crons', 'server', 'backups', 'agents', 'whatsapp', 'memory'].map(t => (
|
<button key={t} onClick={()=>setTab(t)} style={{
|
||||||
<button key={t} onClick={() => setTab(t)} style={{ padding: '10px 20px', background: tab === t ? '#ff0050' : '#333', color: '#fff', border: 'none', borderRadius: '5px', cursor: 'pointer' }}>{t}</button>
|
padding:'8px 12px',background:tab===t?'#f0f': '#333',
|
||||||
|
color:'#fff',border:'none',borderRadius:'4px',fontSize:'12px'
|
||||||
|
}}>{t}</button>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
<pre style={{background:'#111',padding:'15px',borderRadius:'8px',overflow:'auto'}}>
|
||||||
{loading ? (
|
{loading ? 'Loading...' : JSON.stringify(data,null,2)}
|
||||||
<p>Loading...</p>
|
</pre>
|
||||||
) : (
|
|
||||||
<pre style={{ background: '#111', padding: '20px', borderRadius: '10px', overflow: 'auto', maxHeight: '70vh' }}>
|
|
||||||
{JSON.stringify(data, null, 2)}
|
|
||||||
</pre>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user