summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/locales/en-US.json4
-rw-r--r--src/router/index.js3
-rw-r--r--src/store/modules/HardwareStatus/AssemblyStore.js33
-rw-r--r--src/store/modules/HardwareStatus/BmcStore.js9
-rw-r--r--src/store/modules/HardwareStatus/ChassisStore.js9
-rw-r--r--src/store/modules/HardwareStatus/MemoryStore.js33
-rw-r--r--src/store/modules/HardwareStatus/ProcessorStore.js33
-rw-r--r--src/store/modules/HardwareStatus/SystemStore.js7
-rw-r--r--src/views/HardwareStatus/Inventory/InventoryServiceIndicator.vue1
-rw-r--r--src/views/HardwareStatus/Inventory/InventoryTableAssembly.vue1
-rw-r--r--src/views/HardwareStatus/Inventory/InventoryTableBmcManager.vue1
-rw-r--r--src/views/HardwareStatus/Inventory/InventoryTableChassis.vue1
-rw-r--r--src/views/HardwareStatus/Inventory/InventoryTableDimmSlot.vue3
-rw-r--r--src/views/HardwareStatus/Inventory/InventoryTableProcessors.vue1
-rw-r--r--src/views/HardwareStatus/Inventory/InventoryTableSystem.vue1
-rw-r--r--src/views/Overview/OverviewInventory.vue3
-rw-r--r--src/views/Settings/PowerRestorePolicy/PowerRestorePolicy.vue1
-rw-r--r--vue.config.js5
18 files changed, 113 insertions, 36 deletions
diff --git a/src/locales/en-US.json b/src/locales/en-US.json
index ab630757..8ba7ac94 100644
--- a/src/locales/en-US.json
+++ b/src/locales/en-US.json
@@ -452,7 +452,9 @@
},
"toast": {
"errorDisableIdentifyLed": "Error disabling Identify LED.",
- "errorEnableIdentifyLed": "Error enabling Identify LED."
+ "errorEnableIdentifyLed": "Error enabling Identify LED.",
+ "successDisableIdentifyLed": "Successfully disabled Identify LED.",
+ "successEnableIdentifyLed": "Successfully enabled Identify LED."
}
},
"pageKeyClear": {
diff --git a/src/router/index.js b/src/router/index.js
index 5b6d9099..4e962fea 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -12,6 +12,9 @@ const router = new VueRouter({
base: process.env.BASE_URL,
routes,
linkExactActiveClass: 'nav-link--current',
+ scrollBehavior() {
+ return { x: 0, y: 0 };
+ },
});
function allowRouterToNavigate(to, next, currentUserRole) {
diff --git a/src/store/modules/HardwareStatus/AssemblyStore.js b/src/store/modules/HardwareStatus/AssemblyStore.js
index c6ab7cf7..13cdbbc9 100644
--- a/src/store/modules/HardwareStatus/AssemblyStore.js
+++ b/src/store/modules/HardwareStatus/AssemblyStore.js
@@ -54,17 +54,28 @@ const AssemblyStore = {
],
};
- return await api.patch(uri, updatedIdentifyLedValue).catch((error) => {
- dispatch('getAssemblyInfo');
- console.log('error', error);
- if (led.identifyLed) {
- throw new Error(i18n.t('pageInventory.toast.errorEnableIdentifyLed'));
- } else {
- throw new Error(
- i18n.t('pageInventory.toast.errorDisableIdentifyLed'),
- );
- }
- });
+ return await api
+ .patch(uri, updatedIdentifyLedValue)
+ .then(() => {
+ if (led.identifyLed) {
+ return i18n.t('pageInventory.toast.successEnableIdentifyLed');
+ } else {
+ return i18n.t('pageInventory.toast.successDisableIdentifyLed');
+ }
+ })
+ .catch((error) => {
+ dispatch('getAssemblyInfo');
+ console.log('error', error);
+ if (led.identifyLed) {
+ throw new Error(
+ i18n.t('pageInventory.toast.errorEnableIdentifyLed'),
+ );
+ } else {
+ throw new Error(
+ i18n.t('pageInventory.toast.errorDisableIdentifyLed'),
+ );
+ }
+ });
},
},
};
diff --git a/src/store/modules/HardwareStatus/BmcStore.js b/src/store/modules/HardwareStatus/BmcStore.js
index f225e925..d96926ea 100644
--- a/src/store/modules/HardwareStatus/BmcStore.js
+++ b/src/store/modules/HardwareStatus/BmcStore.js
@@ -58,7 +58,14 @@ const BmcStore = {
};
return await api
.patch(uri, updatedIdentifyLedValue)
- .then(() => dispatch('getBmcInfo'))
+ .then(() => {
+ dispatch('getBmcInfo');
+ if (led.identifyLed) {
+ return i18n.t('pageInventory.toast.successEnableIdentifyLed');
+ } else {
+ return i18n.t('pageInventory.toast.successDisableIdentifyLed');
+ }
+ })
.catch((error) => {
dispatch('getBmcInfo');
console.log('error', error);
diff --git a/src/store/modules/HardwareStatus/ChassisStore.js b/src/store/modules/HardwareStatus/ChassisStore.js
index 6f2d74a2..7e591ad2 100644
--- a/src/store/modules/HardwareStatus/ChassisStore.js
+++ b/src/store/modules/HardwareStatus/ChassisStore.js
@@ -72,7 +72,14 @@ const ChassisStore = {
};
return await api
.patch(uri, updatedIdentifyLedValue)
- .then(() => dispatch('getChassisInfo'))
+ .then(() => {
+ dispatch('getChassisInfo');
+ if (led.identifyLed) {
+ return i18n.t('pageInventory.toast.successEnableIdentifyLed');
+ } else {
+ return i18n.t('pageInventory.toast.successDisableIdentifyLed');
+ }
+ })
.catch((error) => {
dispatch('getChassisInfo');
console.log('error', error);
diff --git a/src/store/modules/HardwareStatus/MemoryStore.js b/src/store/modules/HardwareStatus/MemoryStore.js
index 86b77c0a..787a0502 100644
--- a/src/store/modules/HardwareStatus/MemoryStore.js
+++ b/src/store/modules/HardwareStatus/MemoryStore.js
@@ -73,17 +73,28 @@ const MemoryStore = {
const updatedIdentifyLedValue = {
LocationIndicatorActive: led.identifyLed,
};
- return await api.patch(uri, updatedIdentifyLedValue).catch((error) => {
- dispatch('getDimms');
- console.log('error', error);
- if (led.identifyLed) {
- throw new Error(i18n.t('pageInventory.toast.errorEnableIdentifyLed'));
- } else {
- throw new Error(
- i18n.t('pageInventory.toast.errorDisableIdentifyLed'),
- );
- }
- });
+ return await api
+ .patch(uri, updatedIdentifyLedValue)
+ .then(() => {
+ if (led.identifyLed) {
+ return i18n.t('pageInventory.toast.successEnableIdentifyLed');
+ } else {
+ return i18n.t('pageInventory.toast.successDisableIdentifyLed');
+ }
+ })
+ .catch((error) => {
+ dispatch('getDimms');
+ console.log('error', error);
+ if (led.identifyLed) {
+ throw new Error(
+ i18n.t('pageInventory.toast.errorEnableIdentifyLed'),
+ );
+ } else {
+ throw new Error(
+ i18n.t('pageInventory.toast.errorDisableIdentifyLed'),
+ );
+ }
+ });
},
},
};
diff --git a/src/store/modules/HardwareStatus/ProcessorStore.js b/src/store/modules/HardwareStatus/ProcessorStore.js
index 29fb9989..49f96208 100644
--- a/src/store/modules/HardwareStatus/ProcessorStore.js
+++ b/src/store/modules/HardwareStatus/ProcessorStore.js
@@ -81,17 +81,28 @@ const ProcessorStore = {
const updatedIdentifyLedValue = {
LocationIndicatorActive: led.identifyLed,
};
- return await api.patch(uri, updatedIdentifyLedValue).catch((error) => {
- dispatch('getProcessorsInfo');
- console.log('error', error);
- if (led.identifyLed) {
- throw new Error(i18n.t('pageInventory.toast.errorEnableIdentifyLed'));
- } else {
- throw new Error(
- i18n.t('pageInventory.toast.errorDisableIdentifyLed'),
- );
- }
- });
+ return await api
+ .patch(uri, updatedIdentifyLedValue)
+ .then(() => {
+ if (led.identifyLed) {
+ return i18n.t('pageInventory.toast.successEnableIdentifyLed');
+ } else {
+ return i18n.t('pageInventory.toast.successDisableIdentifyLed');
+ }
+ })
+ .catch((error) => {
+ dispatch('getProcessorsInfo');
+ console.log('error', error);
+ if (led.identifyLed) {
+ throw new Error(
+ i18n.t('pageInventory.toast.errorEnableIdentifyLed'),
+ );
+ } else {
+ throw new Error(
+ i18n.t('pageInventory.toast.errorDisableIdentifyLed'),
+ );
+ }
+ });
},
},
};
diff --git a/src/store/modules/HardwareStatus/SystemStore.js b/src/store/modules/HardwareStatus/SystemStore.js
index f1382348..ea519d73 100644
--- a/src/store/modules/HardwareStatus/SystemStore.js
+++ b/src/store/modules/HardwareStatus/SystemStore.js
@@ -49,6 +49,13 @@ const SystemStore = {
.patch('/redfish/v1/Systems/system', {
LocationIndicatorActive: ledState,
})
+ .then(() => {
+ if (ledState) {
+ return i18n.t('pageInventory.toast.successEnableIdentifyLed');
+ } else {
+ return i18n.t('pageInventory.toast.successDisableIdentifyLed');
+ }
+ })
.catch((error) => {
commit('setSystemInfo', this.state.system.systems[0]);
console.log('error', error);
diff --git a/src/views/HardwareStatus/Inventory/InventoryServiceIndicator.vue b/src/views/HardwareStatus/Inventory/InventoryServiceIndicator.vue
index 01f4a446..0825ad7b 100644
--- a/src/views/HardwareStatus/Inventory/InventoryServiceIndicator.vue
+++ b/src/views/HardwareStatus/Inventory/InventoryServiceIndicator.vue
@@ -69,6 +69,7 @@ export default {
toggleIdentifyLedSwitch(state) {
this.$store
.dispatch('system/changeIdentifyLedState', state)
+ .then((message) => this.successToast(message))
.catch(({ message }) => this.errorToast(message));
},
},
diff --git a/src/views/HardwareStatus/Inventory/InventoryTableAssembly.vue b/src/views/HardwareStatus/Inventory/InventoryTableAssembly.vue
index b4010bfe..b9f59cc6 100644
--- a/src/views/HardwareStatus/Inventory/InventoryTableAssembly.vue
+++ b/src/views/HardwareStatus/Inventory/InventoryTableAssembly.vue
@@ -143,6 +143,7 @@ export default {
memberId: row.id,
identifyLed: row.identifyLed,
})
+ .then((message) => this.successToast(message))
.catch(({ message }) => this.errorToast(message));
},
hasIdentifyLed(identifyLed) {
diff --git a/src/views/HardwareStatus/Inventory/InventoryTableBmcManager.vue b/src/views/HardwareStatus/Inventory/InventoryTableBmcManager.vue
index 48b914f4..cf3ee2bf 100644
--- a/src/views/HardwareStatus/Inventory/InventoryTableBmcManager.vue
+++ b/src/views/HardwareStatus/Inventory/InventoryTableBmcManager.vue
@@ -233,6 +233,7 @@ export default {
uri: row.uri,
identifyLed: row.identifyLed,
})
+ .then((message) => this.successToast(message))
.catch(({ message }) => this.errorToast(message));
},
// TO DO: remove hasIdentifyLed method once the following story is merged:
diff --git a/src/views/HardwareStatus/Inventory/InventoryTableChassis.vue b/src/views/HardwareStatus/Inventory/InventoryTableChassis.vue
index 4c557fa2..18ddfbaf 100644
--- a/src/views/HardwareStatus/Inventory/InventoryTableChassis.vue
+++ b/src/views/HardwareStatus/Inventory/InventoryTableChassis.vue
@@ -186,6 +186,7 @@ export default {
uri: row.uri,
identifyLed: row.identifyLed,
})
+ .then((message) => this.successToast(message))
.catch(({ message }) => this.errorToast(message));
},
// TO DO: Remove this method when the LocationIndicatorActive is added from backend.
diff --git a/src/views/HardwareStatus/Inventory/InventoryTableDimmSlot.vue b/src/views/HardwareStatus/Inventory/InventoryTableDimmSlot.vue
index 6aa1578f..f3db133e 100644
--- a/src/views/HardwareStatus/Inventory/InventoryTableDimmSlot.vue
+++ b/src/views/HardwareStatus/Inventory/InventoryTableDimmSlot.vue
@@ -193,6 +193,7 @@ import IconChevron from '@carbon/icons-vue/es/chevron--down/20';
import StatusIcon from '@/components/Global/StatusIcon';
import TableCellCount from '@/components/Global/TableCellCount';
+import BVToastMixin from '@/components/Mixins/BVToastMixin';
import DataFormatterMixin from '@/components/Mixins/DataFormatterMixin';
import TableSortMixin from '@/components/Mixins/TableSortMixin';
import Search from '@/components/Global/Search';
@@ -206,6 +207,7 @@ import TableRowExpandMixin, {
export default {
components: { IconChevron, PageSection, StatusIcon, Search, TableCellCount },
mixins: [
+ BVToastMixin,
TableRowExpandMixin,
DataFormatterMixin,
TableSortMixin,
@@ -287,6 +289,7 @@ export default {
uri: row.uri,
identifyLed: row.identifyLed,
})
+ .then((message) => this.successToast(message))
.catch(({ message }) => this.errorToast(message));
},
hasIdentifyLed(identifyLed) {
diff --git a/src/views/HardwareStatus/Inventory/InventoryTableProcessors.vue b/src/views/HardwareStatus/Inventory/InventoryTableProcessors.vue
index 07376a5b..2887fc49 100644
--- a/src/views/HardwareStatus/Inventory/InventoryTableProcessors.vue
+++ b/src/views/HardwareStatus/Inventory/InventoryTableProcessors.vue
@@ -257,6 +257,7 @@ export default {
uri: row.uri,
identifyLed: row.identifyLed,
})
+ .then((message) => this.successToast(message))
.catch(({ message }) => this.errorToast(message));
},
// TO DO: remove hasIdentifyLed when the following is merged:
diff --git a/src/views/HardwareStatus/Inventory/InventoryTableSystem.vue b/src/views/HardwareStatus/Inventory/InventoryTableSystem.vue
index 3eb7ca29..8ac1a259 100644
--- a/src/views/HardwareStatus/Inventory/InventoryTableSystem.vue
+++ b/src/views/HardwareStatus/Inventory/InventoryTableSystem.vue
@@ -202,6 +202,7 @@ export default {
toggleIdentifyLedSwitch(state) {
this.$store
.dispatch('system/changeIdentifyLedState', state)
+ .then((message) => this.successToast(message))
.catch(({ message }) => this.errorToast(message));
},
},
diff --git a/src/views/Overview/OverviewInventory.vue b/src/views/Overview/OverviewInventory.vue
index 575cb7b7..1da5685f 100644
--- a/src/views/Overview/OverviewInventory.vue
+++ b/src/views/Overview/OverviewInventory.vue
@@ -29,12 +29,14 @@
<script>
import OverviewCard from './OverviewCard';
+import BVToastMixin from '@/components/Mixins/BVToastMixin';
export default {
name: 'Inventory',
components: {
OverviewCard,
},
+ mixins: [BVToastMixin],
computed: {
systems() {
let systemData = this.$store.getters['system/systems'][0];
@@ -50,6 +52,7 @@ export default {
toggleIdentifyLedSwitch(state) {
this.$store
.dispatch('system/changeIdentifyLedState', state)
+ .then((message) => this.successToast(message))
.catch(({ message }) => this.errorToast(message));
},
},
diff --git a/src/views/Settings/PowerRestorePolicy/PowerRestorePolicy.vue b/src/views/Settings/PowerRestorePolicy/PowerRestorePolicy.vue
index 9f206296..11870a87 100644
--- a/src/views/Settings/PowerRestorePolicy/PowerRestorePolicy.vue
+++ b/src/views/Settings/PowerRestorePolicy/PowerRestorePolicy.vue
@@ -9,6 +9,7 @@
v-model="currentPowerRestorePolicy"
:options="options"
name="power-restore-policy"
+ stacked
></b-form-radio-group>
</b-form-group>
</b-col>
diff --git a/vue.config.js b/vue.config.js
index e66d5d15..01d48b94 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -69,6 +69,11 @@ module.exports = {
.options({
name: '[name].[contenthash:8].[ext]',
});
+ config.plugins.delete('preload');
+ config.plugin('html').tap((options) => {
+ options[0].filename = 'index.[hash:8].html';
+ return options;
+ });
},
configureWebpack: (config) => {
config.plugins.push(