All checks were successful
Beta Release / beta (push) Successful in 38s
- Config: sidebar navigation with 5 panels (Profile, AI Providers, Updates, Locale, Skills) - Dashboard: remove duplicated system overview section, keep workflows and activity log - New CSS for config window layout, cards, provider cards, update rows - Add i18n panel keys (FR/EN) 💾 Generated with Crush Assisted-by: GLM-5-Turbo via Crush <crush@charm.land>
63 lines
2.4 KiB
JavaScript
63 lines
2.4 KiB
JavaScript
import { useState } from 'react'
|
|
import { useI18n } from '../i18n'
|
|
|
|
export default function Dashboard({ api, onRescan }) {
|
|
const { t, layout } = useI18n()
|
|
const [notifications, setNotifications] = useState([])
|
|
|
|
const addNotif = (text, type) => {
|
|
setNotifications(prev => [{ text, type, id: Date.now(), time: new Date() }, ...prev])
|
|
}
|
|
|
|
return (
|
|
<div className="dashboard-layout">
|
|
<div className="dashboard-content">
|
|
<div className="dashboard-grid">
|
|
<div className="dashboard-section">
|
|
<div className="dashboard-section-header">
|
|
<div className="dashboard-section-title">{t('studio.workflows')}</div>
|
|
</div>
|
|
<div className="dashboard-workflows-inline">
|
|
<div className="workflow-section">
|
|
<div className="section-label">{t('studio.workflows')}</div>
|
|
<div className="empty-state" style={{ padding: 20 }}>
|
|
{t('studio.noWorkflow')}
|
|
</div>
|
|
</div>
|
|
<div className="workflow-section">
|
|
<div className="section-label">{t('studio.activeAgents')}</div>
|
|
<div className="empty-state" style={{ padding: 20 }}>
|
|
{t('studio.noWorkflow')}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div className="dashboard-section">
|
|
<div className="dashboard-section-header">
|
|
<div className="dashboard-section-title">{t('dashboard.activityLog')}</div>
|
|
{notifications.length > 0 && (
|
|
<span className="badge warn">{notifications.length}</span>
|
|
)}
|
|
</div>
|
|
{notifications.length === 0 ? (
|
|
<div className="empty-state">{t('dashboard.noUpdateData')}</div>
|
|
) : (
|
|
<div className="dashboard-notifications-inline">
|
|
{notifications.map(n => (
|
|
<div key={n.id} className={`notif-row notif-${n.type}`}>
|
|
<span className="notif-time">
|
|
{n.time.toLocaleTimeString(layout.locale, { hour: '2-digit', minute: '2-digit', second: '2-digit' })}
|
|
</span>
|
|
<span className="notif-text">{n.text}</span>
|
|
</div>
|
|
))}
|
|
</div>
|
|
)}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|