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 { Box, Group, Title } from "@mantine/core";
|
||||
import { Box, Group } from "@mantine/core";
|
||||
|
||||
import { api } from "@homarr/api/server";
|
||||
import { auth } from "@homarr/auth/next";
|
||||
import { env } from "@homarr/docker/env";
|
||||
import { getScopedI18n } from "@homarr/translation/server";
|
||||
|
||||
import "@xterm/xterm/css/xterm.css";
|
||||
|
||||
@@ -32,16 +31,14 @@ export default async function DockerContainerLogsPage({ params, searchParams }:
|
||||
notFound();
|
||||
}
|
||||
|
||||
const tDocker = await getScopedI18n("docker");
|
||||
|
||||
return (
|
||||
<>
|
||||
<Group justify="space-between" align="center" wrap="nowrap">
|
||||
<DynamicBreadcrumb />
|
||||
<DynamicBreadcrumb
|
||||
dynamicMappings={new Map([[containerId, name ?? containerId]])}
|
||||
nonInteractable={[containerId]}
|
||||
/>
|
||||
</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">
|
||||
<ClientSideDockerLogsTerminal containerId={containerId} />
|
||||
</Box>
|
||||
|
||||
@@ -51,6 +51,7 @@ export const DockerLogsTerminal = ({ containerId }: DockerLogsTerminalProps) =>
|
||||
cursorBlink: false,
|
||||
disableStdin: true,
|
||||
convertEol: true,
|
||||
fontSize: 14,
|
||||
});
|
||||
terminalRef.current.open(ref.current);
|
||||
terminalRef.current.loadAddon(canvasAddon);
|
||||
|
||||
@@ -43,6 +43,7 @@ export const TerminalComponent = () => {
|
||||
cursorBlink: false,
|
||||
disableStdin: true,
|
||||
convertEol: true,
|
||||
fontSize: 14,
|
||||
});
|
||||
terminalRef.current.open(ref.current);
|
||||
terminalRef.current.loadAddon(canvasAddon);
|
||||
|
||||
@@ -28,7 +28,7 @@ const NavLinkHref = (props: NavigationLinkHref) => {
|
||||
label={props.label}
|
||||
leftSection={props.icon}
|
||||
href={props.href}
|
||||
active={pathname === props.href}
|
||||
active={pathname === props.href || pathname.startsWith(`${props.href}/`)}
|
||||
style={{
|
||||
borderRadius: 5,
|
||||
}}
|
||||
@@ -38,7 +38,7 @@ const NavLinkHref = (props: NavigationLinkHref) => {
|
||||
|
||||
const NavLinkWithItems = (props: NavigationLinkWithItems) => {
|
||||
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 (
|
||||
<NavLink
|
||||
style={{
|
||||
|
||||
@@ -4395,7 +4395,10 @@
|
||||
"label": "Tasks"
|
||||
},
|
||||
"docker": {
|
||||
"label": "Docker"
|
||||
"label": "Docker",
|
||||
"logs": {
|
||||
"label": "Logs"
|
||||
}
|
||||
},
|
||||
"kubernetes": {
|
||||
"label": "Kubernetes",
|
||||
|
||||
Reference in new issue
Block a user