blob: 84a8f08a576fcfcaeb21706dafb8d3faeacdb074 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
import api from '@/store/api';
import i18n from '@/i18n';
const FactoryResetStore = {
namespaced: true,
actions: {
async resetToDefaults() {
return await api
.post(
`${await this.dispatch('global/getBmcPath')}/Actions/Manager.ResetToDefaults`,
{
ResetType: 'ResetAll',
},
)
.then(() => i18n.t('pageFactoryReset.toast.resetToDefaultsSuccess'))
.catch((error) => {
console.log('Factory Reset: ', error);
throw new Error(
i18n.t('pageFactoryReset.toast.resetToDefaultsError'),
);
});
},
async resetBios() {
return await api
.post(
`${await this.dispatch('global/getSystemPath')}/Bios/Actions/Bios.ResetBios`,
)
.then(() => i18n.t('pageFactoryReset.toast.resetBiosSuccess'))
.catch((error) => {
console.log('Factory Reset: ', error);
throw new Error(i18n.t('pageFactoryReset.toast.resetBiosError'));
});
},
},
};
export default FactoryResetStore;
|