diff options
author | Vitalii Lysak <v.lysak@dunice.net> | 2022-07-04 12:02:52 +0300 |
---|---|---|
committer | Vitalii Lysak <v.lysak@dunice.net> | 2022-07-04 12:02:52 +0300 |
commit | 03080e30d351494fbedef1b1c616bddb6bfe13cc (patch) | |
tree | 352f769075b6f4668d4106d0f6acc7c05a773ae5 /src | |
parent | 17c1d8bdaf236f1209b7283bbf75a4c062c7a6ad (diff) | |
parent | c8d25fd2b9ecb1395fa086a727d238489d568908 (diff) | |
download | webui-vue-03080e30d351494fbedef1b1c616bddb6bfe13cc.tar.xz |
Merge branch 'template-bugs' into sila-dev
Diffstat (limited to 'src')
-rw-r--r-- | src/assets/styles/bmc/custom/_kvm.scss | 8 | ||||
-rw-r--r-- | src/components/AppNavigation/AppNavigationMixin.js | 34 | ||||
-rw-r--r-- | src/locales/ru-RU.json | 12 | ||||
-rw-r--r-- | src/store/modules/HardwareStatus/SensorsStore.js | 43 | ||||
-rw-r--r-- | src/views/Fans/StaticInformation/FansStaticPage.vue | 46 | ||||
-rw-r--r-- | src/views/Operations/Kvm/KvmConsole.vue | 24 | ||||
-rw-r--r-- | src/views/SecurityAndAccess/Certificates/Certificates.vue | 9 |
7 files changed, 142 insertions, 34 deletions
diff --git a/src/assets/styles/bmc/custom/_kvm.scss b/src/assets/styles/bmc/custom/_kvm.scss index a7223844..1045f133 100644 --- a/src/assets/styles/bmc/custom/_kvm.scss +++ b/src/assets/styles/bmc/custom/_kvm.scss @@ -1,12 +1,14 @@ #terminal-kvm { - height: calc(100vh - 300px); display: flex; &.full-window { - height: calc(100vh - 80px); + height: calc(100vh - 80px); } div:nth-child(1) { background: transparent !important; display: block !important; overflow: hidden !important; + canvas { + max-height: 579px; + } } -}
\ No newline at end of file +} diff --git a/src/components/AppNavigation/AppNavigationMixin.js b/src/components/AppNavigation/AppNavigationMixin.js index 2e2c4e71..fc34b3af 100644 --- a/src/components/AppNavigation/AppNavigationMixin.js +++ b/src/components/AppNavigation/AppNavigationMixin.js @@ -129,23 +129,23 @@ export const AppNavigationMixin = { // }, // ], // }, - // { - // id: 'fans', - // label: this.$t('appNavigation.fans'), - // icon: 'iconChevronUp', - // children: [ - // { - // id: 'fans-static', - // label: this.$t('appNavigation.statisticInformation'), - // route: '/fans-static', - // }, - // { - // id: 'fans', - // label: this.$t('appNavigation.dynamicInformation'), - // route: '/fans', - // }, - // ], - // }, + { + id: 'fans', + label: this.$t('appNavigation.fans'), + icon: 'iconChevronUp', + children: [ + { + id: 'fans-static', + label: this.$t('appNavigation.statisticInformation'), + route: '/fans-static', + }, + { + id: 'fans', + label: this.$t('appNavigation.dynamicInformation'), + route: '/fans', + }, + ], + }, // { // id: 'physical-drives', // label: this.$t('appNavigation.physicalDrives'), diff --git a/src/locales/ru-RU.json b/src/locales/ru-RU.json index 75ff4c1b..6a9f7d50 100644 --- a/src/locales/ru-RU.json +++ b/src/locales/ru-RU.json @@ -41,9 +41,9 @@ }, "date": { "lastHour": "Последний час", - "lastDay": "Последние сутки", + "lastDay": "Последние сутки", "lastWeek": "Последняя неделя", - "lastMounth": "Последний месяц", + "lastMounth": "Последний месяц", "lastYear": "Последний год", "selectDate": "Выбрать период" }, @@ -179,7 +179,7 @@ "ethernetAdapters": "Ethetnet-адаптеры", "fcHbaAdapters": "FC-HBA-адаптеры", "pciDevices": "PCI-устройства", - + "resourceManagement": "Управление ресурсами", "securityAndAccess": "Безопасность и доступ", "sessions": "@:appPageTitle.sessions", @@ -210,7 +210,7 @@ "description": { "configuration": "Конфигурация" } - }, + }, "appPageTitle": { "changePassword": "Изменить пароль", @@ -593,7 +593,6 @@ "upload": "Начать загрузку", "urlAdress": "URL-адрес сервера", "connectionType": "Тип подключения" - }, "pageLdap": { "pageDescription": "Настройка параметров LDAP и управление группами", @@ -1140,7 +1139,8 @@ "outputPower": "Выходная мощность", "voltageWarning": "Пороговое значение предупреждения, B", "voltageShutdown": "Пороговое значениe отказа, B", - "amperage": "Сила тока" + "cpu": "Процессор", + "system": "Системная плата" }, "RAID": { "cache": "Cache RAID-контроллеров", diff --git a/src/store/modules/HardwareStatus/SensorsStore.js b/src/store/modules/HardwareStatus/SensorsStore.js index 287796d9..896297e3 100644 --- a/src/store/modules/HardwareStatus/SensorsStore.js +++ b/src/store/modules/HardwareStatus/SensorsStore.js @@ -5,14 +5,19 @@ const SensorsStore = { namespaced: true, state: { sensors: [], + fanSensors: [], }, getters: { sensors: (state) => state.sensors, + fanSensors: (state) => state.fanSensors, }, mutations: { setSensors: (state, sensors) => { state.sensors = uniqBy([...state.sensors, ...sensors], 'name'); }, + setFanSensors: (state, fanSensors) => { + state.fanSensors = uniqBy([...state.fanSensors, ...fanSensors], 'name'); + }, }, actions: { async getAllSensors({ dispatch }) { @@ -26,6 +31,15 @@ const SensorsStore = { }, []); return await api.all(promises); }, + async getFanSensors({ dispatch }) { + const collection = await dispatch('getChassisCollection'); + if (!collection) return; + const promises = collection.reduce((acc, id) => { + acc.push(dispatch('getOnlyFanSensors', id)); + return acc; + }, []); + return await api.all(promises); + }, async getChassisCollection() { return await api .get('/redfish/v1/Chassis') @@ -64,6 +78,35 @@ const SensorsStore = { }) ); }, + async getOnlyFanSensors({ commit }, id) { + const sensors = await api + .get(`${id}/Sensors`) + .then((response) => response.data.Members) + .catch((error) => console.log(error)); + const fanSensors = sensors.filter((sensor) => { + return sensor['@odata.id'].toLowerCase().includes('fan'); + }); + if (!fanSensors) return; + const promises = fanSensors.map((sensor) => { + return api.get(sensor['@odata.id']).catch((error) => { + console.log(error); + return error; + }); + }); + return await api.all(promises).then( + api.spread((...responses) => { + const sensorData = responses.map(({ data }) => { + return { + name: data.Name, + status: data.Status.Health, + currentValue: data.Reading, + units: data.ReadingUnits, + }; + }); + commit('setFanSensors', sensorData); + }) + ); + }, async getThermalSensors({ commit }, id) { return await api .get(`${id}/Thermal`) diff --git a/src/views/Fans/StaticInformation/FansStaticPage.vue b/src/views/Fans/StaticInformation/FansStaticPage.vue index 7c5e6059..a9f2d68b 100644 --- a/src/views/Fans/StaticInformation/FansStaticPage.vue +++ b/src/views/Fans/StaticInformation/FansStaticPage.vue @@ -10,7 +10,8 @@ responsive="md" show-empty class="bootstrap-rounded-table" - :items="items" + :items="filteredSensors" + :busy="isBusy" :fields="fields" :empty-text="$t('global.table.emptyMessage')" > @@ -28,6 +29,9 @@ </span> </div> </template> + <template #cell(currentValue)="data"> + {{ data.value }} + </template> </b-table> </page-section> </b-container> @@ -37,8 +41,12 @@ import PageTitle from '@/components/Global/PageTitle'; import PageSection from '@/components/Global/PageSection'; +import TableFilterMixin from '@/components/Mixins/TableFilterMixin'; +import DataFormatterMixin from '@/components/Mixins/DataFormatterMixin'; + export default { components: { PageTitle, PageSection }, + mixins: [TableFilterMixin, DataFormatterMixin], data() { return { isBusy: true, @@ -72,11 +80,11 @@ export default { tdClass: 'regular-12px bootstrap-rounded-table__td', }, { - key: 'value', + key: 'currentValue', label: 'Номинальная скорость, об/мин', formatter: this.dataFormatter, thClass: 'semi-bold-12px__caps bootstrap-rounded-table__head_bg', - class: `bootstrap-rounded-table__column-last + class: `bootstrap-rounded-table__column-last fans-table-col-third`, tdClass: 'regular-12px bootstrap-rounded-table__td', }, @@ -101,8 +109,40 @@ export default { value: '2400', }, ], + activeFilters: [], }; }, + + computed: { + allSensors() { + let sensors = this.$store.getters['sensors/fanSensors']; + if (this.isSensorsExist) { + sensors.forEach((sensor) => { + sensor.type = sensor.name.toLowerCase().includes('cpu') + ? this.$t('tablesDescription.cpu') + : this.$t('tablesDescription.system'); + }); + } + return sensors; + }, + + isSensorsExist() { + return ( + this.$store.getters['sensors/fanSensors'] && + this.$store.getters['sensors/fanSensors'].length > 0 + ); + }, + + filteredSensors() { + return this.getFilteredTableData(this.allSensors, this.activeFilters); + }, + }, + + created() { + this.$store.dispatch('sensors/getFanSensors').finally(() => { + this.isBusy = false; + }); + }, }; </script> <style lang="scss"> diff --git a/src/views/Operations/Kvm/KvmConsole.vue b/src/views/Operations/Kvm/KvmConsole.vue index c028a9fc..d06e2824 100644 --- a/src/views/Operations/Kvm/KvmConsole.vue +++ b/src/views/Operations/Kvm/KvmConsole.vue @@ -1,8 +1,12 @@ <template> <div :class="marginClass"> <div ref="toolbar" class="kvm-toolbar"> - <b-row class="d-flex"> - <b-col class="d-flex flex-column justify-content-end" cols="4"> + <b-row class="d-flex flex-column flex-sm-row"> + <b-col + class="d-flex flex-column justify-content-end console-title" + style="min-width: 105px" + cols="3" + > <dl class="mb-2" sm="2" md="2"> <dt class="d-inline font-weight-bold mr-1"> {{ $t('pageKvm.status') }}: @@ -14,9 +18,10 @@ </dl> </b-col> - <b-col class="d-flex justify-content-end pr-1"> + <b-col class="d-flex justify-content-end pr-1 flex-column flex-sm-row"> <b-button v-if="isConnected" + class="console-title console-button" variant="link" type="button" @click="sendCtrlAltDel" @@ -26,6 +31,7 @@ </b-button> <b-button v-if="!isFullWindow" + class="console-title console-button" variant="link" type="button" @click="openConsoleWindow()" @@ -167,4 +173,16 @@ export default { .margin-left-full-window { margin-left: 5px; } + +@media (max-width: 1200px) { + .console-title { + font-size: 0.7rem; + } +} + +@media (max-width: 576px) { + .console-button { + justify-content: flex-end; + } +} </style> diff --git a/src/views/SecurityAndAccess/Certificates/Certificates.vue b/src/views/SecurityAndAccess/Certificates/Certificates.vue index 852e6d34..f685e608 100644 --- a/src/views/SecurityAndAccess/Certificates/Certificates.vue +++ b/src/views/SecurityAndAccess/Certificates/Certificates.vue @@ -1,7 +1,7 @@ <template> <b-container fluid="xl"> <page-title /> - <b-row> + <b-row class="margin-bottom--16px"> <b-col xl="11"> <!-- Expired certificates banner --> <alert :show="expiredCertificateTypes.length > 0" variant="danger"> @@ -31,7 +31,7 @@ </alert> </b-col> </b-row> - <b-row> + <b-row class="margin-bottom--16px"> <b-col xl="11" class="text-right"> <b-button v-b-modal.generate-csr @@ -322,3 +322,8 @@ export default { }, }; </script> +<style lang="scss" scoped> +.margin-bottom--16px { + margin-bottom: 16px; +} +</style> |