| <!-- |
| Copyright 2020 TATA ELXSI |
| |
| Licensed 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. |
| |
| Author: SANDHYA JS (sandhya.j@tataelxsi.co.in) |
| --> |
| <div class="d-flex flex-row justify-content-between"> |
| <div class="col-sm-8 mb-3"> |
| <div class="d-flex align-items-center header-style">{{clusterName}}</div> |
| </div> |
| </div> |
| <div class="btn-group list action" role="group"> |
| <button type="button" class="btn btn-block border-0 bg-light collapse text-dark" |
| [ngClass]="{'active': activeButton === 1}" (click)="setActiveButton(1)"> |
| <span class="circle">{{(node_count)?node_count:0}}</span> |
| <p>{{'PAGE.K8S.NODE' | translate}}</p> |
| </button> |
| <button type="button" class="btn btn-block border-0 bg-light collapse text-dark" |
| [ngClass]="{'active': activeButton === 2}" (click)="setActiveButton(2)"> |
| <span class="circle">{{(ksu_count)?ksu_count:0}}</span> |
| <p>{{'PAGE.K8S.KSU' | translate}}</p> |
| </button> |
| </div> |
| <div id="demo" class="collapse context-style p-2" *ngIf="isCollapsed2 === true"> |
| <div class="container"> |
| <span class="button d-flex justify-content-end"> |
| <button class="btn btn-primary mb-2 me-2" type="button" placement="top" container="body" |
| ngbTooltip="{{'Add KSU' | translate}}" (click)="addK8sCluster('card_ksu')"> |
| <i class="fas fa-plus-circle" aria-hidden="true"></i> {{'PAGE.K8S.ADDKSU' | translate}} |
| </button> |
| </span> |
| <div class="row info gx-3" *ngIf="ksu_count !== 0 else noData"> |
| <div *ngFor="let item of ksuDetail" class="col-12 col-sm-4 col-md-4 col-lg-4 col-xl-4 mb-3"> |
| <ng-container *ngIf="item?.package_name.length > 1; else singleCard"> |
| <ngb-carousel class="card-carousel" [interval]="0" wrap="true"> |
| <ng-template ngbSlide *ngFor="let pkg of item?.package_name; let i = index"> |
| <div class="custom-card card"> |
| <div class="card-header custom-card-header d-flex justify-content-between"> |
| <b style="font-size:medium;">{{ item.name }}</b> |
| <span> |
| <i *ngIf="item.state === 'READY'" class="fas fa-check-circle text-success" |
| data-bs-toggle="tooltip" title="READY"></i> |
| <i *ngIf="item.state.startsWith('IN_PROGRESS')" |
| class="fas fa-spinner text-warning" data-bs-toggle="tooltip" |
| title="{{ item.state }}"></i> |
| <i *ngIf="item.state === 'ERROR'" class="fas fa-times-circle text-danger" |
| data-bs-toggle="tooltip" title="ERROR"></i> |
| </span> |
| </div> |
| <div class="card-body"> |
| <p class="label-value-pair-description"> |
| <span class="label1">{{ 'PAGE.K8S.DESCRIPTION' | translate }}:</span> |
| <span class="value1"> |
| <span class="short-description" |
| (mouseenter)="showPopover($event, item.description)" |
| (mouseleave)="hidePopover()"> |
| {{ item.description }} |
| </span> |
| <span class="popover-description" #popover |
| *ngIf="isPopoverVisible && item?.description.length > 15">{{ |
| popoverText }}</span> |
| </span> |
| </p> |
| <hr> |
| <p class="label-value-pair"> |
| <span class="label">{{ 'PAGE.K8S.PACKAGENAME' | translate }}:</span> |
| <span class="value">{{ item?.package_name[i] }}</span> |
| </p> |
| <p class="label-value-pair"> |
| <span class="label">{{ 'PAGE.K8S.PACKAGEPATH' | translate }}:</span> |
| <span class="value">{{ item?.package_path[i] }}</span> |
| </p> |
| <p class="label-value-pair"> |
| <span class="label">{{'MODIFIED' | translate }}:</span> |
| <span class="value">{{ item.modified }}</span> |
| </p> |
| </div> |
| <div class="card-footer"> |
| <div class="btn-group list" role="group"> |
| <button type="button" class="btn btn-primary" |
| (click)='onView(item.identifier, 2)' placement="top" container="body" |
| ngbTooltip="{{'VIEW' | translate}}"> |
| <i class="fa fa-eye"></i> |
| </button> |
| </div> |
| </div> |
| </div> |
| </ng-template> |
| </ngb-carousel> |
| </ng-container> |
| <ng-template #singleCard> |
| <div class="custom-card card"> |
| <div class="card-header custom-card-header d-flex justify-content-between"> |
| <b style="font-size:medium;">{{ item.name }}</b> |
| <span> |
| <i *ngIf="item.state === 'READY'" class="fas fa-check-circle text-success" |
| data-bs-toggle="tooltip" title="READY"></i> |
| <i *ngIf="item.state.startsWith('IN_PROGRESS')" class="fas fa-spinner text-warning" |
| data-bs-toggle="tooltip" title="{{ item.state }}"></i> |
| <i *ngIf="item.state === 'ERROR'" class="fas fa-times-circle text-danger" |
| data-bs-toggle="tooltip" title="ERROR"></i> |
| </span> |
| </div> |
| <div class="card-body"> |
| <p class="label-value-pair-description"> |
| <span class="label1">{{ 'PAGE.K8S.DESCRIPTION' | translate}}:</span> |
| <span class="value1"> |
| <span class="short-description" (mouseenter)="showPopover($event, item.description)" |
| (mouseleave)="hidePopover()"> |
| {{ item.description }} |
| </span> |
| <span class="popover-description" #popover *ngIf="isPopoverVisible">{{ |
| popoverText }}</span> |
| </span> |
| </p> |
| <hr> |
| <p class="label-value-pair"> |
| <span class="label">{{ 'PAGE.K8S.PACKAGENAME' | translate }}:</span> |
| <span class="value">{{ item?.package_name[0] }}</span> |
| </p> |
| <p class="label-value-pair"> |
| <span class="label">{{ 'PAGE.K8S.PACKAGEPATH' | translate }}:</span> |
| <span class="value">{{ item?.package_path[0] }}</span> |
| </p> |
| <p class="label-value-pair"> |
| <span class="label">{{ 'MODIFIED' | translate }}:</span> |
| <span class="value">{{ item.modified }}</span> |
| </p> |
| </div> |
| <div class="card-footer"> |
| <div class="btn-group list" role="group"> |
| <button type="button" class="btn btn-primary" (click)='onView(item.identifier, 2)' |
| placement="top" container="body" ngbTooltip="{{'VIEW' | translate}}"> |
| <i class="fa fa-eye"></i> |
| </button> |
| </div> |
| </div> |
| </div> |
| </ng-template> |
| </div> |
| </div> |
| <ng-template #noData> |
| <div class="no-data"> |
| {{ 'NODATA' | translate }} |
| </div> |
| </ng-template> |
| </div> |
| </div> |
| <div id="demo" class="collapse context-style p-2" *ngIf="isCollapsed1 === true"> |
| <div class="container"> |
| <span class="button d-flex justify-content-end"> |
| <button class="btn btn-primary mb-2 me-2" type="button" placement="top" container="body" |
| ngbTooltip="{{'Add Node' | translate}}" (click)="addK8sCluster('card_node')"> |
| <i class="fas fa-plus-circle" aria-hidden="true"></i> {{ 'PAGE.K8S.ADDNODE' | translate}} |
| </button> |
| </span> |
| <div class="row info gx-3" *ngIf="node_count !== 0 else noData"> |
| <div *ngFor="let item of nodeDetail" class="col-12 col-sm-4 col-md-4 col-lg-4 col-xl-4 mb-3"> |
| <div class="custom-card card" style="width: 100%; max-width: 20rem;"> |
| <div class="card-header custom-card-header d-flex justify-content-between"> |
| <b style="font-size:medium;">{{ item.name }}</b> |
| <span class="badge px-2" [ngClass]="{ |
| 'bg-danger text-white': item.state === 'ERROR', |
| 'bg-success text-white': item.state === 'READY', |
| 'bg-warning text-white': ['IN_PROGRESS', 'IN_PROGRESS.GIT_SYNCED', |
| 'IN_PROGRESS.KUSTOMIZATION_READY', |
| 'IN_PROGRESS.KUSTOMIZATION_DELETED'].includes(item.state)}"> |
| {{ countData?.k8s_version }} |
| </span> |
| <span> |
| <i *ngIf="item.state === 'READY'" class="fas fa-check-circle text-success" |
| data-bs-toggle="tooltip" title="READY"></i> |
| <i *ngIf="item.state.includes('IN_PROGRESS')" class="fas fa-spinner text-warning" |
| data-bs-toggle="tooltip" [title]="item.state"></i> |
| <i *ngIf="item.state === 'ERROR'" class="fas fa-times-circle text-danger" |
| data-bs-toggle="tooltip" title="ERROR"></i> |
| </span> |
| </div> |
| <div class="card-body"> |
| <p class="label-value-pair-description"> |
| <span class="label1">{{ 'PAGE.K8S.DESCRIPTION' | translate }}:</span> |
| <span class="value1"> |
| <span class="short-description" (mouseenter)="showPopover($event, item.description)" |
| (mouseleave)="hidePopover()"> |
| {{ item.description }} |
| </span> |
| <span class="popover-description" #popover |
| *ngIf="isPopoverVisible && item?.description.length > 15">{{ popoverText |
| }}</span> |
| </span> |
| </p> |
| <hr> |
| <p class="label-value-pair"><span class="label">{{ 'PAGE.K8S.NODESIZE' | translate }}:</span> |
| <span class="value">{{ |
| item.nodeSize }}</span> |
| </p> |
| <p class="label-value-pair"><span class="label">{{ 'PAGE.K8S.NODECOUNT' | translate }}:</span> |
| <span class="value">{{ item.nodeCount }}</span> |
| </p> |
| <p class="label-value-pair"><span class="label">{{ 'MODIFIED' | translate }}:</span> <span |
| class="value">{{ item.modified }}</span></p> |
| </div> |
| <div class="card-footer"> |
| <div class="btn-group list" role="group"> |
| <button type="button" class="btn btn-primary" (click)='onView(item.identifier, 1)' |
| placement="top" container="body" ngbTooltip="{{'VIEW' | translate}}"> |
| <i class="fa fa-eye"></i> |
| </button> |
| <button type="button" class="btn btn-primary" placement="top" container="body" |
| ngbTooltip="{{'EDIT' | translate}}" [disabled]="item.state !== 'READY'" |
| (click)='scaling(item.identifier, "edit-node")'> |
| <i class="fas fa-edit"></i> |
| </button> |
| <button type="button" class="btn btn-primary" placement="top" container="body" |
| ngbTooltip="{{'DELETE' | translate}}" |
| [disabled]="item.state !== 'READY' && item.state !== 'ERROR'" |
| (click)='onDelete(item.identifier, item.name, 1)'> |
| <i class="far fa-trash-alt icons"></i> |
| </button> |
| <button type="button" class="btn btn-primary" placement="top" container="body" |
| ngbTooltip="{{'PAGE.K8S.K8SSCALING' | translate}}" [disabled]="item.state !== 'READY'" |
| (click)='scaling(item.identifier, "k8s-scale")'> |
| <i class="fas fa-arrows-alt-v"></i> |
| </button> |
| </div> |
| </div> |
| </div> |
| </div> |
| </div> |
| <ng-template #noData> |
| <div class="no-data"> |
| {{ 'NODATA' | translate }} |
| </div> |
| </ng-template> |
| </div> |
| </div> |
| <app-loader [waitingMessage]="message" *ngIf="isLoadingResults"></app-loader> |