     switch path
       when '/kcsapi/api_port/port'
         updateflag = true
+        label = @updateLabels()
       when '/kcsapi/api_req_hensei/change'
         updateflag = true
+        label = @updateLabels()
       when '/kcsapi/api_req_nyukyo/start'
         shipId = parseInt postBody.api_ship_id
         if shipId in @props.deck.api_ship
           i = @props.deck.api_ship.indexOf shipId
-          # status = getStatusArray shipId
-          label[i][1] = true
+          # status = getShipStatus shipId
+          label[i] = 1
           updateflag = true
     if updateflag
-      label = @updateLabels()
       @setState
         label: label
   shouldComponentUpdate: (nextProps, nextState) ->

    else if @props.status[4]? and @props.status[4]
      <Label bsStyle="warning"><FontAwesome key={0} name='rub' /></Label>

    @todo: improve extesibility
###
StatusLabelMini = React.createClass
  shouldComponentUpdate: (nextProps, nextState) ->
    not _.isEqual(nextProps.label, @props.label)
  render: ->
    if @props.label[0]? and @props.label[0]
      <Label bsStyle="danger"><FontAwesome key={0} name='exclamation-circle' /></Label>
    else if @props.label[1]? and @props.label[1]
      <Label bsStyle="info"><FontAwesome key={0} name='wrench' /></Label>
    else if @props.label[2]? and @props.label[2]
      <Label bsStyle="info"><FontAwesome key={0} name='lock' /></Label>
    else if @props.label[3]? and @props.label[3]
      <Label bsStyle="primary"><FontAwesome key={0} name='lock' /></Label>
    else if @props.label[4]? and @props.label[4]
      <Label bsStyle="success"><FontAwesome key={0} name='lock' /></Label>
    else if @props.label[4]? and @props.label[4]
      <Label bsStyle="warning"><FontAwesome key={0} name='lock' /></Label>
    else
      <Label bsStyle="default" style={border: '1px solid'}></Label>


getStatusStyle = (status) ->
  if status?
    flag = status == 0 or status == 1 # retreat or repairing
    if flag? and flag
      return {opacity: 0.4}
  else
    return {}

getShipStatus = (shipId) ->
  status = -1
  # retreat status
  if shipId == escapeId || shipId == towId
    return status = 0
  # reparing
  if shipId in _ndocks
    return status = 1
  # special 1 locked phase 1
  else if _ships[shipId].api_sally_area == 1
    return status = 2
  # special 2 locked phase 2
  else if _ships[shipId].api_sally_area == 2
    return status = 3
  # special 3 locked phase 3
  else if  _ships[shipId].api_sally_area == 3
    return status = 4
  # special 3 locked phase 3
  else if _ships[shipId].api_sally_area == 4
    return status = 5
  return status

###
