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
38
39
40
41
42
43
44
45
46
47
48
49
|
import Vuex from 'vuex';
import clusterDropdownStore from '~/create_cluster/store/cluster_dropdown';
import {
fetchRoles,
fetchKeyPairs,
fetchVpcs,
fetchSubnets,
fetchSecurityGroups,
} from '../services/aws_services_facade';
import * as actions from './actions';
import * as getters from './getters';
import mutations from './mutations';
import state from './state';
const createStore = ({ initialState }) =>
new Vuex.Store({
actions,
getters,
mutations,
state: Object.assign(state(), initialState),
modules: {
roles: {
namespaced: true,
...clusterDropdownStore({ fetchFn: fetchRoles }),
},
keyPairs: {
namespaced: true,
...clusterDropdownStore({ fetchFn: fetchKeyPairs }),
},
vpcs: {
namespaced: true,
...clusterDropdownStore({ fetchFn: fetchVpcs }),
},
subnets: {
namespaced: true,
...clusterDropdownStore({ fetchFn: fetchSubnets }),
},
securityGroups: {
namespaced: true,
...clusterDropdownStore({ fetchFn: fetchSecurityGroups }),
},
instanceTypes: {
namespaced: true,
...clusterDropdownStore({ initialState: { items: initialState.instanceTypes } }),
},
},
});
export default createStore;
|