feat: dispositivos e ajustes de csat e relatórios
This commit is contained in:
parent
25d2a9b062
commit
e0ef66555d
86 changed files with 5811 additions and 992 deletions
|
|
@ -83,7 +83,7 @@ import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "@/
|
|||
import { useQuery } from "convex/react"
|
||||
import { api } from "@/convex/_generated/api"
|
||||
import { MultiValueInput } from "@/components/ui/multi-value-input"
|
||||
import { AdminMachinesOverview } from "@/components/admin/machines/admin-machines-overview"
|
||||
import { AdminDevicesOverview } from "@/components/admin/devices/admin-devices-overview"
|
||||
|
||||
type LastAlertInfo = { createdAt: number; usagePct: number; threshold: number } | null
|
||||
|
||||
|
|
@ -283,8 +283,8 @@ export function AdminCompaniesManager({ initialCompanies, tenantId }: Props) {
|
|||
|
||||
const effectiveTenantId = tenantId ?? companies[0]?.tenantId ?? DEFAULT_TENANT_ID
|
||||
|
||||
// Máquinas por empresa para contagem rápida
|
||||
const machines = useQuery(api.machines.listByTenant, {
|
||||
// Dispositivos por empresa para contagem rápida
|
||||
const machines = useQuery(api.devices.listByTenant, {
|
||||
tenantId: effectiveTenantId,
|
||||
includeMetadata: false,
|
||||
}) as unknown[] | undefined
|
||||
|
|
@ -513,10 +513,10 @@ export function AdminCompaniesManager({ initialCompanies, tenantId }: Props) {
|
|||
type="button"
|
||||
className="inline-flex items-center gap-1 text-muted-foreground transition hover:text-foreground"
|
||||
onClick={() => {
|
||||
window.location.href = `/admin/machines?company=${company.slug}`
|
||||
window.location.href = `/admin/devices?company=${company.slug}`
|
||||
}}
|
||||
>
|
||||
<IconDeviceDesktop className="size-3.5" /> Máquinas
|
||||
<IconDeviceDesktop className="size-3.5" /> Dispositivos
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
|
|
@ -754,7 +754,7 @@ function TableView({ companies, machineCountsBySlug, onEdit, onDelete }: TableVi
|
|||
<TableHead>Empresa</TableHead>
|
||||
<TableHead>Contratos ativos</TableHead>
|
||||
<TableHead>Contatos</TableHead>
|
||||
<TableHead>Máquinas</TableHead>
|
||||
<TableHead>Dispositivos</TableHead>
|
||||
<TableHead className="text-right">Ações</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
|
|
@ -864,9 +864,9 @@ function TableView({ companies, machineCountsBySlug, onEdit, onDelete }: TableVi
|
|||
<IconCopy className="mr-2 size-3.5" />
|
||||
Código
|
||||
</Button>
|
||||
<Button size="sm" variant="outline" className="whitespace-nowrap" onClick={() => { window.location.href = `/admin/machines?company=${company.slug}` }}>
|
||||
<Button size="sm" variant="outline" className="whitespace-nowrap" onClick={() => { window.location.href = `/admin/devices?company=${company.slug}` }}>
|
||||
<IconDeviceDesktop className="mr-2 size-3.5" />
|
||||
Máquinas
|
||||
Dispositivos
|
||||
</Button>
|
||||
<Button
|
||||
size="icon"
|
||||
|
|
@ -1687,10 +1687,10 @@ function CompanySheet({ tenantId, editor, onClose, onCreated, onUpdated }: Compa
|
|||
|
||||
{editor?.mode === "edit" ? (
|
||||
<AccordionItem value="machines" className="rounded-lg border border-border/60 bg-muted/20 px-4">
|
||||
<AccordionTrigger className="py-3 font-semibold">Máquinas vinculadas</AccordionTrigger>
|
||||
<AccordionTrigger className="py-3 font-semibold">Dispositivos vinculadas</AccordionTrigger>
|
||||
<AccordionContent className="pb-5">
|
||||
<div className="rounded-lg border border-border/60 bg-background p-3">
|
||||
<AdminMachinesOverview tenantId={tenantId} initialCompanyFilterSlug={editor.company.slug} />
|
||||
<AdminDevicesOverview tenantId={tenantId} initialCompanyFilterSlug={editor.company.slug} />
|
||||
</div>
|
||||
</AccordionContent>
|
||||
</AccordionItem>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue