Skip to content
Merged
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
8 changes: 4 additions & 4 deletions src/components/Global/TableRowAction.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<slot name="icon">
{{ $t('global.action.export') }}
</slot>
<span v-if="btnIconOnly" class="sr-only">{{ title }}</span>
<span v-if="btnIconOnly" class="visually-hidden">{{ title }}</span>
</b-link>
<b-link
v-else-if="
Expand All @@ -22,7 +22,7 @@
:title="title"
>
<slot name="icon" />
<span class="sr-only">
<span class="visually-hidden">
{{ $t('global.action.download') }}
</span>
</b-link>
Expand All @@ -34,7 +34,7 @@
:title="title"
>
<slot name="icon" />
<span class="sr-only">
<span class="visually-hidden">
{{ $t('global.action.download') }}
</span>
</b-link>
Expand All @@ -49,7 +49,7 @@
<slot name="icon">
{{ title }}
</slot>
<span v-if="btnIconOnly" class="sr-only">{{ title }}</span>
<span v-if="btnIconOnly" class="visually-hidden">{{ title }}</span>
</b-button>
</span>
</template>
Expand Down
9 changes: 9 additions & 0 deletions src/router/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import FieldCoreOverride from '@/views/ResourceManagement/FieldCoreOverride';
import ServiceLoginConsoles from '@/views/Operations/ServiceLoginConsoles/ServiceLoginConsoles.vue';
import ServiceLogin from '@/views/Operations/ServiceLoginConsoles';
import ProfileSettings from '@/views/ProfileSettings';
import Network from '@/views/Settings/Network';

const roles = {
administrator: 'Administrator',
Expand Down Expand Up @@ -281,6 +282,14 @@ export const routes = [
title: i18n.global.t('appPageTitle.deconfigurationHardware'),
},
},
{
path: '/settings/network',
name: 'network',
component: Network,
meta: {
title: i18n.global.t('appPageTitle.network'),
},
},
{
path: '/resource-management/power',
name: 'power',
Expand Down
70 changes: 54 additions & 16 deletions src/store/modules/Settings/NetworkStore.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
//TODO: Work Requird -->
import api from '@/store/api';
import i18n from '@/i18n';
import { defineStore } from 'pinia';
Expand All @@ -24,6 +23,30 @@ export const NetworkStore = defineStore('network', {
isTableBusyGetter: (state) => state.isTableBusy,
},
actions: {
setDhcpEnabledState(dhcpEnabledState) {
this.networkSettings[this.selectedInterfaceIndex].dhcpEnabled =
dhcpEnabledState;
},
setIpv6DhcpEnabledState(ipv6DhcpEnabledState) {
this.networkSettings[this.selectedInterfaceIndex].ipv6OperatingMode =
ipv6DhcpEnabledState;
},
setIpv6AutoConfigEnabled(ipv6AutoConfigEnabled) {
this.networkSettings[this.selectedInterfaceIndex].ipv6AutoConfigEnabled =
ipv6AutoConfigEnabled;
},
setDomainNameState(domainState) {
this.networkSettings[this.selectedInterfaceIndex].useDomainNameEnabled =
domainState;
},
setDnsState(dnsState) {
this.networkSettings[this.selectedInterfaceIndex].useDnsEnabled =
dnsState;
},
setNtpState(ntpState) {
this.networkSettings[this.selectedInterfaceIndex].useNtpEnabled =
ntpState;
},
async setNetworkSettings(data) {
this.networkSettings = data.map(({ data }) => {
const {
Expand Down Expand Up @@ -110,7 +133,7 @@ export const NetworkStore = defineStore('network', {
}, 15000);
},
async saveDomainNameState(domainState) {
this.domainState = domainState;
this.setDomainNameState(domainState);
const data = {
DHCPv4: {
UseDomainName: domainState,
Expand All @@ -121,15 +144,20 @@ export const NetworkStore = defineStore('network', {
`/redfish/v1/Managers/bmc/EthernetInterfaces/${this.selectedInterfaceId}`,
data
)
.then(this.getEthernetData())
.then(() => {
// Getting Ethernet data here so that the toggle gets updated
this.getEthernetData();
// Getting Ethernet data here so that the IPv4 table gets updated
this.getEthernetDataAfterDelay();
})
.then(() => {
return i18n.global.t('pageNetwork.toast.successSaveNetworkSettings', {
setting: i18n.global.t('pageNetwork.domainName'),
});
})
.catch((error) => {
console.log(error);
this.domainState = !domainState;
this.setDomainNameState(!domainState);
throw new Error(
i18n.global.t('pageNetwork.toast.errorSaveNetworkSettings', {
setting: i18n.global.t('pageNetwork.domainName'),
Expand All @@ -138,7 +166,7 @@ export const NetworkStore = defineStore('network', {
});
},
async saveDnsState(dnsState) {
this.dnsState = dnsState;
this.setDnsState(dnsState);
const data = {
DHCPv4: {
UseDNSServers: dnsState,
Expand All @@ -149,15 +177,20 @@ export const NetworkStore = defineStore('network', {
`/redfish/v1/Managers/bmc/EthernetInterfaces/${this.selectedInterfaceId}`,
data
)
.then(this.getEthernetData())
.then(() => {
// Getting Ethernet data here so that the toggle gets updated
this.getEthernetData();
// Getting Ethernet data here so that the IPv4 table gets updated
this.getEthernetDataAfterDelay();
})
.then(() => {
return i18n.global.t('pageNetwork.toast.successSaveNetworkSettings', {
setting: i18n.global.t('pageNetwork.dns'),
});
})
.catch((error) => {
console.log(error);
this.dnsState = !dnsState;
this.setDnsState(!dnsState);
throw new Error(
i18n.global.t('pageNetwork.toast.errorSaveNetworkSettings', {
setting: i18n.global.t('pageNetwork.dns'),
Expand All @@ -166,7 +199,7 @@ export const NetworkStore = defineStore('network', {
});
},
async saveNtpState(ntpState) {
this.ntpState = ntpState;
this.setNtpState(ntpState);
const data = {
DHCPv4: {
UseNTPServers: ntpState,
Expand All @@ -177,15 +210,20 @@ export const NetworkStore = defineStore('network', {
`/redfish/v1/Managers/bmc/EthernetInterfaces/${this.selectedInterfaceId}`,
data
)
.then(this.getEthernetData())
.then(() => {
// Getting Ethernet data here so that the toggle gets updated
this.getEthernetData();
// Getting Ethernet data here so that the IPv4 table gets updated
this.getEthernetDataAfterDelay();
})
.then(() => {
return i18n.global.t('pageNetwork.toast.successSaveNetworkSettings', {
setting: i18n.global.t('pageNetwork.ntp'),
});
})
.catch((error) => {
console.log(error);
this.ntpState = !ntpState;
this.setNtpState(!ntpState);
throw new Error(
i18n.global.t('pageNetwork.toast.errorSaveNetworkSettings', {
setting: i18n.global.t('pageNetwork.ntp'),
Expand All @@ -194,7 +232,7 @@ export const NetworkStore = defineStore('network', {
});
},
async saveDhcpEnabledState(dhcpState) {
this.dhcpEnabledState = dhcpState;
this.setDhcpEnabledState(dhcpState);
const data = {
DHCPv4: {
DHCPEnabled: dhcpState,
Expand All @@ -218,7 +256,7 @@ export const NetworkStore = defineStore('network', {
})
.catch((error) => {
console.log(error);
this.dhcpEnabledState = !dhcpState;
this.setDhcpEnabledState(!dhcpState);
throw new Error(
i18n.global.t('pageNetwork.toast.errorSaveNetworkSettings', {
setting: i18n.global.t('pageNetwork.dhcp'),
Expand All @@ -228,7 +266,7 @@ export const NetworkStore = defineStore('network', {
},
async saveIpv6DhcpEnabledState(dhcpState) {
const updatedDhcpState = dhcpState ? 'Enabled' : 'Disabled';
this.ipv6DhcpEnabledState = updatedDhcpState;
this.setIpv6DhcpEnabledState(updatedDhcpState);
const data = {
DHCPv6: {
OperatingMode: updatedDhcpState,
Expand All @@ -252,7 +290,7 @@ export const NetworkStore = defineStore('network', {
})
.catch((error) => {
console.log(error);
this.ipv6DhcpEnabledState = !dhcpState;
this.setIpv6DhcpEnabledState(!dhcpState ? 'Enabled' : 'Disabled');
throw new Error(
i18n.global.t('pageNetwork.toast.errorSaveNetworkSettings', {
setting: i18n.global.t('pageNetwork.dhcp'),
Expand All @@ -261,7 +299,7 @@ export const NetworkStore = defineStore('network', {
});
},
async saveIpv6AutoConfigState(ipv6AutoConfigState) {
this.ipv6AutoConfigEnabled = ipv6AutoConfigState;
this.setIpv6AutoConfigEnabled(ipv6AutoConfigState);
const data = {
StatelessAddressAutoConfig: {
IPv6AutoConfigEnabled: ipv6AutoConfigState,
Expand All @@ -285,7 +323,7 @@ export const NetworkStore = defineStore('network', {
})
.catch((error) => {
console.log(error);
this.ipv6AutoConfigEnabled = !ipv6AutoConfigState;
this.setIpv6AutoConfigEnabled(!ipv6AutoConfigState);
throw new Error(
i18n.global.t('pageNetwork.toast.errorSaveNetworkSettings', {
setting: i18n.global.t('pageNetwork.ipv6AutoConfig'),
Expand Down
Loading