Skip to content

Commit

Permalink
wip(web/players): mock table working + layout
Browse files Browse the repository at this point in the history
  • Loading branch information
tabarra committed Mar 14, 2024
1 parent 490a437 commit 6bfa522
Show file tree
Hide file tree
Showing 5 changed files with 618 additions and 6 deletions.
12 changes: 8 additions & 4 deletions docs/dev_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ seems like it just refreshes the page
- fix disallowed intents message

- rtl issue

- [ ] fix all imgur links
- [ ] build: generate fxmanifest files list dynamically
- [ ] easter egg with some old music? https://www.youtube.com/watch?v=nNoaXej0Jeg
- [ ] update docs on development?


- [ ] Use q5/q95 from QuantileArrayOutput to help me define the buckets, then implement the join check time histogram

## Client game print issue
https://github.com/citizenfx/fivem/commit/cafd87148a9a47eb267c24c00ec15f96103d4257
Expand Down Expand Up @@ -897,10 +896,15 @@ con_miniconChannels script:runcode
nui_devtoold mpMenu

# hang fxserver (runcode)
console.log('hanging the thread for 60s');
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, 60 * 1000);
const duration = 60_000;
console.log(`hanging the thread for ${duration}ms`);
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, duration);
console.log('done');

setInterval(() => {
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, 2);
}, 0);

# stress http post
seq 50000 | parallel --max-args 0 --jobs 10000 "curl -s http://xxxxxxxxxxx:40120/ -d @braces768kb.json --header \"Content-Type: application/json\" > /dev/null"

Expand Down
117 changes: 117 additions & 0 deletions panel/src/components/ui/table.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
import * as React from "react"

import { cn } from "@/lib/utils"

const Table = React.forwardRef<
HTMLTableElement,
React.HTMLAttributes<HTMLTableElement>
>(({ className, ...props }, ref) => (
<div className="relative w-full overflow-auto">
<table
ref={ref}
className={cn("w-full caption-bottom text-sm", className)}
{...props}
/>
</div>
))
Table.displayName = "Table"

const TableHeader = React.forwardRef<
HTMLTableSectionElement,
React.HTMLAttributes<HTMLTableSectionElement>
>(({ className, ...props }, ref) => (
<thead ref={ref} className={cn("[&_tr]:border-b", className)} {...props} />
))
TableHeader.displayName = "TableHeader"

const TableBody = React.forwardRef<
HTMLTableSectionElement,
React.HTMLAttributes<HTMLTableSectionElement>
>(({ className, ...props }, ref) => (
<tbody
ref={ref}
className={cn("[&_tr:last-child]:border-0", className)}
{...props}
/>
))
TableBody.displayName = "TableBody"

const TableFooter = React.forwardRef<
HTMLTableSectionElement,
React.HTMLAttributes<HTMLTableSectionElement>
>(({ className, ...props }, ref) => (
<tfoot
ref={ref}
className={cn(
"border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
className
)}
{...props}
/>
))
TableFooter.displayName = "TableFooter"

const TableRow = React.forwardRef<
HTMLTableRowElement,
React.HTMLAttributes<HTMLTableRowElement>
>(({ className, ...props }, ref) => (
<tr
ref={ref}
className={cn(
"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
className
)}
{...props}
/>
))
TableRow.displayName = "TableRow"

const TableHead = React.forwardRef<
HTMLTableCellElement,
React.ThHTMLAttributes<HTMLTableCellElement>
>(({ className, ...props }, ref) => (
<th
ref={ref}
className={cn(
"h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",
className
)}
{...props}
/>
))
TableHead.displayName = "TableHead"

const TableCell = React.forwardRef<
HTMLTableCellElement,
React.TdHTMLAttributes<HTMLTableCellElement>
>(({ className, ...props }, ref) => (
<td
ref={ref}
className={cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className)}
{...props}
/>
))
TableCell.displayName = "TableCell"

const TableCaption = React.forwardRef<
HTMLTableCaptionElement,
React.HTMLAttributes<HTMLTableCaptionElement>
>(({ className, ...props }, ref) => (
<caption
ref={ref}
className={cn("mt-4 text-sm text-muted-foreground", className)}
{...props}
/>
))
TableCaption.displayName = "TableCaption"

export {
Table,
TableHeader,
TableBody,
TableFooter,
TableHead,
TableRow,
TableCell,
TableCaption,
}
2 changes: 1 addition & 1 deletion panel/src/layout/PlayerlistSidebar/Playerlist.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ function PlayerlistFilter({ filterString, setFilterString }: PlayerlistFilterPro
</DropdownMenu> */}
</div>
);
};
}
const PlayerlistFilterMemo = memo(PlayerlistFilter);


Expand Down
4 changes: 3 additions & 1 deletion panel/src/pages/TestingPage/TestingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,22 @@ import TmpSocket from "./TmpSocket";
import TmpToasts from "./TmpToasts";
import TmpApi from "./TmpApi";
import TmpFiller from "./TmpFiller";
import TmpTestTables from "./TmpTestTables";


export default function TestingPage() {
const setPageTitle = useSetPageTitle();
setPageTitle();

return <div className="flex flex-col gap-4 w-full">
<TmpTestTables />
{/* <TmpFiller /> */}
{/* <TmpApi /> */}
{/* <TmpToasts /> */}
{/* <TmpSocket /> */}
{/* <TmpWarningBarState /> */}
{/* <TmpAuthState /> */}
{/* <TmpMarkdown /> */}
<TmpColors />
{/* <TmpColors /> */}
</div>;
}
Loading

0 comments on commit 6bfa522

Please sign in to comment.