diff options
-rw-r--r-- | src/components/_sila/Global/Chart.vue | 8 | ||||
-rw-r--r-- | src/store/modules/GlobalStore.js | 2 | ||||
-rw-r--r-- | src/store/modules/HardwareStatus/FanStore.js | 4 | ||||
-rw-r--r-- | src/store/modules/HardwareStatus/MemoryStore.js | 5 | ||||
-rw-r--r-- | src/store/modules/HardwareStatus/MotherboardStore.js | 5 | ||||
-rw-r--r-- | src/store/modules/HardwareStatus/ProcessorStore.js | 9 | ||||
-rw-r--r-- | src/utilities/_sila/metricProperties.js | 30 | ||||
-rw-r--r-- | src/views/_sila/ProfileSettings/ProfileSettings.vue | 14 |
8 files changed, 33 insertions, 44 deletions
diff --git a/src/components/_sila/Global/Chart.vue b/src/components/_sila/Global/Chart.vue index fa66683a..4da58798 100644 --- a/src/components/_sila/Global/Chart.vue +++ b/src/components/_sila/Global/Chart.vue @@ -76,7 +76,7 @@ export default { computed: { readyData() { let filteredData = this.data.filter((metric) => { - return metric.MetricValue !== 'nan'; + return metric.Value !== 'nan'; }); filteredData.sort((a, b) => { @@ -90,7 +90,7 @@ export default { return { ...metric, Timestamp: time, - MetricValue: Math.round(metric.MetricValue), + Value: Math.round(metric.Value), }; }); @@ -101,7 +101,7 @@ export default { }, metricData() { let group = this.readyData.reduce(function (rv, x) { - (rv[x['MetricProperty']] = rv[x['MetricProperty']] || []).push(x); + (rv[x['Sensor']] = rv[x['Sensor']] || []).push(x); return rv; }, {}); @@ -116,7 +116,7 @@ export default { const { length } = arr; return Math.round( arr.reduce((acc, val) => { - return acc + val.MetricValue / length; + return acc + val.Value / length; }, 0) ); }; diff --git a/src/store/modules/GlobalStore.js b/src/store/modules/GlobalStore.js index 49283b03..39eb597e 100644 --- a/src/store/modules/GlobalStore.js +++ b/src/store/modules/GlobalStore.js @@ -37,7 +37,7 @@ const GlobalStore = { languagePreference: localStorage.getItem('storedLanguage') || 'en-US', isUtcDisplay: localStorage.getItem('storedUtcDisplay') ? JSON.parse(localStorage.getItem('storedUtcDisplay')) - : true, + : false, username: localStorage.getItem('storedUsername'), isAuthorized: true, }, diff --git a/src/store/modules/HardwareStatus/FanStore.js b/src/store/modules/HardwareStatus/FanStore.js index fed3f742..e58296b5 100644 --- a/src/store/modules/HardwareStatus/FanStore.js +++ b/src/store/modules/HardwareStatus/FanStore.js @@ -54,9 +54,9 @@ const FanStore = { let url = null; if (lastHour) { url = - '/redfish/v1/TelemetryService/MetricReports/hour_data&id=fans&period=last_hour'; + '/redfish/v1/TelemetryService/MetricReports/fans&period=last_hour'; } else { - url = '/redfish/v1/TelemetryService/MetricReports/hour_data&id=fans'; + url = '/redfish/v1/TelemetryService/MetricReports/fans'; } return await api .get(url) diff --git a/src/store/modules/HardwareStatus/MemoryStore.js b/src/store/modules/HardwareStatus/MemoryStore.js index 358ca725..924d52a1 100644 --- a/src/store/modules/HardwareStatus/MemoryStore.js +++ b/src/store/modules/HardwareStatus/MemoryStore.js @@ -68,10 +68,9 @@ const MemoryStore = { let url = null; if (lastHour) { url = - '/redfish/v1/TelemetryService/MetricReports/hour_data&id=dimm_temp&period=last_hour'; + '/redfish/v1/TelemetryService/MetricReports/dimm_temp&period=last_hour'; } else { - url = - '/redfish/v1/TelemetryService/MetricReports/hour_data&id=dimm_temp'; + url = '/redfish/v1/TelemetryService/MetricReports/dimm_temp'; } return await api .get(url) diff --git a/src/store/modules/HardwareStatus/MotherboardStore.js b/src/store/modules/HardwareStatus/MotherboardStore.js index 7b2fe032..09f24498 100644 --- a/src/store/modules/HardwareStatus/MotherboardStore.js +++ b/src/store/modules/HardwareStatus/MotherboardStore.js @@ -23,10 +23,9 @@ const MotherboardStore = { let url = null; if (lastHour) { url = - '/redfish/v1/TelemetryService/MetricReports/hour_data&id=other_temp&period=last_hour'; + '/redfish/v1/TelemetryService/MetricReports/other_temp&period=last_hour'; } else { - url = - '/redfish/v1/TelemetryService/MetricReports/hour_data&id=other_temp'; + url = '/redfish/v1/TelemetryService/MetricReports/other_temp'; } return await api .get(url) diff --git a/src/store/modules/HardwareStatus/ProcessorStore.js b/src/store/modules/HardwareStatus/ProcessorStore.js index 5466b85e..68b29ab6 100644 --- a/src/store/modules/HardwareStatus/ProcessorStore.js +++ b/src/store/modules/HardwareStatus/ProcessorStore.js @@ -84,9 +84,9 @@ const ProcessorStore = { let url = null; if (lastHour) { url = - '/redfish/v1/TelemetryService/MetricReports/hour_data&id=power&period=last_hour'; + '/redfish/v1/TelemetryService/MetricReports/power&period=last_hour'; } else { - url = '/redfish/v1/TelemetryService/MetricReports/hour_data&id=power'; + url = '/redfish/v1/TelemetryService/MetricReports/power'; } return await api .get(url) @@ -103,10 +103,9 @@ const ProcessorStore = { let url = null; if (lastHour) { url = - '/redfish/v1/TelemetryService/MetricReports/hour_data&id=cpu_temp&period=last_hour'; + '/redfish/v1/TelemetryService/MetricReports/cpu_temp&period=last_hour'; } else { - url = - '/redfish/v1/TelemetryService/MetricReports/hour_data&id=cpu_temp'; + url = '/redfish/v1/TelemetryService/MetricReports/cpu_temp'; } return await api .get(url) diff --git a/src/utilities/_sila/metricProperties.js b/src/utilities/_sila/metricProperties.js index 32495605..389c4683 100644 --- a/src/utilities/_sila/metricProperties.js +++ b/src/utilities/_sila/metricProperties.js @@ -1,6 +1,6 @@ export function getItems(data) { let filteredData = data.filter((metric) => { - return metric.MetricValue !== 'nan'; + return metric.Value !== 'nan'; }); let transform = filteredData.map((metric) => { @@ -12,19 +12,19 @@ export function getItems(data) { date.getHours() + ':' + String(date.getMinutes()).padStart(2, '0'), date: formatDate(date), }, - MetricValue: Math.round(metric.MetricValue), + Value: Math.round(metric.Value), }; }); let group = transform.reduce(function (rv, x) { - (rv[x['MetricProperty']] = rv[x['MetricProperty']] || []).push(x); + (rv[x['Sensor']] = rv[x['Sensor']] || []).push(x); return rv; }, {}); return Object.keys(group).map((metric) => { return { name: metric, - current: group[metric][group[metric].length - 1].MetricValue, + current: group[metric][group[metric].length - 1].Value, middle: findAverage(group[metric]), min: findMin(group[metric]), minDate: findDateOfMin(group[metric]), @@ -50,33 +50,25 @@ function findAverage(arr) { const { length } = arr; return Math.round( arr.reduce((acc, val) => { - return acc + val.MetricValue / length; + return acc + val.Value / length; }, 0) ); } function findMin(arr) { - return arr.reduce( - (min, p) => (p.MetricValue < min ? p.MetricValue : min), - arr[0].MetricValue - ); + return arr.reduce((min, p) => (p.Value < min ? p.Value : min), arr[0].Value); } function findMax(arr) { - return arr.reduce( - (max, p) => (p.MetricValue > max ? p.MetricValue : max), - arr[0].MetricValue - ); + return arr.reduce((max, p) => (p.Value > max ? p.Value : max), arr[0].Value); } function findDateOfMin(arr) { - return arr.reduce((res, obj) => - obj.MetricValue < res.MetricValue ? obj : res - ).Timestamp; + return arr.reduce((res, obj) => (obj.Value < res.Value ? obj : res)) + .Timestamp; } function findDateOfMax(arr) { - return arr.reduce((res, obj) => - obj.MetricValue > res.MetricValue ? obj : res - ).Timestamp; + return arr.reduce((res, obj) => (obj.Value > res.Value ? obj : res)) + .Timestamp; } diff --git a/src/views/_sila/ProfileSettings/ProfileSettings.vue b/src/views/_sila/ProfileSettings/ProfileSettings.vue index bc2b4702..258668e0 100644 --- a/src/views/_sila/ProfileSettings/ProfileSettings.vue +++ b/src/views/_sila/ProfileSettings/ProfileSettings.vue @@ -96,13 +96,6 @@ <b-form-group :label="$t('pageProfileSettings.timezone')"> <b-form-radio v-model="form.isUtcDisplay" - :value="true" - data-test-id="profileSettings-radio-defaultUTC" - > - {{ $t('pageProfileSettings.defaultUTC') }} - </b-form-radio> - <b-form-radio - v-model="form.isUtcDisplay" :value="false" data-test-id="profileSettings-radio-browserOffset" > @@ -112,6 +105,13 @@ }) }} </b-form-radio> + <b-form-radio + v-model="form.isUtcDisplay" + :value="true" + data-test-id="profileSettings-radio-defaultUTC" + > + {{ $t('pageProfileSettings.defaultUTC') }} + </b-form-radio> </b-form-group> </b-col> </b-row> |