Updates
This commit is contained in:
+1
-1
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user