mirror of
https://github.com/podman-desktop/podman-desktop
synced 2026-05-24 10:18:53 +00:00
Signed-off-by: lstocchi <lstocchi@redhat.com>
This commit is contained in:
parent
e884bc8964
commit
880a8b7b2a
2 changed files with 18 additions and 7 deletions
|
|
@ -1,6 +1,5 @@
|
|||
<script lang="ts">
|
||||
import type { ContainerInfoUI } from './container/ContainerInfoUI';
|
||||
import { router } from 'tinro';
|
||||
import { onDestroy, onMount } from 'svelte';
|
||||
import { Terminal } from 'xterm';
|
||||
import { FitAddon } from 'xterm-addon-fit';
|
||||
|
|
@ -16,7 +15,7 @@ export let container: ContainerInfoUI;
|
|||
|
||||
// Log
|
||||
let logsXtermDiv: HTMLDivElement;
|
||||
let logsContainer;
|
||||
let refContainer;
|
||||
// logs has been initialized
|
||||
let noLogs = true;
|
||||
|
||||
|
|
@ -24,12 +23,16 @@ let noLogs = true;
|
|||
let resizeObserver: ResizeObserver;
|
||||
let termFit: FitAddon;
|
||||
|
||||
// need to refresh logs when container is switched
|
||||
// need to refresh logs when container is switched or state changes
|
||||
$: {
|
||||
if (logsContainer?.id !== container.id || logsContainer?.state != container.state) {
|
||||
if (
|
||||
refContainer &&
|
||||
(refContainer.id !== container.id || (refContainer.state != container.state && container.state !== 'EXITED'))
|
||||
) {
|
||||
logsTerminal?.clear();
|
||||
fetchContainerLogs();
|
||||
}
|
||||
logsContainer = container;
|
||||
refContainer = container;
|
||||
}
|
||||
|
||||
let currentRouterPath: string;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
<script lang="ts">
|
||||
import { router } from 'tinro';
|
||||
import { onDestroy, onMount } from 'svelte';
|
||||
import { Terminal } from 'xterm';
|
||||
import { FitAddon } from 'xterm-addon-fit';
|
||||
|
|
@ -15,11 +14,20 @@ export let pod: PodInfoUI;
|
|||
|
||||
// Log
|
||||
let logsXtermDiv: HTMLDivElement;
|
||||
|
||||
let refPod;
|
||||
// Logs has been initialized
|
||||
let noLogs = true;
|
||||
let logsTerminal: Terminal;
|
||||
|
||||
// need to refresh logs when pod is switched or state changes
|
||||
$: {
|
||||
if (refPod && (refPod.id !== pod.id || (refPod.status != pod.status && pod.status !== 'EXITED'))) {
|
||||
logsTerminal?.clear();
|
||||
fetchPodLogs();
|
||||
}
|
||||
refPod = pod;
|
||||
}
|
||||
|
||||
// Terminal resize
|
||||
let resizeObserver: ResizeObserver;
|
||||
let termFit: FitAddon;
|
||||
|
|
|
|||
Loading…
Reference in a new issue