-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add inspect tab to compose (#3316)
### What does this PR do? * Adds the inspect tab to Compose which is an array of "container inspect" from docker / podman. * Inspect is JSON array of containers, see docker/compose#4155 for inspiration (they don't actually have a `compose inspect` command..) * Adds tests ### Screenshot/screencast of this PR <!-- Please include a screenshot or a screencast explaining what is doing this PR --> ### What issues does this PR fix or reference? <!-- Please include any related issue from Podman Desktop repository (or from another issue tracker). --> Closes #3192 ### How to test this PR? 1. Deploy a compose example 2. Click on the compose group 3. Select the inspect tab <!-- Please explain steps to reproduce --> Signed-off-by: Charlie Drage <charlie@charliedrage.com>
- Loading branch information
Showing
4 changed files
with
203 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
packages/renderer/src/lib/compose/ComposeDetailsInspect.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<script lang="ts"> | ||
import type { ComposeInfoUI } from './ComposeInfoUI'; | ||
import { onMount } from 'svelte'; | ||
import MonacoEditor from '../editor/MonacoEditor.svelte'; | ||
export let compose: ComposeInfoUI; | ||
let inspectDetails: string; | ||
onMount(async () => { | ||
// Go through each container and grab the inspect result, add it to inspectDetails / stringify | ||
const mappedResults = await Promise.all( | ||
compose.containers.map(async container => { | ||
const inspectResult = await window.getContainerInspect(container.engineId, container.id); | ||
// remove engine* properties from the inspect result as it's more internal | ||
delete inspectResult.engineId; | ||
delete inspectResult.engineName; | ||
return inspectResult; | ||
}), | ||
); | ||
// stringify the results | ||
inspectDetails = JSON.stringify(mappedResults, undefined, 2); | ||
}); | ||
</script> | ||
|
||
{#if inspectDetails} | ||
<MonacoEditor content="{inspectDetails}" language="json" /> | ||
{/if} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters