               @data.meta.initScript = Encoder.htmlEncode modal.editor.getValue()
 
 
-  pistachio:->
 
-    {label, provider, ipAddress, status:{state} } = @getData()
 
-    title = label or provider
 
-    publicUrl = ""
-
-    { NotInitialized, Terminated } = Machine.State
-
-    if state not in [ NotInitialized, Terminated ] and ipAddress?
-
-      publicUrl = """
         <a href="http://#{ipAddress}" target="_blank" title="#{ipAddress}">
           <span class='url'>#{ipAddress}</span>
         </a>
       """
 
-    """
-      <div class='details'>
-        <span class='toggle'></span>
-        <h3>#{title}</h3>
-        #{publicUrl}
-        {span.state{#(status.state)}}
-        {{> @progress}}
-        {{> @terminalIcon}}
-        {{> @chevron}}
-      </div>
-    """

class EnvironmentMachineItem extends EnvironmentItem

  JView.mixin @prototype
  stateClasses = ""
  for state in Object.keys Machine.State
    stateClasses += "#{state.toLowerCase()} "


    super options, data

  viewAppended: ->

    { label, provider, uid, status } = machine = @getData()
    { computeController } = KD.singletons

    @addSubView new KDCustomHTMLView
      partial : "<span class='toggle'></span>"

    @addSubView @title = new KDCustomHTMLView
      partial : "<h3>#{label or provider or uid}</h3>"

    @addSubView @ipAddress = new KDCustomHTMLView
      partial  : @getIpLink()

    @addSubView @state = new KDCustomHTMLView
      tagName  : "span"
      cssClass : "state"

    @addSubView @statusToggle = new KodingSwitch
      cssClass     : "tiny"
      defaultValue : status.state is Machine.State.Running
      callback     : (state)=>
        if state
          computeController.start machine
        else
          computeController.stop machine

    @addSubView @progress = new KDProgressBarView
      cssClass : "progress"

    @addSubView @terminalIcon = new KDCustomHTMLView
      tagName  : "span"
      cssClass : "terminal"
      click    : @bound "openTerminal"

    computeController.on "build-#{machine._id}",   @bound 'invalidateMachine'
    computeController.on "destroy-#{machine._id}", @bound 'invalidateMachine'
