summaryrefslogtreecommitdiff
path: root/src/store/modules/Settings/NetworkStore.js
diff options
context:
space:
mode:
authorSean Zhang <xiazhang@nvidia.com>2024-06-15 08:42:41 +0300
committerGunnar Mills <gunnar@gmills.xyz>2024-06-25 18:45:07 +0300
commit8841b7d463a5272a87faaa14cb103f778a772770 (patch)
tree731d8c82ddb76c1c9358c36d707747b09c5189cd /src/store/modules/Settings/NetworkStore.js
parentccb71f0bd6b91b4344cf9a776a433528a5771217 (diff)
downloadwebui-vue-8841b7d463a5272a87faaa14cb103f778a772770.tar.xz
Replace fixed paths with response from APIHEADmaster
Currently, the Redfish request used fixed URIs, modify the code to use the BMC and System paths got from response of API calls. For CertificateStore, since it was using the URL for constant variable assignment, changed the constant CERTIFICATE_TYPES to method call. Change-Id: I330b7272083e3e6993aae5705aae170b8e9a4659 Signed-off-by: Sean Zhang <xiazhang@nvidia.com>
Diffstat (limited to 'src/store/modules/Settings/NetworkStore.js')
-rw-r--r--src/store/modules/Settings/NetworkStore.js20
1 files changed, 10 insertions, 10 deletions
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'))