Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .env.ibm
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ VITE_CUSTOM_APP_NAV=true
VITE_CUSTOM_ROUTER=true
VITE_CUSTOM_STORE=true
VITE_APP_SERVER_OFF_REQUIRED=true
VITE_APP_TFTP_SERVER=false
VITE_APP_ACF_UPLOAD_REQUIRED=true
25 changes: 21 additions & 4 deletions src/store/modules/GlobalStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,26 @@ export const GlobalStore = defineStore('global', {
})
.catch((error) => console.log(error));
},
async getSafeMode() {
return api
.get('/redfish/v1/Systems/system/Processors?$expand=.($levels=2)')
.then(({ data }) => {
this.safeMode = false;
for (let member of data.Members) {
if (
member?.Throttled &&
member?.ThrottleCauses.includes('ManagementDetectedFault')
) {
this.safeMode = true;
break;
}
}
})
.catch((error) => {
console.log(error);
return Promise.reject(error);
});
},
async getSystemInfo() {
return await api
.get('/redfish/v1/Systems/system')
Expand All @@ -157,17 +177,13 @@ export const GlobalStore = defineStore('global', {
Model,
PowerState,
SerialNumber,
Oem: {
IBM: { SafeMode },
},
Status: { State } = {},
},
} = {}) => {
this.assetTag = AssetTag;
this.serialNumber = SerialNumber;
this.modelType = Model;
localStorage.setItem('storedModelType', Model);
this.safeMode = SafeMode;
if (State === 'Quiesced' || State === 'InTest') {
// OpenBMC's host state interface is mapped to 2 Redfish
// properties "Status""State" and "PowerState". Look first
Expand All @@ -177,6 +193,7 @@ export const GlobalStore = defineStore('global', {
} else {
this.serverStatus = serverStateMapper(PowerState);
}
this.getSafeMode();
return Promise.resolve();
},
)
Expand Down
4 changes: 2 additions & 2 deletions src/store/modules/HardwareStatus/ChassisStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const ChassisStore = defineStore('chassisStore', {
LocationIndicatorActive,
Name,
Location,
Oem,
Version,
} = chassis;

return {
Expand All @@ -31,7 +31,7 @@ export const ChassisStore = defineStore('chassisStore', {
identifyLed: LocationIndicatorActive,
uri: chassis['@odata.id'],
locationNumber: Location?.PartLocation?.ServiceLabel,
firmwareVersion: Oem?.OpenBMC?.FirmwareVersion,
firmwareVersion: Version,
};
});
},
Expand Down
2 changes: 1 addition & 1 deletion src/store/modules/HardwareStatus/PcieTopologyStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ export const PcieTopologyStore = defineStore('pcieTopologyStore', {
if (slot?.pcieDevice) {
row.linkSpeed = slot?.pcieDevice?.PCIeInterface?.PCIeType;
row.linkWidth =
slot?.pcieDevice?.PCIeInterface?.LanesInUse === -1
slot?.pcieDevice?.PCIeInterface?.LanesInUse === null
? 'unknown'
: slot?.pcieDevice?.PCIeInterface?.LanesInUse;
if (
Expand Down
17 changes: 16 additions & 1 deletion src/store/modules/Logs/DumpsStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,22 @@ export const DumpsStore = defineStore('dumps', {
this.allDumps = allDumps.map((dump) => ({
data: dump.AdditionalDataURI,
dateTime: new Date(dump.Created),
dumpType: dump.Name,
dumpType:
dump.Name === 'System Dump Entry'
? dump.Id.startsWith('0')
? 'Hardware Dump Entry'
: dump.Id.startsWith('2')
? 'Hostboot Dump Entry'
: dump.Id.startsWith('3')
? 'SBE Dump Entry'
: dump.Id.startsWith('4')
? 'OCMB SBE Dump Entry'
: dump.Id.startsWith('A')
? 'System Dump Entry'
: dump.Id.startsWith('B')
? 'Resource Dump Entry'
: dump.Name
: dump.Name,
id: dump.Id,
location: dump['@odata.id'],
size: dump.AdditionalDataSizeBytes,
Expand Down
2 changes: 1 addition & 1 deletion src/store/modules/Logs/IBMiServiceFunctionsStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const IBMiServiceFunctionsStore = defineStore('ibmiServiceFunctions', {
async executeServiceFunction(value) {
return await api
.post(
'/redfish/v1/Systems/system/Actions/Oem/OemComputerSystem.ExecutePanelFunction',
'/redfish/v1/Systems/system/Actions/Oem/IBM/IBMComputerSystem.ExecutePanelFunction',
{
FuncNo: value,
},
Expand Down
33 changes: 1 addition & 32 deletions src/store/modules/Operations/FirmwareStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ export const FirmwareStore = defineStore('firmware', {
bmcActiveFirmwareId: null,
hostActiveFirmwareId: null,
applyTime: null,
tftpAvailable: false,
firmwareBootSide: null,
lowestSupportedFirmwareVersion: '',
showAlert: false,
}),
getters: {
isTftpUploadAvailable: (state) => state.tftpAvailable,
isSingleFileUploadEnabled: (state) => state.hostFirmware.length === 0,
activeBmcFirmware: (state) => {
return state.bmcFirmware.find(
Expand Down Expand Up @@ -133,14 +131,7 @@ export const FirmwareStore = defineStore('firmware', {
.then(({ data }) => {
const applyTime =
data.HttpPushUriOptions.HttpPushUriApplyTime.ApplyTime;
const allowableActions =
data?.Actions?.['#UpdateService.SimpleUpdate']?.[
'TransferProtocol@Redfish.AllowableValues'
];
this.applyTime = applyTime;
if (allowableActions?.includes('TFTP')) {
this.tftpAvailable = true;
}
})
.catch((error) => console.log(error));
},
Expand Down Expand Up @@ -169,7 +160,7 @@ export const FirmwareStore = defineStore('firmware', {
await this.setApplyTimeImmediate();
}
return await api
.post('/redfish/v1/UpdateService', image, {
.post('/redfish/v1/UpdateService/update', image, {
headers: { 'Content-Type': 'application/octet-stream' },
})
.catch((error) => {
Expand All @@ -179,28 +170,6 @@ export const FirmwareStore = defineStore('firmware', {
);
});
},
async uploadFirmwareTFTP(fileAddress) {
const data = {
TransferProtocol: 'TFTP',
ImageURI: fileAddress,
};
if (this.applyTime !== 'Immediate') {
// ApplyTime must be set to Immediate before making
// request to update firmware
await this.setApplyTimeImmediate();
}
return await api
.post(
'/redfish/v1/UpdateService/Actions/UpdateService.SimpleUpdate',
data,
)
.catch((error) => {
console.log(error);
throw new Error(
i18n.global.t('pageFirmware.toast.errorUpdateFirmware'),
);
});
},
async switchBmcFirmwareAndReboot() {
const backupLocation = this.backupBmcFirmware.location;
const data = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export const ResourceMemoryStore = defineStore('resourceMemory', {
);
if (dynamicIoDrawerDefaultCapacity.length > 0) {
let dynamicIoDrawerAttachmentDefaultCapacity =
dynamicIoDrawerDefaultCapacity[0].DefaultValue;
dynamicIoDrawerDefaultCapacity[0].UpperBound;
this.dynamicIoDrawerDefaultCapacity =
dynamicIoDrawerAttachmentDefaultCapacity;
}
Expand Down
Loading