gitlab-org--gitlab-foss/app/assets/javascripts/create_cluster/eks_cluster/index.js

55 lines
1.3 KiB
JavaScript

import Vue from 'vue';
import Vuex from 'vuex';
import { parseBoolean } from '~/lib/utils/common_utils';
import CreateEksCluster from './components/create_eks_cluster.vue';
import createStore from './store';
Vue.use(Vuex);
export default (el) => {
const {
gitlabManagedClusterHelpPath,
namespacePerEnvironmentHelpPath,
kubernetesIntegrationHelpPath,
accountAndExternalIdsHelpPath,
createRoleArnHelpPath,
externalId,
accountId,
instanceTypes,
hasCredentials,
createRolePath,
createClusterPath,
externalLinkIcon,
roleArn,
} = el.dataset;
return new Vue({
el,
store: createStore({
initialState: {
hasCredentials: parseBoolean(hasCredentials),
externalId,
accountId,
instanceTypes: JSON.parse(instanceTypes),
createRolePath,
createClusterPath,
roleArn,
},
}),
components: {
CreateEksCluster,
},
render(createElement) {
return createElement('create-eks-cluster', {
props: {
gitlabManagedClusterHelpPath,
namespacePerEnvironmentHelpPath,
kubernetesIntegrationHelpPath,
accountAndExternalIdsHelpPath,
createRoleArnHelpPath,
externalLinkIcon,
},
});
},
});
};