This commit is contained in:
2026-08-13 17:35:15 +09:00
parent 99f0451412
commit f29b44da07
3 changed files with 15 additions and 6 deletions
+2 -2
View File
@@ -1237,7 +1237,7 @@ async function collectLocalRosGraph(): Promise<RosGraphSnapshot> {
const names = (await runCommandOutput('docker', ['ps', '--format', '{{.Names}}'], undefined, undefined, 8_000))
.split('\n').map((line) => line.trim()).filter(Boolean)
const containerName = pickRosGraphProbeContainer(names)
if (!containerName) return { topics: [], message: '실행 중인 ROS 컨테이너가 없습니다.' }
if (!containerName) return { topics: [] }
const output = await runCommandOutput('docker', ['exec', containerName, 'bash', '-lc', rosGraphProbeCommand()], undefined, undefined, 12_000)
return parseRosGraphSnapshot(output)
} catch (error) {
@@ -1251,7 +1251,7 @@ async function collectRemoteRosGraph(targetInput: RemoteWorkspaceTarget): Promis
const names = (await runSshOutput(target, 'timeout 8s docker ps --format "{{.Names}}" 2>/dev/null || true', 15_000))
.split('\n').map((line) => line.trim()).filter(Boolean)
const containerName = pickRosGraphProbeContainer(names)
if (!containerName) return { topics: [], message: '실행 중인 ROS 컨테이너가 없습니다.' }
if (!containerName) return { topics: [] }
const output = await runSshOutput(target, `timeout 12s docker exec ${quoteShellSingle(containerName)} bash -lc ${quoteShellSingle(rosGraphProbeCommand())}`, 20_000)
return parseRosGraphSnapshot(output)
} catch (error) {
@@ -133,6 +133,15 @@ function summarizeEndpoints(endpoints: RosEndpoint[]): string {
return endpoints.length === 1 ? truncatedFirstNode : `${truncatedFirstNode} 외 ${endpoints.length - 1}`
}
function uniqueEndpoints(endpoints: RosEndpoint[]): RosEndpoint[] {
const nodes = new Set<string>()
return endpoints.filter((endpoint) => {
if (nodes.has(endpoint.node)) return false
nodes.add(endpoint.node)
return true
})
}
function RuntimeLane({
title,
modules,
@@ -372,8 +381,8 @@ export default function WorkspaceRosConnectionsView({
const fallbackSubscribers = rosModules
.filter((module) => module.subscribers.some((entry) => entry.name === item.name))
.map(({ module }) => ({ node: getModuleNodeName(module), type: item.type }))
const publishers = graphTopic?.publishers ?? fallbackPublishers
const subscribers = graphTopic?.subscribers ?? fallbackSubscribers
const publishers = uniqueEndpoints(graphTopic?.publishers ?? fallbackPublishers)
const subscribers = uniqueEndpoints(graphTopic?.subscribers ?? fallbackSubscribers)
return {
topic: { name: item.name, type: graphTopic?.types[0] ?? item.type },
publishers,
@@ -546,7 +555,7 @@ export default function WorkspaceRosConnectionsView({
</button>
)
}) : (
<div className={['rounded-md border border-dashed px-4 py-10 text-center text-[11px]', dark ? 'border-white/12 text-white/38' : 'border-[#cdd6e4] text-[#7b8799]'].join(' ')}>
<div className={['rounded-md border border-dashed px-3 py-8 text-center text-[11px]', dark ? 'border-white/12 text-white/38' : 'border-[#cdd6e4] text-[#7b8799]'].join(' ')}>
실행 모듈에서 확인된 토픽이 없습니다.
</div>
)}