mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Moving Configs to SettingsPage.
This commit is contained in:
parent
4d1f6dc20e
commit
d4fc3d1c07
6 changed files with 375 additions and 399 deletions
|
|
@ -66,7 +66,7 @@ function ConfigTableRow({config, importConfig, saveConfig, fetchConfigs}) {
|
|||
</TableRow>
|
||||
}
|
||||
|
||||
function ConfigsTable({configs, loading, importConfig, saveConfig, fetchConfigs}) {
|
||||
export function ConfigsTable({configs, loading, importConfig, saveConfig, fetchConfigs}) {
|
||||
let body = <TableRow>
|
||||
<TableCell colSpan={4}><TableRowPlaceholder/></TableCell>
|
||||
</TableRow>
|
||||
|
|
@ -109,40 +109,3 @@ function ConfigsTable({configs, loading, importConfig, saveConfig, fetchConfigs}
|
|||
</TableBody>
|
||||
</Table>
|
||||
}
|
||||
|
||||
export function ConfigsPage() {
|
||||
const {configs, loading, importConfig, saveConfig, fetchConfigs} = useConfigs();
|
||||
|
||||
React.useEffect(() => {
|
||||
fetchConfigs();
|
||||
}, []);
|
||||
|
||||
const refreshButton = <APIButton
|
||||
icon='refresh'
|
||||
onClick={fetchConfigs}
|
||||
/>;
|
||||
const refreshPopupButton = <Popup
|
||||
content='Check if configs are valid'
|
||||
on='hover'
|
||||
trigger={refreshButton}
|
||||
/>;
|
||||
|
||||
return <PageContainer>
|
||||
<Grid columns={2}>
|
||||
<GridRow>
|
||||
<GridColumn>
|
||||
<Header as='h1'>Configs</Header>
|
||||
</GridColumn>
|
||||
<GridColumn textAlign='right'>{refreshPopupButton}</GridColumn>
|
||||
</GridRow>
|
||||
</Grid>
|
||||
|
||||
<ConfigsTable
|
||||
configs={configs}
|
||||
loading={loading}
|
||||
importConfig={importConfig}
|
||||
saveConfig={saveConfig}
|
||||
fetchConfigs={fetchConfigs}
|
||||
/>
|
||||
</PageContainer>
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue