Show command details
Summary: This is the most basic visualiser for command details. Reviewed By: antonk52 Differential Revision: D47917006 fbshipit-source-id: 7654a3c6e416346548b45dbc72ca4a1838bea787
This commit is contained in:
committed by
Facebook GitHub Bot
parent
f63c749e0e
commit
7e9228985b
@@ -136,19 +136,43 @@ const Placeholder = styled(Layout.Container)({
|
|||||||
});
|
});
|
||||||
|
|
||||||
function Sidebar({selection}: {selection: undefined | ConnectionRecordEntry}) {
|
function Sidebar({selection}: {selection: undefined | ConnectionRecordEntry}) {
|
||||||
return (
|
const content: JSX.Element[] = [];
|
||||||
<Layout.ScrollContainer pad>
|
|
||||||
{selection != null ? (
|
if (selection) {
|
||||||
<Panel key="Raw" heading="Raw Details">
|
if ('cmd' in selection) {
|
||||||
<DataInspector data={selection} />
|
const cmd = selection as CommandRecordEntry;
|
||||||
</Panel>
|
content.push(
|
||||||
) : (
|
<Panel key="cmd" heading="CMD">
|
||||||
<Placeholder grow pad="large">
|
{cmd.cmd}
|
||||||
Select an entry to visualize details
|
</Panel>,
|
||||||
</Placeholder>
|
<Panel key="description" heading="Description">
|
||||||
)}
|
{cmd.description}
|
||||||
</Layout.ScrollContainer>
|
</Panel>,
|
||||||
);
|
<Panel key="stdout" heading="STDOUT">
|
||||||
|
{cmd.stdout}
|
||||||
|
</Panel>,
|
||||||
|
<Panel key="stderr" heading="STDERR">
|
||||||
|
{cmd.stderr}
|
||||||
|
</Panel>,
|
||||||
|
<Panel key="troubleshoot" heading="Troubleshooting Tips">
|
||||||
|
{cmd.troubleshoot}
|
||||||
|
</Panel>,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
content.push(
|
||||||
|
<Panel key="Raw" heading="Raw Details" collapsed>
|
||||||
|
<DataInspector data={selection} />
|
||||||
|
</Panel>,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
content.push(
|
||||||
|
<Placeholder grow pad="large" center>
|
||||||
|
Select an entry to visualize details
|
||||||
|
</Placeholder>,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return <Layout.ScrollContainer pad>{content}</Layout.ScrollContainer>;
|
||||||
}
|
}
|
||||||
|
|
||||||
function clearMessages() {
|
function clearMessages() {
|
||||||
|
|||||||
Reference in New Issue
Block a user