<div class="channels-protocol__item" ng-class="{'channels-protocol__item--active': channel.active}">
  <div class="channels-protocol-title">{{ ::channelName }}</div>
  <div class="channels-protocol-status-list">
    <channel-status-item ng-show="showChannelStatus()"
                         active="channel.active" error="isError()">
      <div class="channels-protocol-status-list__item-title"
           ng-switch="channel.state">
        <span ng-switch-when="NONE" translate>Идет инициализация</span>
        <span ng-switch-when="GPRS_INIT" translate>Инициализация GPRS</span>
        <span ng-switch-when="GPRS_INIT_FAILED" translate>Ошибка инициализации GPRS</span>
        <span ng-switch-when="PPP_ERROR" translate>Ошибка инициализации PPP</span>
        <span ng-switch-when="CSP_NOT_FOUND" translate>Не найдены настройки GPRS для оператора связи</span>
        <span ng-switch-when="GPRS_CHANNEL_ERROR" translate>Ошибка GPRS</span>
        <span ng-switch-when="SC_CONNECTION_FAILED" translate>Ошибка подключения к «Центру охраны»</span>
      </div>
    </channel-status-item>

    <channel-status-item ng-if="channelType == 'gprs'" ng-show="isReady()"
                         active="channel.active" error="isError()">
      <div class="channels-protocol-status-list__item-title"
           ng-switch="channel.state">
        <span ng-switch-when="READY" translate>Идет подключение к «Центру охраны»</span>
        <span ng-switch-when="GPRS_INIT" translate>Идет подключение к «Центру охраны»</span>
        <span ng-switch-when="CONNECTED" translate>Подключено к «Центру охраны»</span>
        <span ng-switch-default translate>Нет подключения к «Центру охраны»</span>
      </div>
      <div class="channels-protocol-status-list__item-subtitle"
           ng-if="channel.address_port_pair !== null">
        {[ utils.SCAddress(channel.address_port_pair) ]}
      </div>
    </channel-status-item>

    <channel-status-item ng-if="channelType == 'gprs'" ng-show="isReady()"
                         active="channel.active" error="isError() || isCloudError()">
      <div class="channels-protocol-status-list__item-title"
           ng-switch="channel.state">
        <span ng-switch-when="GPRS_INIT" translate>Идет подключение к Облаку</span>
        <span ng-switch-when="CONNECTED">
          <span ng-if="channel.cloud_connected" translate>
            Подключено к Облаку
          </span>
          <span ng-if="!channel.cloud_connected" translate>
            Нет подключения к Облаку
          </span>
        </span>
        <span ng-switch-default translate>Нет подключения к Облаку</span>
      </div>
      <div only-desktop
           class="channels-protocol-status-list__item-subtitle">
        {[ utils.cloudAddress() ]}
      </div>
    </channel-status-item>

  </div>
  <div class="channels-protocol-messages">{[ channel.events_delivered ]}</div>
  <channel-activator channel-type="{{ ::channelType }}" channel-num="{{ ::sim }}" channel-active="channel.active"/>
</div>
