Conversation
|
Thanks for the PR. I'm very busy right now and don't have time for a proper UI review right now. I'll try to do this later this week. Can you rebase this branch on latest |
Add a new Info tab as the default (leftmost) tab on the container info page. It calls `docker inspect` via ddClient and displays a summary table (name, short ID, image, status, IP, timestamps) plus collapsible sections for mounts, environment, command/args, capabilities, ports and labels. Also adds a matching e2e page object and test suite, and marks Container Exploration as released in the feature tracker. Signed-off-by: Gildas Le Nadan <3ntr0p13+github@gmail.com>
|
@jandubois should be done now. No worries, take your time! |
- Reorder v-if/v-else-if/v-else so error/unknown state is the final
fallback; use `{{ error || 'An unknown error has occurred' }}`
- Wrap Name and Image summary fields in <code> for consistent styling
- Replace .section-summary class with nested > summary selector in
.inspect-section, removing the redundant class from all <summary>
elements
- Move ContainerInspectData fetch into the container-engine store:
export ContainerMount/ContainerInspectData interfaces, add
inspectData state, SET_INSPECT_DATA mutation, and
fetchContainerInspect action; clear inspectData on backend/namespace
change; component now dispatches the action and reads data from store
- Simplify e2e nav helper usage (navPage.navigateTo returns the page)
Signed-off-by: Gildas Le Nadan <3ntr0p13+github@gmail.com>
- Change SET_INSPECT_DATA payload to Record<string, ContainerInspectData> to satisfy MutationsType<ContainersState> constraint - Pass namespace as --namespace=<ns> CLI arg instead of ExecOptions property, consistent with the rest of the codebase - Guard against null client before calling exec Signed-off-by: Gildas Le Nadan <3ntr0p13+github@gmail.com>
mook-as
left a comment
There was a problem hiding this comment.
Looks basically fine; just needs some trivial fixes. Please feel free to push back on any comments you don't agree with; nothing here seems that important.
| type ValidContainerEngine = Exclude<ContainerEngine, ContainerEngine.NONE>; | ||
| type SubscriberType = 'containers' | 'volumes'; | ||
| type ErrorSource = 'containers' | 'volumes' | 'namespaces'; | ||
| type ErrorSource = 'containers' | 'volumes' | 'namespaces' | 'inspect'; |
There was a problem hiding this comment.
I think we should still use containers for the error, since inspect is about containers.
| const result = await client.docker.cli.exec('inspect', args); | ||
| const parsed = result.parseJsonObject() as ContainerInspectData[]; | ||
|
|
||
| commit('SET_INSPECT_DATA', { ...state.inspectData, [containerId]: parsed[0] }); |
There was a problem hiding this comment.
I guess if the container is not found (it's deleted before it manages to run), the result is undefined, which is fine because the view handles it.
Also, this means that we'll accumulate data over time, since nothing ever removes values. That might need to be fixed.
| watch(containerId, () => { | ||
| activeTab.value = 'tab-info'; | ||
| shellEverActivated.value = false; | ||
| }); | ||
|
|
There was a problem hiding this comment.
Why are we automatically switching tabs on container id change again? But then, I guess the container id should be static while the page is up, so it doesn't matter…
| subscriber: Subscriber | null; | ||
| containers: Record<string, Container> | null; | ||
| volumes: Record<string, Volume> | null; | ||
| inspectData: Record<string, ContainerInspectData>; |
There was a problem hiding this comment.
| inspectData: Record<string, ContainerInspectData>; | |
| inspectData: Record<string, ContainerInspectData | undefined>; |
Because of the case where the container might be missing on inspect.
| onMounted(fetchInspect); | ||
| watch(() => props.containerId, fetchInspect); |
There was a problem hiding this comment.
I think this can be done as an eager watch?
| onMounted(fetchInspect); | |
| watch(() => props.containerId, fetchInspect); | |
| watch(() => props.containerId, fetchInspect, { immediate: true }); |
| const result = await client.docker.cli.exec('inspect', args); | ||
| const parsed = result.parseJsonObject() as ContainerInspectData[]; | ||
|
|
||
| commit('SET_INSPECT_DATA', { ...state.inspectData, [containerId]: parsed[0] }); |
There was a problem hiding this comment.
So, I don't understand why we can now assert that .NetworkSettings is always non-null here. Of course, the documentation really doesn't say either way…
| const data = computed<ContainerInspectData | undefined>( | ||
| () => store.state['container-engine'].inspectData[props.containerId], | ||
| ); | ||
| const loading = ref(false); |
There was a problem hiding this comment.
Should this be initially true? Theoretically, this defaulting to false means it shows an error (because data isn't loaded), then it shows the loading screen. In practice, of course, that's unlikely to be an issue because fetchInspect should run fast enough…

This is an implementation proposition for #9986
It provides the base features