From a1d73a292ca4a36a8ce532ee42e20cd5274e955b Mon Sep 17 00:00:00 2001 From: tomsun28 Date: Wed, 21 Aug 2024 13:39:39 +0800 Subject: [PATCH] [webapp] auto resize the monitor detail ui width (#2577) Signed-off-by: tomsun28 Co-authored-by: YuLuo --- .../monitor-data-chart.component.html | 3 +- .../monitor-data-chart.component.ts | 21 ++++++++++-- .../monitor-data-table.component.html | 4 +-- .../monitor-data-table.component.ts | 34 +++++++++++++++++-- .../monitor-detail.component.html | 2 -- 5 files changed, 53 insertions(+), 11 deletions(-) diff --git a/web-app/src/app/routes/monitor/monitor-data-chart/monitor-data-chart.component.html b/web-app/src/app/routes/monitor/monitor-data-chart/monitor-data-chart.component.html index 8f1c4cb7fa6..e744e7afaa9 100644 --- a/web-app/src/app/routes/monitor/monitor-data-chart/monitor-data-chart.component.html +++ b/web-app/src/app/routes/monitor/monitor-data-chart/monitor-data-chart.component.html @@ -17,7 +17,8 @@ ~ under the License. --> - +
+
= 5) { + this.cardWidth = this.cardWidth + this.cardWidth; + } this.lineHistoryTheme.series = []; let valueKeyArr = Object.keys(values); for (let index = 0; index < valueKeyArr.length; index++) { diff --git a/web-app/src/app/routes/monitor/monitor-data-table/monitor-data-table.component.html b/web-app/src/app/routes/monitor/monitor-data-table/monitor-data-table.component.html index 019ef5535a2..05f4348eb1f 100644 --- a/web-app/src/app/routes/monitor/monitor-data-table/monitor-data-table.component.html +++ b/web-app/src/app/routes/monitor/monitor-data-table/monitor-data-table.component.html @@ -16,10 +16,10 @@ ~ specific language governing permissions and limitations ~ under the License. --> - +
= 5) { + updateWidth = true; + } + } + this.valueRows.forEach(row => { + row.values.forEach((value: any) => { + if (value.origin?.length > 60) { + updateWidth = true; + } + }); + }); + if (updateWidth) { + this.cardWidth = this.cardWidth + this.cardWidth; + this.cdr.detectChanges(); } } else if (message.code !== 0) { this.notifySvc.warning(`${this.metrics}:${message.msg}`, ''); diff --git a/web-app/src/app/routes/monitor/monitor-detail/monitor-detail.component.html b/web-app/src/app/routes/monitor/monitor-detail/monitor-detail.component.html index 7cf402565f0..2dcdaa66ee0 100755 --- a/web-app/src/app/routes/monitor/monitor-detail/monitor-detail.component.html +++ b/web-app/src/app/routes/monitor/monitor-detail/monitor-detail.component.html @@ -65,7 +65,6 @@ [app]="app" >