| Index: dashboard/dashboard/elements/group-report-page.html
|
| diff --git a/dashboard/dashboard/elements/group-report-page.html b/dashboard/dashboard/elements/group-report-page.html
|
| index b40ff87f1ce2565b05a24d61578777821b1112b0..71d8997af3a7ba4e018e82e9eb911287f8fbf562 100644
|
| --- a/dashboard/dashboard/elements/group-report-page.html
|
| +++ b/dashboard/dashboard/elements/group-report-page.html
|
| @@ -142,20 +142,7 @@ found in the LICENSE file.
|
| properties: {
|
| extraColumns: {
|
| type: Array,
|
| - value: () => ([
|
| - {
|
| - 'key': 'percent_changed',
|
| - 'label': 'Delta %'
|
| - },
|
| - {
|
| - 'key': 'absolute_delta',
|
| - 'label': 'Abs Delta'
|
| - },
|
| - {
|
| - 'key': 'units',
|
| - 'label': 'Units'
|
| - }
|
| - ])
|
| + value: () => []
|
| },
|
| loading: {
|
| type: Boolean,
|
| @@ -416,6 +403,47 @@ found in the LICENSE file.
|
| },
|
|
|
| /**
|
| + * Sets the extra columns on the alerts table based on the type of alerts
|
| + * in the list for the table.
|
| + */
|
| + setExtraColumns: function(alertList) {
|
| + // Make a set of types in the table.
|
| + var types = new Set(alertList.map(item => item.type));
|
| +
|
| + // Check if there is only one type.
|
| + if (types.size === 1) {
|
| + if (types.has('anomaly')) {
|
| + // Only anomalies in the table. Use anomaly extraColumns.
|
| + this.set('extraColumns', [
|
| + {
|
| + 'key': 'percent_changed',
|
| + 'label': 'Delta %'
|
| + },
|
| + {
|
| + 'key': 'absolute_delta',
|
| + 'label': 'Abs Delta'
|
| + },
|
| + {
|
| + 'key': 'units',
|
| + 'label': 'Units'
|
| + }
|
| + ]);
|
| + } else {
|
| + // Only stoppage alerts in the table. Use stoppage extraColumns.
|
| + this.set('extraColumns', [
|
| + {
|
| + 'key': 'last_row_date',
|
| + 'label': 'Date'
|
| + }
|
| + ]);
|
| + }
|
| + } else {
|
| + // Either multiple or no types. Can't set extraColumns.
|
| + this.set('extraColumns', []);
|
| + }
|
| + },
|
| +
|
| + /**
|
| * The url params determine what data to request from
|
| * /group_report. sid is a hash of a group of keys.
|
| */
|
| @@ -448,6 +476,7 @@ found in the LICENSE file.
|
| this.xsrfToken = response['xsrf_token'];
|
| this.warningBug = response['warning_bug'];
|
| this.warningMessage = response['warning_message'];
|
| + this.setExtraColumns(response['alert_list']);
|
| this.alertList = response['alert_list'];
|
| this.selectedKeys = response['selected_keys'];
|
| if (this.warningMessage) {
|
|
|