This commit is contained in:
2026-03-14 11:38:37 +01:00
parent f0cfd197a2
commit 40f2577a8a
36 changed files with 38 additions and 23 deletions
@@ -18,7 +18,7 @@ export default function ServiceClusterServerLogSelectorSelectLog({
setLog,
log,
}: Props) {
const logs = service.logs;
let logs = service.logs;
const log_strings = logs?.map((l) => (typeof l == "string" ? l : l.cmd));
const is_custom_log =
@@ -33,11 +33,26 @@ export default function ServiceClusterServer({
const elementRef = useRef<HTMLDivElement>(undefined);
const { isIntersecting } = useIntersectionObserver({ elementRef });
let service_logs = service.logs;
if (service.type == "load_balancer") {
if (!service_logs?.[0]) {
service_logs = [];
}
service_logs.push(
...[
`tail -f /var/log/nginx/access.log`,
`tail -f /var/log/nginx/error.log`,
],
);
}
const [target, setTarget] = useState<
(typeof ServerTerminalTargets)[number]["name"]
>(service.logs?.[0] ? "logs" : "shell");
>(service_logs?.[0] ? "logs" : "shell");
const first_log = service.logs?.[0];
const first_log = service_logs?.[0];
const intial_logs =
typeof first_log == "string" ? first_log : first_log?.cmd;