|
|
|
@ -19,90 +19,70 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="card-body"> |
|
|
|
<abp-table |
|
|
|
*ngIf="[150, 0] as columnWidths" |
|
|
|
[abpLoading]="loading" |
|
|
|
[abpLoadingDelay]="500" |
|
|
|
[abpTableSort]="{ key: sortKey, order: sortOrder }" |
|
|
|
[colgroupTemplate]="tableColGroup" |
|
|
|
[headerTemplate]="tableHeader" |
|
|
|
[bodyTemplate]="tableBody" |
|
|
|
[value]="data$ | async" |
|
|
|
[rows]="pageQuery.maxResultCount" |
|
|
|
[totalRecords]="totalCount$ | async" |
|
|
|
[scrollable]="true" |
|
|
|
(pageChange)="onPageChange($event)" |
|
|
|
<div class=""> |
|
|
|
<ngx-datatable |
|
|
|
[rows]="data$ | async" |
|
|
|
[loadingIndicator]="list.isLoading$ | async" |
|
|
|
[externalSorting]="true" |
|
|
|
(sort)="onSort($event)" |
|
|
|
[externalPaging]="true" |
|
|
|
[count]="totalCount$ | async" |
|
|
|
[offset]="list.page - 1" |
|
|
|
[limit]="list.maxResultCount" |
|
|
|
(page)="list.page = $event.offset + 1" |
|
|
|
[headerHeight]="50" |
|
|
|
[footerHeight]="50" |
|
|
|
columnMode="force" |
|
|
|
rowHeight="auto" |
|
|
|
class="material" |
|
|
|
> |
|
|
|
<ng-template #tableColGroup> |
|
|
|
<colgroup> |
|
|
|
<col *ngFor="let width of columnWidths" [ngStyle]="{ 'width.px': width || undefined }" /> |
|
|
|
</colgroup> |
|
|
|
</ng-template> |
|
|
|
<ng-template #tableHeader> |
|
|
|
<tr> |
|
|
|
<th>{{ 'AbpIdentity::Actions' | abpLocalization }}</th> |
|
|
|
<th (click)="sortOrderIcon.sort('name')"> |
|
|
|
{{ 'AbpIdentity::RoleName' | abpLocalization }} |
|
|
|
<abp-sort-order-icon |
|
|
|
#sortOrderIcon |
|
|
|
sortKey="name" |
|
|
|
[(selectedSortKey)]="sortKey" |
|
|
|
[(order)]="sortOrder" |
|
|
|
></abp-sort-order-icon> |
|
|
|
</th> |
|
|
|
</tr> |
|
|
|
</ng-template> |
|
|
|
<ng-template #tableBody let-data> |
|
|
|
<tr> |
|
|
|
<td class="text-center"> |
|
|
|
<div ngbDropdown container="body" class="d-inline-block"> |
|
|
|
<ngx-datatable-column |
|
|
|
[name]="'AbpIdentity::Actions' | abpLocalization" |
|
|
|
[maxWidth]="150" |
|
|
|
[sortable]="false" |
|
|
|
> |
|
|
|
<ng-template let-value="value" ngx-datatable-cell-template> |
|
|
|
<div ngbDropdown container="body" class="d-inline-block"> |
|
|
|
<button |
|
|
|
class="btn btn-primary btn-sm dropdown-toggle" |
|
|
|
data-toggle="dropdown" |
|
|
|
aria-haspopup="true" |
|
|
|
ngbDropdownToggle |
|
|
|
> |
|
|
|
<i class="fa fa-cog mr-1"></i>{{ 'AbpIdentity::Actions' | abpLocalization }} |
|
|
|
</button> |
|
|
|
<div ngbDropdownMenu> |
|
|
|
<button |
|
|
|
class="btn btn-primary btn-sm dropdown-toggle" |
|
|
|
data-toggle="dropdown" |
|
|
|
aria-haspopup="true" |
|
|
|
ngbDropdownToggle |
|
|
|
*abpPermission="'AbpIdentity.Roles.Update'" |
|
|
|
ngbDropdownItem |
|
|
|
(click)="edit(value.id)" |
|
|
|
> |
|
|
|
<i class="fa fa-cog mr-1"></i>{{ 'AbpIdentity::Actions' | abpLocalization }} |
|
|
|
{{ 'AbpIdentity::Edit' | abpLocalization }} |
|
|
|
</button> |
|
|
|
<button |
|
|
|
*abpPermission="'AbpIdentity.Roles.ManagePermissions'" |
|
|
|
ngbDropdownItem |
|
|
|
(click)="openPermissionsModal(value.name)" |
|
|
|
> |
|
|
|
{{ 'AbpIdentity::Permissions' | abpLocalization }} |
|
|
|
</button> |
|
|
|
<button |
|
|
|
*ngIf="!value.isStatic" |
|
|
|
[abpPermission]="'AbpIdentity.Roles.Delete'" |
|
|
|
ngbDropdownItem |
|
|
|
(click)="delete(value.id, value.name)" |
|
|
|
> |
|
|
|
{{ 'AbpIdentity::Delete' | abpLocalization }} |
|
|
|
</button> |
|
|
|
<div ngbDropdownMenu> |
|
|
|
<button |
|
|
|
*abpPermission="'AbpIdentity.Roles.Update'" |
|
|
|
ngbDropdownItem |
|
|
|
(click)="edit(data.id)" |
|
|
|
> |
|
|
|
{{ 'AbpIdentity::Edit' | abpLocalization }} |
|
|
|
</button> |
|
|
|
<button |
|
|
|
*abpPermission="'AbpIdentity.Roles.ManagePermissions'" |
|
|
|
ngbDropdownItem |
|
|
|
(click)="openPermissionsModal(data.name)" |
|
|
|
> |
|
|
|
{{ 'AbpIdentity::Permissions' | abpLocalization }} |
|
|
|
</button> |
|
|
|
<button |
|
|
|
*ngIf="!data.isStatic" |
|
|
|
[abpPermission]="'AbpIdentity.Roles.Delete'" |
|
|
|
ngbDropdownItem |
|
|
|
(click)="delete(data.id, data.name)" |
|
|
|
> |
|
|
|
{{ 'AbpIdentity::Delete' | abpLocalization }} |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</td> |
|
|
|
<td> |
|
|
|
{{ data.name |
|
|
|
}}<span *ngIf="data.isDefault" class="badge badge-pill badge-success ml-1">{{ |
|
|
|
'AbpIdentity::DisplayName:IsDefault' | abpLocalization |
|
|
|
}}</span> |
|
|
|
<span *ngIf="data.isPublic" class="badge badge-pill badge-info ml-1">{{ |
|
|
|
'AbpIdentity::DisplayName:IsPublic' | abpLocalization |
|
|
|
}}</span> |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
</ng-template> |
|
|
|
</abp-table> |
|
|
|
</div> |
|
|
|
</ng-template> |
|
|
|
</ngx-datatable-column> |
|
|
|
<ngx-datatable-column |
|
|
|
[name]="'AbpIdentity::RoleName' | abpLocalization" |
|
|
|
prop="name" |
|
|
|
></ngx-datatable-column> |
|
|
|
</ngx-datatable> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|