admin-service-checks-page.component.html 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <h3>Service Checks</h3>
  2. <div *ngIf="serverConfigs?.length; else loadingServerConfs" class="border d-flex flex-fill overflow-hidden">
  3. <ul ngbNav #nav="ngbNav" class="border-end nav-pills h-100" style="width: 250px" orientation="vertical" [(activeId)]="activeId">
  4. <li *ngFor="let serverConfig of serverConfigs; index as s" [ngbNavItem]="s" class="bg-light text-primary">
  5. <a ngbNavLink [routerLink]="'/admin/svc/' + serverConfig.id" class="d-flex btn btn-toolbar">
  6. <fa-icon class="pe-2" [icon]="fa.server"></fa-icon>
  7. <span class="flex-fill text-start">{{ serverConfig.title }}</span>
  8. <fa-icon class="ps-2" [icon]="fa.angleRight"></fa-icon>
  9. </a>
  10. <ng-template ngbNavContent>
  11. <ng-container *ngIf="!loadingServiceChecks; else loadingServerConfs">
  12. <div class="d-flex flex-column">
  13. <div class="btn-group d-block">
  14. <button class="btn btn-primary float-end m-1" [disabled]="params?.checkID === -1" (click)="addServiceCheck(serverConfig.id)">
  15. <fa-icon class="pe-2" [icon]="fa.plus"></fa-icon>Add Service Check
  16. </button>
  17. </div>
  18. <ngb-accordion
  19. #acc="ngbAccordion"
  20. [closeOthers]="true"
  21. className="flex-fill"
  22. [activeIds]="params?.activeIds ?? []"
  23. (panelChange)="onAccordeonChange($event)">
  24. <ngb-panel *ngFor="let serviceCheck of serviceChecks" [id]="PANEL_ID_PFX + serviceCheck.id">
  25. <ng-template ngbPanelHeader let-opened="opened">
  26. <button class="accordion-button" ngbPanelToggle [class.collapsed]="!opened" [ngClass]="{ 'bg-primary text-white': opened }">
  27. <p class="flex-fill m-0">{{ serviceCheck.title }}</p>
  28. <fa-icon
  29. class="btn btn-sm btn-outline-light me-4"
  30. title="Save configuration"
  31. (click)="saveServiceCheck($event)"
  32. *ngIf="opened"
  33. [icon]="fa.save"></fa-icon>
  34. <fa-icon
  35. class="btn btn-sm btn-outline-danger me-4"
  36. title="Delete this Service Check"
  37. (click)="removeServiceCheck($event, serviceCheck.id)"
  38. *ngIf="opened"
  39. [icon]="fa.trash"></fa-icon>
  40. </button>
  41. </ng-template>
  42. <ng-template ngbPanelContent>
  43. <app-service-check-form [serviceCheck]="serviceCheck"></app-service-check-form>
  44. </ng-template>
  45. </ngb-panel>
  46. </ngb-accordion>
  47. </div>
  48. </ng-container>
  49. </ng-template>
  50. </li>
  51. </ul>
  52. <div [ngbNavOutlet]="nav" class="flex-fill h-100 overflow-auto"></div>
  53. </div>
  54. <ng-template #loadingServerConfs>
  55. <app-status-timeline-widget></app-status-timeline-widget>
  56. </ng-template>