Skip to content

Commit

Permalink
Further enhance and refine the optimizations implemented in #2215. (#…
Browse files Browse the repository at this point in the history
…2249)

Signed-off-by: Kerwin Bryant <[email protected]>
  • Loading branch information
kerwin612 authored Jul 9, 2024
1 parent 874f7bd commit 6cabe3c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,7 @@
/>
</ng-container>

<nz-collapse
*ngIf="advancedParamDefines && advancedParamDefines.length > 0"
[nzGhost]="true"
style="background: ghostwhite; margin-bottom: 24px"
>
<nz-collapse *ngIf="hasAdvancedParams" [nzGhost]="true" style="background: ghostwhite; margin-bottom: 24px">
<ng-template #extraColHeader>
<button style="margin-left: 40%" nz-button nzType="dashed" nz-tooltip [nzTooltipTitle]="'monitors.advanced.tip' | i18n">
<span>{{ 'monitors.advanced' | i18n }}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,19 @@ export class MonitorFormComponent implements OnChanges {
@Output() readonly formDetect = new EventEmitter<any>();
@Output() readonly hostChange = new EventEmitter<string>();

hasAdvancedParams: boolean = false;

constructor() {}

ngOnChanges(changes: SimpleChanges) {
if (changes.advancedParams && changes.advancedParams.currentValue !== changes.advancedParams.previousValue) {
for (const advancedParam of changes.advancedParams.currentValue) {
if (advancedParam.display !== false) {
this.hasAdvancedParams = true;
break;
}
}
}
if (changes.paramDefines && changes.paramDefines.currentValue !== changes.paramDefines.previousValue) {
changes.paramDefines.currentValue.forEach((paramDefine: any) => {
if (paramDefine.type == 'radio') {
Expand Down

0 comments on commit 6cabe3c

Please sign in to comment.