From c0f0a956a1def725feb1b821e5507183b435262b Mon Sep 17 00:00:00 2001 From: Maksim Zakharov Date: Fri, 5 Aug 2022 15:09:44 +0300 Subject: revert commit add full tables --- src/views/_sila/HardwareStatus/Sensors/Sensors.vue | 5 ++--- src/views/_sila/Logs/EventLogs/EventLogs.vue | 5 ++--- src/views/_sila/Logs/PostCodeLogs/PostCodeLogs.vue | 5 ++--- 3 files changed, 6 insertions(+), 9 deletions(-) (limited to 'src/views/_sila') diff --git a/src/views/_sila/HardwareStatus/Sensors/Sensors.vue b/src/views/_sila/HardwareStatus/Sensors/Sensors.vue index 3f9cf6c3..3dcfcc45 100644 --- a/src/views/_sila/HardwareStatus/Sensors/Sensors.vue +++ b/src/views/_sila/HardwareStatus/Sensors/Sensors.vue @@ -20,8 +20,8 @@ - - + + - - + + - - + + Date: Fri, 5 Aug 2022 16:56:18 +0300 Subject: add power supply page --- src/assets/images/_sila/collapsed/current.svg | 3 + src/assets/images/_sila/collapsed/voltage.svg | 3 + src/components/_sila/Global/Chart.vue | 75 ++++++++- src/components/_sila/Global/Collapse.vue | 6 +- src/env/components/AppNavigation/sila.js | 5 + src/env/router/sila.js | 9 + src/locales/en-US.json | 33 +++- src/locales/ru-RU.json | 31 +++- .../modules/HardwareStatus/PowerSupplyStore.js | 58 +++++++ src/utilities/_sila/metricProperties.js | 5 +- src/utilities/_sila/psuFilter.js | 6 + src/views/_sila/Overview/Inventory/Inventory.vue | 1 - src/views/_sila/Power/Dynamic/CurrentInput.vue | 185 ++++++++++++++++++++ src/views/_sila/Power/Dynamic/CurrentOutput.vue | 170 +++++++++++++++++++ src/views/_sila/Power/Dynamic/PowerDynamicPage.vue | 87 ++++++++++ src/views/_sila/Power/Dynamic/PowerInput.vue | 185 ++++++++++++++++++++ src/views/_sila/Power/Dynamic/PowerOutput.vue | 169 +++++++++++++++++++ src/views/_sila/Power/Dynamic/PowerTemp.vue | 186 +++++++++++++++++++++ src/views/_sila/Power/Dynamic/VoltInput.vue | 184 ++++++++++++++++++++ src/views/_sila/Power/Dynamic/VoltOutput.vue | 169 +++++++++++++++++++ src/views/_sila/Power/Dynamic/index.js | 2 + 21 files changed, 1563 insertions(+), 9 deletions(-) create mode 100644 src/assets/images/_sila/collapsed/current.svg create mode 100644 src/assets/images/_sila/collapsed/voltage.svg create mode 100644 src/utilities/_sila/psuFilter.js create mode 100644 src/views/_sila/Power/Dynamic/CurrentInput.vue create mode 100644 src/views/_sila/Power/Dynamic/CurrentOutput.vue create mode 100644 src/views/_sila/Power/Dynamic/PowerDynamicPage.vue create mode 100644 src/views/_sila/Power/Dynamic/PowerInput.vue create mode 100644 src/views/_sila/Power/Dynamic/PowerOutput.vue create mode 100644 src/views/_sila/Power/Dynamic/PowerTemp.vue create mode 100644 src/views/_sila/Power/Dynamic/VoltInput.vue create mode 100644 src/views/_sila/Power/Dynamic/VoltOutput.vue create mode 100644 src/views/_sila/Power/Dynamic/index.js (limited to 'src/views/_sila') diff --git a/src/assets/images/_sila/collapsed/current.svg b/src/assets/images/_sila/collapsed/current.svg new file mode 100644 index 00000000..299777ff --- /dev/null +++ b/src/assets/images/_sila/collapsed/current.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/images/_sila/collapsed/voltage.svg b/src/assets/images/_sila/collapsed/voltage.svg new file mode 100644 index 00000000..dce7dae8 --- /dev/null +++ b/src/assets/images/_sila/collapsed/voltage.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/components/_sila/Global/Chart.vue b/src/components/_sila/Global/Chart.vue index 4da58798..0b639252 100644 --- a/src/components/_sila/Global/Chart.vue +++ b/src/components/_sila/Global/Chart.vue @@ -42,6 +42,10 @@ export default { type: Number, default: null, }, + float: { + type: Boolean, + default: false, + }, }, data() { return { @@ -90,7 +94,7 @@ export default { return { ...metric, Timestamp: time, - Value: Math.round(metric.Value), + Value: this.float ? metric.Value : Math.round(metric.Value), }; }); @@ -290,6 +294,75 @@ export default { }, }); break; + case 'voltage-input': + this.categories = this.setCategories(251, 'В'); + this.yMax = 250; + this.minTickInterval = 25; + this.plotLines.push({ + color: '#1A3E5B', + dashStyle: 'solid', + value: this.shutdown, + width: 2, + label: { + text: this.$t('chart.thresholdFailure'), + align: 'right', + style: { + fontFamily: 'Inter', + fontSize: '12px', + fontStyle: 'normal', + fontWeight: '400', + lineHeight: '16px', + color: '#0C1C2999', + }, + }, + }); + break; + case 'voltage-output': + this.categories = this.setCategories(101, 'В'); + this.yMax = 100; + this.minTickInterval = 25; + this.plotLines.push({ + color: '#1A3E5B', + dashStyle: 'solid', + value: this.shutdown, + width: 2, + label: { + text: this.$t('chart.thresholdFailure'), + align: 'right', + style: { + fontFamily: 'Inter', + fontSize: '12px', + fontStyle: 'normal', + fontWeight: '400', + lineHeight: '16px', + color: '#0C1C2999', + }, + }, + }); + break; + case 'current': + this.categories = this.setCategories(11, 'A'); + this.yMax = 10; + this.minTickInterval = 2; + this.plotLines.push({ + color: '#1A3E5B', + dashStyle: 'solid', + value: this.shutdown, + width: 2, + label: { + text: this.$t('chart.thresholdFailure'), + align: 'right', + style: { + fontFamily: 'Inter', + fontSize: '12px', + fontStyle: 'normal', + fontWeight: '400', + lineHeight: '16px', + color: '#0C1C2999', + }, + }, + }); + break; } }, setCategories(count, desc) { diff --git a/src/components/_sila/Global/Collapse.vue b/src/components/_sila/Global/Collapse.vue index f004c955..da2b74c8 100644 --- a/src/components/_sila/Global/Collapse.vue +++ b/src/components/_sila/Global/Collapse.vue @@ -10,7 +10,7 @@ {{ title }} - + @@ -29,6 +29,10 @@ export default { type: String, default: null, }, + defaultOpen: { + type: Boolean, + default: false, + }, }, data() { return { diff --git a/src/env/components/AppNavigation/sila.js b/src/env/components/AppNavigation/sila.js index ea251dcc..50aaf996 100644 --- a/src/env/components/AppNavigation/sila.js +++ b/src/env/components/AppNavigation/sila.js @@ -165,6 +165,11 @@ const AppNavigationMixin = { label: this.$t('appNavigation.staticInfo'), route: '/power/static', }, + { + id: 'power/dynamic', + label: this.$t('appNavigation.dynamicInformation'), + route: '/power/dynamic', + }, ], }, { diff --git a/src/env/router/sila.js b/src/env/router/sila.js index a5495638..e9d238b0 100644 --- a/src/env/router/sila.js +++ b/src/env/router/sila.js @@ -35,6 +35,7 @@ import MemoryDynamic from '@/views/_sila/Memory/Dynamic'; import FansDynamic from '@/views/_sila/Fans/Dynamic'; import MotherboardDynamic from '@/views/_sila/Motherboard/Dynamic'; import PowerStatic from '@/views/_sila/Power/Static'; +import PowerDynamic from '@/views/_sila/Power/Dynamic'; import i18n from '@/i18n'; const routes = [ @@ -205,6 +206,14 @@ const routes = [ title: i18n.t('appPageTitle.powerSup'), }, }, + { + path: 'power/dynamic', + name: 'power-dynamic', + component: PowerDynamic, + meta: { + title: i18n.t('appPageTitle.powerSup'), + }, + }, { path: '/security-and-access/sessions', name: 'sessions', diff --git a/src/locales/en-US.json b/src/locales/en-US.json index dfee7375..a3302c07 100644 --- a/src/locales/en-US.json +++ b/src/locales/en-US.json @@ -150,7 +150,6 @@ "staticInfo": "Static Information", "fans": "@:appPageTitle.fans", "processors": "@:appPageTitle.processors", - "dynamicInformation": "@:appPageTitle.dynamicInformation", "memory": "@:appPageTitle.memory", "motherboard": "@:appPageTitle.motherboard" }, @@ -243,6 +242,7 @@ "delaySaveDateTime": "Update the page after 10 seconds to apply the changes." } }, + "pageDumps": { "dumpsAvailableOnBmc": "Dumps available on BMC", "initiateDump": "Initiate dump", @@ -919,6 +919,19 @@ }, "pagePowerSup": { "supplies": "Installed power supplies", + "temperature": "Temperature Display", + "InputPower": "Input Power", + "OutputPower": "Output Power", + "InputVolt": "Input Voltage", + "OutputVolt": "Output Voltage", + "InputCurrent": "Input Current", + "OutputCurrent": "Output Current", + "labels": { + "notNormal": "Not regular mode", + "critical": "Critical mode", + "warning": "Meaning of the warning", + "shutdown": "Shutdown" + }, "table": { "param": "Parameter", "value": "Значение", @@ -929,7 +942,23 @@ "manufacturer": "Manufacturer", "model": "Model", "efficiencyPercent": "Efficiency percentage", - "powerInputWatts": "Output power, W" + "powerInputWatts": "Output power, W", + "nameModule": "Name", + "currentTemperature": "Current, С°", + "middleTemperature": "Middle, С°", + "minTemperature": "Minimum, С°", + "minDate": "Date of minimum", + "maxTemperature": "Maximum, С°", + "maxDate": "Date of maximum", + "currentPower": "Current, W", + "minPower": "Minimum, W", + "maxPower": "Maximum, W", + "currentVolt": "Current, V", + "minVolt": "Minimum, V", + "maxVolt": "Maximum, V", + "currentCurrent": "Current, A", + "minCurrent": "Minimum, A", + "maxCurrent": "Maximum, A" } }, "pageSerialOverLan": { diff --git a/src/locales/ru-RU.json b/src/locales/ru-RU.json index f540cf4e..574cf0ee 100644 --- a/src/locales/ru-RU.json +++ b/src/locales/ru-RU.json @@ -919,6 +919,19 @@ }, "pagePowerSup": { "supplies": "Установленые источники питания", + "temperature": "Показатели температуры", + "InputPower": "Входная мощность", + "OutputPower": "Выходная мощность", + "InputVolt": "Входное напряжение", + "OutputVolt": "Выходное напряжение", + "InputCurrent": "Входная сила тока", + "OutputCurrent": "Выходная сила тока", + "labels": { + "notNormal": "Не штатный режим", + "critical": "Критический режим", + "warning": "Значение предупреждения", + "shutdown": "Значение отказа" + }, "table": { "param": "Параметр", "value": "Значение", @@ -929,7 +942,23 @@ "manufacturer": "Производитель", "model": "Модель", "efficiencyPercent": "Процент эффективности", - "powerInputWatts": "Выходная мощность, Вт" + "powerInputWatts": "Выходная мощность, Вт", + "nameModule": "Имя модуля", + "currentTemperature": "Текущее, С°", + "middleTemperature": "Среднее, С°", + "minTemperature": "Минимальное, С°", + "minDate": "Дата минимального", + "maxTemperature": "Максимальное, С°", + "maxDate": "Дата максимального", + "currentPower": "Текущее, Вт", + "minPower": "Минимальное, Вт", + "maxPower": "Максимальное, Вт", + "currentVolt": "Текущее, В", + "minVolt": "Минимальное, В", + "maxVolt": "Максимальное, В", + "currentCurrent": "Текущее, A", + "minCurrent": "Минимальное, A", + "maxCurrent": "Максимальное, A" } }, "pageSerialOverLan": { diff --git a/src/store/modules/HardwareStatus/PowerSupplyStore.js b/src/store/modules/HardwareStatus/PowerSupplyStore.js index dc7691da..775e86e8 100644 --- a/src/store/modules/HardwareStatus/PowerSupplyStore.js +++ b/src/store/modules/HardwareStatus/PowerSupplyStore.js @@ -3,10 +3,26 @@ import api from '@/store/api'; const PowerSupplyStore = { namespaced: true, state: { + psuTemp: [], + psuTempLastHour: [], + psuPower: [], + psuPowerLastHour: [], + psuVoltage: [], + psuVoltageLastHour: [], + psuCurrent: [], + psuCurrentLastHour: [], powerSupplies: [], }, getters: { powerSupplies: (state) => state.powerSupplies, + psuTemp: (state) => state.psuTemp, + psuTempLastHour: (state) => state.psuTempLastHour, + psuPower: (state) => state.psuPower, + psuPowerLastHour: (state) => state.psuPowerLastHour, + psuVoltage: (state) => state.psuVoltage, + psuVoltageLastHour: (state) => state.psuVoltageLastHour, + psuCurrent: (state) => state.psuCurrent, + psuCurrentLastHour: (state) => state.psuCurrentLastHour, }, mutations: { setPowerSupply: (state, data) => { @@ -44,8 +60,50 @@ const PowerSupplyStore = { }; }); }, + setpsu_temp: (state, data) => { + state.psuTemp = data; + }, + setpsu_tempLastHour: (state, data) => { + state.psuTempLastHour = data; + }, + setpsu_voltage: (state, data) => { + state.psuVoltage = data; + }, + setpsu_voltageLastHour: (state, data) => { + state.psuVoltageLastHour = data; + }, + setpsu_power: (state, data) => { + state.psuPower = data; + }, + setpsu_powerLastHour: (state, data) => { + state.psuPowerLastHour = data; + }, + setpsu_current: (state, data) => { + state.psuCurrent = data; + }, + setpsu_currentLastHour: (state, data) => { + state.psuCurrentLastHour = data; + }, }, actions: { + async getPsu({ commit }, { lastHour, metricsName }) { + let url = null; + if (lastHour) { + url = `/redfish/v1/TelemetryService/MetricReports/${metricsName}&period=last_hour`; + } else { + url = `/redfish/v1/TelemetryService/MetricReports/${metricsName}`; + } + return await api + .get(url) + .then(({ data: { MetricValues = [] } }) => { + if (lastHour) { + commit(`set${metricsName}LastHour`, MetricValues); + } else { + commit(`set${metricsName}`, MetricValues); + } + }) + .catch((error) => console.log(error)); + }, async getChassisCollection() { return await api .get('/redfish/v1/Chassis') diff --git a/src/utilities/_sila/metricProperties.js b/src/utilities/_sila/metricProperties.js index 389c4683..edc701d6 100644 --- a/src/utilities/_sila/metricProperties.js +++ b/src/utilities/_sila/metricProperties.js @@ -1,4 +1,4 @@ -export function getItems(data) { +export function getItems(data, float = false) { let filteredData = data.filter((metric) => { return metric.Value !== 'nan'; }); @@ -12,7 +12,7 @@ export function getItems(data) { date.getHours() + ':' + String(date.getMinutes()).padStart(2, '0'), date: formatDate(date), }, - Value: Math.round(metric.Value), + Value: float ? metric.Value : Math.round(metric.Value), }; }); @@ -20,7 +20,6 @@ export function getItems(data) { (rv[x['Sensor']] = rv[x['Sensor']] || []).push(x); return rv; }, {}); - return Object.keys(group).map((metric) => { return { name: metric, diff --git a/src/utilities/_sila/psuFilter.js b/src/utilities/_sila/psuFilter.js new file mode 100644 index 00000000..c75a7b02 --- /dev/null +++ b/src/utilities/_sila/psuFilter.js @@ -0,0 +1,6 @@ +export function psuFilter(items, type) { + if (!items || !items.length) return []; + return items.filter(function (el) { + return el.Sensor.toLowerCase().indexOf(type.toLowerCase()) > -1; + }); +} diff --git a/src/views/_sila/Overview/Inventory/Inventory.vue b/src/views/_sila/Overview/Inventory/Inventory.vue index a8db953d..3bf9433f 100644 --- a/src/views/_sila/Overview/Inventory/Inventory.vue +++ b/src/views/_sila/Overview/Inventory/Inventory.vue @@ -146,7 +146,6 @@ export default { }, }, created() { - console.log(123456, process.env.VUE_APP_ENV_NAME); this.startLoader(); const bmcManagerTablePromise = new Promise((resolve) => { this.$root.$on('hardware-status-bmc-manager-complete', () => resolve()); diff --git a/src/views/_sila/Power/Dynamic/CurrentInput.vue b/src/views/_sila/Power/Dynamic/CurrentInput.vue new file mode 100644 index 00000000..ad1a1608 --- /dev/null +++ b/src/views/_sila/Power/Dynamic/CurrentInput.vue @@ -0,0 +1,185 @@ + + diff --git a/src/views/_sila/Power/Dynamic/CurrentOutput.vue b/src/views/_sila/Power/Dynamic/CurrentOutput.vue new file mode 100644 index 00000000..a27a5a57 --- /dev/null +++ b/src/views/_sila/Power/Dynamic/CurrentOutput.vue @@ -0,0 +1,170 @@ + + diff --git a/src/views/_sila/Power/Dynamic/PowerDynamicPage.vue b/src/views/_sila/Power/Dynamic/PowerDynamicPage.vue new file mode 100644 index 00000000..45e7eaf9 --- /dev/null +++ b/src/views/_sila/Power/Dynamic/PowerDynamicPage.vue @@ -0,0 +1,87 @@ + + diff --git a/src/views/_sila/Power/Dynamic/PowerInput.vue b/src/views/_sila/Power/Dynamic/PowerInput.vue new file mode 100644 index 00000000..1b633ecb --- /dev/null +++ b/src/views/_sila/Power/Dynamic/PowerInput.vue @@ -0,0 +1,185 @@ + + diff --git a/src/views/_sila/Power/Dynamic/PowerOutput.vue b/src/views/_sila/Power/Dynamic/PowerOutput.vue new file mode 100644 index 00000000..6402801e --- /dev/null +++ b/src/views/_sila/Power/Dynamic/PowerOutput.vue @@ -0,0 +1,169 @@ + + diff --git a/src/views/_sila/Power/Dynamic/PowerTemp.vue b/src/views/_sila/Power/Dynamic/PowerTemp.vue new file mode 100644 index 00000000..8ad31451 --- /dev/null +++ b/src/views/_sila/Power/Dynamic/PowerTemp.vue @@ -0,0 +1,186 @@ + + diff --git a/src/views/_sila/Power/Dynamic/VoltInput.vue b/src/views/_sila/Power/Dynamic/VoltInput.vue new file mode 100644 index 00000000..5c39a889 --- /dev/null +++ b/src/views/_sila/Power/Dynamic/VoltInput.vue @@ -0,0 +1,184 @@ + + diff --git a/src/views/_sila/Power/Dynamic/VoltOutput.vue b/src/views/_sila/Power/Dynamic/VoltOutput.vue new file mode 100644 index 00000000..191e29fd --- /dev/null +++ b/src/views/_sila/Power/Dynamic/VoltOutput.vue @@ -0,0 +1,169 @@ + + diff --git a/src/views/_sila/Power/Dynamic/index.js b/src/views/_sila/Power/Dynamic/index.js new file mode 100644 index 00000000..c45d5c89 --- /dev/null +++ b/src/views/_sila/Power/Dynamic/index.js @@ -0,0 +1,2 @@ +import PowerDynamicPage from './PowerDynamicPage.vue'; +export default PowerDynamicPage; -- cgit v1.2.3