mirror of https://github.com/abpframework/abp.git
2 changed files with 317 additions and 134 deletions
@ -1,145 +1,161 @@ |
|||||
<abp-modal *ngIf="visible" [(visible)]="visible" [busy]="modalBusy" [options]="{ size: 'lg' }"> |
@if (visible) { |
||||
<ng-template #abpHeader> |
<abp-modal [(visible)]="visible" [busy]="modalBusy" [options]="{ size: 'lg' }"> |
||||
<h3>{{ 'AbpFeatureManagement::Features' | abpLocalization }}</h3> |
<ng-template #abpHeader> |
||||
</ng-template> |
<h3>{{ 'AbpFeatureManagement::Features' | abpLocalization }}</h3> |
||||
|
</ng-template> |
||||
|
|
||||
<ng-template #abpBody> |
<ng-template #abpBody> |
||||
<div class="row"> |
<div class="row"> |
||||
<ng-container *ngIf="groups.length"> |
@if (groups.length) { |
||||
<div class="col-md-4"> |
<div class="col-md-4"> |
||||
<ul |
<ul |
||||
ngbNav |
ngbNav |
||||
#nav="ngbNav" |
#nav="ngbNav" |
||||
[(activeId)]="selectedGroupDisplayName" |
[(activeId)]="selectedGroupDisplayName" |
||||
class="nav-pills" |
class="nav-pills" |
||||
orientation="vertical" |
orientation="vertical" |
||||
> |
|
||||
<li |
|
||||
*ngFor="let group of groups; trackBy: track.by('name')" |
|
||||
[ngbNavItem]="group.displayName" |
|
||||
> |
> |
||||
<a ngbNavLink>{{ group.displayName }}</a> |
@for (group of groups; track group.name) { |
||||
<ng-template ngbNavContent> |
<li [ngbNavItem]="group.displayName"> |
||||
<h4>{{ selectedGroupDisplayName }}</h4> |
<a ngbNavLink>{{ group.displayName }}</a> |
||||
<hr class="mt-2 mb-3" /> |
<ng-template ngbNavContent> |
||||
|
<h4>{{ selectedGroupDisplayName }}</h4> |
||||
|
<hr class="mt-2 mb-3" /> |
||||
|
|
||||
<div |
@for (feature of features[group.name]; track feature.id; let i = $index) { |
||||
class="mt-2" |
<div class="mt-2" [ngStyle]="feature.style" (keyup.enter)="save()"> |
||||
*ngFor=" |
@switch (feature.valueType?.name) { |
||||
let feature of features[group.name]; |
@case (valueTypes.ToggleStringValueType) { |
||||
let i = index; |
<div class="form-check"> |
||||
trackBy: track.by('id') |
<input |
||||
" |
class="form-check-input" |
||||
[ngStyle]="feature.style" |
type="checkbox" |
||||
[ngSwitch]="feature.valueType?.name" |
[id]="feature.name" |
||||
(keyup.enter)="save()" |
[(ngModel)]="feature.value" |
||||
> |
(ngModelChange)="onCheckboxClick($event, feature)" |
||||
<ng-container *ngSwitchCase="valueTypes.ToggleStringValueType"> |
/> |
||||
<div class="form-check"> |
|
||||
<input |
|
||||
class="form-check-input" |
|
||||
type="checkbox" |
|
||||
[id]="feature.name" |
|
||||
[(ngModel)]="feature.value" |
|
||||
(ngModelChange)="onCheckboxClick($event, feature)" |
|
||||
/> |
|
||||
|
|
||||
<label class="form-check-label" [htmlFor]="feature.name">{{ |
<label class="form-check-label" [htmlFor]="feature.name">{{ |
||||
feature.displayName |
feature.displayName |
||||
}}</label> |
}}</label> |
||||
<ng-container |
<ng-container |
||||
*ngTemplateOutlet="descTmp; context: { $implicit: feature.description }" |
*ngTemplateOutlet=" |
||||
></ng-container> |
descTmp; |
||||
</div> |
context: { $implicit: feature.description } |
||||
</ng-container> |
" |
||||
<ng-container *ngSwitchCase="valueTypes.FreeTextStringValueType"> |
></ng-container> |
||||
<div class="mb-3 form-group"> |
</div> |
||||
<label [htmlFor]="feature.name" class="form-label">{{ |
} |
||||
feature.displayName |
@case (valueTypes.FreeTextStringValueType) { |
||||
}}</label> |
<div class="mb-3 form-group"> |
||||
<input |
<label [htmlFor]="feature.name" class="form-label">{{ |
||||
class="form-control" |
feature.displayName |
||||
type="text" |
}}</label> |
||||
[id]="feature.name" |
<input |
||||
[(ngModel)]="feature.value" |
class="form-control" |
||||
[abpFeatureManagementFreeText]="feature" |
type="text" |
||||
/> |
[id]="feature.name" |
||||
|
[(ngModel)]="feature.value" |
||||
|
[abpFeatureManagementFreeText]="feature" |
||||
|
/> |
||||
|
|
||||
<ng-container |
<ng-container |
||||
*ngTemplateOutlet="descTmp; context: { $implicit: feature.description }" |
*ngTemplateOutlet=" |
||||
></ng-container> |
descTmp; |
||||
</div> |
context: { $implicit: feature.description } |
||||
</ng-container> |
" |
||||
<ng-container *ngSwitchCase="valueTypes.SelectionStringValueType"> |
></ng-container> |
||||
<ng-container *ngIf="feature.valueType.itemSource?.items?.length"> |
</div> |
||||
<div class="mb-3 form-group"> |
} |
||||
<label [htmlFor]="feature.name" class="form-label">{{ |
@case (valueTypes.SelectionStringValueType) { |
||||
feature.displayName |
@if (feature.valueType.itemSource?.items?.length) { |
||||
}}</label> |
<div class="mb-3 form-group"> |
||||
<select class="form-select" [id]="feature.name" [(ngModel)]="feature.value"> |
<label [htmlFor]="feature.name" class="form-label">{{ |
||||
<option |
feature.displayName |
||||
*ngFor=" |
}}</label> |
||||
let item of feature.valueType.itemSource?.items; |
<select |
||||
trackBy: track.by('value') |
class="form-select" |
||||
" |
[id]="feature.name" |
||||
[ngValue]="item.value" |
[(ngModel)]="feature.value" |
||||
> |
> |
||||
{{ |
@for ( |
||||
item.displayText?.resourceName + '::' + item.displayText?.name |
item of feature.valueType.itemSource?.items; |
||||
| abpLocalization |
track item.value |
||||
}} |
) { |
||||
</option> |
<option [ngValue]="item.value"> |
||||
</select> |
{{ |
||||
<ng-container |
item.displayText?.resourceName + |
||||
*ngTemplateOutlet="descTmp; context: { $implicit: feature.description }" |
'::' + |
||||
></ng-container> |
item.displayText?.name | abpLocalization |
||||
|
}} |
||||
|
</option> |
||||
|
} |
||||
|
</select> |
||||
|
<ng-container |
||||
|
*ngTemplateOutlet=" |
||||
|
descTmp; |
||||
|
context: { $implicit: feature.description } |
||||
|
" |
||||
|
></ng-container> |
||||
|
</div> |
||||
|
} |
||||
|
} |
||||
|
@default { |
||||
|
{{ feature.displayName }} |
||||
|
} |
||||
|
} |
||||
</div> |
</div> |
||||
</ng-container> |
} |
||||
</ng-container> |
</ng-template> |
||||
<ng-container *ngSwitchDefault>{{ feature.displayName }}</ng-container> |
</li> |
||||
</div> |
} |
||||
</ng-template> |
</ul> |
||||
</li> |
</div> |
||||
</ul> |
|
||||
</div> |
|
||||
|
|
||||
<ng-template #descTmp let-description> |
<ng-template #descTmp let-description> |
||||
<small *ngIf="description" class="d-block form-text text-muted">{{ description }}</small> |
@if (description) { |
||||
</ng-template> |
<small class="d-block form-text text-muted">{{ description }}</small> |
||||
|
} |
||||
|
</ng-template> |
||||
|
|
||||
<div class="col-md-8"><div class="py-0" [ngbNavOutlet]="nav"></div></div> |
<div class="col-md-8"><div class="py-0" [ngbNavOutlet]="nav"></div></div> |
||||
</ng-container> |
} |
||||
|
|
||||
<div class="col" *ngIf="!groups.length"> |
@if (!groups.length) { |
||||
{{ 'AbpFeatureManagement::NoFeatureFoundMessage' | abpLocalization }} |
<div class="col"> |
||||
|
{{ 'AbpFeatureManagement::NoFeatureFoundMessage' | abpLocalization }} |
||||
|
</div> |
||||
|
} |
||||
</div> |
</div> |
||||
</div> |
</ng-template> |
||||
</ng-template> |
|
||||
|
|
||||
<ng-template #abpFooter> |
<ng-template #abpFooter> |
||||
<button abpClose type="button" class="btn btn-link"> |
<button abpClose type="button" class="btn btn-link"> |
||||
{{ 'AbpFeatureManagement::Cancel' | abpLocalization }} |
{{ 'AbpFeatureManagement::Cancel' | abpLocalization }} |
||||
</button> |
</button> |
||||
|
|
||||
<abp-button |
@if (groups.length) { |
||||
*ngIf="groups.length" |
<abp-button |
||||
iconClass="fa fa-refresh" |
iconClass="fa fa-refresh" |
||||
buttonClass="btn btn-outline-primary" |
buttonClass="btn btn-outline-primary" |
||||
[disabled]="modalBusy" |
[disabled]="modalBusy" |
||||
(click)="resetToDefault()" |
(click)="resetToDefault()" |
||||
aria-hidden="true" |
aria-hidden="true" |
||||
> |
> |
||||
{{ 'AbpFeatureManagement::ResetToDefault' | abpLocalization }} |
{{ 'AbpFeatureManagement::ResetToDefault' | abpLocalization }} |
||||
</abp-button> |
</abp-button> |
||||
|
} |
||||
|
|
||||
<abp-button |
@if (groups.length) { |
||||
*ngIf="groups.length" |
<abp-button |
||||
iconClass="fa fa-check" |
iconClass="fa fa-check" |
||||
[disabled]="modalBusy" |
[disabled]="modalBusy" |
||||
(click)="save()" |
(click)="save()" |
||||
aria-hidden="true" |
aria-hidden="true" |
||||
> |
> |
||||
{{ 'AbpFeatureManagement::Save' | abpLocalization }} |
{{ 'AbpFeatureManagement::Save' | abpLocalization }} |
||||
</abp-button> |
</abp-button> |
||||
</ng-template> |
} |
||||
</abp-modal> |
</ng-template> |
||||
|
</abp-modal> |
||||
|
} |
||||
|
|||||
Loading…
Reference in new issue