feature: the VPN, the router, the name server and WebDAV are components switched on the System tab and installed on demand, Caddy from the Ubuntu archive is a dependency and serves every HTTP and HTTPS port, HTTPS is chosen at install, its certificate is of the Servers Issuing CA or self-signed by default, of ACME or of another CA, the issuing CAs are in one tab, a locked account is unlocked again, the name of a CA is fixed once the CA exists, and a run of setup is no longer cut short by a change.
Release / release (push) Failing after 8s
Release / release (push) Failing after 8s
This commit is contained in:
1 parent
a649331aa2
commit
a7bfabcb89
97 files changed
+4498
-1834
No files matched your search
+37
-25
@@ -1,10 +1,14 @@
|
||||
import Refresh from '@mui/icons-material/Refresh'
|
||||
import { Alert, Box, Button, Typography } from '@mui/material'
|
||||
import { Pairs, Section, text } from './ServerPanel.tsx'
|
||||
import { Board, BoardButtons, useBoard, type BoardPanel } from './PanelBoard.tsx'
|
||||
import { Pairs, text } from './ServerPanel.tsx'
|
||||
import Toolbar from './Toolbar.tsx'
|
||||
import { DETAILS_SHAPE, STATUS_SHAPE, request, type RouterDetails, type RouterStatus } from './api.ts'
|
||||
import { useRead } from './useRead.ts'
|
||||
|
||||
/** The localStorage key of the tab's layout. */
|
||||
const LAYOUT_KEY = 'linux-manager-ui.docker-layout'
|
||||
|
||||
/** Reads the server's /status/full and /config. */
|
||||
const readDocker = async () => {
|
||||
const [status, details] = await Promise.all([
|
||||
@@ -17,42 +21,50 @@ const readDocker = async () => {
|
||||
/**
|
||||
* The state of Docker on the server: whether it is installed, the state of docker.service and of the server's Docker
|
||||
* rules, from /status/full, and the ports exposed on the external interface and the rules of the LINUX-MANAGER-DOCKER
|
||||
* chain, from /config.
|
||||
* chain, from /config. The panels are on a PanelBoard whose layout is kept in the browser.
|
||||
*/
|
||||
export default function DockerPanel() {
|
||||
const { data, error, busy, refresh } = useRead(readDocker)
|
||||
const status = data?.status
|
||||
const details = data?.details
|
||||
const docker = status?.docker
|
||||
const board = useBoard(LAYOUT_KEY)
|
||||
const panels: BoardPanel[] = status && details ? [
|
||||
{
|
||||
id: 'status',
|
||||
title: 'Status',
|
||||
fixed: true,
|
||||
content: (
|
||||
<Pairs
|
||||
rows={[
|
||||
['Docker', docker === undefined ? 'unknown' : docker.installed ? 'installed' : 'not installed'],
|
||||
['docker.service', text(docker?.service)],
|
||||
['Docker rules', text(docker?.rules)],
|
||||
['Exposed ports', text(details.docker.exposed_ports)],
|
||||
]}
|
||||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
id: 'rules',
|
||||
title: 'Rules of LINUX-MANAGER-DOCKER',
|
||||
content: details.docker.rules === null
|
||||
? <Typography variant="body2" color="text.secondary">Not available.</Typography>
|
||||
: (
|
||||
<Box component="pre" sx={{ m: 0, overflow: 'auto', fontFamily: 'monospace', fontSize: 12 }}>
|
||||
{details.docker.rules.length === 0 ? '(none)' : details.docker.rules.join('\n')}
|
||||
</Box>
|
||||
),
|
||||
},
|
||||
] : []
|
||||
return (
|
||||
<Box component="section">
|
||||
<Toolbar description="Docker and its firewall rules.">
|
||||
<BoardButtons board={board} />
|
||||
<Button variant="outlined" startIcon={<Refresh />} disabled={busy} onClick={() => void refresh()}>Refresh</Button>
|
||||
</Toolbar>
|
||||
{error && <Alert severity="error" sx={{ mb: 2, whiteSpace: 'pre-line' }}>{error}</Alert>}
|
||||
{status && details && (
|
||||
<Box sx={{ display: 'grid', gap: 2, gridTemplateColumns: { xs: '1fr', md: '1fr 1fr' } }}>
|
||||
<Section title="Status">
|
||||
<Pairs
|
||||
rows={[
|
||||
['Docker', docker === undefined ? 'unknown' : docker.installed ? 'installed' : 'not installed'],
|
||||
['docker.service', text(docker?.service)],
|
||||
['Docker rules', text(docker?.rules)],
|
||||
['Exposed ports', text(details.docker.exposed_ports)],
|
||||
]}
|
||||
/>
|
||||
</Section>
|
||||
<Section title="Rules of LINUX-MANAGER-DOCKER">
|
||||
{details.docker.rules === null
|
||||
? <Typography variant="body2" color="text.secondary">Not available.</Typography>
|
||||
: (
|
||||
<Box component="pre" sx={{ m: 0, overflow: 'auto', fontFamily: 'monospace', fontSize: 12 }}>
|
||||
{details.docker.rules.length === 0 ? '(none)' : details.docker.rules.join('\n')}
|
||||
</Box>
|
||||
)}
|
||||
</Section>
|
||||
</Box>
|
||||
)}
|
||||
<Board board={board} panels={panels} />
|
||||
</Box>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user