diff options
author | Sukanya Pandey <sukapan1@in.ibm.com> | 2021-04-09 13:10:27 +0300 |
---|---|---|
committer | Sukanya Pandey <sukapan1@in.ibm.com> | 2021-07-08 12:43:31 +0300 |
commit | eb4cef3fca00d908bfd890afe0a80387e88c16f2 (patch) | |
tree | da9f03ab725aad20cd249f0a7a5bf5de2c478240 /src | |
parent | 240c056c8989c5e3e0f0ff640f38f3e4cdbc6ac5 (diff) | |
download | webui-vue-eb4cef3fca00d908bfd890afe0a80387e88c16f2.tar.xz |
Add system table missing properties
- Design is updated for system table.
- Missing properties are added, added properties are: Hardware type, Location number, Memory summary
data, Processor summary data and submodel.
- Also adding functionality of toggling identify led switch
Signed-off-by: Sukanya Pandey <sukapan1@in.ibm.com>
Change-Id: I0e5143638ce2254f9b4fd2c8c520544c1db8d342
Diffstat (limited to 'src')
-rw-r--r-- | src/locales/en-US.json | 5 | ||||
-rw-r--r-- | src/store/modules/Health/SystemStore.js | 33 | ||||
-rw-r--r-- | src/views/Health/HardwareStatus/HardwareStatusTableStystem.vue | 126 |
3 files changed, 134 insertions, 30 deletions
diff --git a/src/locales/en-US.json b/src/locales/en-US.json index 3196dcf8..c9e6bc56 100644 --- a/src/locales/en-US.json +++ b/src/locales/en-US.json @@ -378,6 +378,7 @@ "bmcDateTime": "BMC date and time", "chassisType": "Chassis type", "connectTypesSupported": "Connect types supported", + "count": "Count", "description": "Description", "efficiencyPercent": "Efficiency percent", "fanSpeed": "Fan speed", @@ -388,7 +389,6 @@ "healthRollup": "Health rollup", "id": "ID", "identifyLed": "Identify LED", - "indicatorLed": "Indicator LED", "instructionSet": "Instruction set", "lastResetTime": "Last reset time", "locationNumber": "Location number", @@ -400,12 +400,14 @@ "maxPowerWatts": "Max power watts", "minPowerWatts": "Min power watts", "model": "Model", + "memorySummary": "Memory summary", "name": "Name", "partNumber": "Part number", "power": "Power", "powerInputWatts": "Power input watts", "powerState": "Power state", "processorArchitecture": "Processor architecture", + "processorSummary": "Processor summary", "processorType": "Processor type", "serialConsole": "Serial console", "serialNumber": "Serial number", @@ -414,6 +416,7 @@ "sparePartNumber": "Spare part number", "statusHealthRollup": "Status (Health rollup)", "statusState": "Status (State)", + "subModel": "Sub model", "systemType": "System type", "totalCores": "Total cores", "totalThreads": "Total threads", diff --git a/src/store/modules/Health/SystemStore.js b/src/store/modules/Health/SystemStore.js index 23b12d72..b4ee3847 100644 --- a/src/store/modules/Health/SystemStore.js +++ b/src/store/modules/Health/SystemStore.js @@ -1,4 +1,5 @@ import api from '@/store/api'; +import i18n from '@/i18n'; const SystemStore = { namespaced: true, @@ -14,15 +15,25 @@ const SystemStore = { system.assetTag = data.AssetTag; system.description = data.Description; system.firmwareVersion = data.BiosVersion; + system.hardwareType = data.Name; system.health = data.Status.Health; system.id = data.Id; system.locationIndicatorActive = data.LocationIndicatorActive; + system.locationNumber = data.LocationNumber; system.manufacturer = data.Manufacturer; + system.memorySummaryHealth = data.MemorySummary.Status.Health; + system.memorySummaryHealthRollup = data.MemorySummary.Status.HealthRollup; + system.memorySummaryState = data.MemorySummary.Status.State; system.model = data.Model; - system.partNumber = data.PartNumber; + system.processorSummaryCount = data.ProcessorSummary.Count; + system.processorSummaryHealth = data.ProcessorSummary.Status.Health; + system.processorSummaryHealthRoll = + data.ProcessorSummary.Status.HealthRollup; + system.processorSummaryState = data.ProcessorSummary.Status.State; system.powerState = data.PowerState; system.serialNumber = data.SerialNumber; system.healthRollup = data.Status.HealthRollup; + system.subModel = data.SubModel; system.statusState = data.Status.State; system.systemType = data.SystemType; state.systems = [system]; @@ -35,6 +46,26 @@ const SystemStore = { .then(({ data }) => commit('setSystemInfo', data)) .catch((error) => console.log(error)); }, + changeIdentifyLedState({ dispatch }, ledState) { + api + .patch('/redfish/v1/Systems/system', { + LocationIndicatorActive: ledState, + }) + .then(() => dispatch('getSystem')) + .catch((error) => { + dispatch('getSystem'); + console.log('error', error); + if (ledState) { + throw new Error( + i18n.t('pageHardwareStatus.toast.errorTurnOnIdentifyLed') + ); + } else { + throw new Error( + i18n.t('pageHardwareStatus.toast.errorTurnOffIdentifyLed') + ); + } + }); + }, }, }; diff --git a/src/views/Health/HardwareStatus/HardwareStatusTableStystem.vue b/src/views/Health/HardwareStatus/HardwareStatusTableStystem.vue index 9f2e7852..1dccd51c 100644 --- a/src/views/Health/HardwareStatus/HardwareStatusTableStystem.vue +++ b/src/views/Health/HardwareStatus/HardwareStatusTableStystem.vue @@ -28,47 +28,103 @@ {{ value }} </template> + <template #cell(locationIndicatorActive)="{ item }"> + <b-form-checkbox + id="identifyLedSwitch" + v-model="item.locationIndicatorActive" + data-test-id="hardwareStatus-toggle-identifyLed" + switch + @change="toggleIdentifyLedSwitch" + > + </b-form-checkbox> + </template> + <template #row-details="{ item }"> <b-container fluid> <b-row> - <b-col sm="6" xl="4"> + <b-col class="mt-2" sm="6"> <dl> + <!-- Serial number --> + <dt>{{ $t('pageHardwareStatus.table.serialNumber') }}:</dt> + <dd>{{ tableFormatter(item.serialNumber) }}</dd> + <!-- Model --> + <dt>{{ $t('pageHardwareStatus.table.model') }}:</dt> + <dd>{{ tableFormatter(item.model) }}</dd> <!-- Asset tag --> <dt>{{ $t('pageHardwareStatus.table.assetTag') }}:</dt> + <dd class="mb-2"> + {{ tableFormatter(item.assetTag) }} + </dd> + </dl> + </b-col> + <b-col class="mt-2" sm="6"> + <dl> + <!-- Status state --> + <dt>{{ $t('pageHardwareStatus.table.statusState') }}:</dt> + <dd>{{ tableFormatter(item.statusState) }}</dd> + <!-- Power state --> + <dt>{{ $t('pageHardwareStatus.table.power') }}:</dt> + <dd>{{ tableFormatter(item.powerState) }}</dd> + <!-- Health rollup --> + <dt>{{ $t('pageHardwareStatus.table.healthRollup') }}:</dt> + <dd>{{ tableFormatter(item.healthRollup) }}</dd> + </dl> + </b-col> + </b-row> + <div class="section-divider mb-3 mt-3"></div> + <b-row> + <b-col class="mt-1" sm="6"> + <dl> + <!-- Manufacturer --> + <dt>{{ $t('pageHardwareStatus.table.manufacturer') }}:</dt> <dd>{{ tableFormatter(item.assetTag) }}</dd> <!-- Description --> <dt>{{ $t('pageHardwareStatus.table.description') }}:</dt> <dd>{{ tableFormatter(item.description) }}</dd> - <!-- Indicator LED --> - <dt>{{ $t('pageHardwareStatus.table.indicatorLed') }}:</dt> - <dd v-if="item.locationIndicatorActive === true"> - {{ $t('global.status.on') }} + <!-- Sub Model --> + <dt>{{ $t('pageHardwareStatus.table.subModel') }}:</dt> + <dd> + {{ tableFormatter(item.subModel) }} </dd> - <dd v-else-if="item.locationIndicatorActive === false"> - {{ $t('global.status.off') }} + <!-- System Type --> + <dt>{{ $t('pageHardwareStatus.table.systemType') }}:</dt> + <dd> + {{ tableFormatter(item.systemType) }} </dd> - <dd v-else>--</dd> - <!-- Model --> - <dt>{{ $t('pageHardwareStatus.table.model') }}:</dt> - <dd>{{ tableFormatter(item.model) }}</dd> </dl> </b-col> - <b-col sm="6" xl="4"> + <b-col sm="6"> <dl> - <!-- Power state --> - <dt>{{ $t('pageHardwareStatus.table.powerState') }}:</dt> - <dd>{{ tableFormatter(item.powerState) }}</dd> - <!-- Health rollup --> - <dt> - {{ $t('pageHardwareStatus.table.statusHealthRollup') }}: + <!-- Memory Summary --> + <dt class="mt-1 mb-2 font-weight-bold float-none"> + {{ $t('pageHardwareStatus.table.memorySummary') }} </dt> - <dd>{{ tableFormatter(item.healthRollup) }}</dd> <!-- Status state --> <dt>{{ $t('pageHardwareStatus.table.statusState') }}:</dt> - <dd>{{ tableFormatter(item.statusState) }}</dd> - <!-- System type --> - <dt>{{ $t('pageHardwareStatus.table.systemType') }}:</dt> - <dd>{{ tableFormatter(item.systemType) }}</dd> + <dd>{{ tableFormatter(item.memorySummaryState) }}</dd> + <!-- Health --> + <dt>{{ $t('pageHardwareStatus.table.health') }}:</dt> + <dd>{{ tableFormatter(item.memorySummaryHealth) }}</dd> + <!-- Health Roll --> + <dt>{{ $t('pageHardwareStatus.table.healthRollup') }}:</dt> + <dd>{{ tableFormatter(item.memorySummaryHealthRoll) }}</dd> + + <!-- Processor Summary --> + <dt class="mt-1 mb-2 font-weight-bold float-none"> + {{ $t('pageHardwareStatus.table.processorSummary') }} + </dt> + <!-- Status state --> + <dt>{{ $t('pageHardwareStatus.table.statusState') }}:</dt> + <dd>{{ tableFormatter(item.processorSummaryState) }}</dd> + <!-- Health --> + <dt>{{ $t('pageHardwareStatus.table.health') }}:</dt> + <dd>{{ tableFormatter(item.processorSummaryHealth) }}</dd> + <!-- Health Rollup --> + <dt>{{ $t('pageHardwareStatus.table.healthRollup') }}:</dt> + <dd>{{ tableFormatter(item.processorSummaryHealthRoll) }}</dd> + <!-- Count --> + <dt>{{ $t('pageHardwareStatus.table.count') }}:</dt> + <dd>{{ tableFormatter(item.processorSummaryCount) }}</dd> </dl> </b-col> </b-row> @@ -79,6 +135,7 @@ </template> <script> +import BVToastMixin from '@/components/Mixins/BVToastMixin'; import PageSection from '@/components/Global/PageSection'; import IconChevron from '@carbon/icons-vue/es/chevron--down/20'; @@ -91,7 +148,7 @@ import TableDataFormatterMixin from '@/components/Mixins/TableDataFormatterMixin export default { components: { IconChevron, PageSection, StatusIcon }, - mixins: [TableRowExpandMixin, TableDataFormatterMixin], + mixins: [BVToastMixin, TableRowExpandMixin, TableDataFormatterMixin], data() { return { fields: [ @@ -106,19 +163,25 @@ export default { formatter: this.tableFormatter, }, { + key: 'hardwareType', + label: this.$t('pageHardwareStatus.table.hardwareType'), + formatter: this.tableFormatter, + tdClass: 'text-nowrap', + }, + { key: 'health', label: this.$t('pageHardwareStatus.table.health'), formatter: this.tableFormatter, tdClass: 'text-nowrap', }, { - key: 'partNumber', - label: this.$t('pageHardwareStatus.table.partNumber'), + key: 'locationNumber', + label: this.$t('pageHardwareStatus.table.locationNumber'), formatter: this.tableFormatter, }, { - key: 'serialNumber', - label: this.$t('pageHardwareStatus.table.serialNumber'), + key: 'locationIndicatorActive', + label: this.$t('pageHardwareStatus.table.identifyLed'), formatter: this.tableFormatter, }, ], @@ -136,5 +199,12 @@ export default { this.$root.$emit('hardware-status-system-complete'); }); }, + methods: { + toggleIdentifyLedSwitch(state) { + this.$store + .dispatch('system/changeIdentifyLedState', state) + .catch(({ message }) => this.errorToast(message)); + }, + }, }; </script> |