<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one or more
  ~ contributor license agreements.  See the NOTICE file distributed with
  ~ this work for additional information regarding copyright ownership.
  ~ The ASF licenses this file to You under the Apache License, Version 2.0
  ~ (the "License"); you may not use this file except in compliance with
  ~ the License.  You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<div class="bg-nifi-accent h-8 flow-status">
    <div class="flex justify-between">
        <div class="flex flex-1 justify-around pr-20">
            <div
                class="flex items-center gap-x-2"
                title="Connected nodes / Total number of nodes in the cluster"
                *ngIf="clusterSummary.clustered">
                <div class="fa fa-cubes" [class]="getClusterStyle()"></div>
                <div class="text">{{ formatClusterMessage() }}</div>
            </div>
            <div class="flex items-center gap-x-2" [title]="getActiveThreadsTitle()">
                <div class="icon icon-threads" [class]="getActiveThreadsStyle()"></div>
                <div class="status-value">{{ formatActiveThreads() }}</div>
            </div>
            <div class="flex items-center gap-x-2" title="Total queued data">
                <div class="fa fa-list" [class]="getQueuedStyle()"></div>
                <div class="status-value">{{ controllerStatus.queued }}</div>
            </div>
            <div class="flex items-center gap-x-2" title="Transmitting Remote Process Groups">
                <div
                    class="fa fa-bullseye"
                    [class]="getActiveStyle(controllerStatus.activeRemotePortCount, 'transmitting')"></div>
                <div class="status-value">{{ formatValue(controllerStatus.activeRemotePortCount) }}</div>
            </div>
            <div class="flex items-center gap-x-2" title="Not Transmitting Remote Process Groups">
                <div
                    class="icon icon-transmit-false"
                    [class]="getActiveStyle(controllerStatus.inactiveRemotePortCount, 'not-transmitting')"></div>
                <div class="status-value">{{ formatValue(controllerStatus.inactiveRemotePortCount) }}</div>
            </div>
            <div class="flex items-center gap-x-2" title="Running Components">
                <div class="fa fa-play" [class]="getActiveStyle(controllerStatus.runningCount, 'running')"></div>
                <div class="status-value">{{ formatValue(controllerStatus.runningCount) }}</div>
            </div>
            <div class="flex items-center gap-x-2" title="Stopped Components">
                <div class="fa fa-stop" [class]="getActiveStyle(controllerStatus.stoppedCount, 'stopped')"></div>
                <div class="status-value">{{ formatValue(controllerStatus.stoppedCount) }}</div>
            </div>
            <div class="flex items-center gap-x-2" title="Invalid Components">
                <div class="fa fa-warning" [class]="getActiveStyle(controllerStatus.invalidCount, 'invalid')"></div>
                <div class="status-value">{{ formatValue(controllerStatus.invalidCount) }}</div>
            </div>
            <div class="flex items-center gap-x-2" title="Disabled Components">
                <div
                    class="icon icon-enable-false"
                    [class]="getActiveStyle(controllerStatus.disabledCount, 'disabled')"></div>
                <div class="status-value">{{ formatValue(controllerStatus.disabledCount) }}</div>
            </div>
            <div class="flex items-center gap-x-2" title="Up to date Versioned Process Groups">
                <div class="fa fa-check" [class]="getActiveStyle(controllerStatus.upToDateCount, 'up-to-date')"></div>
                <div class="status-value">{{ formatValue(controllerStatus.upToDateCount) }}</div>
            </div>
            <div class="flex items-center gap-x-2" title="Locally modified Versioned Process Groups">
                <div
                    class="fa fa-asterisk"
                    [class]="getActiveStyle(controllerStatus.locallyModifiedCount, 'locally-modified')"></div>
                <div class="status-value">{{ formatValue(controllerStatus.locallyModifiedCount) }}</div>
            </div>
            <div class="flex items-center gap-x-2" title="Stale Versioned Process Groups">
                <div class="fa fa-arrow-circle-up" [class]="getActiveStyle(controllerStatus.staleCount, 'stale')"></div>
                <div class="status-value">{{ formatValue(controllerStatus.staleCount) }}</div>
            </div>
            <div class="flex items-center gap-x-2" title="Locally modified and stale Versioned Process Groups">
                <div
                    class="fa fa-exclamation-circle"
                    [class]="
                        getActiveStyle(controllerStatus.locallyModifiedAndStaleCount, 'locally-modified-and-stale')
                    "></div>
                <div class="status-value">{{ formatValue(controllerStatus.locallyModifiedAndStaleCount) }}</div>
            </div>
            <div class="flex items-center gap-x-2" title="Sync failure Versioned Process Groups">
                <div
                    class="fa fa-question"
                    [class]="getActiveStyle(controllerStatus.syncFailureCount, 'sync-failure')"></div>
                <div class="status-value">{{ formatValue(controllerStatus.syncFailureCount) }}</div>
            </div>
            <div class="flex items-center gap-x-2" title="Last refresh">
                <div class="fa fa-refresh" [class.fa-spin]="loadingStatus"></div>
                <div class="status-value">{{ lastRefreshed }}</div>
            </div>
        </div>
        <div class="flex">
            <search [currentProcessGroupId]="currentProcessGroupId"></search>
            <ng-container *ngIf="hasBulletins(); else noBulletins">
                <button
                    nifiTooltip
                    [tooltipComponentType]="BulletinsTip"
                    [tooltipInputData]="getBulletins()"
                    [xOffset]="getBulletinTooltipXOffset()"
                    class="h-8 w-8 controller-bulletins has-bulletins">
                    <i class="fa fa-sticky-note-o"></i>
                </button>
            </ng-container>
            <ng-template #noBulletins>
                <button class="h-8 w-8 controller-bulletins">
                    <i class="fa fa-sticky-note-o"></i>
                </button>
            </ng-template>
        </div>
    </div>
</div>
