From ae878518894d344d1c102ff144ad2a1a9c9a1de6 Mon Sep 17 00:00:00 2001 From: Michael Ficocelli Date: Thu, 31 Aug 2023 20:31:48 -0400 Subject: [PATCH] Improve pagination for Active Scripts page (#763) --- .../ActiveScripts/ServerAccordionContent.tsx | 24 +++++---- src/ui/ActiveScripts/ServerAccordions.tsx | 52 ++++++++++++------- 2 files changed, 47 insertions(+), 29 deletions(-) diff --git a/src/ui/ActiveScripts/ServerAccordionContent.tsx b/src/ui/ActiveScripts/ServerAccordionContent.tsx index fc1508dcc..df167dedb 100644 --- a/src/ui/ActiveScripts/ServerAccordionContent.tsx +++ b/src/ui/ActiveScripts/ServerAccordionContent.tsx @@ -25,16 +25,20 @@ export function ServerAccordionContent(props: IProps): React.ReactElement { return ( <> - + {props.workerScripts.length > 10 ? ( + + ) : ( + "" + )} {props.workerScripts.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((ws) => ( diff --git a/src/ui/ActiveScripts/ServerAccordions.tsx b/src/ui/ActiveScripts/ServerAccordions.tsx index 25f030c6d..e06de5147 100644 --- a/src/ui/ActiveScripts/ServerAccordions.tsx +++ b/src/ui/ActiveScripts/ServerAccordions.tsx @@ -9,6 +9,7 @@ import { ServerAccordion } from "./ServerAccordion"; import TextField from "@mui/material/TextField"; import List from "@mui/material/List"; import TablePagination from "@mui/material/TablePagination"; +import Grid from "@mui/material/Grid"; import { WorkerScript } from "../../Netscript/WorkerScript"; import { GetServer } from "../../Server/AllServers"; import { BaseServer } from "../../Server/BaseServer"; @@ -88,25 +89,38 @@ export function ServerAccordions(props: IProps): React.ReactElement { return ( <> - , - spellCheck: false, - }} - /> - + + + , + spellCheck: false, + }} + style={{ + paddingTop: "8px", + }} + /> + + + {filtered.length > 10 ? ( + + ) : ( + "" + )} + + {filtered.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((data) => { return (