A component for displaying a Juju machine.
Example usage:
<Machine
hardware={[
{
label: 'disk',
value: 'floppy'
},
{
label: 'memory',
value: 'goldfish-like'
}
]}
machine={{
name: 'new0',
root: false,
region: 'antarctica-east',
series: 'spotty',
status: 'chillaxing'
}}
menuItems={[
{
label: 'Delete',
action: () => {}
}
]}
units={[
{
icon: 'smalldata.svg',
id: 'new0/0',
name: 'new0/0',
status: 'upper-middle'
}
]}
/>
Display a container:
<Machine
isContainer={true}
machine={{
name: 'new0',
root: false,
region: 'antarctica-east',
series: 'spotty',
status: 'chillaxing'
}}
units={[
{
icon: 'smalldata.svg',
id: 'new0/0',
name: 'new0/0',
status: 'upper-middle'
}
]}
/>
Without hardware or units:
<Machine
machine={{
name: 'new0',
root: false,
region: 'antarctica-east',
series: 'spotty',
status: 'chillaxing'
}}
/>
With a terminal action:
<Machine
isContainer={true}
machine={{
name: 'new0',
root: false,
region: 'antarctica-east',
series: 'spotty',
status: 'chillaxing'
}}
sshAction={() => {}}
sshLabel="1.1.1.1"
/>
As a root container:
<Machine
isContainer={true}
machine={{
name: 'new0',
root: true,
region: 'antarctica-east',
series: 'spotty',
status: 'chillaxing'
}}
/>
With children:
<Machine
machine={{
name: 'new0',
root: false,
region: 'antarctica-east',
series: 'spotty',
status: 'chillaxing'
}}
>
<span className="kids">content</span>
</Machine>