summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table-actions/table-actions.component.html
blob: 905aaa96b69be5721fad0edc874f2ce4ab198bbb (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
<div class="btn-group">
  <ng-container *ngIf="currentAction">
    <button type="button"
            title="{{ useDisableDesc(currentAction) }}"
            class="btn btn-{{btnColor}}"
            [ngClass]="{'disabled': disableSelectionAction(currentAction)}"
            (click)="useClickAction(currentAction)"
            [routerLink]="useRouterLink(currentAction)"
            [attr.aria-label]="currentAction.name"
            [preserveFragment]="currentAction.preserveFragment ? '' : null">
      <i [ngClass]="[currentAction.icon]"></i>
      <span>{{ currentAction.name }}</span>
    </button>
  </ng-container>
  <div class="btn-group"
       ngbDropdown
       role="group"
       *ngIf="dropDownActions.length > 1"
       aria-label="Button group with nested dropdown">
    <button class="btn btn-{{btnColor}} dropdown-toggle-split"
            ngbDropdownToggle>
      <ng-container *ngIf="dropDownOnly">{{ dropDownOnly }} </ng-container>
      <span *ngIf="!dropDownOnly"
            class="sr-only"></span>
    </button>
    <div class="dropdown-menu"
         ngbDropdownMenu>
      <ng-container *ngFor="let action of dropDownActions">
        <button ngbDropdownItem
                class="{{ toClassName(action) }}"
                title="{{ useDisableDesc(action) }}"
                (click)="useClickAction(action)"
                [routerLink]="useRouterLink(action)"
                [preserveFragment]="action.preserveFragment ? '' : null"
                [disabled]="disableSelectionAction(action)"
                [attr.aria-label]="action.name">
          <i [ngClass]="[action.icon, 'action-icon']"></i>
          <span>{{ action.name }}</span>
        </button>
      </ng-container>
    </div>
  </div>
</div>