mirror of
https://github.com/domfelipe/mika-agent-assist.git
synced 2026-08-07 08:36:44 +00:00
Changes
Co-authored-by: domfelipe <53182096+domfelipe@users.noreply.github.com>
This commit is contained in:
parent
08a69cd378
commit
4c325b736c
2 changed files with 37 additions and 15 deletions
|
|
@ -31,6 +31,7 @@ import { Route as PainelSkillsIdRouteImport } from './routes/painel.skills.$id'
|
||||||
import { Route as PainelIntegracoesSlugRouteImport } from './routes/painel.integracoes.$slug'
|
import { Route as PainelIntegracoesSlugRouteImport } from './routes/painel.integracoes.$slug'
|
||||||
import { Route as PainelCronjobsNovaRouteImport } from './routes/painel.cronjobs.nova'
|
import { Route as PainelCronjobsNovaRouteImport } from './routes/painel.cronjobs.nova'
|
||||||
import { Route as PainelCronjobsIdRouteImport } from './routes/painel.cronjobs.$id'
|
import { Route as PainelCronjobsIdRouteImport } from './routes/painel.cronjobs.$id'
|
||||||
|
import { Route as AdminAgenteIdRouteImport } from './routes/admin.agente.$id'
|
||||||
|
|
||||||
const SignupRoute = SignupRouteImport.update({
|
const SignupRoute = SignupRouteImport.update({
|
||||||
id: '/signup',
|
id: '/signup',
|
||||||
|
|
@ -142,10 +143,15 @@ const PainelCronjobsIdRoute = PainelCronjobsIdRouteImport.update({
|
||||||
path: '/cronjobs/$id',
|
path: '/cronjobs/$id',
|
||||||
getParentRoute: () => PainelRoute,
|
getParentRoute: () => PainelRoute,
|
||||||
} as any)
|
} as any)
|
||||||
|
const AdminAgenteIdRoute = AdminAgenteIdRouteImport.update({
|
||||||
|
id: '/agente/$id',
|
||||||
|
path: '/agente/$id',
|
||||||
|
getParentRoute: () => AdminRoute,
|
||||||
|
} as any)
|
||||||
|
|
||||||
export interface FileRoutesByFullPath {
|
export interface FileRoutesByFullPath {
|
||||||
'/': typeof IndexRoute
|
'/': typeof IndexRoute
|
||||||
'/admin': typeof AdminRoute
|
'/admin': typeof AdminRouteWithChildren
|
||||||
'/login': typeof LoginRoute
|
'/login': typeof LoginRoute
|
||||||
'/painel': typeof PainelRouteWithChildren
|
'/painel': typeof PainelRouteWithChildren
|
||||||
'/recuperar-senha': typeof RecuperarSenhaRoute
|
'/recuperar-senha': typeof RecuperarSenhaRoute
|
||||||
|
|
@ -157,6 +163,7 @@ export interface FileRoutesByFullPath {
|
||||||
'/painel/faturamento': typeof PainelFaturamentoRoute
|
'/painel/faturamento': typeof PainelFaturamentoRoute
|
||||||
'/painel/skills': typeof PainelSkillsRouteWithChildren
|
'/painel/skills': typeof PainelSkillsRouteWithChildren
|
||||||
'/painel/': typeof PainelIndexRoute
|
'/painel/': typeof PainelIndexRoute
|
||||||
|
'/admin/agente/$id': typeof AdminAgenteIdRoute
|
||||||
'/painel/cronjobs/$id': typeof PainelCronjobsIdRoute
|
'/painel/cronjobs/$id': typeof PainelCronjobsIdRoute
|
||||||
'/painel/cronjobs/nova': typeof PainelCronjobsNovaRoute
|
'/painel/cronjobs/nova': typeof PainelCronjobsNovaRoute
|
||||||
'/painel/integracoes/$slug': typeof PainelIntegracoesSlugRoute
|
'/painel/integracoes/$slug': typeof PainelIntegracoesSlugRoute
|
||||||
|
|
@ -169,7 +176,7 @@ export interface FileRoutesByFullPath {
|
||||||
}
|
}
|
||||||
export interface FileRoutesByTo {
|
export interface FileRoutesByTo {
|
||||||
'/': typeof IndexRoute
|
'/': typeof IndexRoute
|
||||||
'/admin': typeof AdminRoute
|
'/admin': typeof AdminRouteWithChildren
|
||||||
'/login': typeof LoginRoute
|
'/login': typeof LoginRoute
|
||||||
'/recuperar-senha': typeof RecuperarSenhaRoute
|
'/recuperar-senha': typeof RecuperarSenhaRoute
|
||||||
'/redefinir-senha': typeof RedefinirSenhaRoute
|
'/redefinir-senha': typeof RedefinirSenhaRoute
|
||||||
|
|
@ -179,6 +186,7 @@ export interface FileRoutesByTo {
|
||||||
'/painel/configuracoes': typeof PainelConfiguracoesRoute
|
'/painel/configuracoes': typeof PainelConfiguracoesRoute
|
||||||
'/painel/faturamento': typeof PainelFaturamentoRoute
|
'/painel/faturamento': typeof PainelFaturamentoRoute
|
||||||
'/painel': typeof PainelIndexRoute
|
'/painel': typeof PainelIndexRoute
|
||||||
|
'/admin/agente/$id': typeof AdminAgenteIdRoute
|
||||||
'/painel/cronjobs/$id': typeof PainelCronjobsIdRoute
|
'/painel/cronjobs/$id': typeof PainelCronjobsIdRoute
|
||||||
'/painel/cronjobs/nova': typeof PainelCronjobsNovaRoute
|
'/painel/cronjobs/nova': typeof PainelCronjobsNovaRoute
|
||||||
'/painel/integracoes/$slug': typeof PainelIntegracoesSlugRoute
|
'/painel/integracoes/$slug': typeof PainelIntegracoesSlugRoute
|
||||||
|
|
@ -192,7 +200,7 @@ export interface FileRoutesByTo {
|
||||||
export interface FileRoutesById {
|
export interface FileRoutesById {
|
||||||
__root__: typeof rootRouteImport
|
__root__: typeof rootRouteImport
|
||||||
'/': typeof IndexRoute
|
'/': typeof IndexRoute
|
||||||
'/admin': typeof AdminRoute
|
'/admin': typeof AdminRouteWithChildren
|
||||||
'/login': typeof LoginRoute
|
'/login': typeof LoginRoute
|
||||||
'/painel': typeof PainelRouteWithChildren
|
'/painel': typeof PainelRouteWithChildren
|
||||||
'/recuperar-senha': typeof RecuperarSenhaRoute
|
'/recuperar-senha': typeof RecuperarSenhaRoute
|
||||||
|
|
@ -204,6 +212,7 @@ export interface FileRoutesById {
|
||||||
'/painel/faturamento': typeof PainelFaturamentoRoute
|
'/painel/faturamento': typeof PainelFaturamentoRoute
|
||||||
'/painel/skills': typeof PainelSkillsRouteWithChildren
|
'/painel/skills': typeof PainelSkillsRouteWithChildren
|
||||||
'/painel/': typeof PainelIndexRoute
|
'/painel/': typeof PainelIndexRoute
|
||||||
|
'/admin/agente/$id': typeof AdminAgenteIdRoute
|
||||||
'/painel/cronjobs/$id': typeof PainelCronjobsIdRoute
|
'/painel/cronjobs/$id': typeof PainelCronjobsIdRoute
|
||||||
'/painel/cronjobs/nova': typeof PainelCronjobsNovaRoute
|
'/painel/cronjobs/nova': typeof PainelCronjobsNovaRoute
|
||||||
'/painel/integracoes/$slug': typeof PainelIntegracoesSlugRoute
|
'/painel/integracoes/$slug': typeof PainelIntegracoesSlugRoute
|
||||||
|
|
@ -230,6 +239,7 @@ export interface FileRouteTypes {
|
||||||
| '/painel/faturamento'
|
| '/painel/faturamento'
|
||||||
| '/painel/skills'
|
| '/painel/skills'
|
||||||
| '/painel/'
|
| '/painel/'
|
||||||
|
| '/admin/agente/$id'
|
||||||
| '/painel/cronjobs/$id'
|
| '/painel/cronjobs/$id'
|
||||||
| '/painel/cronjobs/nova'
|
| '/painel/cronjobs/nova'
|
||||||
| '/painel/integracoes/$slug'
|
| '/painel/integracoes/$slug'
|
||||||
|
|
@ -252,6 +262,7 @@ export interface FileRouteTypes {
|
||||||
| '/painel/configuracoes'
|
| '/painel/configuracoes'
|
||||||
| '/painel/faturamento'
|
| '/painel/faturamento'
|
||||||
| '/painel'
|
| '/painel'
|
||||||
|
| '/admin/agente/$id'
|
||||||
| '/painel/cronjobs/$id'
|
| '/painel/cronjobs/$id'
|
||||||
| '/painel/cronjobs/nova'
|
| '/painel/cronjobs/nova'
|
||||||
| '/painel/integracoes/$slug'
|
| '/painel/integracoes/$slug'
|
||||||
|
|
@ -276,6 +287,7 @@ export interface FileRouteTypes {
|
||||||
| '/painel/faturamento'
|
| '/painel/faturamento'
|
||||||
| '/painel/skills'
|
| '/painel/skills'
|
||||||
| '/painel/'
|
| '/painel/'
|
||||||
|
| '/admin/agente/$id'
|
||||||
| '/painel/cronjobs/$id'
|
| '/painel/cronjobs/$id'
|
||||||
| '/painel/cronjobs/nova'
|
| '/painel/cronjobs/nova'
|
||||||
| '/painel/integracoes/$slug'
|
| '/painel/integracoes/$slug'
|
||||||
|
|
@ -289,7 +301,7 @@ export interface FileRouteTypes {
|
||||||
}
|
}
|
||||||
export interface RootRouteChildren {
|
export interface RootRouteChildren {
|
||||||
IndexRoute: typeof IndexRoute
|
IndexRoute: typeof IndexRoute
|
||||||
AdminRoute: typeof AdminRoute
|
AdminRoute: typeof AdminRouteWithChildren
|
||||||
LoginRoute: typeof LoginRoute
|
LoginRoute: typeof LoginRoute
|
||||||
PainelRoute: typeof PainelRouteWithChildren
|
PainelRoute: typeof PainelRouteWithChildren
|
||||||
RecuperarSenhaRoute: typeof RecuperarSenhaRoute
|
RecuperarSenhaRoute: typeof RecuperarSenhaRoute
|
||||||
|
|
@ -454,9 +466,26 @@ declare module '@tanstack/react-router' {
|
||||||
preLoaderRoute: typeof PainelCronjobsIdRouteImport
|
preLoaderRoute: typeof PainelCronjobsIdRouteImport
|
||||||
parentRoute: typeof PainelRoute
|
parentRoute: typeof PainelRoute
|
||||||
}
|
}
|
||||||
|
'/admin/agente/$id': {
|
||||||
|
id: '/admin/agente/$id'
|
||||||
|
path: '/agente/$id'
|
||||||
|
fullPath: '/admin/agente/$id'
|
||||||
|
preLoaderRoute: typeof AdminAgenteIdRouteImport
|
||||||
|
parentRoute: typeof AdminRoute
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface AdminRouteChildren {
|
||||||
|
AdminAgenteIdRoute: typeof AdminAgenteIdRoute
|
||||||
|
}
|
||||||
|
|
||||||
|
const AdminRouteChildren: AdminRouteChildren = {
|
||||||
|
AdminAgenteIdRoute: AdminAgenteIdRoute,
|
||||||
|
}
|
||||||
|
|
||||||
|
const AdminRouteWithChildren = AdminRoute._addFileChildren(AdminRouteChildren)
|
||||||
|
|
||||||
interface PainelSkillsRouteChildren {
|
interface PainelSkillsRouteChildren {
|
||||||
PainelSkillsIdRoute: typeof PainelSkillsIdRoute
|
PainelSkillsIdRoute: typeof PainelSkillsIdRoute
|
||||||
PainelSkillsNovaRoute: typeof PainelSkillsNovaRoute
|
PainelSkillsNovaRoute: typeof PainelSkillsNovaRoute
|
||||||
|
|
@ -506,7 +535,7 @@ const PainelRouteWithChildren =
|
||||||
|
|
||||||
const rootRouteChildren: RootRouteChildren = {
|
const rootRouteChildren: RootRouteChildren = {
|
||||||
IndexRoute: IndexRoute,
|
IndexRoute: IndexRoute,
|
||||||
AdminRoute: AdminRoute,
|
AdminRoute: AdminRouteWithChildren,
|
||||||
LoginRoute: LoginRoute,
|
LoginRoute: LoginRoute,
|
||||||
PainelRoute: PainelRouteWithChildren,
|
PainelRoute: PainelRouteWithChildren,
|
||||||
RecuperarSenhaRoute: RecuperarSenhaRoute,
|
RecuperarSenhaRoute: RecuperarSenhaRoute,
|
||||||
|
|
|
||||||
|
|
@ -117,14 +117,8 @@ function AgentDetailPage() {
|
||||||
? d.subscription.find((s: { plans: unknown }) => s.plans) ?? d.subscription[0] ?? null
|
? d.subscription.find((s: { plans: unknown }) => s.plans) ?? d.subscription[0] ?? null
|
||||||
: d.subscription;
|
: d.subscription;
|
||||||
|
|
||||||
// Buscar email via auth (admin)
|
// Email não é acessível via client (RLS) — admin pode ver no Railway/Telegram
|
||||||
let userEmail: string | null = null;
|
const userEmail: string | null = null;
|
||||||
try {
|
|
||||||
const { data: u } = await supabase.auth.admin.getUserById(d.user_id);
|
|
||||||
userEmail = u?.user?.email ?? null;
|
|
||||||
} catch {
|
|
||||||
// Sem permissão admin no client — ignorar
|
|
||||||
}
|
|
||||||
|
|
||||||
return { ...d, profile, subscription, user_email: userEmail } as AgentDetail;
|
return { ...d, profile, subscription, user_email: userEmail } as AgentDetail;
|
||||||
},
|
},
|
||||||
|
|
@ -487,8 +481,7 @@ function Field({ label, value }: { label: string; value: string }) {
|
||||||
|
|
||||||
function StatusBadge({ status }: { status: string }) {
|
function StatusBadge({ status }: { status: string }) {
|
||||||
if (status === "active") return <Badge variant="success">Ativo</Badge>;
|
if (status === "active") return <Badge variant="success">Ativo</Badge>;
|
||||||
if (status === "provisioning")
|
if (status === "provisioning") return <Badge variant="secondary">Provisionando</Badge>;
|
||||||
return <Badge className="bg-amber-500/15 text-amber-700 dark:text-amber-400 border-amber-500/30">Provisionando</Badge>;
|
|
||||||
if (status === "suspended") return <Badge variant="destructive">Suspenso</Badge>;
|
if (status === "suspended") return <Badge variant="destructive">Suspenso</Badge>;
|
||||||
if (status === "error") return <Badge variant="destructive">Erro</Badge>;
|
if (status === "error") return <Badge variant="destructive">Erro</Badge>;
|
||||||
return <Badge variant="secondary">{status}</Badge>;
|
return <Badge variant="secondary">{status}</Badge>;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue