Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component: Fix Dark mode and responsiveness on PageRSEProtocols #372 #403

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 89 additions & 39 deletions src/component-library/Pages/RSE/PageRSEProtocols.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,95 +16,145 @@ export const PageRSEProtocols = (
tableData: RSEProtocolViewModel
}
) => {
const shortstyle = { style: "w-20" }
const shortstyleblue = { style: "w-20 bg-blue-100"}
const shortstylepink = { style: "w-20 bg-pink-100"}
const shortstyleblue = { style: "w-20 sm:w-10 bg-blue-100 dark:bg-blue-900"}
const shortstylepink = { style: "w-20 sm:w-10 bg-pink-100 dark:bg-pink-900"}
const columnHelper = createColumnHelper<RSEProtocol>()
const tablecolumns: any[] = [
columnHelper.accessor("scheme", {
id: "scheme",
header: info => <H3>Scheme</H3>,
cell: info => <P className="break-all pr-1">{info.getValue()}</P>,
meta: { style: "w-24" }
meta: { style: "w-20" }
}),
columnHelper.accessor("hostname", {
id: "hostname",
header: info => <H3>Hostname</H3>,
cell: info => <P className="break-all pr-1">{info.getValue()}</P>
cell: info => <P className="break-all pr-1">{info.getValue()}</P>,
meta: { style: "w-26 lg:w-36" }
}),
columnHelper.accessor("port", {
id: "port",
header: info => <H3>Port</H3>,
cell: info => <P className="break-all pr-1">{info.getValue()}</P>,
meta: { style: "w-24" }
header: info =>(
<div>
<H3 >Port</H3>
</div>
),
cell: info => <P className="break-all pr-1 flex justify-center">{info.getValue()}</P>,
meta: { style: "w-20" }
}),
columnHelper.accessor("prefix", {
id: "prefix",
header: info => <H3>Prefix</H3>,
header: info => (
<div>
<H3>Prefix</H3>
</div>
),
cell: info => <P className="break-all pr-1">{info.getValue()}</P>,
meta: { style: "w-24" }
}),
columnHelper.accessor("priorities_lan.read", {
id: "priorities_lan.read",
header: info => <TableSortUpDown name="LAN/R" column={info.column} stack />,
cell: info => <P className="break-all pr-1 text-right">{info.getValue()}</P>,
meta: shortstyleblue
}),
header: info => (<div className="flex flex-col">
<H3 className="lg:hidden">L/R</H3>
<H3 className="hidden lg:block">LAN/R</H3>
<TableSortUpDown name="" column={info.column} stack />
</div>
),
cell: info => <P className="break-all pr-1 text-center">{info.getValue()}</P>,
meta: shortstyleblue
}),
columnHelper.accessor("priorities_lan.write", {
id: "priorities_lan.write",
header: info => <TableSortUpDown name="LAN/W" column={info.column} stack />,
cell: info => <P className="break-all pr-1 text-right">{info.getValue()}</P>,
header: info => (<div className="flex flex-col">
<H3 className="lg:hidden">L/W</H3>
<H3 className="hidden lg:block">LAN/W</H3>
<TableSortUpDown name="" column={info.column} stack />
</div>
),
cell: info => <P className="break-all pr-1 text-center">{info.getValue()}</P>,
meta: shortstyleblue
}),
columnHelper.accessor("priorities_lan.delete", {
id: "priorities_lan.delete",
header: info => <TableSortUpDown name="LAN/D" column={info.column} stack />,
cell: info => <P className="break-all pr-1 text-right">{info.getValue()}</P>,
header: info => (<div className="flex flex-col">
<H3 className="lg:hidden">L/D</H3>
<H3 className="hidden lg:block">LAN/D</H3>
<TableSortUpDown name="" column={info.column} stack />
</div>
),
cell: info => <P className="break-all pr-1 text-center">{info.getValue()}</P>,
meta: shortstyleblue
}),
columnHelper.accessor("priorities_wan.read", {
id: "priorities_lan.read",
header: info => <TableSortUpDown name="WAN/R" column={info.column} stack />,
cell: info => <P className="break-all pr-1 text-right">{info.getValue()}</P>,
id: "priorities_wan.read",
header: info => (<div className="flex flex-col">
<H3 className="lg:hidden">W/R</H3>
<H3 className="hidden lg:block">WAN/R</H3>
<TableSortUpDown name="" column={info.column} stack />
</div>
),
cell: info => <P className="break-all pr-1 text-center">{info.getValue()}</P>,
meta: shortstylepink
}),
columnHelper.accessor("priorities_wan.write", {
id: "priorities_lan.write",
header: info => <TableSortUpDown name="WAN/W" column={info.column} stack />,
cell: info => <P className="break-all pr-1 text-right">{info.getValue()}</P>,
id: "priorities_wan.write",
header: info => <div className="flex flex-col">
<H3 className="lg:hidden">W/W</H3>
<H3 className="hidden lg:block">WAN/W</H3>
<TableSortUpDown name="" column={info.column} stack />
</div>
,
cell: info => <P className="break-all pr-1 text-center">{info.getValue()}</P>,
meta: shortstylepink
}),
columnHelper.accessor("priorities_wan.delete", {
id: "priorities_lan.delete",
header: info => <TableSortUpDown name="WAN/D" column={info.column} stack />,
cell: info => <P className="break-all pr-1 text-right">{info.getValue()}</P>,
id: "priorities_wan.delete",
header: info => (<div className="flex flex-col">
<H3 className="lg:hidden">W/D</H3>
<H3 className="hidden lg:block">WAN/D</H3>
<TableSortUpDown name="" column={info.column} stack />
</div>
),
cell: info => <P className="break-all pr-1 text-center">{info.getValue()}</P>,
meta: shortstylepink,
}),
// columnHelper.accessor("priorities_wan.tpc", {
// id: "priorities_lan.tpc",
// header: info => <TableSortUpDown name="TPC" column={info.column} stack />,
// cell: info => <P className="break-all pr-1 text-right">{info.getValue()}</P>,
// meta: shortstylepink,
// }),
columnHelper.accessor("priorities_wan.tpcwrite", {
id: "priorities_lan.tpcwrite",
header: info => <TableSortUpDown name="TPC/W" column={info.column} stack />,
cell: info => <P className="break-all pr-1 text-right">{info.getValue()}</P>,
id: "priorities_wan.tpcwrite",
header: info => (<div className="flex flex-col">
<H3 className="lg:hidden">T/W</H3>
<H3 className="hidden lg:block">TCP/W</H3>

<TableSortUpDown name="" column={info.column} stack />
</div>
),
cell: info => <P className="break-all pr-1 text-center">{info.getValue()}</P>,
meta: shortstylepink,
}),
columnHelper.accessor("priorities_wan.tpcread", {
id: "priorities_lan.tpcread",
header: info => <TableSortUpDown name="TPC/R" column={info.column} stack />,
cell: info => <P className="break-all pr-1 text-right">{info.getValue()}</P>,
id: "priorities_wan.tpcread",
header: info => (<div className="flex flex-col">
<H3 className="lg:hidden">T/R</H3>
<H3 className="hidden lg:block">TCP/R</H3>
<TableSortUpDown name="" column={info.column} stack />
</div>
),
cell: info => <P className="break-all pr-1 text-center">{info.getValue()}</P>,
meta: shortstylepink,
}),
]

return (
<NormalTable<RSEProtocol>
tabledata={props.tableData.protocols || []}
tablecolumns={tablecolumns}
tablestyling={{
pageSize: 5,
pageSize: 10,
} as TableStyling}
tableselecting={{
enableRowSelection: true,
handleChange: (rows: RSEProtocol[]) => {},
}
}
/>
);
};
15 changes: 15 additions & 0 deletions src/component-library/StreamedTables/NormalTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { TableHeader } from "./TableHeader";
import { TableBody } from "./TableBody";
import { NormalTableProps } from "./types";
import { usePrepareTable } from "./helpers";
import { TableBreakout } from "./TableBreakout";


export function NormalTable<T>(props: NormalTableProps<T>) {
Expand All @@ -13,6 +14,7 @@ export function NormalTable<T>(props: NormalTableProps<T>) {
tabledata: props.tabledata,
tablecolumns: props.tablecolumns,
tablestyling: props.tablestyling,
tableselecting: props.tableselecting,
})

return (
Expand All @@ -35,6 +37,19 @@ export function NormalTable<T>(props: NormalTableProps<T>) {
role="rowgroup"
aria-label="NormalTable Footer"
>
<tr aria-label="Extra Information">
maany marked this conversation as resolved.
Show resolved Hide resolved
<td
className={twMerge(
props.tableselecting?.breakOut?.breakoutVisibility ? "table-cell" : "hidden"
)}
colSpan={table.getVisibleLeafColumns().length}
>
<TableBreakout
keys={props.tableselecting?.breakOut?.keys ?? {} as Record<string, string>}
row={table.getSelectedRowModel().flatRows[0]}
/>
</td>
</tr>
Comment on lines +41 to +52
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this table section do exactly?

<tr aria-label="Pagination Controls">
<td
colSpan={table.getVisibleLeafColumns().length}
Expand Down
21 changes: 21 additions & 0 deletions src/component-library/outputtailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -2451,6 +2451,11 @@ html {
background-color: rgb(190 24 93 / var(--tw-bg-opacity));
}

.dark\:bg-pink-900 {
--tw-bg-opacity: 1;
background-color: rgb(131 24 67 / var(--tw-bg-opacity));
}

.dark\:bg-purple-600 {
--tw-bg-opacity: 1;
background-color: rgb(147 51 234 / var(--tw-bg-opacity));
Expand Down Expand Up @@ -2744,6 +2749,10 @@ html {
display: none;
}

.sm\:w-10 {
width: 2.5rem;
}

.sm\:w-24 {
width: 6rem;
}
Expand Down Expand Up @@ -3008,10 +3017,22 @@ html {
grid-column: span 2 / span 2;
}

.lg\:block {
display: block;
}

.lg\:hidden {
display: none;
}

.lg\:w-32 {
width: 8rem;
}

.lg\:w-36 {
width: 9rem;
}

.lg\:w-48 {
width: 12rem;
}
Expand Down
Loading