Skip to content

Friendlier instance statuses in the UI

Solves #132 (closed) (read for background).

In order to better model instance statuses, I ended up doing a substantial re-organization of types as explained in this commit message:

This giant refactor started because I wanted to change the type of 'server status' from a string to a custom type representing all possible states, and some type naming conflicts arose (e.g. "suspended" for both power state and server state). I realized that we could push all the types which describe OpenStack-specific resources down into OpenstackTypes.elm, and this namespacing would allow for better names like OSTypes.ServerPaused instead of ServerOSStatusPaused. This also provides clearer separation of types which closely describe OpenStack resources from types which are Exosphere-isms.

Everything else in this diff fixes our state logic to deal with the consequences, especially consequences of the Server type going from this...

type alias Server =
    { name : String
    , uuid : ServerUuid
    , details : Maybe ServerDetails
    , floatingIpState : FloatingIpState
    , selected : Bool
    , cockpitStatus : CockpitStatus
    , deletionAttempted : Bool
    }

...to this, in OpenStackTypes.elm...

type alias Server =
    { name : String
    , uuid : ServerUuid
    , details : Maybe ServerDetails
    }

...and in top-level Types.elm...

type alias ExoServerProps =
    { floatingIpState : FloatingIpState
    , selected : Bool
    , cockpitStatus : CockpitStatus
    , deletionAttempted : Bool
    }

type alias Server =
    { osProps : OSTypes.Server
    , exoProps : ExoServerProps
    }

Some functions (like Rest.receiveServer) got much nicer because Exosphere-specific server properties (which we persist across API calls to OpenStack) are no longer "interleaved" with the base properties of the server in Openstack (which change with each API call to get the servers).

Todo:

  • Eventually should go from "Building"/"Starting" to "Error" status? If it takes too long for either OpenStack to launch or Cockpit to become ready For another PR
  • Details in UI showing raw OpenStack status, OpenStack power state, and Cockpit status
    • These details should be hidden by default
  • Maybe some namespacing/modularity so that types like "ServerOSStatusActive" can be instead something like "OSTypes.Server.Active".
  • Icons representing states along the lines of "definitely not ready", "partially ready", "completely ready", and "error"
  • Perhaps an animation for the "definitely not ready" and "getting ready" icons For another PR
  • Human-friendly power state in UI
  • Normalize capitalization of os, Os, OS (for OpenStack)
  • Fix Unable to detect status of Terminal and Cockpit services
  • Change IpAddressFixed and IpAddressFloating to human-friendly "Fixed IP Address" and "Floating IP Address"
Edited by Chris Martin

Merge request reports