This is an automated email from the ASF dual-hosted git repository. marat pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-karavan.git
The following commit(s) were added to refs/heads/main by this push: new 77cae5db Trace tab default container 77cae5db is described below commit 77cae5db82875c95d742bdb2dfe64990f0b44aaf Author: Marat Gubaidullin <ma...@talismancloud.io> AuthorDate: Fri Mar 1 15:29:07 2024 -0500 Trace tab default container --- karavan-app/src/main/webui/src/project/trace/TraceTab.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/karavan-app/src/main/webui/src/project/trace/TraceTab.tsx b/karavan-app/src/main/webui/src/project/trace/TraceTab.tsx index b34a5361..a21fc0f4 100644 --- a/karavan-app/src/main/webui/src/project/trace/TraceTab.tsx +++ b/karavan-app/src/main/webui/src/project/trace/TraceTab.tsx @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import React, {useState} from 'react'; +import React, {useEffect, useState} from 'react'; import { Bullseye, Button, @@ -68,6 +68,11 @@ export function TraceTab() { const camelContainers = containers .filter(c => c.projectId === project.projectId && ['devmode', 'project'].includes(c.type)); + + function getContainer() { + return containerName ? containerName : camelContainers.at(0)?.containerName; + } + return ( <PageSection className="project-tab-panel" padding={{default: "padding"}}> <Panel> @@ -85,7 +90,7 @@ export function TraceTab() { {camelContainers.map((containerStatus, index) => <ToggleGroupItem text={containerStatus.containerName} - isSelected={containerName === containerStatus.containerName} + isSelected={getContainer() === containerStatus.containerName} onChange={(_, selected) => { if (selected) { setContainerName(containerStatus.containerName); @@ -116,7 +121,7 @@ export function TraceTab() { </Flex> </PanelHeader> </Panel> - <TraceTable containerName={containerName}/> + <TraceTable containerName={getContainer()}/> </PageSection> ) }