From 4a6bf7f2180969fb86fefeb35761bd9195dc9f65 Mon Sep 17 00:00:00 2001 From: jackyin Date: Mon, 17 Jun 2024 22:02:00 +0800 Subject: [PATCH] app/vmui: copy button shows undefined (#6495) ### Describe Your Changes fix #6421 some aggregation func don't return \_\_name\_\_ value --- .../packages/vmui/src/components/Views/TableView/TableView.tsx | 1 + docs/CHANGELOG.md | 1 + 2 files changed, 2 insertions(+) diff --git a/app/vmui/packages/vmui/src/components/Views/TableView/TableView.tsx b/app/vmui/packages/vmui/src/components/Views/TableView/TableView.tsx index 7b66129be6..4317aa351f 100644 --- a/app/vmui/packages/vmui/src/components/Views/TableView/TableView.tsx +++ b/app/vmui/packages/vmui/src/components/Views/TableView/TableView.tsx @@ -36,6 +36,7 @@ const TableView: FC = ({ data, displayColumns }) => { const getCopyValue = (metric: { [p: string]: string }) => { const { __name__, ...fields } = metric; if (!__name__ && !Object.keys(fields).length) return ""; + if (!__name__) return `${JSON.stringify(fields)}`; return `${__name__} ${JSON.stringify(fields)}`; }; diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 90f725fe98..564dd58a89 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -49,6 +49,7 @@ See also [LTS releases](https://docs.victoriametrics.com/lts-releases/). * BUGFIX: [vmalert](https://docs.victoriametrics.com/vmalert/): properly specify oauth2 `ClientSecret` when configuring authentication for `notifier.url`. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6471) for details. Thanks to @yincongcyincong for the [pull request](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/6478). * BUGFIX: [Single-node VictoriaMetrics](https://docs.victoriametrics.com/) and `vmstorage` in [VictoriaMetrics cluster](https://docs.victoriametrics.com/cluster-victoriametrics/): add validation for the max value specified for `-retentionPeriod`. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6330) for details. * BUGFIX: [vmselect](https://docs.victoriametrics.com/cluster-victoriametrics/): calculate the exact number of [raw samples](https://docs.victoriametrics.com/keyconcepts/#raw-samples) during query processing, the limit is specified via command-line flag `-search.maxSamplesPerQuery`. Previously, samples could have been over-counted and lead to false-positive errors of `maxSamplesPerQuery`limit exceeded. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5851). +* BUGFIX: [vmui](https://docs.victoriametrics.com/#vmui): **copy row** button in Table view produces unexpected result. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6421) and [pull request](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/6495). ## [v1.102.0-rc1](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.102.0-rc1)