mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-20 05:05:47 +01:00
Improve pagination for Active Scripts page (#763)
This commit is contained in:
parent
7c82221a13
commit
ae87851889
@ -25,6 +25,7 @@ export function ServerAccordionContent(props: IProps): React.ReactElement {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
{props.workerScripts.length > 10 ? (
|
||||||
<TablePagination
|
<TablePagination
|
||||||
rowsPerPageOptions={[10, 15, 20, 100]}
|
rowsPerPageOptions={[10, 15, 20, 100]}
|
||||||
component="div"
|
component="div"
|
||||||
@ -35,6 +36,9 @@ export function ServerAccordionContent(props: IProps): React.ReactElement {
|
|||||||
onRowsPerPageChange={handleChangeRowsPerPage}
|
onRowsPerPageChange={handleChangeRowsPerPage}
|
||||||
ActionsComponent={TablePaginationActionsAll}
|
ActionsComponent={TablePaginationActionsAll}
|
||||||
/>
|
/>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
<List dense disablePadding>
|
<List dense disablePadding>
|
||||||
{props.workerScripts.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((ws) => (
|
{props.workerScripts.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((ws) => (
|
||||||
<WorkerScriptAccordion key={`${ws.pid}`} workerScript={ws} />
|
<WorkerScriptAccordion key={`${ws.pid}`} workerScript={ws} />
|
||||||
|
@ -9,6 +9,7 @@ import { ServerAccordion } from "./ServerAccordion";
|
|||||||
import TextField from "@mui/material/TextField";
|
import TextField from "@mui/material/TextField";
|
||||||
import List from "@mui/material/List";
|
import List from "@mui/material/List";
|
||||||
import TablePagination from "@mui/material/TablePagination";
|
import TablePagination from "@mui/material/TablePagination";
|
||||||
|
import Grid from "@mui/material/Grid";
|
||||||
import { WorkerScript } from "../../Netscript/WorkerScript";
|
import { WorkerScript } from "../../Netscript/WorkerScript";
|
||||||
import { GetServer } from "../../Server/AllServers";
|
import { GetServer } from "../../Server/AllServers";
|
||||||
import { BaseServer } from "../../Server/BaseServer";
|
import { BaseServer } from "../../Server/BaseServer";
|
||||||
@ -88,6 +89,8 @@ export function ServerAccordions(props: IProps): React.ReactElement {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<Grid container>
|
||||||
|
<Grid item xs={4}>
|
||||||
<TextField
|
<TextField
|
||||||
value={filter}
|
value={filter}
|
||||||
onChange={handleFilterChange}
|
onChange={handleFilterChange}
|
||||||
@ -96,7 +99,13 @@ export function ServerAccordions(props: IProps): React.ReactElement {
|
|||||||
startAdornment: <SearchIcon />,
|
startAdornment: <SearchIcon />,
|
||||||
spellCheck: false,
|
spellCheck: false,
|
||||||
}}
|
}}
|
||||||
|
style={{
|
||||||
|
paddingTop: "8px",
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={8}>
|
||||||
|
{filtered.length > 10 ? (
|
||||||
<TablePagination
|
<TablePagination
|
||||||
rowsPerPageOptions={[10, 15, 20, 100]}
|
rowsPerPageOptions={[10, 15, 20, 100]}
|
||||||
component="div"
|
component="div"
|
||||||
@ -107,6 +116,11 @@ export function ServerAccordions(props: IProps): React.ReactElement {
|
|||||||
onRowsPerPageChange={handleChangeRowsPerPage}
|
onRowsPerPageChange={handleChangeRowsPerPage}
|
||||||
ActionsComponent={TablePaginationActionsAll}
|
ActionsComponent={TablePaginationActionsAll}
|
||||||
/>
|
/>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
<List dense={true}>
|
<List dense={true}>
|
||||||
{filtered.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((data) => {
|
{filtered.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((data) => {
|
||||||
return (
|
return (
|
||||||
|
Loading…
Reference in New Issue
Block a user