summaryrefslogtreecommitdiff
path: root/src/store/modules/Settings
diff options
context:
space:
mode:
Diffstat (limited to 'src/store/modules/Settings')
-rw-r--r--src/store/modules/Settings/DateTimeStore.js14
-rw-r--r--src/store/modules/Settings/NetworkStore.js20
-rw-r--r--src/store/modules/Settings/PowerPolicyStore.js4
3 files changed, 22 insertions, 16 deletions
diff --git a/src/store/modules/Settings/DateTimeStore.js b/src/store/modules/Settings/DateTimeStore.js
index 51b722a8..9d804a7e 100644
--- a/src/store/modules/Settings/DateTimeStore.js
+++ b/src/store/modules/Settings/DateTimeStore.js
@@ -19,7 +19,7 @@ const DateTimeStore = {
actions: {
async getNtpData({ commit }) {
return await api
- .get('/redfish/v1/Managers/bmc/NetworkProtocol')
+ .get(`${await this.dispatch('global/getBmcPath')}/NetworkProtocol`)
.then((response) => {
const ntpServers = response.data.NTP.NTPServers;
const isNtpProtocolEnabled = response.data.NTP.ProtocolEnabled;
@@ -40,7 +40,10 @@ const DateTimeStore = {
ntpData.NTP.NTPServers = dateTimeForm.ntpServersArray;
}
return await api
- .patch(`/redfish/v1/Managers/bmc/NetworkProtocol`, ntpData)
+ .patch(
+ `${await this.dispatch('global/getBmcPath')}/NetworkProtocol`,
+ ntpData,
+ )
.then(async () => {
if (!dateTimeForm.ntpProtocolEnabled) {
const dateTimeData = {
@@ -58,9 +61,12 @@ const DateTimeStore = {
*/
const timeoutVal = state.isNtpProtocolEnabled ? 20000 : 0;
return await new Promise((resolve, reject) => {
- setTimeout(() => {
+ setTimeout(async () => {
return api
- .patch(`/redfish/v1/Managers/bmc`, dateTimeData)
+ .patch(
+ `${await this.dispatch('global/getBmcPath')}`,
+ dateTimeData,
+ )
.then(() => resolve())
.catch(() => reject());
}, timeoutVal);
diff --git a/src/store/modules/Settings/NetworkStore.js b/src/store/modules/Settings/NetworkStore.js
index 9b016030..7f24e198 100644
--- a/src/store/modules/Settings/NetworkStore.js
+++ b/src/store/modules/Settings/NetworkStore.js
@@ -60,7 +60,7 @@ const NetworkStore = {
actions: {
async getEthernetData({ commit }) {
return await api
- .get('/redfish/v1/Managers/bmc/EthernetInterfaces')
+ .get(`${await this.dispatch('global/getBmcPath')}/EthernetInterfaces`)
.then((response) =>
response.data.Members.map(
(ethernetInterface) => ethernetInterface['@odata.id'],
@@ -96,7 +96,7 @@ const NetworkStore = {
};
return api
.patch(
- `/redfish/v1/Managers/bmc/EthernetInterfaces/${state.selectedInterfaceId}`,
+ `${await this.dispatch('global/getBmcPath')}/EthernetInterfaces/${state.selectedInterfaceId}`,
data,
)
.then(dispatch('getEthernetData'))
@@ -125,7 +125,7 @@ const NetworkStore = {
// on all interfaces
return api
.patch(
- `/redfish/v1/Managers/bmc/EthernetInterfaces/${state.firstInterfaceId}`,
+ `${await this.dispatch('global/getBmcPath')}/EthernetInterfaces/${state.firstInterfaceId}`,
data,
)
.then(() => {
@@ -154,7 +154,7 @@ const NetworkStore = {
// on all interfaces
return api
.patch(
- `/redfish/v1/Managers/bmc/EthernetInterfaces/${state.firstInterfaceId}`,
+ `${await this.dispatch('global/getBmcPath')}/EthernetInterfaces/${state.firstInterfaceId}`,
data,
)
.then(() => {
@@ -183,7 +183,7 @@ const NetworkStore = {
// on all interfaces
return api
.patch(
- `/redfish/v1/Managers/bmc/EthernetInterfaces/${state.firstInterfaceId}`,
+ `${await this.dispatch('global/getBmcPath')}/EthernetInterfaces/${state.firstInterfaceId}`,
data,
)
.then(() => {
@@ -221,7 +221,7 @@ const NetworkStore = {
const newAddress = [ipv4Form];
return api
.patch(
- `/redfish/v1/Managers/bmc/EthernetInterfaces/${state.selectedInterfaceId}`,
+ `${await this.dispatch('global/getBmcPath')}/EthernetInterfaces/${state.selectedInterfaceId}`,
{ IPv4StaticAddresses: originalAddresses.concat(newAddress) },
)
.then(dispatch('getEthernetData'))
@@ -242,7 +242,7 @@ const NetworkStore = {
async editIpv4Address({ dispatch, state }, ipv4TableData) {
return api
.patch(
- `/redfish/v1/Managers/bmc/EthernetInterfaces/${state.selectedInterfaceId}`,
+ `${await this.dispatch('global/getBmcPath')}/EthernetInterfaces/${state.selectedInterfaceId}`,
{ IPv4StaticAddresses: ipv4TableData },
)
.then(dispatch('getEthernetData'))
@@ -263,7 +263,7 @@ const NetworkStore = {
async saveSettings({ state, dispatch }, interfaceSettingsForm) {
return api
.patch(
- `/redfish/v1/Managers/bmc/EthernetInterfaces/${state.selectedInterfaceId}`,
+ `${await this.dispatch('global/getBmcPath')}/EthernetInterfaces/${state.selectedInterfaceId}`,
interfaceSettingsForm,
)
.then(dispatch('getEthernetData'))
@@ -288,7 +288,7 @@ const NetworkStore = {
const newDnsArray = originalAddresses.concat(newAddress);
return api
.patch(
- `/redfish/v1/Managers/bmc/EthernetInterfaces/${state.selectedInterfaceId}`,
+ `${await this.dispatch('global/getBmcPath')}/EthernetInterfaces/${state.selectedInterfaceId}`,
{ StaticNameServers: newDnsArray },
)
.then(dispatch('getEthernetData'))
@@ -309,7 +309,7 @@ const NetworkStore = {
async editDnsAddress({ dispatch, state }, dnsTableData) {
return api
.patch(
- `/redfish/v1/Managers/bmc/EthernetInterfaces/${state.selectedInterfaceId}`,
+ `${await this.dispatch('global/getBmcPath')}/EthernetInterfaces/${state.selectedInterfaceId}`,
{ StaticNameServers: dnsTableData },
)
.then(dispatch('getEthernetData'))
diff --git a/src/store/modules/Settings/PowerPolicyStore.js b/src/store/modules/Settings/PowerPolicyStore.js
index 3adaec8d..fc65381e 100644
--- a/src/store/modules/Settings/PowerPolicyStore.js
+++ b/src/store/modules/Settings/PowerPolicyStore.js
@@ -44,7 +44,7 @@ const PowerPolicyStore = {
},
async getPowerRestoreCurrentPolicy({ commit }) {
return await api
- .get('/redfish/v1/Systems/system')
+ .get(`${await this.dispatch('global/getSystemPath')}`)
.then(({ data: { PowerRestorePolicy } }) => {
commit('setPowerRestoreCurrentPolicy', PowerRestorePolicy);
})
@@ -54,7 +54,7 @@ const PowerPolicyStore = {
const data = { PowerRestorePolicy: powerPolicy };
return await api
- .patch('/redfish/v1/Systems/system', data)
+ .patch(`${await this.dispatch('global/getSystemPath')}`, data)
.then(() => {
dispatch('getPowerRestoreCurrentPolicy');
return i18n.t('pagePowerRestorePolicy.toast.successSaveSettings');