Skip to content

Commit

Permalink
Implemented Deconfiguration Records page - 1060
Browse files Browse the repository at this point in the history
- Implmented Deconfiguration Records page - 1060
- Jira Story: https://jsw.ibm.com/browse/PFEBMC-2375

Signed-off-by: Vedangi Mittal <[email protected]>
  • Loading branch information
vedangimittal committed Jan 20, 2025
1 parent 9fab780 commit 51e02e4
Show file tree
Hide file tree
Showing 4 changed files with 249 additions and 255 deletions.
9 changes: 9 additions & 0 deletions src/router/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import Firmware from '@/views/Operations/Firmware';
import Certificates from '@/views/SecurityAndAccess/Certificates';
import Inventory from '../views/HardwareStatus/Inventory/Inventory.vue';
import SystemParameters from '@/views/ResourceManagement/SystemParameters';
import DeconfigurationRecords from '../views/Logs/DeconfigurationRecords/DeconfigurationRecords.vue';

const roles = {
administrator: 'Administrator',
Expand Down Expand Up @@ -167,6 +168,14 @@ export const routes = [
title: i18n.global.t('appPageTitle.firmware'),
},
},
{
path: '/logs/deconfiguration-records',
name: 'deconfiguration-records',
component: DeconfigurationRecords,
meta: {
title: i18n.global.t('appPageTitle.deconfigurationRecords'),
},
},
{
path: '/settings/power-restore-policy',
name: 'power-restore-policy',
Expand Down
4 changes: 3 additions & 1 deletion src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import SystemParametersStore from './modules/ResourceManagement/SystemParameters
import CertificatesStore from './modules/SecurityAndAccess/CertificatesStore';
import UserManagementStore from './modules/SecurityAndAccess/UserManagementStore';
import PcieTopologyStore from './modules/HardwareStatus/PcieTopologyStore.js';
import DeconfigurationRecordsStore from './modules/Logs/DeconfigurationRecordsStore.js';
// ... (export use other stores)
export {
EventLogStore,
Expand Down Expand Up @@ -60,5 +61,6 @@ export {
SystemParametersStore,
CertificatesStore,
UserManagementStore,
PcieTopologyStore
PcieTopologyStore,
DeconfigurationRecordsStore
};
40 changes: 21 additions & 19 deletions src/store/modules/Logs/DeconfigurationRecordsStore.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import api from '@/store/api';
import i18n from '@/i18n';
import { defineStore } from 'pinia';

const DeconfigurationRecordsStore = {
namespaced: true,
state: {
export const DeconfigurationRecordsStore = defineStore('deconfigurationRecordsStore', {
state: () => ({
deconfigRecords: [],
},
}),
getters: {
deconfigRecords: (state) => state.deconfigRecords,
},
mutations: {
setDeconfigurationRecordInfo: (state, deconfigRecords) =>
(state.deconfigRecords = deconfigRecords),
deconfigRecordsGetter: (state) => state.deconfigRecords,
},
// mutations: {
// setDeconfigurationRecordInfo: (state, deconfigRecords) =>
// (state.deconfigRecords = deconfigRecords),
// },
actions: {
async getDeconfigurationRecordInfo({ commit }) {
async getDeconfigurationRecordInfo() {
return await api
.get('/redfish/v1/Systems/system/LogServices/HardwareIsolation/Entries')
.then(async ({ data: { Members = [] } = {} }) => {
Expand Down Expand Up @@ -85,29 +85,31 @@ const DeconfigurationRecordsStore = {
severity: Severity,
location: LocationCode,
eventID: eventId,
isSelected: false,
toggleDetails: false,
};
}),
);
commit('setDeconfigurationRecordInfo', deconfigRecords);
this.deconfigRecords = deconfigRecords;
})
.catch((error) => console.log(error));
},
async clearAllEntries({ dispatch }, data) {
async clearAllEntries(data) {
return await api
.post(
'/redfish/v1/Systems/system/LogServices/HardwareIsolation/Actions/LogService.ClearLog',
)
.then(() => dispatch('getDeconfigurationRecordInfo'))
.then(() => this.getDeconfigurationRecordInfo())
.then(() =>
i18n.tc(
i18n.global.t(
'pageDeconfigurationRecords.toast.successDelete',
data.length,
),
)
.catch((error) => {
console.log(error);
throw new Error(
i18n.tc(
i18n.global.t(
'pageDeconfigurationRecords.toast.errorDelete',
data.length,
),
Expand Down Expand Up @@ -141,9 +143,9 @@ const DeconfigurationRecordsStore = {
})
.then(() => {
const message = [
i18n.t('pageDeconfigurationRecords.toast.successStartDownload'),
i18n.global.t('pageDeconfigurationRecords.toast.successStartDownload'),
{
title: i18n.t(
title: i18n.global.t(
'pageDeconfigurationRecords.toast.successStartDownloadTitle',
),
},
Expand All @@ -154,11 +156,11 @@ const DeconfigurationRecordsStore = {
.catch((error) => {
console.log(error);
throw new Error(
i18n.t('pageDeconfigurationRecords.toast.errorStartDownload'),
i18n.global.t('pageDeconfigurationRecords.toast.errorStartDownload'),
);
});
},
},
};
});

export default DeconfigurationRecordsStore;
Loading

0 comments on commit 51e02e4

Please sign in to comment.