fix(docker): fix logs page font size, sidebar active state, and breadcrumb translations
- Set fontSize: 14 on both docker and server logs terminals for consistency - Use startsWith for nav link active state so docker sub-pages highlight Docker - Add missing navigationStructure.manage.tools.docker.logs translation key - Pass dynamicMappings for containerId in breadcrumb to show container name
This commit is contained in:
5 files changed
+13
-11
No files matched your search
@@ -1,10 +1,9 @@
|
|||||||
import { notFound } from "next/navigation";
|
import { notFound } from "next/navigation";
|
||||||
import { Box, Group, Title } from "@mantine/core";
|
import { Box, Group } from "@mantine/core";
|
||||||
|
|
||||||
import { api } from "@homarr/api/server";
|
import { api } from "@homarr/api/server";
|
||||||
import { auth } from "@homarr/auth/next";
|
import { auth } from "@homarr/auth/next";
|
||||||
import { env } from "@homarr/docker/env";
|
import { env } from "@homarr/docker/env";
|
||||||
import { getScopedI18n } from "@homarr/translation/server";
|
|
||||||
|
|
||||||
import "@xterm/xterm/css/xterm.css";
|
import "@xterm/xterm/css/xterm.css";
|
||||||
|
|
||||||
@@ -32,16 +31,14 @@ export default async function DockerContainerLogsPage({ params, searchParams }:
|
|||||||
notFound();
|
notFound();
|
||||||
}
|
}
|
||||||
|
|
||||||
const tDocker = await getScopedI18n("docker");
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Group justify="space-between" align="center" wrap="nowrap">
|
<Group justify="space-between" align="center" wrap="nowrap">
|
||||||
<DynamicBreadcrumb />
|
<DynamicBreadcrumb
|
||||||
|
dynamicMappings={new Map([[containerId, name ?? containerId]])}
|
||||||
|
nonInteractable={[containerId]}
|
||||||
|
/>
|
||||||
</Group>
|
</Group>
|
||||||
<Title order={2} mb="md">
|
|
||||||
{tDocker("action.logs.page.title", { name: name ?? containerId })}
|
|
||||||
</Title>
|
|
||||||
<Box style={{ borderRadius: 6 }} h={fullHeightWithoutHeaderAndFooter} p="md" bg="black">
|
<Box style={{ borderRadius: 6 }} h={fullHeightWithoutHeaderAndFooter} p="md" bg="black">
|
||||||
<ClientSideDockerLogsTerminal containerId={containerId} />
|
<ClientSideDockerLogsTerminal containerId={containerId} />
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ export const DockerLogsTerminal = ({ containerId }: DockerLogsTerminalProps) =>
|
|||||||
cursorBlink: false,
|
cursorBlink: false,
|
||||||
disableStdin: true,
|
disableStdin: true,
|
||||||
convertEol: true,
|
convertEol: true,
|
||||||
|
fontSize: 14,
|
||||||
});
|
});
|
||||||
terminalRef.current.open(ref.current);
|
terminalRef.current.open(ref.current);
|
||||||
terminalRef.current.loadAddon(canvasAddon);
|
terminalRef.current.loadAddon(canvasAddon);
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ export const TerminalComponent = () => {
|
|||||||
cursorBlink: false,
|
cursorBlink: false,
|
||||||
disableStdin: true,
|
disableStdin: true,
|
||||||
convertEol: true,
|
convertEol: true,
|
||||||
|
fontSize: 14,
|
||||||
});
|
});
|
||||||
terminalRef.current.open(ref.current);
|
terminalRef.current.open(ref.current);
|
||||||
terminalRef.current.loadAddon(canvasAddon);
|
terminalRef.current.loadAddon(canvasAddon);
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ const NavLinkHref = (props: NavigationLinkHref) => {
|
|||||||
label={props.label}
|
label={props.label}
|
||||||
leftSection={props.icon}
|
leftSection={props.icon}
|
||||||
href={props.href}
|
href={props.href}
|
||||||
active={pathname === props.href}
|
active={pathname === props.href || pathname.startsWith(`${props.href}/`)}
|
||||||
style={{
|
style={{
|
||||||
borderRadius: 5,
|
borderRadius: 5,
|
||||||
}}
|
}}
|
||||||
@@ -38,7 +38,7 @@ const NavLinkHref = (props: NavigationLinkHref) => {
|
|||||||
|
|
||||||
const NavLinkWithItems = (props: NavigationLinkWithItems) => {
|
const NavLinkWithItems = (props: NavigationLinkWithItems) => {
|
||||||
const pathname = usePathname();
|
const pathname = usePathname();
|
||||||
const isActive = props.items.some((item) => item.href === pathname);
|
const isActive = props.items.some((item) => pathname === item.href || pathname.startsWith(`${item.href}/`));
|
||||||
return (
|
return (
|
||||||
<NavLink
|
<NavLink
|
||||||
style={{
|
style={{
|
||||||
|
|||||||
@@ -4395,7 +4395,10 @@
|
|||||||
"label": "Tasks"
|
"label": "Tasks"
|
||||||
},
|
},
|
||||||
"docker": {
|
"docker": {
|
||||||
"label": "Docker"
|
"label": "Docker",
|
||||||
|
"logs": {
|
||||||
|
"label": "Logs"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"kubernetes": {
|
"kubernetes": {
|
||||||
"label": "Kubernetes",
|
"label": "Kubernetes",
|
||||||
|
|||||||
Reference in new issue
Block a user