summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitalii Lysak <v.lysak@dunice.net>2022-07-07 18:37:45 +0300
committerVitalii Lysak <v.lysak@dunice.net>2022-07-07 18:37:45 +0300
commitff057d62b8ae347c0c937bf9388f03dcf42164da (patch)
treea9ce51c0664723fde6d1a5f16ec306270920a17b
parentc568c0558ac417fa6348840b20560dd4675c573e (diff)
downloadwebui-vue-ff057d62b8ae347c0c937bf9388f03dcf42164da.tar.xz
upd logic
-rw-r--r--src/components/AppNavigation/AppNavigationMixin.js8
-rw-r--r--src/components/Global/SilaComponents/Tables/AccessoryTableWithLabel.vue3
-rw-r--r--src/store/modules/HardwareStatus/SensorsStore.js45
-rw-r--r--src/views/Fans/DynamicInformation/IndicatorsTable.vue12
-rw-r--r--src/views/MemoryModules/DynamicInfo/MemoryDynamicPage.vue20
-rw-r--r--src/views/MemoryModules/DynamicInfo/helpers.js63
-rw-r--r--src/views/Motherboard/DynamicInfo/helpers.js4
7 files changed, 83 insertions, 72 deletions
diff --git a/src/components/AppNavigation/AppNavigationMixin.js b/src/components/AppNavigation/AppNavigationMixin.js
index d4c2f23d..5ee8c102 100644
--- a/src/components/AppNavigation/AppNavigationMixin.js
+++ b/src/components/AppNavigation/AppNavigationMixin.js
@@ -112,23 +112,23 @@ export const AppNavigationMixin = {
},
],
},*/
- /*{
+ {
id: 'memory',
label: this.$t('appNavigation.memoryModules'),
icon: 'iconChevronUp',
children: [
- {
+ /*{
id: 'memory-specification',
label: this.$t('appNavigation.specification'),
route: '/memory-specification',
- },
+ },*/
{
id: 'memory-dynamic-info',
label: this.$t('appNavigation.analyticalPanel'),
route: '/memory-dynamic-info',
},
],
- },*/
+ },
{
id: 'fans',
label: this.$t('appNavigation.fans'),
diff --git a/src/components/Global/SilaComponents/Tables/AccessoryTableWithLabel.vue b/src/components/Global/SilaComponents/Tables/AccessoryTableWithLabel.vue
index d7487e48..4974750a 100644
--- a/src/components/Global/SilaComponents/Tables/AccessoryTableWithLabel.vue
+++ b/src/components/Global/SilaComponents/Tables/AccessoryTableWithLabel.vue
@@ -18,9 +18,6 @@
{{ value }}
</span>
</template>
- <template #cell(currentValue)="data">
- {{ data.value }} {{ data.item.units }}
- </template>
<template #cell(minDate)="{ value }">
<span class="regular-12px">
{{ value.time }}
diff --git a/src/store/modules/HardwareStatus/SensorsStore.js b/src/store/modules/HardwareStatus/SensorsStore.js
index 1e57158b..585be484 100644
--- a/src/store/modules/HardwareStatus/SensorsStore.js
+++ b/src/store/modules/HardwareStatus/SensorsStore.js
@@ -7,11 +7,13 @@ const SensorsStore = {
sensors: [],
fanSensors: [],
tempSensors: [],
+ memorySensors: [],
},
getters: {
sensors: (state) => state.sensors,
fanSensors: (state) => state.fanSensors,
tempSensors: (state) => state.tempSensors,
+ memorySensors: (state) => state.memorySensors,
},
mutations: {
setSensors: (state, sensors) => {
@@ -26,6 +28,12 @@ const SensorsStore = {
'name'
);
},
+ setMemorySensors: (state, memorySensors) => {
+ state.memorySensors = uniqBy(
+ [...state.memorySensors, ...memorySensors],
+ 'name'
+ );
+ },
},
actions: {
async getAllSensors({ dispatch }) {
@@ -39,6 +47,15 @@ const SensorsStore = {
}, []);
return await api.all(promises);
},
+ async getMemorySensors({ dispatch }) {
+ const collection = await dispatch('getChassisCollection');
+ if (!collection) return;
+ const promises = collection.reduce((acc, id) => {
+ acc.push(dispatch('getOnlyMemorySensors', id));
+ return acc;
+ }, []);
+ return await api.all(promises);
+ },
async getTempSensors({ dispatch }) {
const collection = await dispatch('getChassisCollection');
if (!collection) return;
@@ -95,6 +112,30 @@ const SensorsStore = {
})
);
},
+ async getOnlyMemorySensors({ commit }, id) {
+ return await api
+ .get(`${id}/Thermal`)
+ .then(({ data: { Temperatures = [] } }) => {
+ const sensorData = [];
+ Temperatures.forEach((sensor) => {
+ sensorData.push({
+ name: sensor.Name,
+ status: sensor.Status.Health,
+ currentValue: sensor.ReadingCelsius,
+ lowerCaution: sensor.LowerThresholdNonCritical,
+ upperCaution: sensor.UpperThresholdNonCritical,
+ lowerCritical: sensor.LowerThresholdCritical,
+ upperCritical: sensor.UpperThresholdCritical,
+ units: '℃',
+ });
+ });
+ const memorySensors = sensorData.filter((sensor) => {
+ return sensor.name.toLowerCase().includes('dimm');
+ });
+ commit('setMemorySensors', memorySensors);
+ })
+ .catch((error) => console.log(error));
+ },
async getOnlyFanSensors({ commit }, id) {
return await api
.get(`${id}/Thermal`)
@@ -105,8 +146,8 @@ const SensorsStore = {
name: sensor.Name,
status: sensor.Status.Health,
currentValue: sensor.Reading,
- lowerCaution: sensor.LowerThresholdNonCritical,
- upperCaution: sensor.UpperThresholdNonCritical,
+ lowerCaution: sensor.MinReadingRange,
+ upperCaution: sensor.MaxReadingRange,
lowerCritical: sensor.LowerThresholdCritical,
upperCritical: sensor.UpperThresholdCritical,
units: sensor.ReadingUnits,
diff --git a/src/views/Fans/DynamicInformation/IndicatorsTable.vue b/src/views/Fans/DynamicInformation/IndicatorsTable.vue
index 933b47a3..9cb73863 100644
--- a/src/views/Fans/DynamicInformation/IndicatorsTable.vue
+++ b/src/views/Fans/DynamicInformation/IndicatorsTable.vue
@@ -19,6 +19,14 @@
{{ value }}
</span>
</template>
+ <template #cell(middleSpeed)="{ value }">
+ <span class="regular-12px">
+ {{ value.time }}
+ </span>
+ <span class="regular-12px tretiatry">
+ {{ value.date }}
+ </span>
+ </template>
<template #cell(minSpeedDate)="{ value }">
<span class="regular-12px">
{{ value.time }}
@@ -76,7 +84,7 @@ export default {
tdClass: 'bootstrap-fans-table__td light-12px',
},
{
- key: 'minSpeed',
+ key: 'lowerCaution',
label: 'Минимальная',
formatter: this.dataFormatter,
thClass: 'bootstrap-fans-table__th medium-12px',
@@ -90,7 +98,7 @@ export default {
tdClass: 'bootstrap-fans-table__td light-12px',
},
{
- key: 'maxSpeed',
+ key: 'upperCaution',
label: 'Максимальная',
formatter: this.dataFormatter,
thClass: 'bootstrap-fans-table__th medium-12px',
diff --git a/src/views/MemoryModules/DynamicInfo/MemoryDynamicPage.vue b/src/views/MemoryModules/DynamicInfo/MemoryDynamicPage.vue
index 0db6dd54..a9ff01b8 100644
--- a/src/views/MemoryModules/DynamicInfo/MemoryDynamicPage.vue
+++ b/src/views/MemoryModules/DynamicInfo/MemoryDynamicPage.vue
@@ -89,6 +89,8 @@ import TemperatureTable from './TemperatureTable';
import AccessoryTable from '@/components/Global/SilaComponents/Tables/AccessoryTableWithLabel';
import iconChevronUp from '@carbon/icons-vue/es/chevron--up/16';
+import TableFilterMixin from '@/components/Mixins/TableFilterMixin';
+
import { AccessoryData } from './helpers';
export default {
@@ -98,8 +100,10 @@ export default {
TemperatureTable,
AccessoryTable,
},
+ mixins: [TableFilterMixin],
data() {
return {
+ isBusy: true,
timeScale: 'hour',
temperatureWarning: 72,
temperatureWarningInput: 72,
@@ -110,8 +114,24 @@ export default {
notificationInput: 42,
accessoryData: AccessoryData,
iconChevronUp: iconChevronUp,
+ activeFilters: [],
};
},
+ computed: {
+ allSensors() {
+ let sensors = this.$store.getters['sensors/memorySensors'];
+ return sensors;
+ },
+ },
+ created() {
+ this.$store.dispatch('sensors/getMemorySensors').finally(() => {
+ this.accessoryData.temperatureTable.items = this.getFilteredTableData(
+ this.allSensors,
+ this.activeFilters
+ );
+ this.isBusy = false;
+ });
+ },
methods: {
switchTimeScale(period) {
this.timeScale = period;
diff --git a/src/views/MemoryModules/DynamicInfo/helpers.js b/src/views/MemoryModules/DynamicInfo/helpers.js
index 8e54e01f..4df38754 100644
--- a/src/views/MemoryModules/DynamicInfo/helpers.js
+++ b/src/views/MemoryModules/DynamicInfo/helpers.js
@@ -431,7 +431,7 @@ export const AccessoryData = {
tdClass: 'bootstrap-fans-table__td light-12px',
},
{
- key: 'currentTemperature',
+ key: 'currentValue',
label: 'Текущее, С°',
thClass: 'bootstrap-fans-table__th semi-bold-12px',
tdClass: 'bootstrap-fans-table__td light-12px',
@@ -443,7 +443,7 @@ export const AccessoryData = {
tdClass: 'bootstrap-fans-table__td light-12px',
},
{
- key: 'minTemperature',
+ key: 'lowerCaution',
label: 'Минимальное, С°',
thClass: 'bootstrap-fans-table__th semi-bold-12px',
tdClass: 'bootstrap-fans-table__td light-12px',
@@ -455,7 +455,7 @@ export const AccessoryData = {
tdClass: 'bootstrap-fans-table__td light-12px',
},
{
- key: 'maxTemperature',
+ key: 'upperCaution',
label: 'Максимальное, С°',
thClass: 'bootstrap-fans-table__th semi-bold-12px',
tdClass: 'bootstrap-fans-table__td light-12px',
@@ -467,61 +467,6 @@ export const AccessoryData = {
tdClass: 'bootstrap-fans-table__td light-12px',
},
],
- items: [
- {
- name: 'Модуль памяти 1',
- currentTemperature: 19,
- middleTemperature: 40,
- minTemperature: 31,
- minDate: { time: '15:15', date: '11.11.2021' },
- maxTemperature: 88,
- maxDate: { time: '10:26', date: '15.11.2021' },
- },
- {
- name: 'Модуль памяти 2',
- currentTemperature: 29,
- middleTemperature: 40,
- minTemperature: 20,
- minDate: { time: '15:45', date: '11.11.2021' },
- maxTemperature: 76,
- maxDate: { time: '16:59', date: '16.11.2021' },
- },
- {
- name: 'Модуль памяти 3',
- currentTemperature: 48,
- middleTemperature: 46,
- minTemperature: 31,
- minDate: { time: '15:23', date: '11.11.2021' },
- maxTemperature: 69,
- maxDate: { time: '15:26', date: '15.11.2021' },
- },
- {
- name: 'Модуль памяти 4',
- currentTemperature: 48,
- middleTemperature: 45,
- minTemperature: 5,
- minDate: { time: '16:45', date: '25.11.2021' },
- maxTemperature: 75,
- maxDate: { time: '11:26', date: '16.11.2021' },
- },
- {
- name: 'Модуль памяти 5',
- currentTemperature: 39,
- middleTemperature: 44,
- minTemperature: 30,
- minDate: { time: '15:23', date: '11.11.2021' },
- maxTemperature: 80,
- maxDate: { time: '15:26', date: '17.11.2021' },
- },
- {
- name: 'Модуль памяти 6',
- currentTemperature: 39,
- middleTemperature: 44,
- minTemperature: 5,
- minDate: { time: '16:45', date: '25.11.2021' },
- maxTemperature: 80,
- maxDate: { time: '15:26', date: '15.11.2021' },
- },
- ],
+ items: [],
},
};
diff --git a/src/views/Motherboard/DynamicInfo/helpers.js b/src/views/Motherboard/DynamicInfo/helpers.js
index 3d36a1b3..e98f1873 100644
--- a/src/views/Motherboard/DynamicInfo/helpers.js
+++ b/src/views/Motherboard/DynamicInfo/helpers.js
@@ -443,7 +443,7 @@ export const AccessoryData = {
tdClass: 'bootstrap-fans-table__td light-12px',
},
{
- key: 'minTemperature',
+ key: 'lowerCaution',
label: 'Минимальное, С°',
thClass: 'bootstrap-fans-table__th semi-bold-12px',
tdClass: 'bootstrap-fans-table__td light-12px',
@@ -455,7 +455,7 @@ export const AccessoryData = {
tdClass: 'bootstrap-fans-table__td light-12px',
},
{
- key: 'maxTemperature',
+ key: 'upperCaution',
label: 'Максимальное, С°',
thClass: 'bootstrap-fans-table__th semi-bold-12px',
tdClass: 'bootstrap-fans-table__td light-12px',