summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-daemon-list/service-daemon-list.component.html
blob: fc076a185a03f12d39dafd29b1029272b6c20396 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<cd-orchestrator-doc-panel *ngIf="showDocPanel"></cd-orchestrator-doc-panel>

<div *ngIf="flag === 'hostDetails'; else serviceDetailsTpl">
  <ng-container *ngTemplateOutlet="serviceDaemonDetailsTpl"></ng-container>
</div>

<ng-template #serviceDetailsTpl>
  <ng-container>
    <ul ngbNav
        #nav="ngbNav"
        class="nav-tabs"
        cdStatefulTab="service-details">
      <li ngbNavItem="details">
        <a ngbNavLink
           i18n>Details</a>
        <ng-template ngbNavContent>
          <ng-container *ngTemplateOutlet="serviceDaemonDetailsTpl"></ng-container>
        </ng-template>
      </li>
      <li ngbNavItem="service_events">
        <a ngbNavLink
           i18n>Service Events</a>
        <ng-template ngbNavContent>
          <cd-table *ngIf="hasOrchestrator"
                    #serviceTable
                    [data]="services"
                    [columns]="serviceColumns"
                    columnMode="flex"
                    (fetchData)="getServices($event)">
          </cd-table>
        </ng-template>
      </li>
    </ul>
    <div [ngbNavOutlet]="nav"></div>
  </ng-container>
</ng-template>

<ng-template #statusTpl
             let-row="row">
  <span class="badge"
        [ngClass]="row | pipeFunction:getStatusClass">
    {{ row.status_desc }}
  </span>
</ng-template>

<ng-template #listTpl
             let-events="value">
  <ul class="list-group list-group-flush"
      *ngIf="events?.length else noEventsAvailable">
    <li class="list-group-item"
        *ngFor="let event of events; trackBy:trackByFn">
      <b>{{ event.created | relativeDate }} - </b>
      <span class="badge badge-info">{{ event.subject }}</span><br>
      <span *ngIf="event.level === 'INFO'">
      <i [ngClass]="[icons.infoCircle]"
         aria-hidden="true"></i>
      </span>
      <span *ngIf="event.level === 'ERROR'">
      <i [ngClass]="[icons.warning]"
         aria-hidden="true"></i>
      </span>
      {{ event.message }}
    </li>
  </ul>
  <ng-template #noEventsAvailable>
    <div *ngIf="events?.length === 0"
         class="list-group-item">
      <span>No data available</span>
    </div>
  </ng-template>
</ng-template>

<ng-template #serviceDaemonDetailsTpl>
  <cd-table *ngIf="hasOrchestrator"
            #daemonsTable
            [data]="daemons"
            selectionType="single"
            [columns]="columns"
            columnMode="flex"
            identifier="daemon_name"
            (fetchData)="getDaemons($event)"
            (updateSelection)="updateSelection($event)">
    <cd-table-actions id="service-daemon-list-actions"
                      class="table-actions"
                      [selection]="selection"
                      [permission]="permissions.hosts"
                      [tableActions]="tableActions">
    </cd-table-actions>
  </cd-table>
</ng-template>

<ng-template #cpuTpl
             let-row="row">
  <cd-usage-bar [total]="total"
                [calculatePerc]="false"
                [used]="row.cpu_percentage"
                [isBinary]="false"
                [warningThreshold]="warningThreshold"
                [errorThreshold]="errorThreshold">
  </cd-usage-bar>
</ng-template>