| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame^] | 1 | <!-- |
| 2 | Copyright 2020 TATA ELXSI |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the 'License'); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | |
| 16 | Author: SANDHYA JS (sandhya.j@tataelxsi.co.in) |
| 17 | --> |
| 18 | <div class="d-flex flex-row justify-content-between"> |
| 19 | <div class="col-sm-8 mb-3"> |
| 20 | <div class="d-flex align-items-center header-style">{{clusterName}}</div> |
| 21 | </div> |
| 22 | </div> |
| 23 | <div class="btn-group list action" role="group"> |
| 24 | <button type="button" class="btn btn-block border-0 bg-light collapse text-dark" |
| 25 | [ngClass]="{'active': activeButton === 1}" (click)="setActiveButton(1)"> |
| 26 | <span class="circle">{{(node_count)?node_count:0}}</span> |
| 27 | <p>{{'PAGE.K8S.NODE' | translate}}</p> |
| 28 | </button> |
| 29 | <button type="button" class="btn btn-block border-0 bg-light collapse text-dark" |
| 30 | [ngClass]="{'active': activeButton === 2}" (click)="setActiveButton(2)"> |
| 31 | <span class="circle">{{(ksu_count)?ksu_count:0}}</span> |
| 32 | <p>{{'PAGE.K8S.KSU' | translate}}</p> |
| 33 | </button> |
| 34 | </div> |
| 35 | <div id="demo" class="collapse context-style p-2" *ngIf="isCollapsed2 === true"> |
| 36 | <div class="container"> |
| 37 | <span class="button d-flex justify-content-end"> |
| 38 | <button class="btn btn-primary mb-2 me-2" type="button" placement="top" container="body" |
| 39 | ngbTooltip="{{'Add KSU' | translate}}" (click)="addK8sCluster('card_ksu')"> |
| 40 | <i class="fas fa-plus-circle" aria-hidden="true"></i> {{'PAGE.K8S.ADDKSU' | translate}} |
| 41 | </button> |
| 42 | </span> |
| 43 | <div class="row info gx-3" *ngIf="ksu_count !== 0 else noData"> |
| 44 | <div *ngFor="let item of ksuDetail" class="col-12 col-sm-4 col-md-4 col-lg-4 col-xl-4 mb-3"> |
| 45 | <ng-container *ngIf="item?.package_name.length > 1; else singleCard"> |
| 46 | <ngb-carousel class="card-carousel" [interval]="0" wrap="true"> |
| 47 | <ng-template ngbSlide *ngFor="let pkg of item?.package_name; let i = index"> |
| 48 | <div class="custom-card card"> |
| 49 | <div class="card-header custom-card-header d-flex justify-content-between"> |
| 50 | <b style="font-size:medium;">{{ item.name }}</b> |
| 51 | <span> |
| 52 | <i *ngIf="item.state === 'READY'" class="fas fa-check-circle text-success" |
| 53 | data-bs-toggle="tooltip" title="READY"></i> |
| 54 | <i *ngIf="item.state.startsWith('IN_PROGRESS')" |
| 55 | class="fas fa-spinner text-warning" data-bs-toggle="tooltip" |
| 56 | title="{{ item.state }}"></i> |
| 57 | <i *ngIf="item.state === 'ERROR'" class="fas fa-times-circle text-danger" |
| 58 | data-bs-toggle="tooltip" title="ERROR"></i> |
| 59 | </span> |
| 60 | </div> |
| 61 | <div class="card-body"> |
| 62 | <p class="label-value-pair-description"> |
| 63 | <span class="label1">{{ 'PAGE.K8S.DESCRIPTION' | translate }}:</span> |
| 64 | <span class="value1"> |
| 65 | <span class="short-description" |
| 66 | (mouseenter)="showPopover($event, item.description)" |
| 67 | (mouseleave)="hidePopover()"> |
| 68 | {{ item.description }} |
| 69 | </span> |
| 70 | <span class="popover-description" #popover |
| 71 | *ngIf="isPopoverVisible && item?.description.length > 15">{{ |
| 72 | popoverText }}</span> |
| 73 | </span> |
| 74 | </p> |
| 75 | <hr> |
| 76 | <p class="label-value-pair"> |
| 77 | <span class="label">{{ 'PAGE.K8S.PACKAGENAME' | translate }}:</span> |
| 78 | <span class="value">{{ item?.package_name[i] }}</span> |
| 79 | </p> |
| 80 | <p class="label-value-pair"> |
| 81 | <span class="label">{{ 'PAGE.K8S.PACKAGEPATH' | translate }}:</span> |
| 82 | <span class="value">{{ item?.package_path[i] }}</span> |
| 83 | </p> |
| 84 | <p class="label-value-pair"> |
| 85 | <span class="label">{{'MODIFIED' | translate }}:</span> |
| 86 | <span class="value">{{ item.modified }}</span> |
| 87 | </p> |
| 88 | </div> |
| 89 | <div class="card-footer"> |
| 90 | <div class="btn-group list" role="group"> |
| 91 | <button type="button" class="btn btn-primary" |
| 92 | (click)='onView(item.identifier, 2)' placement="top" container="body" |
| 93 | ngbTooltip="{{'VIEW' | translate}}"> |
| 94 | <i class="fa fa-eye"></i> |
| 95 | </button> |
| 96 | </div> |
| 97 | </div> |
| 98 | </div> |
| 99 | </ng-template> |
| 100 | </ngb-carousel> |
| 101 | </ng-container> |
| 102 | <ng-template #singleCard> |
| 103 | <div class="custom-card card"> |
| 104 | <div class="card-header custom-card-header d-flex justify-content-between"> |
| 105 | <b style="font-size:medium;">{{ item.name }}</b> |
| 106 | <span> |
| 107 | <i *ngIf="item.state === 'READY'" class="fas fa-check-circle text-success" |
| 108 | data-bs-toggle="tooltip" title="READY"></i> |
| 109 | <i *ngIf="item.state.startsWith('IN_PROGRESS')" class="fas fa-spinner text-warning" |
| 110 | data-bs-toggle="tooltip" title="{{ item.state }}"></i> |
| 111 | <i *ngIf="item.state === 'ERROR'" class="fas fa-times-circle text-danger" |
| 112 | data-bs-toggle="tooltip" title="ERROR"></i> |
| 113 | </span> |
| 114 | </div> |
| 115 | <div class="card-body"> |
| 116 | <p class="label-value-pair-description"> |
| 117 | <span class="label1">{{ 'PAGE.K8S.DESCRIPTION' | translate}}:</span> |
| 118 | <span class="value1"> |
| 119 | <span class="short-description" (mouseenter)="showPopover($event, item.description)" |
| 120 | (mouseleave)="hidePopover()"> |
| 121 | {{ item.description }} |
| 122 | </span> |
| 123 | <span class="popover-description" #popover *ngIf="isPopoverVisible">{{ |
| 124 | popoverText }}</span> |
| 125 | </span> |
| 126 | </p> |
| 127 | <hr> |
| 128 | <p class="label-value-pair"> |
| 129 | <span class="label">{{ 'PAGE.K8S.PACKAGENAME' | translate }}:</span> |
| 130 | <span class="value">{{ item?.package_name[0] }}</span> |
| 131 | </p> |
| 132 | <p class="label-value-pair"> |
| 133 | <span class="label">{{ 'PAGE.K8S.PACKAGEPATH' | translate }}:</span> |
| 134 | <span class="value">{{ item?.package_path[0] }}</span> |
| 135 | </p> |
| 136 | <p class="label-value-pair"> |
| 137 | <span class="label">{{ 'MODIFIED' | translate }}:</span> |
| 138 | <span class="value">{{ item.modified }}</span> |
| 139 | </p> |
| 140 | </div> |
| 141 | <div class="card-footer"> |
| 142 | <div class="btn-group list" role="group"> |
| 143 | <button type="button" class="btn btn-primary" (click)='onView(item.identifier, 2)' |
| 144 | placement="top" container="body" ngbTooltip="{{'VIEW' | translate}}"> |
| 145 | <i class="fa fa-eye"></i> |
| 146 | </button> |
| 147 | </div> |
| 148 | </div> |
| 149 | </div> |
| 150 | </ng-template> |
| 151 | </div> |
| 152 | </div> |
| 153 | <ng-template #noData> |
| 154 | <div class="no-data"> |
| 155 | {{ 'NODATA' | translate }} |
| 156 | </div> |
| 157 | </ng-template> |
| 158 | </div> |
| 159 | </div> |
| 160 | <div id="demo" class="collapse context-style p-2" *ngIf="isCollapsed1 === true"> |
| 161 | <div class="container"> |
| 162 | <span class="button d-flex justify-content-end"> |
| 163 | <button class="btn btn-primary mb-2 me-2" type="button" placement="top" container="body" |
| 164 | ngbTooltip="{{'Add Node' | translate}}" (click)="addK8sCluster('card_node')"> |
| 165 | <i class="fas fa-plus-circle" aria-hidden="true"></i> {{ 'PAGE.K8S.ADDNODE' | translate}} |
| 166 | </button> |
| 167 | </span> |
| 168 | <div class="row info gx-3" *ngIf="node_count !== 0 else noData"> |
| 169 | <div *ngFor="let item of nodeDetail" class="col-12 col-sm-4 col-md-4 col-lg-4 col-xl-4 mb-3"> |
| 170 | <div class="custom-card card" style="width: 100%; max-width: 20rem;"> |
| 171 | <div class="card-header custom-card-header d-flex justify-content-between"> |
| 172 | <b style="font-size:medium;">{{ item.name }}</b> |
| 173 | <span class="badge px-2" [ngClass]="{ |
| 174 | 'bg-danger text-white': item.state === 'ERROR', |
| 175 | 'bg-success text-white': item.state === 'READY', |
| 176 | 'bg-warning text-white': ['IN_PROGRESS', 'IN_PROGRESS.GIT_SYNCED', |
| 177 | 'IN_PROGRESS.KUSTOMIZATION_READY', |
| 178 | 'IN_PROGRESS.KUSTOMIZATION_DELETED'].includes(item.state)}"> |
| 179 | {{ countData?.k8s_version }} |
| 180 | </span> |
| 181 | <span> |
| 182 | <i *ngIf="item.state === 'READY'" class="fas fa-check-circle text-success" |
| 183 | data-bs-toggle="tooltip" title="READY"></i> |
| 184 | <i *ngIf="item.state.includes('IN_PROGRESS')" class="fas fa-spinner text-warning" |
| 185 | data-bs-toggle="tooltip" [title]="item.state"></i> |
| 186 | <i *ngIf="item.state === 'ERROR'" class="fas fa-times-circle text-danger" |
| 187 | data-bs-toggle="tooltip" title="ERROR"></i> |
| 188 | </span> |
| 189 | </div> |
| 190 | <div class="card-body"> |
| 191 | <p class="label-value-pair-description"> |
| 192 | <span class="label1">{{ 'PAGE.K8S.DESCRIPTION' | translate }}:</span> |
| 193 | <span class="value1"> |
| 194 | <span class="short-description" (mouseenter)="showPopover($event, item.description)" |
| 195 | (mouseleave)="hidePopover()"> |
| 196 | {{ item.description }} |
| 197 | </span> |
| 198 | <span class="popover-description" #popover |
| 199 | *ngIf="isPopoverVisible && item?.description.length > 15">{{ popoverText |
| 200 | }}</span> |
| 201 | </span> |
| 202 | </p> |
| 203 | <hr> |
| 204 | <p class="label-value-pair"><span class="label">{{ 'PAGE.K8S.NODESIZE' | translate }}:</span> |
| 205 | <span class="value">{{ |
| 206 | item.nodeSize }}</span> |
| 207 | </p> |
| 208 | <p class="label-value-pair"><span class="label">{{ 'PAGE.K8S.NODECOUNT' | translate }}:</span> |
| 209 | <span class="value">{{ item.nodeCount }}</span> |
| 210 | </p> |
| 211 | <p class="label-value-pair"><span class="label">{{ 'MODIFIED' | translate }}:</span> <span |
| 212 | class="value">{{ item.modified }}</span></p> |
| 213 | </div> |
| 214 | <div class="card-footer"> |
| 215 | <div class="btn-group list" role="group"> |
| 216 | <button type="button" class="btn btn-primary" (click)='onView(item.identifier, 1)' |
| 217 | placement="top" container="body" ngbTooltip="{{'VIEW' | translate}}"> |
| 218 | <i class="fa fa-eye"></i> |
| 219 | </button> |
| 220 | <button type="button" class="btn btn-primary" placement="top" container="body" |
| 221 | ngbTooltip="{{'EDIT' | translate}}" [disabled]="item.state !== 'READY'" |
| 222 | (click)='scaling(item.identifier, "edit-node")'> |
| 223 | <i class="fas fa-edit"></i> |
| 224 | </button> |
| 225 | <button type="button" class="btn btn-primary" placement="top" container="body" |
| 226 | ngbTooltip="{{'DELETE' | translate}}" |
| 227 | [disabled]="item.state !== 'READY' && item.state !== 'ERROR'" |
| 228 | (click)='onDelete(item.identifier, item.name, 1)'> |
| 229 | <i class="far fa-trash-alt icons"></i> |
| 230 | </button> |
| 231 | <button type="button" class="btn btn-primary" placement="top" container="body" |
| 232 | ngbTooltip="{{'PAGE.K8S.K8SSCALING' | translate}}" [disabled]="item.state !== 'READY'" |
| 233 | (click)='scaling(item.identifier, "k8s-scale")'> |
| 234 | <i class="fas fa-arrows-alt-v"></i> |
| 235 | </button> |
| 236 | </div> |
| 237 | </div> |
| 238 | </div> |
| 239 | </div> |
| 240 | </div> |
| 241 | <ng-template #noData> |
| 242 | <div class="no-data"> |
| 243 | {{ 'NODATA' | translate }} |
| 244 | </div> |
| 245 | </ng-template> |
| 246 | </div> |
| 247 | </div> |
| 248 | <app-loader [waitingMessage]="message" *ngIf="isLoadingResults"></app-loader> |