| .. | .. |
|---|
| 1 | 1 | <md-toolbar role="toolbar" class="mat-secondary"> |
|---|
| 2 | 2 | <span class="push-left-sm"> |
|---|
| 3 | | - <span class="md-title" i18n>License Packs</span> |
|---|
| 3 | + <button md-icon-button (click)="goBack" color="accent"> |
|---|
| 4 | + <md-icon class="md-36">arrow_back</md-icon> |
|---|
| 5 | + </button> |
|---|
| 6 | + <span class="md-title" i18n>Licenses for pack</span>: {{pack?.code}} |
|---|
| 4 | 7 | </span> |
|---|
| 5 | 8 | <span class="push-left-sm" *ngIf="filteredItems < data.length"> |
|---|
| 6 | 9 | <span class="md-body-1">{{filteredItems}} of {{data.length}} packs filtered</span> |
|---|
| 7 | 10 | </span> |
|---|
| 8 | 11 | <td-search-box #searchBox class="push-right-sm" placeholder="Search here" (searchDebounce)="search($event)" flex> |
|---|
| 9 | 12 | </td-search-box> |
|---|
| 10 | | - <button md-mini-fab color="accent" (click)="createPack()"> |
|---|
| 13 | + <button md-mini-fab color="accent" (click)="createLicense()"> |
|---|
| 11 | 14 | <md-icon>add</md-icon> |
|---|
| 12 | 15 | </button> |
|---|
| 16 | + <md-toolbar-row *ngIf="!!pack"> |
|---|
| 17 | + <md-chip-list flex="80" style="margin-left: 70px;"> |
|---|
| 18 | + <md-chip selected [mdTooltip]="$L.get('field.application_name')" color="primary">{{pack.application_name}} </md-chip> |
|---|
| 19 | + <md-chip selected [mdTooltip]="$L.get('field.organization_id')" color="accent">{{pack.organization_name}} </md-chip> |
|---|
| 20 | + <md-chip selected [mdTooltip]="$L.get('field.license_type_id')" color="accent">{{pack.licensetype_code}} </md-chip> |
|---|
| 21 | + <md-chip selected [mdTooltip]="$L.get('field.num_available')" color="accent">{{pack.num_available}} </md-chip> |
|---|
| 22 | + </md-chip-list> |
|---|
| 23 | + </md-toolbar-row> |
|---|
| 13 | 24 | </md-toolbar> |
|---|
| 14 | 25 | <md-divider></md-divider> |
|---|
| 15 | 26 | <div layout="row" layout-align="center center"> |
|---|
| 16 | 27 | <div flex="80" layout="column" layout-align="end center" > |
|---|
| 17 | | -<td-data-table [data]="filteredData" [columns]="columns" style="width: 100%"> |
|---|
| 18 | | - <template tdDataTableTemplate="used_licenses" let-row="row"> |
|---|
| 28 | +<td-data-table |
|---|
| 29 | + [data]="filteredData" |
|---|
| 30 | + [columns]="columns" |
|---|
| 31 | + [sortable]="true" |
|---|
| 32 | + [sortBy]="sortBy" |
|---|
| 33 | + (sortChange)="sort($event)" |
|---|
| 34 | + style="width: 100%"> |
|---|
| 35 | + <template tdDataTableTemplate="status" let-row="row"> |
|---|
| 19 | 36 | <div layout="row"> |
|---|
| 20 | | - <td-notification-count color="secondary" [notifications]="row['num_licenses']"> |
|---|
| 21 | | - </td-notification-count> |
|---|
| 22 | | - <td-notification-count color="primary" [notifications]="row['num_available']"> |
|---|
| 23 | | - </td-notification-count> |
|---|
| 37 | + <md-chip-list> |
|---|
| 38 | + <md-icon [style]="'color: ' + licenses.getStatusColor(row.status)">brightness_1</md-icon> <span>{{licenses.getStatusName(row.status)}}</span> |
|---|
| 39 | + </md-chip-list> |
|---|
| 24 | 40 | </div> |
|---|
| 25 | 41 | </template> |
|---|
| 26 | | - <template tdDataTableTemplate="code" let-row="row" let-value="value"> |
|---|
| 27 | | - <div layout="row" layout-align="start center"> |
|---|
| 28 | | - <span style="white-space: nowrap">{{value}}</span> |
|---|
| 42 | + <template tdDataTableTemplate="email" let-row="row"> |
|---|
| 43 | + <div layout="row"> |
|---|
| 44 | + <a [href]="'mailto:' + row.email + '?subject=SeCuris'">{{row.email}}</a> |
|---|
| 29 | 45 | </div> |
|---|
| 30 | 46 | </template> |
|---|
| 47 | + <template tdDataTableTemplate="expiration_date" let-row="row"> |
|---|
| 48 | + <div layout="row"> |
|---|
| 49 | + <span [class]="isLicenseExpired(row) ? 'warn' : ''" >{{row.expiration_date | date: 'short'}}</span> |
|---|
| 50 | + </div> |
|---|
| 51 | + </template> |
|---|
| 52 | + |
|---|
| 31 | 53 | <template tdDataTableTemplate="menu" let-row="row" let-index="index"> |
|---|
| 32 | 54 | <div layout="row" layout-align="end center"> |
|---|
| 33 | | - <button md-icon-button (click)="editPack(row)" color="primary"><md-icon>edit</md-icon></button> |
|---|
| 34 | | - <button md-icon-button [mdMenuTriggerFor]="packMenu" aria-label="Pack menu"> |
|---|
| 55 | + <button md-icon-button (click)="editLicense(row)" color="primary"><md-icon>edit</md-icon></button> |
|---|
| 56 | + <button md-icon-button [mdMenuTriggerFor]="licenseMenu" aria-label="License menu"> |
|---|
| 35 | 57 | <md-icon>more_vert</md-icon> |
|---|
| 36 | 58 | </button> |
|---|
| 37 | | - |
|---|
| 38 | | - <md-menu #packMenu="mdMenu"> |
|---|
| 39 | | - <button md-menu-item *ngFor="let action of pack_menu_options" (click)="packAction(action.command, row)" [disabled]="!isActionAvailable(row)"> |
|---|
| 59 | + <md-menu #licenseMenu="mdMenu"> |
|---|
| 60 | + <button md-menu-item *ngFor="let action of license_menu_options" (click)="licenseAction(action.command, row)" [disabled]="!isActionAvailable(row)"> |
|---|
| 40 | 61 | <md-icon *ngIf="!!action.icon">{{ action.icon }}</md-icon> {{ action.name }} |
|---|
| 41 | 62 | </button> |
|---|
| 42 | 63 | </md-menu> |
|---|
| 43 | | - <button md-icon-button (click)="showLicenses(row)" color="accent"><md-icon>arrow_forward</md-icon></button> |
|---|
| 44 | 64 | </div> |
|---|
| 45 | 65 | </template> |
|---|
| 46 | 66 | </td-data-table> |
|---|