Skip to content
This repository has been archived by the owner on Nov 15, 2019. It is now read-only.

Latest commit

 

History

History
 
 

machine

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Machine

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>