@tleblancureta/proto 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core-web/src/ProtoApp.tsx +30 -20
- package/core-web/src/components/admin/AdminPanel.tsx +285 -0
- package/core-web/src/components/admin/SystemTab.tsx +167 -0
- package/core-web/src/components/shell/Toolbar.tsx +11 -1
- package/core-web/src/index.ts +1 -0
- package/dist/core-web/src/ProtoApp.d.ts.map +1 -1
- package/dist/core-web/src/ProtoApp.js +5 -3
- package/dist/core-web/src/ProtoApp.js.map +1 -1
- package/dist/core-web/src/components/admin/AdminPanel.d.ts +7 -0
- package/dist/core-web/src/components/admin/AdminPanel.d.ts.map +1 -0
- package/dist/core-web/src/components/admin/AdminPanel.js +112 -0
- package/dist/core-web/src/components/admin/AdminPanel.js.map +1 -0
- package/dist/core-web/src/components/admin/SystemTab.d.ts +2 -0
- package/dist/core-web/src/components/admin/SystemTab.d.ts.map +1 -0
- package/dist/core-web/src/components/admin/SystemTab.js +25 -0
- package/dist/core-web/src/components/admin/SystemTab.js.map +1 -0
- package/dist/core-web/src/components/shell/Toolbar.d.ts.map +1 -1
- package/dist/core-web/src/components/shell/Toolbar.js +4 -2
- package/dist/core-web/src/components/shell/Toolbar.js.map +1 -1
- package/dist/core-web/src/index.d.ts +1 -0
- package/dist/core-web/src/index.d.ts.map +1 -1
- package/dist/core-web/src/index.js +1 -0
- package/dist/core-web/src/index.js.map +1 -1
- package/package.json +2 -1
|
@@ -18,7 +18,9 @@
|
|
|
18
18
|
* }
|
|
19
19
|
*/
|
|
20
20
|
import { useState, useCallback, useRef, useMemo } from 'react'
|
|
21
|
+
import { BrowserRouter, Routes, Route } from 'react-router-dom'
|
|
21
22
|
import Shell, { type CockpitDefinition } from './components/Shell.js'
|
|
23
|
+
import { AdminPanel } from './components/admin/AdminPanel.js'
|
|
22
24
|
import { useAuth } from './hooks/useAuth.js'
|
|
23
25
|
import { useTheme } from './hooks/useTheme.js'
|
|
24
26
|
import { buildWidgetRegistry, type WidgetDefinition } from './lib/define-widget.js'
|
|
@@ -64,7 +66,7 @@ export function ProtoApp({
|
|
|
64
66
|
}: ProtoAppProps) {
|
|
65
67
|
useTheme()
|
|
66
68
|
|
|
67
|
-
const { user, companyId, companies, profile, loading, signOut, setCompanyId } = useAuth()
|
|
69
|
+
const { user, role, companyId, companies, profile, loading, signOut, setCompanyId } = useAuth()
|
|
68
70
|
const [refreshKey, setRefreshKey] = useState(0)
|
|
69
71
|
const chatSendRef = useRef<((msg: string) => void) | null>(null)
|
|
70
72
|
|
|
@@ -140,24 +142,32 @@ export function ProtoApp({
|
|
|
140
142
|
const effectiveCompanyId = companyId || user.id
|
|
141
143
|
|
|
142
144
|
return (
|
|
143
|
-
<
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
145
|
+
<BrowserRouter>
|
|
146
|
+
<Routes>
|
|
147
|
+
<Route path="/admin" element={<AdminPanel widgets={widgetRegistry} />} />
|
|
148
|
+
<Route path="*" element={
|
|
149
|
+
<Shell
|
|
150
|
+
widgets={widgetRegistry}
|
|
151
|
+
defaultWidgets={defaultWidgets}
|
|
152
|
+
defaultLayouts={defaultLayouts}
|
|
153
|
+
cockpits={cockpits}
|
|
154
|
+
companyId={effectiveCompanyId}
|
|
155
|
+
refreshKey={refreshKey}
|
|
156
|
+
onSendToChat={onSendToChat}
|
|
157
|
+
activeEntity={activeEntity}
|
|
158
|
+
onActivateEntity={activateEntity}
|
|
159
|
+
onDeactivateEntity={() => setActiveEntity(null)}
|
|
160
|
+
openEntities={openEntities}
|
|
161
|
+
onCloseTab={closeEntityTab}
|
|
162
|
+
role={role}
|
|
163
|
+
companies={companies}
|
|
164
|
+
effectiveCompanyId={effectiveCompanyId}
|
|
165
|
+
setCompanyId={setCompanyId}
|
|
166
|
+
onSignOut={signOut}
|
|
167
|
+
userEmail={profile?.full_name || user.email || ''}
|
|
168
|
+
/>
|
|
169
|
+
} />
|
|
170
|
+
</Routes>
|
|
171
|
+
</BrowserRouter>
|
|
162
172
|
)
|
|
163
173
|
}
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import { useState, useMemo } from 'react'
|
|
2
|
+
import { useNavigate } from 'react-router-dom'
|
|
3
|
+
import { useAuth } from '../../hooks/useAuth.js'
|
|
4
|
+
import { useData } from '../../hooks/useData.js'
|
|
5
|
+
import { useTheme } from '../../hooks/useTheme.js'
|
|
6
|
+
import { supabase } from '../../lib/supabase.js'
|
|
7
|
+
import { Button } from '../ui/button.js'
|
|
8
|
+
import {
|
|
9
|
+
ArrowLeftIcon, UsersIcon, Building2Icon, WrenchIcon,
|
|
10
|
+
LayoutGridIcon, SearchIcon,
|
|
11
|
+
} from 'lucide-react'
|
|
12
|
+
import { SystemTab } from './SystemTab.js'
|
|
13
|
+
import type { WidgetRegistry } from '../../lib/define-widget.js'
|
|
14
|
+
|
|
15
|
+
type Tab = 'users' | 'companies' | 'widgets' | 'system'
|
|
16
|
+
|
|
17
|
+
interface AdminPanelProps {
|
|
18
|
+
widgets?: WidgetRegistry
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function AdminPanel({ widgets }: AdminPanelProps) {
|
|
22
|
+
useTheme()
|
|
23
|
+
const navigate = useNavigate()
|
|
24
|
+
const { role, loading } = useAuth()
|
|
25
|
+
const [activeTab, setActiveTab] = useState<Tab>('users')
|
|
26
|
+
|
|
27
|
+
if (loading) {
|
|
28
|
+
return <div className="flex h-screen items-center justify-center text-muted-foreground">Loading...</div>
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (role !== 'admin') {
|
|
32
|
+
return (
|
|
33
|
+
<div className="flex h-screen items-center justify-center text-muted-foreground">
|
|
34
|
+
No tienes acceso a esta seccion.
|
|
35
|
+
</div>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const tabs: { id: Tab; label: string; icon: React.ReactNode }[] = [
|
|
40
|
+
{ id: 'users', label: 'Usuarios', icon: <UsersIcon className="w-4 h-4" /> },
|
|
41
|
+
{ id: 'companies', label: 'Empresas', icon: <Building2Icon className="w-4 h-4" /> },
|
|
42
|
+
{ id: 'widgets', label: 'Widgets', icon: <LayoutGridIcon className="w-4 h-4" /> },
|
|
43
|
+
{ id: 'system', label: 'Sistema', icon: <WrenchIcon className="w-4 h-4" /> },
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<div className="h-screen flex flex-col bg-background text-foreground">
|
|
48
|
+
<div className="border-b border-border px-4 py-3 flex items-center gap-3 bg-background/80 backdrop-blur">
|
|
49
|
+
<Button variant="ghost" size="sm" className="h-8 gap-1.5" onClick={() => navigate('/')}>
|
|
50
|
+
<ArrowLeftIcon className="w-4 h-4" /> Shell
|
|
51
|
+
</Button>
|
|
52
|
+
<div className="h-4 w-px bg-border" />
|
|
53
|
+
<h1 className="text-sm font-semibold">Admin</h1>
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
<div className="flex flex-1 overflow-hidden">
|
|
57
|
+
<nav className="w-48 border-r border-border p-2 flex flex-col gap-0.5 shrink-0">
|
|
58
|
+
{tabs.map(tab => (
|
|
59
|
+
<button
|
|
60
|
+
key={tab.id}
|
|
61
|
+
onClick={() => setActiveTab(tab.id)}
|
|
62
|
+
className={`flex items-center gap-2 px-3 py-2 rounded-md text-sm transition-colors ${
|
|
63
|
+
activeTab === tab.id
|
|
64
|
+
? 'bg-accent text-foreground font-medium'
|
|
65
|
+
: 'text-muted-foreground hover:text-foreground hover:bg-accent/50'
|
|
66
|
+
}`}
|
|
67
|
+
>
|
|
68
|
+
{tab.icon}
|
|
69
|
+
{tab.label}
|
|
70
|
+
</button>
|
|
71
|
+
))}
|
|
72
|
+
</nav>
|
|
73
|
+
|
|
74
|
+
<main className="flex-1 overflow-y-auto p-6">
|
|
75
|
+
{activeTab === 'users' && <UsersTab />}
|
|
76
|
+
{activeTab === 'companies' && <CompaniesTab />}
|
|
77
|
+
{activeTab === 'widgets' && <WidgetsTab widgets={widgets} />}
|
|
78
|
+
{activeTab === 'system' && <SystemTab />}
|
|
79
|
+
</main>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* ── Users Tab ─────────────────────────────────────────── */
|
|
86
|
+
|
|
87
|
+
function UsersTab() {
|
|
88
|
+
const [search, setSearch] = useState('')
|
|
89
|
+
|
|
90
|
+
const { data: users } = useData(async () => {
|
|
91
|
+
const { data: profiles } = await supabase
|
|
92
|
+
.from('profiles')
|
|
93
|
+
.select('id, full_name, role_title, onboarding_completed')
|
|
94
|
+
.order('full_name')
|
|
95
|
+
if (!profiles) return []
|
|
96
|
+
|
|
97
|
+
const { data: companies } = await supabase
|
|
98
|
+
.from('companies')
|
|
99
|
+
.select('id, name, owner_id')
|
|
100
|
+
|
|
101
|
+
const { data: memberships } = await supabase
|
|
102
|
+
.from('company_users')
|
|
103
|
+
.select('user_id, company_id')
|
|
104
|
+
|
|
105
|
+
return profiles.map((p: any) => {
|
|
106
|
+
const owned = (companies || []).filter((c: any) => c.owner_id === p.id)
|
|
107
|
+
const memberOf = (memberships || [])
|
|
108
|
+
.filter((m: any) => m.user_id === p.id)
|
|
109
|
+
.map((m: any) => (companies || []).find((c: any) => c.id === m.company_id))
|
|
110
|
+
.filter(Boolean)
|
|
111
|
+
return {
|
|
112
|
+
...p,
|
|
113
|
+
role: owned.length > 0 ? 'admin' : memberOf.length > 0 ? 'client' : 'none',
|
|
114
|
+
companies: owned.length > 0 ? owned : memberOf,
|
|
115
|
+
}
|
|
116
|
+
})
|
|
117
|
+
}, [], [])
|
|
118
|
+
|
|
119
|
+
const filtered = useMemo(() => {
|
|
120
|
+
if (!search) return users
|
|
121
|
+
const q = search.toLowerCase()
|
|
122
|
+
return users.filter((u: any) =>
|
|
123
|
+
u.full_name?.toLowerCase().includes(q) ||
|
|
124
|
+
u.role_title?.toLowerCase().includes(q) ||
|
|
125
|
+
u.role?.includes(q)
|
|
126
|
+
)
|
|
127
|
+
}, [users, search])
|
|
128
|
+
|
|
129
|
+
return (
|
|
130
|
+
<div>
|
|
131
|
+
<div className="flex items-center justify-between mb-4">
|
|
132
|
+
<h2 className="text-lg font-semibold">Usuarios</h2>
|
|
133
|
+
<div className="relative">
|
|
134
|
+
<SearchIcon className="w-4 h-4 absolute left-2.5 top-2.5 text-muted-foreground" />
|
|
135
|
+
<input
|
|
136
|
+
type="text"
|
|
137
|
+
placeholder="Buscar..."
|
|
138
|
+
value={search}
|
|
139
|
+
onChange={e => setSearch(e.target.value)}
|
|
140
|
+
className="pl-8 pr-3 py-2 text-sm bg-background border border-border rounded-md w-60 focus:outline-none focus:ring-1 focus:ring-primary"
|
|
141
|
+
/>
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
<div className="border border-border rounded-lg overflow-hidden">
|
|
145
|
+
<table className="w-full text-sm">
|
|
146
|
+
<thead>
|
|
147
|
+
<tr className="bg-muted/50 border-b border-border">
|
|
148
|
+
<th className="text-left px-4 py-2 font-medium text-muted-foreground">Nombre</th>
|
|
149
|
+
<th className="text-left px-4 py-2 font-medium text-muted-foreground">Cargo</th>
|
|
150
|
+
<th className="text-left px-4 py-2 font-medium text-muted-foreground">Rol</th>
|
|
151
|
+
<th className="text-left px-4 py-2 font-medium text-muted-foreground">Empresa</th>
|
|
152
|
+
<th className="text-left px-4 py-2 font-medium text-muted-foreground">Onboarding</th>
|
|
153
|
+
</tr>
|
|
154
|
+
</thead>
|
|
155
|
+
<tbody>
|
|
156
|
+
{filtered.map((u: any) => (
|
|
157
|
+
<tr key={u.id} className="border-b border-border/50 hover:bg-accent/30 transition-colors">
|
|
158
|
+
<td className="px-4 py-2.5">{u.full_name || <span className="text-muted-foreground italic">Sin nombre</span>}</td>
|
|
159
|
+
<td className="px-4 py-2.5 text-muted-foreground">{u.role_title || '—'}</td>
|
|
160
|
+
<td className="px-4 py-2.5"><RoleBadge role={u.role} /></td>
|
|
161
|
+
<td className="px-4 py-2.5 text-muted-foreground">
|
|
162
|
+
{u.companies.map((c: any) => c.name).join(', ') || '—'}
|
|
163
|
+
</td>
|
|
164
|
+
<td className="px-4 py-2.5">
|
|
165
|
+
{u.onboarding_completed
|
|
166
|
+
? <span className="text-green-600 dark:text-green-400">Completo</span>
|
|
167
|
+
: <span className="text-amber-600 dark:text-amber-400">Pendiente</span>}
|
|
168
|
+
</td>
|
|
169
|
+
</tr>
|
|
170
|
+
))}
|
|
171
|
+
{filtered.length === 0 && (
|
|
172
|
+
<tr><td colSpan={5} className="px-4 py-8 text-center text-muted-foreground">No hay usuarios</td></tr>
|
|
173
|
+
)}
|
|
174
|
+
</tbody>
|
|
175
|
+
</table>
|
|
176
|
+
</div>
|
|
177
|
+
<p className="text-xs text-muted-foreground mt-2">{users.length} usuarios total</p>
|
|
178
|
+
</div>
|
|
179
|
+
)
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/* ── Companies Tab ─────────────────────────────────────── */
|
|
183
|
+
|
|
184
|
+
function CompaniesTab() {
|
|
185
|
+
const { data: companies } = useData(async () => {
|
|
186
|
+
const { data } = await supabase
|
|
187
|
+
.from('companies')
|
|
188
|
+
.select('id, name, owner_id, created_at')
|
|
189
|
+
.order('name')
|
|
190
|
+
if (!data) return []
|
|
191
|
+
|
|
192
|
+
const { data: profiles } = await supabase.from('profiles').select('id, full_name')
|
|
193
|
+
const { data: memberships } = await supabase.from('company_users').select('company_id, user_id')
|
|
194
|
+
|
|
195
|
+
return data.map((c: any) => ({
|
|
196
|
+
...c,
|
|
197
|
+
owner_name: (profiles || []).find((p: any) => p.id === c.owner_id)?.full_name || '—',
|
|
198
|
+
member_count: (memberships || []).filter((m: any) => m.company_id === c.id).length,
|
|
199
|
+
}))
|
|
200
|
+
}, [], [])
|
|
201
|
+
|
|
202
|
+
return (
|
|
203
|
+
<div>
|
|
204
|
+
<h2 className="text-lg font-semibold mb-4">Empresas</h2>
|
|
205
|
+
<div className="border border-border rounded-lg overflow-hidden">
|
|
206
|
+
<table className="w-full text-sm">
|
|
207
|
+
<thead>
|
|
208
|
+
<tr className="bg-muted/50 border-b border-border">
|
|
209
|
+
<th className="text-left px-4 py-2 font-medium text-muted-foreground">Nombre</th>
|
|
210
|
+
<th className="text-left px-4 py-2 font-medium text-muted-foreground">Owner</th>
|
|
211
|
+
<th className="text-left px-4 py-2 font-medium text-muted-foreground">Miembros</th>
|
|
212
|
+
<th className="text-left px-4 py-2 font-medium text-muted-foreground">Creada</th>
|
|
213
|
+
</tr>
|
|
214
|
+
</thead>
|
|
215
|
+
<tbody>
|
|
216
|
+
{companies.map((c: any) => (
|
|
217
|
+
<tr key={c.id} className="border-b border-border/50 hover:bg-accent/30 transition-colors">
|
|
218
|
+
<td className="px-4 py-2.5 font-medium">{c.name}</td>
|
|
219
|
+
<td className="px-4 py-2.5 text-muted-foreground">{c.owner_name}</td>
|
|
220
|
+
<td className="px-4 py-2.5 text-muted-foreground">{c.member_count}</td>
|
|
221
|
+
<td className="px-4 py-2.5 text-muted-foreground">
|
|
222
|
+
{new Date(c.created_at).toLocaleDateString()}
|
|
223
|
+
</td>
|
|
224
|
+
</tr>
|
|
225
|
+
))}
|
|
226
|
+
{companies.length === 0 && (
|
|
227
|
+
<tr><td colSpan={4} className="px-4 py-8 text-center text-muted-foreground">No hay empresas</td></tr>
|
|
228
|
+
)}
|
|
229
|
+
</tbody>
|
|
230
|
+
</table>
|
|
231
|
+
</div>
|
|
232
|
+
<p className="text-xs text-muted-foreground mt-2">{companies.length} empresas total</p>
|
|
233
|
+
</div>
|
|
234
|
+
)
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/* ── Widgets Tab ───────────────────────────────────────── */
|
|
238
|
+
|
|
239
|
+
function WidgetsTab({ widgets }: { widgets?: WidgetRegistry }) {
|
|
240
|
+
const entries = useMemo(() => {
|
|
241
|
+
if (!widgets) return []
|
|
242
|
+
return Array.from(widgets.values()).map(w => ({
|
|
243
|
+
type: w.type, title: w.title, icon: w.icon || '▦', category: w.category || 'general',
|
|
244
|
+
}))
|
|
245
|
+
}, [widgets])
|
|
246
|
+
|
|
247
|
+
return (
|
|
248
|
+
<div>
|
|
249
|
+
<h2 className="text-lg font-semibold mb-4">Widgets registrados</h2>
|
|
250
|
+
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3">
|
|
251
|
+
{entries.map(w => (
|
|
252
|
+
<div key={w.type} className="border border-border rounded-lg p-4 hover:bg-accent/30 transition-colors">
|
|
253
|
+
<div className="flex items-center gap-2 mb-1">
|
|
254
|
+
<span className="text-lg">{w.icon}</span>
|
|
255
|
+
<span className="font-medium text-sm">{w.title}</span>
|
|
256
|
+
</div>
|
|
257
|
+
<div className="flex items-center gap-2 mt-2">
|
|
258
|
+
<span className="text-xs px-2 py-0.5 bg-muted rounded-full text-muted-foreground">{w.type}</span>
|
|
259
|
+
<span className="text-xs px-2 py-0.5 bg-muted rounded-full text-muted-foreground">{w.category}</span>
|
|
260
|
+
</div>
|
|
261
|
+
</div>
|
|
262
|
+
))}
|
|
263
|
+
{entries.length === 0 && (
|
|
264
|
+
<p className="text-muted-foreground text-sm col-span-3">No hay widgets registrados</p>
|
|
265
|
+
)}
|
|
266
|
+
</div>
|
|
267
|
+
<p className="text-xs text-muted-foreground mt-3">{entries.length} widgets total</p>
|
|
268
|
+
</div>
|
|
269
|
+
)
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/* ── Shared ────────────────────────────────────────────── */
|
|
273
|
+
|
|
274
|
+
function RoleBadge({ role }: { role: string }) {
|
|
275
|
+
const styles: Record<string, string> = {
|
|
276
|
+
admin: 'bg-primary/10 text-primary border-primary/20',
|
|
277
|
+
client: 'bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20',
|
|
278
|
+
none: 'bg-muted text-muted-foreground border-border',
|
|
279
|
+
}
|
|
280
|
+
return (
|
|
281
|
+
<span className={`text-xs px-2 py-0.5 rounded-full border ${styles[role] || styles.none}`}>
|
|
282
|
+
{role}
|
|
283
|
+
</span>
|
|
284
|
+
)
|
|
285
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { useData } from '../../hooks/useData.js'
|
|
2
|
+
import { GATEWAY_URL, INTERNAL_SECRET } from '../../lib/config.js'
|
|
3
|
+
import {
|
|
4
|
+
WrenchIcon, BoxIcon, GitBranchIcon, BookOpenIcon,
|
|
5
|
+
} from 'lucide-react'
|
|
6
|
+
|
|
7
|
+
interface McpMeta {
|
|
8
|
+
tools: { name: string; description: string }[]
|
|
9
|
+
entities: { name: string; table: string }[]
|
|
10
|
+
workflows: { name: string; entityTable: string; phases: string[] }[]
|
|
11
|
+
skills: { name: string; description: string | null; mcp_tools: string[] }[]
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function SystemTab() {
|
|
15
|
+
const { data: meta } = useData<McpMeta | null>(async () => {
|
|
16
|
+
try {
|
|
17
|
+
const headers: Record<string, string> = { 'Content-Type': 'application/json' }
|
|
18
|
+
if (INTERNAL_SECRET) headers['X-Internal-Secret'] = INTERNAL_SECRET
|
|
19
|
+
const res = await fetch(`${GATEWAY_URL}/admin/meta`, { headers })
|
|
20
|
+
if (!res.ok) return null
|
|
21
|
+
return res.json()
|
|
22
|
+
} catch {
|
|
23
|
+
return null
|
|
24
|
+
}
|
|
25
|
+
}, [], null)
|
|
26
|
+
|
|
27
|
+
if (!meta) {
|
|
28
|
+
return (
|
|
29
|
+
<div>
|
|
30
|
+
<h2 className="text-lg font-semibold mb-4">Sistema</h2>
|
|
31
|
+
<p className="text-muted-foreground text-sm">
|
|
32
|
+
No se pudo conectar al gateway. Asegurate de que esta corriendo y que el endpoint <code>/admin/meta</code> esta disponible.
|
|
33
|
+
</p>
|
|
34
|
+
</div>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<div className="space-y-8">
|
|
40
|
+
{/* Tools */}
|
|
41
|
+
<section>
|
|
42
|
+
<div className="flex items-center gap-2 mb-3">
|
|
43
|
+
<WrenchIcon className="w-4 h-4 text-muted-foreground" />
|
|
44
|
+
<h2 className="text-lg font-semibold">Tools</h2>
|
|
45
|
+
<span className="text-xs px-2 py-0.5 bg-muted rounded-full text-muted-foreground">{meta.tools.length}</span>
|
|
46
|
+
</div>
|
|
47
|
+
<div className="border border-border rounded-lg overflow-hidden">
|
|
48
|
+
<table className="w-full text-sm">
|
|
49
|
+
<thead>
|
|
50
|
+
<tr className="bg-muted/50 border-b border-border">
|
|
51
|
+
<th className="text-left px-4 py-2 font-medium text-muted-foreground">Nombre</th>
|
|
52
|
+
<th className="text-left px-4 py-2 font-medium text-muted-foreground">Descripcion</th>
|
|
53
|
+
</tr>
|
|
54
|
+
</thead>
|
|
55
|
+
<tbody>
|
|
56
|
+
{meta.tools.map(t => (
|
|
57
|
+
<tr key={t.name} className="border-b border-border/50 hover:bg-accent/30 transition-colors">
|
|
58
|
+
<td className="px-4 py-2 font-mono text-xs">{t.name}</td>
|
|
59
|
+
<td className="px-4 py-2 text-muted-foreground">{t.description}</td>
|
|
60
|
+
</tr>
|
|
61
|
+
))}
|
|
62
|
+
</tbody>
|
|
63
|
+
</table>
|
|
64
|
+
</div>
|
|
65
|
+
</section>
|
|
66
|
+
|
|
67
|
+
{/* Entities */}
|
|
68
|
+
<section>
|
|
69
|
+
<div className="flex items-center gap-2 mb-3">
|
|
70
|
+
<BoxIcon className="w-4 h-4 text-muted-foreground" />
|
|
71
|
+
<h2 className="text-lg font-semibold">Entities</h2>
|
|
72
|
+
<span className="text-xs px-2 py-0.5 bg-muted rounded-full text-muted-foreground">{meta.entities.length}</span>
|
|
73
|
+
</div>
|
|
74
|
+
{meta.entities.length > 0 ? (
|
|
75
|
+
<div className="border border-border rounded-lg overflow-hidden">
|
|
76
|
+
<table className="w-full text-sm">
|
|
77
|
+
<thead>
|
|
78
|
+
<tr className="bg-muted/50 border-b border-border">
|
|
79
|
+
<th className="text-left px-4 py-2 font-medium text-muted-foreground">Nombre</th>
|
|
80
|
+
<th className="text-left px-4 py-2 font-medium text-muted-foreground">Tabla</th>
|
|
81
|
+
</tr>
|
|
82
|
+
</thead>
|
|
83
|
+
<tbody>
|
|
84
|
+
{meta.entities.map((e: any) => (
|
|
85
|
+
<tr key={e.name} className="border-b border-border/50 hover:bg-accent/30 transition-colors">
|
|
86
|
+
<td className="px-4 py-2 font-medium">{e.name}</td>
|
|
87
|
+
<td className="px-4 py-2 font-mono text-xs text-muted-foreground">{e.table}</td>
|
|
88
|
+
</tr>
|
|
89
|
+
))}
|
|
90
|
+
</tbody>
|
|
91
|
+
</table>
|
|
92
|
+
</div>
|
|
93
|
+
) : (
|
|
94
|
+
<p className="text-sm text-muted-foreground">No hay entities definidas</p>
|
|
95
|
+
)}
|
|
96
|
+
</section>
|
|
97
|
+
|
|
98
|
+
{/* Workflows */}
|
|
99
|
+
<section>
|
|
100
|
+
<div className="flex items-center gap-2 mb-3">
|
|
101
|
+
<GitBranchIcon className="w-4 h-4 text-muted-foreground" />
|
|
102
|
+
<h2 className="text-lg font-semibold">Workflows</h2>
|
|
103
|
+
<span className="text-xs px-2 py-0.5 bg-muted rounded-full text-muted-foreground">{meta.workflows.length}</span>
|
|
104
|
+
</div>
|
|
105
|
+
{meta.workflows.length > 0 ? (
|
|
106
|
+
<div className="grid grid-cols-1 sm:grid-cols-2 gap-3">
|
|
107
|
+
{meta.workflows.map((w: any) => (
|
|
108
|
+
<div key={w.name} className="border border-border rounded-lg p-4">
|
|
109
|
+
<div className="font-medium text-sm mb-1">{w.name}</div>
|
|
110
|
+
<div className="text-xs text-muted-foreground mb-2">Tabla: <code>{w.entityTable}</code></div>
|
|
111
|
+
<div className="flex flex-wrap gap-1">
|
|
112
|
+
{w.phases.map((p: string, i: number) => (
|
|
113
|
+
<span key={p} className="text-xs px-2 py-0.5 bg-muted rounded-full text-muted-foreground flex items-center gap-1">
|
|
114
|
+
{i > 0 && <span className="text-muted-foreground/40">→</span>}
|
|
115
|
+
{p}
|
|
116
|
+
</span>
|
|
117
|
+
))}
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
))}
|
|
121
|
+
</div>
|
|
122
|
+
) : (
|
|
123
|
+
<p className="text-sm text-muted-foreground">No hay workflows definidos</p>
|
|
124
|
+
)}
|
|
125
|
+
</section>
|
|
126
|
+
|
|
127
|
+
{/* Skills */}
|
|
128
|
+
<section>
|
|
129
|
+
<div className="flex items-center gap-2 mb-3">
|
|
130
|
+
<BookOpenIcon className="w-4 h-4 text-muted-foreground" />
|
|
131
|
+
<h2 className="text-lg font-semibold">Skills</h2>
|
|
132
|
+
<span className="text-xs px-2 py-0.5 bg-muted rounded-full text-muted-foreground">{meta.skills.length}</span>
|
|
133
|
+
</div>
|
|
134
|
+
{meta.skills.length > 0 ? (
|
|
135
|
+
<div className="border border-border rounded-lg overflow-hidden">
|
|
136
|
+
<table className="w-full text-sm">
|
|
137
|
+
<thead>
|
|
138
|
+
<tr className="bg-muted/50 border-b border-border">
|
|
139
|
+
<th className="text-left px-4 py-2 font-medium text-muted-foreground">Nombre</th>
|
|
140
|
+
<th className="text-left px-4 py-2 font-medium text-muted-foreground">Descripcion</th>
|
|
141
|
+
<th className="text-left px-4 py-2 font-medium text-muted-foreground">Tools</th>
|
|
142
|
+
</tr>
|
|
143
|
+
</thead>
|
|
144
|
+
<tbody>
|
|
145
|
+
{meta.skills.map((s: any) => (
|
|
146
|
+
<tr key={s.name} className="border-b border-border/50 hover:bg-accent/30 transition-colors">
|
|
147
|
+
<td className="px-4 py-2 font-medium">{s.name}</td>
|
|
148
|
+
<td className="px-4 py-2 text-muted-foreground">{s.description || '—'}</td>
|
|
149
|
+
<td className="px-4 py-2">
|
|
150
|
+
<div className="flex flex-wrap gap-1">
|
|
151
|
+
{s.mcp_tools.map((t: string) => (
|
|
152
|
+
<span key={t} className="text-xs px-1.5 py-0.5 bg-muted rounded text-muted-foreground font-mono">{t}</span>
|
|
153
|
+
))}
|
|
154
|
+
</div>
|
|
155
|
+
</td>
|
|
156
|
+
</tr>
|
|
157
|
+
))}
|
|
158
|
+
</tbody>
|
|
159
|
+
</table>
|
|
160
|
+
</div>
|
|
161
|
+
) : (
|
|
162
|
+
<p className="text-sm text-muted-foreground">No hay skills cargados</p>
|
|
163
|
+
)}
|
|
164
|
+
</section>
|
|
165
|
+
</div>
|
|
166
|
+
)
|
|
167
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useState, useCallback, type ReactNode } from 'react'
|
|
2
|
+
import { useNavigate } from 'react-router-dom'
|
|
2
3
|
import { useMountEffect } from '../../hooks/useMountEffect.js'
|
|
3
4
|
import { Button } from '../ui/button.js'
|
|
4
|
-
import { PlusIcon, RotateCcwIcon, SunIcon, MoonIcon, MonitorIcon, UserIcon, LogOutIcon, Building2Icon, ChevronDownIcon, CheckIcon, XIcon, HomeIcon, SettingsIcon, LayoutGridIcon } from 'lucide-react'
|
|
5
|
+
import { PlusIcon, RotateCcwIcon, SunIcon, MoonIcon, MonitorIcon, UserIcon, LogOutIcon, Building2Icon, ChevronDownIcon, CheckIcon, XIcon, HomeIcon, SettingsIcon, LayoutGridIcon, ShieldIcon } from 'lucide-react'
|
|
5
6
|
import { useTheme, type Theme } from '../../hooks/useTheme.js'
|
|
6
7
|
import type { ActiveEntity, WidgetType } from './types.js'
|
|
7
8
|
|
|
@@ -55,6 +56,7 @@ export function Toolbar({
|
|
|
55
56
|
document.addEventListener('keydown', handler)
|
|
56
57
|
return () => document.removeEventListener('keydown', handler)
|
|
57
58
|
})
|
|
59
|
+
const navigate = useNavigate()
|
|
58
60
|
const currentCompany = companies?.find(c => c.id === effectiveCompanyId)
|
|
59
61
|
|
|
60
62
|
return (
|
|
@@ -197,6 +199,14 @@ export function Toolbar({
|
|
|
197
199
|
<SettingsIcon className="w-3.5 h-3.5" /> Configuracion
|
|
198
200
|
</button>
|
|
199
201
|
)}
|
|
202
|
+
{role === 'admin' && (
|
|
203
|
+
<button
|
|
204
|
+
onClick={() => { setOpenDropdown(null); navigate('/admin') }}
|
|
205
|
+
className="w-full text-left px-3 py-1.5 text-sm rounded hover:bg-accent transition-colors flex items-center gap-2"
|
|
206
|
+
>
|
|
207
|
+
<ShieldIcon className="w-3.5 h-3.5" /> Admin
|
|
208
|
+
</button>
|
|
209
|
+
)}
|
|
200
210
|
<ThemeToggleRow />
|
|
201
211
|
<div className="border-t border-border/50 mt-1 pt-1">
|
|
202
212
|
<button
|
package/core-web/src/index.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
// Framework components
|
|
9
9
|
export { default as Shell, type CockpitDefinition } from './components/Shell.js'
|
|
10
10
|
export { ProtoApp, type ProtoAppProps } from './ProtoApp.js'
|
|
11
|
+
export { AdminPanel } from './components/admin/AdminPanel.js'
|
|
11
12
|
|
|
12
13
|
// Extension API
|
|
13
14
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProtoApp.d.ts","sourceRoot":"","sources":["../../../core-web/src/ProtoApp.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ProtoApp.d.ts","sourceRoot":"","sources":["../../../core-web/src/ProtoApp.tsx"],"names":[],"mappings":"AAyBA,OAAO,EAAuB,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAEnF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACtE,OAAO,KAAK,EAAgB,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAE/E,MAAM,WAAW,aAAa;IAC5B,sDAAsD;IACtD,OAAO,EAAE,gBAAgB,EAAE,CAAA;IAE3B,wDAAwD;IACxD,QAAQ,CAAC,EAAE,gBAAgB,EAAE,CAAA;IAE7B,kFAAkF;IAClF,cAAc,CAAC,EAAE,cAAc,EAAE,CAAA;IAEjC,sEAAsE;IACtE,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAA;IAE1C,0CAA0C;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB,gCAAgC;IAChC,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CACrC;AAUD,wBAAgB,QAAQ,CAAC,EACvB,OAAO,EAAE,UAAU,EACnB,QAAa,EACb,cAAc,EAAE,kBAAkB,EAClC,cAAc,EAAE,kBAAkB,EAClC,OAAO,EACP,cAAc,EAAE,cAA6B,GAC9C,EAAE,aAAa,2CA2Gf"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/**
|
|
3
3
|
* ProtoApp — zero-config React app component.
|
|
4
4
|
*
|
|
@@ -19,7 +19,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
19
19
|
* }
|
|
20
20
|
*/
|
|
21
21
|
import { useState, useCallback, useRef, useMemo } from 'react';
|
|
22
|
+
import { BrowserRouter, Routes, Route } from 'react-router-dom';
|
|
22
23
|
import Shell from './components/Shell.js';
|
|
24
|
+
import { AdminPanel } from './components/admin/AdminPanel.js';
|
|
23
25
|
import { useAuth } from './hooks/useAuth.js';
|
|
24
26
|
import { useTheme } from './hooks/useTheme.js';
|
|
25
27
|
import { buildWidgetRegistry } from './lib/define-widget.js';
|
|
@@ -29,7 +31,7 @@ function DefaultLogin() {
|
|
|
29
31
|
}
|
|
30
32
|
export function ProtoApp({ widgets: widgetDefs, entities = [], defaultWidgets: defaultWidgetsProp, defaultLayouts: defaultLayoutsProp, appName, loginComponent: LoginComponent = DefaultLogin, }) {
|
|
31
33
|
useTheme();
|
|
32
|
-
const { user, companyId, companies, profile, loading, signOut, setCompanyId } = useAuth();
|
|
34
|
+
const { user, role, companyId, companies, profile, loading, signOut, setCompanyId } = useAuth();
|
|
33
35
|
const [refreshKey, setRefreshKey] = useState(0);
|
|
34
36
|
const chatSendRef = useRef(null);
|
|
35
37
|
const [activeEntity, setActiveEntity] = useState(null);
|
|
@@ -87,6 +89,6 @@ export function ProtoApp({ widgets: widgetDefs, entities = [], defaultWidgets: d
|
|
|
87
89
|
return _jsx(LoginComponent, {});
|
|
88
90
|
}
|
|
89
91
|
const effectiveCompanyId = companyId || user.id;
|
|
90
|
-
return (_jsx(Shell, { widgets: widgetRegistry, defaultWidgets: defaultWidgets, defaultLayouts: defaultLayouts, cockpits: cockpits, companyId: effectiveCompanyId, refreshKey: refreshKey, onSendToChat: onSendToChat, activeEntity: activeEntity, onActivateEntity: activateEntity, onDeactivateEntity: () => setActiveEntity(null), openEntities: openEntities, onCloseTab: closeEntityTab, companies: companies, effectiveCompanyId: effectiveCompanyId, setCompanyId: setCompanyId, onSignOut: signOut, userEmail: profile?.full_name || user.email || '' }));
|
|
92
|
+
return (_jsx(BrowserRouter, { children: _jsxs(Routes, { children: [_jsx(Route, { path: "/admin", element: _jsx(AdminPanel, { widgets: widgetRegistry }) }), _jsx(Route, { path: "*", element: _jsx(Shell, { widgets: widgetRegistry, defaultWidgets: defaultWidgets, defaultLayouts: defaultLayouts, cockpits: cockpits, companyId: effectiveCompanyId, refreshKey: refreshKey, onSendToChat: onSendToChat, activeEntity: activeEntity, onActivateEntity: activateEntity, onDeactivateEntity: () => setActiveEntity(null), openEntities: openEntities, onCloseTab: closeEntityTab, role: role, companies: companies, effectiveCompanyId: effectiveCompanyId, setCompanyId: setCompanyId, onSignOut: signOut, userEmail: profile?.full_name || user.email || '' }) })] }) }));
|
|
91
93
|
}
|
|
92
94
|
//# sourceMappingURL=ProtoApp.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProtoApp.js","sourceRoot":"","sources":["../../../core-web/src/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ChC,kBAAkB,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,EAC/C,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,cAAc,EAC1B,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,kBAAkB,EAAE,kBAAkB,EACtC,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,OAAO,EAClB,SAAS,EAAE,OAAO,EAAE,SAAS,IAAI,IAAI,CAAC,KAAK,IAAI,EAAE,GACjD,GACA,IACG,GACK,CACjB,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { WidgetRegistry } from '../../lib/define-widget.js';
|
|
2
|
+
interface AdminPanelProps {
|
|
3
|
+
widgets?: WidgetRegistry;
|
|
4
|
+
}
|
|
5
|
+
export declare function AdminPanel({ widgets }: AdminPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=AdminPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdminPanel.d.ts","sourceRoot":"","sources":["../../../../../core-web/src/components/admin/AdminPanel.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAIhE,UAAU,eAAe;IACvB,OAAO,CAAC,EAAE,cAAc,CAAA;CACzB;AAED,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,EAAE,eAAe,2CA8DtD"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useMemo } from 'react';
|
|
3
|
+
import { useNavigate } from 'react-router-dom';
|
|
4
|
+
import { useAuth } from '../../hooks/useAuth.js';
|
|
5
|
+
import { useData } from '../../hooks/useData.js';
|
|
6
|
+
import { useTheme } from '../../hooks/useTheme.js';
|
|
7
|
+
import { supabase } from '../../lib/supabase.js';
|
|
8
|
+
import { Button } from '../ui/button.js';
|
|
9
|
+
import { ArrowLeftIcon, UsersIcon, Building2Icon, WrenchIcon, LayoutGridIcon, SearchIcon, } from 'lucide-react';
|
|
10
|
+
import { SystemTab } from './SystemTab.js';
|
|
11
|
+
export function AdminPanel({ widgets }) {
|
|
12
|
+
useTheme();
|
|
13
|
+
const navigate = useNavigate();
|
|
14
|
+
const { role, loading } = useAuth();
|
|
15
|
+
const [activeTab, setActiveTab] = useState('users');
|
|
16
|
+
if (loading) {
|
|
17
|
+
return _jsx("div", { className: "flex h-screen items-center justify-center text-muted-foreground", children: "Loading..." });
|
|
18
|
+
}
|
|
19
|
+
if (role !== 'admin') {
|
|
20
|
+
return (_jsx("div", { className: "flex h-screen items-center justify-center text-muted-foreground", children: "No tienes acceso a esta seccion." }));
|
|
21
|
+
}
|
|
22
|
+
const tabs = [
|
|
23
|
+
{ id: 'users', label: 'Usuarios', icon: _jsx(UsersIcon, { className: "w-4 h-4" }) },
|
|
24
|
+
{ id: 'companies', label: 'Empresas', icon: _jsx(Building2Icon, { className: "w-4 h-4" }) },
|
|
25
|
+
{ id: 'widgets', label: 'Widgets', icon: _jsx(LayoutGridIcon, { className: "w-4 h-4" }) },
|
|
26
|
+
{ id: 'system', label: 'Sistema', icon: _jsx(WrenchIcon, { className: "w-4 h-4" }) },
|
|
27
|
+
];
|
|
28
|
+
return (_jsxs("div", { className: "h-screen flex flex-col bg-background text-foreground", children: [_jsxs("div", { className: "border-b border-border px-4 py-3 flex items-center gap-3 bg-background/80 backdrop-blur", children: [_jsxs(Button, { variant: "ghost", size: "sm", className: "h-8 gap-1.5", onClick: () => navigate('/'), children: [_jsx(ArrowLeftIcon, { className: "w-4 h-4" }), " Shell"] }), _jsx("div", { className: "h-4 w-px bg-border" }), _jsx("h1", { className: "text-sm font-semibold", children: "Admin" })] }), _jsxs("div", { className: "flex flex-1 overflow-hidden", children: [_jsx("nav", { className: "w-48 border-r border-border p-2 flex flex-col gap-0.5 shrink-0", children: tabs.map(tab => (_jsxs("button", { onClick: () => setActiveTab(tab.id), className: `flex items-center gap-2 px-3 py-2 rounded-md text-sm transition-colors ${activeTab === tab.id
|
|
29
|
+
? 'bg-accent text-foreground font-medium'
|
|
30
|
+
: 'text-muted-foreground hover:text-foreground hover:bg-accent/50'}`, children: [tab.icon, tab.label] }, tab.id))) }), _jsxs("main", { className: "flex-1 overflow-y-auto p-6", children: [activeTab === 'users' && _jsx(UsersTab, {}), activeTab === 'companies' && _jsx(CompaniesTab, {}), activeTab === 'widgets' && _jsx(WidgetsTab, { widgets: widgets }), activeTab === 'system' && _jsx(SystemTab, {})] })] })] }));
|
|
31
|
+
}
|
|
32
|
+
/* ── Users Tab ─────────────────────────────────────────── */
|
|
33
|
+
function UsersTab() {
|
|
34
|
+
const [search, setSearch] = useState('');
|
|
35
|
+
const { data: users } = useData(async () => {
|
|
36
|
+
const { data: profiles } = await supabase
|
|
37
|
+
.from('profiles')
|
|
38
|
+
.select('id, full_name, role_title, onboarding_completed')
|
|
39
|
+
.order('full_name');
|
|
40
|
+
if (!profiles)
|
|
41
|
+
return [];
|
|
42
|
+
const { data: companies } = await supabase
|
|
43
|
+
.from('companies')
|
|
44
|
+
.select('id, name, owner_id');
|
|
45
|
+
const { data: memberships } = await supabase
|
|
46
|
+
.from('company_users')
|
|
47
|
+
.select('user_id, company_id');
|
|
48
|
+
return profiles.map((p) => {
|
|
49
|
+
const owned = (companies || []).filter((c) => c.owner_id === p.id);
|
|
50
|
+
const memberOf = (memberships || [])
|
|
51
|
+
.filter((m) => m.user_id === p.id)
|
|
52
|
+
.map((m) => (companies || []).find((c) => c.id === m.company_id))
|
|
53
|
+
.filter(Boolean);
|
|
54
|
+
return {
|
|
55
|
+
...p,
|
|
56
|
+
role: owned.length > 0 ? 'admin' : memberOf.length > 0 ? 'client' : 'none',
|
|
57
|
+
companies: owned.length > 0 ? owned : memberOf,
|
|
58
|
+
};
|
|
59
|
+
});
|
|
60
|
+
}, [], []);
|
|
61
|
+
const filtered = useMemo(() => {
|
|
62
|
+
if (!search)
|
|
63
|
+
return users;
|
|
64
|
+
const q = search.toLowerCase();
|
|
65
|
+
return users.filter((u) => u.full_name?.toLowerCase().includes(q) ||
|
|
66
|
+
u.role_title?.toLowerCase().includes(q) ||
|
|
67
|
+
u.role?.includes(q));
|
|
68
|
+
}, [users, search]);
|
|
69
|
+
return (_jsxs("div", { children: [_jsxs("div", { className: "flex items-center justify-between mb-4", children: [_jsx("h2", { className: "text-lg font-semibold", children: "Usuarios" }), _jsxs("div", { className: "relative", children: [_jsx(SearchIcon, { className: "w-4 h-4 absolute left-2.5 top-2.5 text-muted-foreground" }), _jsx("input", { type: "text", placeholder: "Buscar...", value: search, onChange: e => setSearch(e.target.value), className: "pl-8 pr-3 py-2 text-sm bg-background border border-border rounded-md w-60 focus:outline-none focus:ring-1 focus:ring-primary" })] })] }), _jsx("div", { className: "border border-border rounded-lg overflow-hidden", children: _jsxs("table", { className: "w-full text-sm", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-muted/50 border-b border-border", children: [_jsx("th", { className: "text-left px-4 py-2 font-medium text-muted-foreground", children: "Nombre" }), _jsx("th", { className: "text-left px-4 py-2 font-medium text-muted-foreground", children: "Cargo" }), _jsx("th", { className: "text-left px-4 py-2 font-medium text-muted-foreground", children: "Rol" }), _jsx("th", { className: "text-left px-4 py-2 font-medium text-muted-foreground", children: "Empresa" }), _jsx("th", { className: "text-left px-4 py-2 font-medium text-muted-foreground", children: "Onboarding" })] }) }), _jsxs("tbody", { children: [filtered.map((u) => (_jsxs("tr", { className: "border-b border-border/50 hover:bg-accent/30 transition-colors", children: [_jsx("td", { className: "px-4 py-2.5", children: u.full_name || _jsx("span", { className: "text-muted-foreground italic", children: "Sin nombre" }) }), _jsx("td", { className: "px-4 py-2.5 text-muted-foreground", children: u.role_title || '—' }), _jsx("td", { className: "px-4 py-2.5", children: _jsx(RoleBadge, { role: u.role }) }), _jsx("td", { className: "px-4 py-2.5 text-muted-foreground", children: u.companies.map((c) => c.name).join(', ') || '—' }), _jsx("td", { className: "px-4 py-2.5", children: u.onboarding_completed
|
|
70
|
+
? _jsx("span", { className: "text-green-600 dark:text-green-400", children: "Completo" })
|
|
71
|
+
: _jsx("span", { className: "text-amber-600 dark:text-amber-400", children: "Pendiente" }) })] }, u.id))), filtered.length === 0 && (_jsx("tr", { children: _jsx("td", { colSpan: 5, className: "px-4 py-8 text-center text-muted-foreground", children: "No hay usuarios" }) }))] })] }) }), _jsxs("p", { className: "text-xs text-muted-foreground mt-2", children: [users.length, " usuarios total"] })] }));
|
|
72
|
+
}
|
|
73
|
+
/* ── Companies Tab ─────────────────────────────────────── */
|
|
74
|
+
function CompaniesTab() {
|
|
75
|
+
const { data: companies } = useData(async () => {
|
|
76
|
+
const { data } = await supabase
|
|
77
|
+
.from('companies')
|
|
78
|
+
.select('id, name, owner_id, created_at')
|
|
79
|
+
.order('name');
|
|
80
|
+
if (!data)
|
|
81
|
+
return [];
|
|
82
|
+
const { data: profiles } = await supabase.from('profiles').select('id, full_name');
|
|
83
|
+
const { data: memberships } = await supabase.from('company_users').select('company_id, user_id');
|
|
84
|
+
return data.map((c) => ({
|
|
85
|
+
...c,
|
|
86
|
+
owner_name: (profiles || []).find((p) => p.id === c.owner_id)?.full_name || '—',
|
|
87
|
+
member_count: (memberships || []).filter((m) => m.company_id === c.id).length,
|
|
88
|
+
}));
|
|
89
|
+
}, [], []);
|
|
90
|
+
return (_jsxs("div", { children: [_jsx("h2", { className: "text-lg font-semibold mb-4", children: "Empresas" }), _jsx("div", { className: "border border-border rounded-lg overflow-hidden", children: _jsxs("table", { className: "w-full text-sm", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-muted/50 border-b border-border", children: [_jsx("th", { className: "text-left px-4 py-2 font-medium text-muted-foreground", children: "Nombre" }), _jsx("th", { className: "text-left px-4 py-2 font-medium text-muted-foreground", children: "Owner" }), _jsx("th", { className: "text-left px-4 py-2 font-medium text-muted-foreground", children: "Miembros" }), _jsx("th", { className: "text-left px-4 py-2 font-medium text-muted-foreground", children: "Creada" })] }) }), _jsxs("tbody", { children: [companies.map((c) => (_jsxs("tr", { className: "border-b border-border/50 hover:bg-accent/30 transition-colors", children: [_jsx("td", { className: "px-4 py-2.5 font-medium", children: c.name }), _jsx("td", { className: "px-4 py-2.5 text-muted-foreground", children: c.owner_name }), _jsx("td", { className: "px-4 py-2.5 text-muted-foreground", children: c.member_count }), _jsx("td", { className: "px-4 py-2.5 text-muted-foreground", children: new Date(c.created_at).toLocaleDateString() })] }, c.id))), companies.length === 0 && (_jsx("tr", { children: _jsx("td", { colSpan: 4, className: "px-4 py-8 text-center text-muted-foreground", children: "No hay empresas" }) }))] })] }) }), _jsxs("p", { className: "text-xs text-muted-foreground mt-2", children: [companies.length, " empresas total"] })] }));
|
|
91
|
+
}
|
|
92
|
+
/* ── Widgets Tab ───────────────────────────────────────── */
|
|
93
|
+
function WidgetsTab({ widgets }) {
|
|
94
|
+
const entries = useMemo(() => {
|
|
95
|
+
if (!widgets)
|
|
96
|
+
return [];
|
|
97
|
+
return Array.from(widgets.values()).map(w => ({
|
|
98
|
+
type: w.type, title: w.title, icon: w.icon || '▦', category: w.category || 'general',
|
|
99
|
+
}));
|
|
100
|
+
}, [widgets]);
|
|
101
|
+
return (_jsxs("div", { children: [_jsx("h2", { className: "text-lg font-semibold mb-4", children: "Widgets registrados" }), _jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3", children: [entries.map(w => (_jsxs("div", { className: "border border-border rounded-lg p-4 hover:bg-accent/30 transition-colors", children: [_jsxs("div", { className: "flex items-center gap-2 mb-1", children: [_jsx("span", { className: "text-lg", children: w.icon }), _jsx("span", { className: "font-medium text-sm", children: w.title })] }), _jsxs("div", { className: "flex items-center gap-2 mt-2", children: [_jsx("span", { className: "text-xs px-2 py-0.5 bg-muted rounded-full text-muted-foreground", children: w.type }), _jsx("span", { className: "text-xs px-2 py-0.5 bg-muted rounded-full text-muted-foreground", children: w.category })] })] }, w.type))), entries.length === 0 && (_jsx("p", { className: "text-muted-foreground text-sm col-span-3", children: "No hay widgets registrados" }))] }), _jsxs("p", { className: "text-xs text-muted-foreground mt-3", children: [entries.length, " widgets total"] })] }));
|
|
102
|
+
}
|
|
103
|
+
/* ── Shared ────────────────────────────────────────────── */
|
|
104
|
+
function RoleBadge({ role }) {
|
|
105
|
+
const styles = {
|
|
106
|
+
admin: 'bg-primary/10 text-primary border-primary/20',
|
|
107
|
+
client: 'bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20',
|
|
108
|
+
none: 'bg-muted text-muted-foreground border-border',
|
|
109
|
+
};
|
|
110
|
+
return (_jsx("span", { className: `text-xs px-2 py-0.5 rounded-full border ${styles[role] || styles.none}`, children: role }));
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=AdminPanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdminPanel.js","sourceRoot":"","sources":["../../../../../core-web/src/components/admin/AdminPanel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EACL,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EACnD,cAAc,EAAE,UAAU,GAC3B,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAS1C,MAAM,UAAU,UAAU,CAAC,EAAE,OAAO,E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AC3C,eAAM,SAAS,EAAC,SAAS,YAAE,CAAC,CAAC,IAAI,GAAQ,EACzC,eAAM,SAAS,EAAC,qBAAqB,YAAE,CAAC,CAAC,KAAK,GAAQ,IAClD,EACN,eAAK,SAAS,EAAC,8BAA8B,aAC3C,eAAM,SAAS,EAAC,iEAAiE,YAAE,CAAC,CAAC,IAAI,GAAQ,EACjG,eAAM,SAAS,EAAC,iEAAiE,YAAE,CAAC,CAAC,QAAQ,GAAQ,IACjG,KARE,CAAC,CAAC,IAAI,CASV,CACP,CAAC,EACD,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,CACvB,YAAG,SAAS,EAAC,0CAA0C,2CAA+B,CACvF,IACG,EACN,aAAG,SAAS,EAAC,oCAAoC,aAAE,OAAO,CAAC,MAAM,sBAAmB,IAChF,CACP,CAAA;AACH,CAAC;AAED,8DAA8D;AAE9D,SAAS,SAAS,CAAC,EAAE,IAAI,EAAoB;IAC3C,MAAM,MAAM,GAA2B;QACrC,KAAK,EAAE,8CAA8C;QACrD,MAAM,EAAE,oEAAoE;QAC5E,IAAI,EAAE,8CAA8C;KACrD,CAAA;IACD,OAAO,CACL,eAAM,SAAS,EAAE,2CAA2C,MAAM,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,IAAI,EAAE,YACtF,IAAI,GACA,CACR,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SystemTab.d.ts","sourceRoot":"","sources":["../../../../../core-web/src/components/admin/SystemTab.tsx"],"names":[],"mappings":"AAaA,wBAAgB,SAAS,4CAyJxB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useData } from '../../hooks/useData.js';
|
|
3
|
+
import { GATEWAY_URL, INTERNAL_SECRET } from '../../lib/config.js';
|
|
4
|
+
import { WrenchIcon, BoxIcon, GitBranchIcon, BookOpenIcon, } from 'lucide-react';
|
|
5
|
+
export function SystemTab() {
|
|
6
|
+
const { data: meta } = useData(async () => {
|
|
7
|
+
try {
|
|
8
|
+
const headers = { 'Content-Type': 'application/json' };
|
|
9
|
+
if (INTERNAL_SECRET)
|
|
10
|
+
headers['X-Internal-Secret'] = INTERNAL_SECRET;
|
|
11
|
+
const res = await fetch(`${GATEWAY_URL}/admin/meta`, { headers });
|
|
12
|
+
if (!res.ok)
|
|
13
|
+
return null;
|
|
14
|
+
return res.json();
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
}, [], null);
|
|
20
|
+
if (!meta) {
|
|
21
|
+
return (_jsxs("div", { children: [_jsx("h2", { className: "text-lg font-semibold mb-4", children: "Sistema" }), _jsxs("p", { className: "text-muted-foreground text-sm", children: ["No se pudo conectar al gateway. Asegurate de que esta corriendo y que el endpoint ", _jsx("code", { children: "/admin/meta" }), " esta disponible."] })] }));
|
|
22
|
+
}
|
|
23
|
+
return (_jsxs("div", { className: "space-y-8", children: [_jsxs("section", { children: [_jsxs("div", { className: "flex items-center gap-2 mb-3", children: [_jsx(WrenchIcon, { className: "w-4 h-4 text-muted-foreground" }), _jsx("h2", { className: "text-lg font-semibold", children: "Tools" }), _jsx("span", { className: "text-xs px-2 py-0.5 bg-muted rounded-full text-muted-foreground", children: meta.tools.length })] }), _jsx("div", { className: "border border-border rounded-lg overflow-hidden", children: _jsxs("table", { className: "w-full text-sm", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-muted/50 border-b border-border", children: [_jsx("th", { className: "text-left px-4 py-2 font-medium text-muted-foreground", children: "Nombre" }), _jsx("th", { className: "text-left px-4 py-2 font-medium text-muted-foreground", children: "Descripcion" })] }) }), _jsx("tbody", { children: meta.tools.map(t => (_jsxs("tr", { className: "border-b border-border/50 hover:bg-accent/30 transition-colors", children: [_jsx("td", { className: "px-4 py-2 font-mono text-xs", children: t.name }), _jsx("td", { className: "px-4 py-2 text-muted-foreground", children: t.description })] }, t.name))) })] }) })] }), _jsxs("section", { children: [_jsxs("div", { className: "flex items-center gap-2 mb-3", children: [_jsx(BoxIcon, { className: "w-4 h-4 text-muted-foreground" }), _jsx("h2", { className: "text-lg font-semibold", children: "Entities" }), _jsx("span", { className: "text-xs px-2 py-0.5 bg-muted rounded-full text-muted-foreground", children: meta.entities.length })] }), meta.entities.length > 0 ? (_jsx("div", { className: "border border-border rounded-lg overflow-hidden", children: _jsxs("table", { className: "w-full text-sm", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-muted/50 border-b border-border", children: [_jsx("th", { className: "text-left px-4 py-2 font-medium text-muted-foreground", children: "Nombre" }), _jsx("th", { className: "text-left px-4 py-2 font-medium text-muted-foreground", children: "Tabla" })] }) }), _jsx("tbody", { children: meta.entities.map((e) => (_jsxs("tr", { className: "border-b border-border/50 hover:bg-accent/30 transition-colors", children: [_jsx("td", { className: "px-4 py-2 font-medium", children: e.name }), _jsx("td", { className: "px-4 py-2 font-mono text-xs text-muted-foreground", children: e.table })] }, e.name))) })] }) })) : (_jsx("p", { className: "text-sm text-muted-foreground", children: "No hay entities definidas" }))] }), _jsxs("section", { children: [_jsxs("div", { className: "flex items-center gap-2 mb-3", children: [_jsx(GitBranchIcon, { className: "w-4 h-4 text-muted-foreground" }), _jsx("h2", { className: "text-lg font-semibold", children: "Workflows" }), _jsx("span", { className: "text-xs px-2 py-0.5 bg-muted rounded-full text-muted-foreground", children: meta.workflows.length })] }), meta.workflows.length > 0 ? (_jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: meta.workflows.map((w) => (_jsxs("div", { className: "border border-border rounded-lg p-4", children: [_jsx("div", { className: "font-medium text-sm mb-1", children: w.name }), _jsxs("div", { className: "text-xs text-muted-foreground mb-2", children: ["Tabla: ", _jsx("code", { children: w.entityTable })] }), _jsx("div", { className: "flex flex-wrap gap-1", children: w.phases.map((p, i) => (_jsxs("span", { className: "text-xs px-2 py-0.5 bg-muted rounded-full text-muted-foreground flex items-center gap-1", children: [i > 0 && _jsx("span", { className: "text-muted-foreground/40", children: "\u2192" }), p] }, p))) })] }, w.name))) })) : (_jsx("p", { className: "text-sm text-muted-foreground", children: "No hay workflows definidos" }))] }), _jsxs("section", { children: [_jsxs("div", { className: "flex items-center gap-2 mb-3", children: [_jsx(BookOpenIcon, { className: "w-4 h-4 text-muted-foreground" }), _jsx("h2", { className: "text-lg font-semibold", children: "Skills" }), _jsx("span", { className: "text-xs px-2 py-0.5 bg-muted rounded-full text-muted-foreground", children: meta.skills.length })] }), meta.skills.length > 0 ? (_jsx("div", { className: "border border-border rounded-lg overflow-hidden", children: _jsxs("table", { className: "w-full text-sm", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-muted/50 border-b border-border", children: [_jsx("th", { className: "text-left px-4 py-2 font-medium text-muted-foreground", children: "Nombre" }), _jsx("th", { className: "text-left px-4 py-2 font-medium text-muted-foreground", children: "Descripcion" }), _jsx("th", { className: "text-left px-4 py-2 font-medium text-muted-foreground", children: "Tools" })] }) }), _jsx("tbody", { children: meta.skills.map((s) => (_jsxs("tr", { className: "border-b border-border/50 hover:bg-accent/30 transition-colors", children: [_jsx("td", { className: "px-4 py-2 font-medium", children: s.name }), _jsx("td", { className: "px-4 py-2 text-muted-foreground", children: s.description || '—' }), _jsx("td", { className: "px-4 py-2", children: _jsx("div", { className: "flex flex-wrap gap-1", children: s.mcp_tools.map((t) => (_jsx("span", { className: "text-xs px-1.5 py-0.5 bg-muted rounded text-muted-foreground font-mono", children: t }, t))) }) })] }, s.name))) })] }) })) : (_jsx("p", { className: "text-sm text-muted-foreground", children: "No hay skills cargados" }))] })] }));
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=SystemTab.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SystemTab.js","sourceRoot":"","sources":["../../../../../core-web/src/components/admin/SystemTab.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;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AAC,CACxB,cAAK,SAAS,EAAC,iDAAiD,YAC9D,iBAAO,SAAS,EAAC,gBAAgB,aAC/B,0BACE,cAAI,SAAS,EAAC,oCAAoC,aAChD,aAAI,SAAS,EAAC,uDAAuD,uBAAY,EACjF,aAAI,SAAS,EAAC,uDAAuD,4BAAiB,EACtF,aAAI,SAAS,EAAC,uDAAuD,sBAAW,IAC7E,GACC,EACR,0BACG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAC3B,cAAiB,SAAS,EAAC,gEAAgE,aACzF,aAAI,SAAS,EAAC,uBAAuB,YAAE,CAAC,CAAC,IAAI,GAAM,EACnD,aAAI,SAAS,EAAC,iCAAiC,YAAE,CAAC,CAAC,WAAW,IAAI,GAAG,GAAM,EAC3E,aAAI,SAAS,EAAC,WAAW,YACvB,cAAK,SAAS,EAAC,sBAAsB,YAClC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,CAC9B,eAAc,SAAS,EAAC,wEAAwE,YAAE,CAAC,IAAxF,CAAC,CAA+F,CAC5G,CAAC,GACE,GACH,KATE,CAAC,CAAC,IAAI,CAUV,CACN,CAAC,GACI,IACF,GACJ,CACP,CAAC,CAAC,CAAC,CACF,YAAG,SAAS,EAAC,+BAA+B,uCAA2B,CACxE,IACO,IACN,CACP,CAAA;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../../../../core-web/src/components/shell/Toolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../../../../core-web/src/components/shell/Toolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAM7D,OAAO,KAAK,EAAE,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AAY,EAAE,kBAAkB,EAAE,OAAO,EAAE,WAAW,EAChF,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,kBAAkB,EAChE,YAAY,EAAE,cAAc,EAAE,UAAU,EACxC,IAAI,EAAE,SAAS,EAAE,kBAAkB,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EACvE,YAAY,GACb,EAAE,KAAK,2CAuLP"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
+
import { useNavigate } from 'react-router-dom';
|
|
3
4
|
import { useMountEffect } from '../../hooks/useMountEffect.js';
|
|
4
5
|
import { Button } from '../ui/button.js';
|
|
5
|
-
import { PlusIcon, RotateCcwIcon, SunIcon, MoonIcon, MonitorIcon, UserIcon, LogOutIcon, Building2Icon, ChevronDownIcon, CheckIcon, XIcon, HomeIcon, SettingsIcon, LayoutGridIcon } from 'lucide-react';
|
|
6
|
+
import { PlusIcon, RotateCcwIcon, SunIcon, MoonIcon, MonitorIcon, UserIcon, LogOutIcon, Building2Icon, ChevronDownIcon, CheckIcon, XIcon, HomeIcon, SettingsIcon, LayoutGridIcon, ShieldIcon } from 'lucide-react';
|
|
6
7
|
import { useTheme } from '../../hooks/useTheme.js';
|
|
7
8
|
export function Toolbar({ widgetCount, cockpitMode, activeEntity, onDeactivateEntity, onReset, onAddWidget, widgetCatalog, onOpenSettings, editingLayout, onToggleEditLayout, openEntities, onSelectEntity, onCloseTab, role, companies, effectiveCompanyId, setCompanyId, onSignOut, userEmail, rightActions, }) {
|
|
8
9
|
const [openDropdown, setOpenDropdown] = useState(null);
|
|
@@ -18,6 +19,7 @@ export function Toolbar({ widgetCount, cockpitMode, activeEntity, onDeactivateEn
|
|
|
18
19
|
document.addEventListener('keydown', handler);
|
|
19
20
|
return () => document.removeEventListener('keydown', handler);
|
|
20
21
|
});
|
|
22
|
+
const navigate = useNavigate();
|
|
21
23
|
const currentCompany = companies?.find(c => c.id === effectiveCompanyId);
|
|
22
24
|
return (_jsxs("div", { className: "sticky top-0 z-20 bg-background/80 backdrop-blur border-b border-border px-3 py-1.5 flex items-center justify-between gap-2", children: [_jsxs("div", { className: "flex items-center gap-1 min-w-0 flex-1", children: [_jsx("button", { onClick: onDeactivateEntity, className: `p-1.5 rounded-md transition-colors shrink-0 ${!cockpitMode ? 'bg-accent text-foreground' : 'text-muted-foreground hover:text-foreground hover:bg-accent'}`, "aria-label": "Inicio", title: "Inicio", children: _jsx(HomeIcon, { className: "w-3.5 h-3.5" }) }), openEntities && openEntities.length > 0 ? (_jsx("div", { className: "flex items-center gap-0.5 min-w-0 overflow-x-auto scrollbar-thin", children: openEntities.map(e => {
|
|
23
25
|
const isActive = !!(cockpitMode && activeEntity && activeEntity.type === e.type && activeEntity.id === e.id);
|
|
@@ -30,7 +32,7 @@ export function Toolbar({ widgetCount, cockpitMode, activeEntity, onDeactivateEn
|
|
|
30
32
|
}) })) : (_jsxs("span", { className: "text-xs text-muted-foreground pl-1", children: [widgetCount, " widgets"] }))] }), _jsxs("div", { className: "flex items-center gap-1", children: [_jsxs(Button, { variant: "ghost", size: "sm", className: "h-7 text-xs gap-1", onClick: onReset, children: [_jsx(RotateCcwIcon, { className: "w-3 h-3" }), " Reset"] }), onToggleEditLayout && !cockpitMode && (_jsx(Button, { variant: editingLayout ? 'default' : 'ghost', size: "sm", className: `h-7 text-xs gap-1 ${editingLayout ? 'bg-primary text-primary-foreground' : ''}`, onClick: onToggleEditLayout, children: editingLayout ? _jsxs(_Fragment, { children: [_jsx(CheckIcon, { className: "w-3 h-3" }), " Listo"] }) : _jsxs(_Fragment, { children: [_jsx(LayoutGridIcon, { className: "w-3 h-3" }), " Editar"] }) })), role === 'admin' && companies && companies.length > 1 && setCompanyId && (_jsxs("div", { className: "relative", children: [_jsxs(Button, { variant: "ghost", size: "sm", className: "h-7 text-xs gap-1.5 max-w-[180px]", onClick: () => toggleDropdown('company'), children: [_jsx(Building2Icon, { className: "w-3 h-3 shrink-0" }), _jsx("span", { className: "truncate", children: currentCompany?.name || 'Empresa' }), _jsx(ChevronDownIcon, { className: "w-3 h-3 shrink-0 opacity-60" })] }), showCompany && (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-20", onClick: () => setOpenDropdown(null) }), _jsxs("div", { className: "absolute right-0 top-8 bg-card border border-border rounded-lg shadow-lg p-1 z-30 w-60 max-h-80 overflow-y-auto scrollbar-thin", children: [_jsx("div", { className: "px-2 py-1 text-[10px] uppercase tracking-wide text-muted-foreground/60", children: "Empresas" }), companies.map(c => {
|
|
31
33
|
const active = c.id === effectiveCompanyId;
|
|
32
34
|
return (_jsxs("button", { onClick: () => { setCompanyId(c.id); setOpenDropdown(null); }, className: `w-full text-left px-2 py-1.5 text-sm rounded hover:bg-accent transition-colors flex items-center gap-2 ${active ? 'bg-accent/50' : ''}`, children: [_jsx(Building2Icon, { className: "w-3.5 h-3.5 shrink-0 text-muted-foreground" }), _jsx("span", { className: "flex-1 truncate", children: c.name }), active && _jsx(CheckIcon, { className: "w-3.5 h-3.5 text-primary shrink-0" })] }, c.id));
|
|
33
|
-
})] })] }))] })), rightActions, _jsxs("div", { className: "relative", children: [_jsxs(Button, { variant: "ghost", size: "sm", className: "h-7 text-xs gap-1", onClick: () => toggleDropdown('catalog'), children: [_jsx(PlusIcon, { className: "w-3 h-3" }), " Agregar"] }), showCatalog && (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-20", onClick: () => setOpenDropdown(null) }), _jsx("div", { className: "absolute right-0 top-8 bg-card border border-border rounded-lg shadow-lg p-1 z-30 w-40", children: widgetCatalog.map(w => (_jsxs("button", { onClick: () => { onAddWidget(w.type); setOpenDropdown(null); }, className: "w-full text-left px-3 py-1.5 text-sm rounded hover:bg-accent transition-colors flex items-center gap-2", children: [_jsx("span", { children: w.icon }), " ", w.title] }, w.type))) })] }))] }), onSignOut && (_jsxs("div", { className: "relative ml-1", children: [_jsx(Button, { variant: "ghost", size: "sm", className: "h-7 w-7 p-0", onClick: () => toggleDropdown('profile'), "aria-label": "Perfil", children: _jsx(UserIcon, { className: "w-3.5 h-3.5" }) }), showProfile && (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-20", onClick: () => setOpenDropdown(null) }), _jsxs("div", { className: "absolute right-0 top-8 bg-card border border-border rounded-lg shadow-lg p-1 z-30 w-48", children: [userEmail && (_jsx("div", { className: "px-3 py-1.5 text-[11px] text-muted-foreground truncate border-b border-border/50 mb-1", children: userEmail })), onOpenSettings && (_jsxs("button", { onClick: () => { setOpenDropdown(null); onOpenSettings(); }, className: "w-full text-left px-3 py-1.5 text-sm rounded hover:bg-accent transition-colors flex items-center gap-2", children: [_jsx(SettingsIcon, { className: "w-3.5 h-3.5" }), " Configuracion"] })), _jsx(ThemeToggleRow, {}), _jsx("div", { className: "border-t border-border/50 mt-1 pt-1", children: _jsxs("button", { onClick: () => { setOpenDropdown(null); onSignOut(); }, className: "w-full text-left px-3 py-1.5 text-sm rounded hover:bg-accent transition-colors flex items-center gap-2", children: [_jsx(LogOutIcon, { className: "w-3.5 h-3.5" }), " Salir"] }) })] })] }))] }))] })] }));
|
|
35
|
+
})] })] }))] })), rightActions, _jsxs("div", { className: "relative", children: [_jsxs(Button, { variant: "ghost", size: "sm", className: "h-7 text-xs gap-1", onClick: () => toggleDropdown('catalog'), children: [_jsx(PlusIcon, { className: "w-3 h-3" }), " Agregar"] }), showCatalog && (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-20", onClick: () => setOpenDropdown(null) }), _jsx("div", { className: "absolute right-0 top-8 bg-card border border-border rounded-lg shadow-lg p-1 z-30 w-40", children: widgetCatalog.map(w => (_jsxs("button", { onClick: () => { onAddWidget(w.type); setOpenDropdown(null); }, className: "w-full text-left px-3 py-1.5 text-sm rounded hover:bg-accent transition-colors flex items-center gap-2", children: [_jsx("span", { children: w.icon }), " ", w.title] }, w.type))) })] }))] }), onSignOut && (_jsxs("div", { className: "relative ml-1", children: [_jsx(Button, { variant: "ghost", size: "sm", className: "h-7 w-7 p-0", onClick: () => toggleDropdown('profile'), "aria-label": "Perfil", children: _jsx(UserIcon, { className: "w-3.5 h-3.5" }) }), showProfile && (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-20", onClick: () => setOpenDropdown(null) }), _jsxs("div", { className: "absolute right-0 top-8 bg-card border border-border rounded-lg shadow-lg p-1 z-30 w-48", children: [userEmail && (_jsx("div", { className: "px-3 py-1.5 text-[11px] text-muted-foreground truncate border-b border-border/50 mb-1", children: userEmail })), onOpenSettings && (_jsxs("button", { onClick: () => { setOpenDropdown(null); onOpenSettings(); }, className: "w-full text-left px-3 py-1.5 text-sm rounded hover:bg-accent transition-colors flex items-center gap-2", children: [_jsx(SettingsIcon, { className: "w-3.5 h-3.5" }), " Configuracion"] })), role === 'admin' && (_jsxs("button", { onClick: () => { setOpenDropdown(null); navigate('/admin'); }, className: "w-full text-left px-3 py-1.5 text-sm rounded hover:bg-accent transition-colors flex items-center gap-2", children: [_jsx(ShieldIcon, { className: "w-3.5 h-3.5" }), " Admin"] })), _jsx(ThemeToggleRow, {}), _jsx("div", { className: "border-t border-border/50 mt-1 pt-1", children: _jsxs("button", { onClick: () => { setOpenDropdown(null); onSignOut(); }, className: "w-full text-left px-3 py-1.5 text-sm rounded hover:bg-accent transition-colors flex items-center gap-2", children: [_jsx(LogOutIcon, { className: "w-3.5 h-3.5" }), " Salir"] }) })] })] }))] }))] })] }));
|
|
34
36
|
}
|
|
35
37
|
function ThemeToggleRow() {
|
|
36
38
|
const { theme, setTheme } = useTheme();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.js","sourceRoot":"","sources":["../../../../../core-web/src/components/shell/Toolbar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAA+B,MAAM,OAAO,CAAA;AAC7D,OAAO,EAAE,cAAc,EAA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AAwG,aAElH,KAAC,UAAU,IAAC,SAAS,EAAC,aAAa,GAAG,cAC/B,CACV,EACD,KAAC,cAAc,KAAG,EAClB,cAAK,SAAS,EAAC,qCAAqC,YAClD,kBACE,OAAO,EAAE,GAAG,EAAE,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EAAE,CAAA,CAAC,CAAC,EACrD,SAAS,EAAC,wGAAwG,aAElH,KAAC,UAAU,IAAC,SAAS,EAAC,aAAa,GAAG,cAC/B,GACL,IACF,IACL,CACJ,IACG,CACP,IACG,IACF,CACP,CAAA;AACH,CAAC;AAED,SAAS,cAAc;IACrB,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,QAAQ,EAAE,CAAA;IACtC,MAAM,IAAI,GAAyB,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,CAAA;IACrF,MAAM,IAAI,GAAG,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAA;IACpF,MAAM,KAAK,GAAG,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAA;IAEhF,OAAO,CACL,kBACE,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EACpC,SAAS,EAAC,wGAAwG,aAElH,KAAC,IAAI,IAAC,SAAS,EAAC,aAAa,GAAG,aAAQ,KAAK,IACtC,CACV,CAAA;AACH,CAAC"}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export { default as Shell, type CockpitDefinition } from './components/Shell.js';
|
|
8
8
|
export { ProtoApp, type ProtoAppProps } from './ProtoApp.js';
|
|
9
|
+
export { AdminPanel } from './components/admin/AdminPanel.js';
|
|
9
10
|
export { defineWidget, buildWidgetRegistry, type WidgetDefinition, type WidgetRegistry, type WidgetCategory, type WidgetSize, type ShellContext, } from './lib/define-widget.js';
|
|
10
11
|
export type { ActiveEntity, WidgetInstance, WidgetType } from './components/shell/types.js';
|
|
11
12
|
export { useAuth } from './hooks/useAuth.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../core-web/src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAChF,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../core-web/src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAChF,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAG7D,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,YAAY,GAClB,MAAM,wBAAwB,CAAA;AAC/B,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAG3F,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,KAAK,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAG1D,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAA;AACnC,cAAc,eAAe,CAAA;AAC7B,cAAc,sBAAsB,CAAA;AAGpC,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAA;AAGrE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAClD,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAA;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAA;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAA;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA"}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
// Framework components
|
|
8
8
|
export { default as Shell } from './components/Shell.js';
|
|
9
9
|
export { ProtoApp } from './ProtoApp.js';
|
|
10
|
+
export { AdminPanel } from './components/admin/AdminPanel.js';
|
|
10
11
|
// Extension API
|
|
11
12
|
export { defineWidget, buildWidgetRegistry, } from './lib/define-widget.js';
|
|
12
13
|
// Hooks
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../core-web/src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,uBAAuB;AACvB,OAAO,EAAE,OAAO,IAAI,KAAK,EAA0B,MAAM,uBAAuB,CAAA;AAChF,OAAO,EAAE,QAAQ,EAAsB,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../core-web/src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,uBAAuB;AACvB,OAAO,EAAE,OAAO,IAAI,KAAK,EAA0B,MAAM,uBAAuB,CAAA;AAChF,OAAO,EAAE,QAAQ,EAAsB,MAAM,eAAe,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAE7D,gBAAgB;AAChB,OAAO,EACL,YAAY,EACZ,mBAAmB,GAMpB,MAAM,wBAAwB,CAAA;AAG/B,QAAQ;AACR,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAc,MAAM,qBAAqB,CAAA;AAE1D,MAAM;AACN,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAA;AACnC,cAAc,eAAe,CAAA;AAC7B,cAAc,sBAAsB,CAAA;AAEpC,4BAA4B;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAA;AAErE,yBAAyB;AACzB,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAClD,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAA;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAA;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAA;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tleblancureta/proto",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "TypeScript framework for building AI-agent-driven apps. Define tools, widgets, and data models — get chat, Shell dashboard, auth, MCP server, and Claude CLI integration.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"lucide-react": "^1.7.0",
|
|
44
44
|
"react-grid-layout": "^2.2.3",
|
|
45
45
|
"react-markdown": "^10.1.0",
|
|
46
|
+
"react-router-dom": "^7.14.0",
|
|
46
47
|
"remark-gfm": "^4.0.1",
|
|
47
48
|
"tailwind-merge": "^3.5.0",
|
|
48
49
|
"zod": "^3.24.0"
|