fix: the root CA is created by the server, an offline CA or a Simple CA service, chosen at setup; the shell can stay open in a tab of its own, the Docker page is offered only with Docker, and the test scripts are in bin/.
Release / release (push) Failing after 14m20s
Release / release (push) Failing after 14m20s
This commit is contained in:
1 parent
ff0c93ed73
commit
a649331aa2
49 files changed
+1597
-637
No files matched your search
+17
-6
@@ -20,6 +20,7 @@ import RemoteAccessPanel from './RemoteAccessPanel.tsx'
|
||||
import ServerPanel from './ServerPanel.tsx'
|
||||
import ServiceAccountsPanel from './ServiceAccountsPanel.tsx'
|
||||
import SettingsButton from './SettingsButton.tsx'
|
||||
import { useBrowserSettings } from './settings.ts'
|
||||
import ShellPanel from './ShellPanel.tsx'
|
||||
import SignIn from './SignIn.tsx'
|
||||
import SystemPanel from './SystemPanel.tsx'
|
||||
@@ -71,7 +72,8 @@ const HELP_KEY = 'linux-manager-ui.help'
|
||||
* the Status panel, its metrics, its logs, its backups or the updates of its system's packages. A page shows one tab at a time, each read only while shown. An
|
||||
* administrator switches pages with the page menu at the right end of the header; the button with the user's name,
|
||||
* left of Sign out, opens the user's own account, and an administrator's shell button, left of it, the shell; pressed
|
||||
* on their page, each returns to the page it was opened from. While files are open in the shell's editor, the editor
|
||||
* on their page, each returns to the page it was opened from; with the browser setting shellNewTab the shell button opens
|
||||
* the shell in a new tab instead. While files are open in the shell's editor, the editor
|
||||
* button left of the shell button switches the Shell page between the terminal and the editor. The help button, between the theme switcher and the page menu, opens or closes the help on
|
||||
* the right (HelpPanel) at the topic of the page and tab shown (HELP_TOPICS), the page moving left; the browser keeps
|
||||
* whether it is open. A call answered 401 ends the session and asks for a sign-in again.
|
||||
@@ -85,16 +87,19 @@ export default function App(props: { info: Info }) {
|
||||
const [filesSite, setFilesSite] = useState<string | null>(null)
|
||||
const [session, setSession] = useState<Session | null | undefined>(undefined)
|
||||
const [role, setRole] = useState<{ name: string; admin: boolean } | null>(null)
|
||||
// The router and the VPN components as router.enabled and vpn.enabled of /config; null while not known, when every page shows.
|
||||
const [components, setComponents] = useState<{ router: boolean; vpn: boolean } | null>(null)
|
||||
// The router and the VPN components as router.enabled and vpn.enabled of /config, and whether Docker is installed;
|
||||
// null while not known, when every page shows.
|
||||
const [components, setComponents] = useState<{ router: boolean; vpn: boolean; docker: boolean } | null>(null)
|
||||
const routerOff = components?.router === false
|
||||
const vpnOff = components?.vpn === false
|
||||
const dockerMissing = components?.docker === false
|
||||
const page = PAGE_PATHS.find((path) => path === window.location.pathname) ?? '/'
|
||||
const userPage = page === USER_PATH
|
||||
const admin = session && role?.name === session.name ? role.admin : undefined
|
||||
// The account page is the page of every user who is not an administrator, and of an administrator at USER_PATH.
|
||||
const accountShown = Boolean(session) && admin !== undefined && (userPage || !admin)
|
||||
const [helpOpen, setHelpOpen] = useState(() => window.localStorage.getItem(HELP_KEY) === 'open')
|
||||
const { shellNewTab } = useBrowserSettings()
|
||||
// The files open in the Shell page's editor, and whether the editor is shown in place of the terminal.
|
||||
const [editorFiles, setEditorFiles] = useState(0)
|
||||
const [editorShown, setEditorShown] = useState(false)
|
||||
@@ -142,6 +147,7 @@ export default function App(props: { info: Info }) {
|
||||
.then((details) => setComponents({
|
||||
router: details.configuration.router?.enabled === true,
|
||||
vpn: details.configuration.vpn?.enabled === true,
|
||||
docker: details.docker.installed,
|
||||
}))
|
||||
.catch(() => setComponents(null))
|
||||
}, [admin])
|
||||
@@ -208,7 +214,7 @@ export default function App(props: { info: Info }) {
|
||||
<IconButton
|
||||
aria-label="shell"
|
||||
color={page === SHELL_PATH ? 'primary' : 'default'}
|
||||
onClick={() => toggle(SHELL_PATH)}
|
||||
onClick={() => (shellNewTab && page !== SHELL_PATH ? window.open(SHELL_PATH, '_blank') : toggle(SHELL_PATH))}
|
||||
sx={page === SHELL_PATH ? { bgcolor: 'action.selected' } : undefined}
|
||||
>
|
||||
<Terminal />
|
||||
@@ -237,7 +243,9 @@ export default function App(props: { info: Info }) {
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
)}
|
||||
{session && admin && <PageMenu path={page} hidden={vpnOff ? [REMOTE_ACCESS_PATH] : []} />}
|
||||
{session && admin && (
|
||||
<PageMenu path={page} hidden={[...(vpnOff ? [REMOTE_ACCESS_PATH] : []), ...(dockerMissing ? [DOCKER_PATH] : [])]} />
|
||||
)}
|
||||
</Stack>
|
||||
</Stack>
|
||||
{session === undefined && <CircularProgress />}
|
||||
@@ -269,7 +277,10 @@ export default function App(props: { info: Info }) {
|
||||
{sitesView === 'dns' && <DnsPanel />}
|
||||
</>
|
||||
)}
|
||||
{session && admin && page === DOCKER_PATH && (
|
||||
{session && admin && page === DOCKER_PATH && dockerMissing && (
|
||||
<Typography color="text.secondary">Docker is not installed on this server.</Typography>
|
||||
)}
|
||||
{session && admin && page === DOCKER_PATH && !dockerMissing && (
|
||||
<>
|
||||
<Typography variant="h6" component="h2" sx={{ mb: 2 }}>Docker</Typography>
|
||||
<DockerPanel />
|
||||
|
||||
Reference in new issue
Block a user