mirror of https://github.com/ghostfolio/ghostfolio
committed by
GitHub
78 changed files with 1115 additions and 770 deletions
@ -1,5 +1,7 @@ |
|||
import { PortfolioReportRule } from '@ghostfolio/common/interfaces'; |
|||
import { XRayRulesSettings } from '@ghostfolio/common/types'; |
|||
|
|||
export interface IRuleSettingsDialogParams { |
|||
rule: PortfolioReportRule; |
|||
settings: XRayRulesSettings['AccountClusterRiskCurrentInvestment']; |
|||
} |
|||
|
@ -1,37 +1,85 @@ |
|||
<div mat-dialog-title>{{ data.rule.name }}</div> |
|||
|
|||
<div class="py-3" mat-dialog-content> |
|||
<mat-form-field |
|||
appearance="outline" |
|||
<div |
|||
class="w-100" |
|||
[ngClass]="{ 'd-none': settings.thresholdMin === undefined }" |
|||
[ngClass]="{ 'd-none': !data.rule.configuration.thresholdMin }" |
|||
> |
|||
<mat-label i18n>Threshold Min</mat-label> |
|||
<input |
|||
matInput |
|||
<h6 class="mb-0"> |
|||
<ng-container i18n>Threshold Min</ng-container>: |
|||
@if (data.rule.configuration.threshold.unit === '%') { |
|||
{{ data.settings.thresholdMin | percent: '1.2-2' }} |
|||
} @else { |
|||
{{ data.settings.thresholdMin }} |
|||
} |
|||
</h6> |
|||
@if (data.rule.configuration.threshold.unit === '%') { |
|||
<label>{{ |
|||
data.rule.configuration.threshold.min | percent: '1.2-2' |
|||
}}</label> |
|||
} @else { |
|||
<label>{{ data.rule.configuration.threshold.min }}</label> |
|||
} |
|||
<mat-slider |
|||
name="thresholdMin" |
|||
type="number" |
|||
[(ngModel)]="settings.thresholdMin" |
|||
/> |
|||
</mat-form-field> |
|||
<mat-form-field |
|||
appearance="outline" |
|||
[max]="data.rule.configuration.threshold.max" |
|||
[min]="data.rule.configuration.threshold.min" |
|||
[step]="data.rule.configuration.threshold.step" |
|||
> |
|||
<input matSliderThumb [(ngModel)]="data.settings.thresholdMin" /> |
|||
</mat-slider> |
|||
@if (data.rule.configuration.threshold.unit === '%') { |
|||
<label>{{ |
|||
data.rule.configuration.threshold.max | percent: '1.2-2' |
|||
}}</label> |
|||
} @else { |
|||
<label>{{ data.rule.configuration.threshold.max }}</label> |
|||
} |
|||
</div> |
|||
<div |
|||
class="w-100" |
|||
[ngClass]="{ 'd-none': settings.thresholdMax === undefined }" |
|||
[ngClass]="{ 'd-none': !data.rule.configuration.thresholdMax }" |
|||
> |
|||
<mat-label i18n>Threshold Max</mat-label> |
|||
<input |
|||
matInput |
|||
<h6 class="mb-0"> |
|||
<ng-container i18n>Threshold Max</ng-container>: |
|||
@if (data.rule.configuration.threshold.unit === '%') { |
|||
{{ data.settings.thresholdMax | percent: '1.2-2' }} |
|||
} @else { |
|||
{{ data.settings.thresholdMax }} |
|||
} |
|||
</h6> |
|||
@if (data.rule.configuration.threshold.unit === '%') { |
|||
<label>{{ |
|||
data.rule.configuration.threshold.min | percent: '1.2-2' |
|||
}}</label> |
|||
} @else { |
|||
<label>{{ data.rule.configuration.threshold.min }}</label> |
|||
} |
|||
<mat-slider |
|||
name="thresholdMax" |
|||
type="number" |
|||
[(ngModel)]="settings.thresholdMax" |
|||
/> |
|||
</mat-form-field> |
|||
[max]="data.rule.configuration.threshold.max" |
|||
[min]="data.rule.configuration.threshold.min" |
|||
[step]="data.rule.configuration.threshold.step" |
|||
> |
|||
<input matSliderThumb [(ngModel)]="data.settings.thresholdMax" /> |
|||
</mat-slider> |
|||
@if (data.rule.configuration.threshold.unit === '%') { |
|||
<label>{{ |
|||
data.rule.configuration.threshold.max | percent: '1.2-2' |
|||
}}</label> |
|||
} @else { |
|||
<label>{{ data.rule.configuration.threshold.max }}</label> |
|||
} |
|||
</div> |
|||
</div> |
|||
|
|||
<div align="end" mat-dialog-actions> |
|||
<button i18n mat-button (click)="dialogRef.close()">Close</button> |
|||
<button color="primary" mat-flat-button (click)="dialogRef.close(settings)"> |
|||
<button |
|||
color="primary" |
|||
mat-flat-button |
|||
(click)="dialogRef.close(data.settings)" |
|||
> |
|||
<ng-container i18n>Save</ng-container> |
|||
</button> |
|||
</div> |
|||
|
@ -1,11 +1,17 @@ |
|||
export interface PortfolioReportRule { |
|||
configuration?: { |
|||
threshold?: { |
|||
max: number; |
|||
min: number; |
|||
step: number; |
|||
unit?: string; |
|||
}; |
|||
thresholdMax?: boolean; |
|||
thresholdMin?: boolean; |
|||
}; |
|||
evaluation?: string; |
|||
isActive: boolean; |
|||
key: string; |
|||
name: string; |
|||
settings?: { |
|||
thresholdMax?: number; |
|||
thresholdMin?: number; |
|||
}; |
|||
value?: boolean; |
|||
} |
|||
|
Loading…
Reference in new issue