mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-10 01:33:54 +01:00
UI: Move pagination to top of active scripts, improve filtering (#494)
This commit is contained in:
parent
bc7482b0a2
commit
1ea555f572
@ -25,11 +25,6 @@ export function ServerAccordionContent(props: IProps): React.ReactElement {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<List dense disablePadding>
|
|
||||||
{props.workerScripts.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((ws) => (
|
|
||||||
<WorkerScriptAccordion key={`${ws.pid}`} workerScript={ws} />
|
|
||||||
))}
|
|
||||||
</List>
|
|
||||||
<TablePagination
|
<TablePagination
|
||||||
rowsPerPageOptions={[10, 15, 20, 100]}
|
rowsPerPageOptions={[10, 15, 20, 100]}
|
||||||
component="div"
|
component="div"
|
||||||
@ -40,6 +35,11 @@ export function ServerAccordionContent(props: IProps): React.ReactElement {
|
|||||||
onRowsPerPageChange={handleChangeRowsPerPage}
|
onRowsPerPageChange={handleChangeRowsPerPage}
|
||||||
ActionsComponent={TablePaginationActionsAll}
|
ActionsComponent={TablePaginationActionsAll}
|
||||||
/>
|
/>
|
||||||
|
<List dense disablePadding>
|
||||||
|
{props.workerScripts.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((ws) => (
|
||||||
|
<WorkerScriptAccordion key={`${ws.pid}`} workerScript={ws} />
|
||||||
|
))}
|
||||||
|
</List>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,12 @@ export function ServerAccordions(props: IProps): React.ReactElement {
|
|||||||
};
|
};
|
||||||
data = serverToScriptMap[server.hostname];
|
data = serverToScriptMap[server.hostname];
|
||||||
}
|
}
|
||||||
if (data !== undefined) data.workerScripts.push(ws);
|
if (data !== undefined) {
|
||||||
|
// Add only scripts that correspond to the filter
|
||||||
|
if (ws.hostname.includes(filter) || ws.name.includes(filter)) {
|
||||||
|
data.workerScripts.push(ws);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Match filter in the scriptname part of the key
|
// Match filter in the scriptname part of the key
|
||||||
@ -92,15 +97,6 @@ export function ServerAccordions(props: IProps): React.ReactElement {
|
|||||||
spellCheck: false,
|
spellCheck: false,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<List dense={true}>
|
|
||||||
{filtered.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((data) => {
|
|
||||||
return (
|
|
||||||
data && (
|
|
||||||
<ServerAccordion key={data.server.hostname} server={data.server} workerScripts={data.workerScripts} />
|
|
||||||
)
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</List>
|
|
||||||
<TablePagination
|
<TablePagination
|
||||||
rowsPerPageOptions={[10, 15, 20, 100]}
|
rowsPerPageOptions={[10, 15, 20, 100]}
|
||||||
component="div"
|
component="div"
|
||||||
@ -111,6 +107,15 @@ export function ServerAccordions(props: IProps): React.ReactElement {
|
|||||||
onRowsPerPageChange={handleChangeRowsPerPage}
|
onRowsPerPageChange={handleChangeRowsPerPage}
|
||||||
ActionsComponent={TablePaginationActionsAll}
|
ActionsComponent={TablePaginationActionsAll}
|
||||||
/>
|
/>
|
||||||
|
<List dense={true}>
|
||||||
|
{filtered.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((data) => {
|
||||||
|
return (
|
||||||
|
data && (
|
||||||
|
<ServerAccordion key={data.server.hostname} server={data.server} workerScripts={data.workerScripts} />
|
||||||
|
)
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</List>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user