diff options
author | Kushal Pandya <kushalspandya@gmail.com> | 2019-09-12 10:51:48 +0300 |
---|---|---|
committer | Kushal Pandya <kushalspandya@gmail.com> | 2019-09-12 10:51:48 +0300 |
commit | 9615a3d3f05e23cb2b5d50884820004c98b252f6 (patch) | |
tree | 5f34d1918c7560b078ead2a8df3f5d8e9c97793f /app | |
parent | 4200a9176b4afc2b9aadc6acfe288f2f75e621bc (diff) | |
parent | bf37e086342f2b2fc478ddb0e836172c950dea83 (diff) |
Merge branch 'create-amazon-eks-cluster-form-skeleton' into 'master'
Create EKS cluster Vue app skeleton
See merge request gitlab-org/gitlab-ce!32479
Diffstat (limited to 'app')
17 files changed, 101 insertions, 0 deletions
diff --git a/app/assets/javascripts/create_cluster/eks_cluster/components/create_eks_cluster.vue b/app/assets/javascripts/create_cluster/eks_cluster/components/create_eks_cluster.vue new file mode 100644 index 00000000000..ce2e4b883e4 --- /dev/null +++ b/app/assets/javascripts/create_cluster/eks_cluster/components/create_eks_cluster.vue @@ -0,0 +1,14 @@ +<script> +import ServiceCredentialsForm from './service_credentials_form.vue'; +import EksClusterConfigurationForm from './eks_cluster_configuration_form.vue'; + +export default { + components: { + ServiceCredentialsForm, + EksClusterConfigurationForm, + }, +}; +</script> +<template> + <eks-cluster-configuration-form /> +</template> diff --git a/app/assets/javascripts/create_cluster/eks_cluster/components/eks_cluster_configuration_form.vue b/app/assets/javascripts/create_cluster/eks_cluster/components/eks_cluster_configuration_form.vue new file mode 100644 index 00000000000..1ec45c8b651 --- /dev/null +++ b/app/assets/javascripts/create_cluster/eks_cluster/components/eks_cluster_configuration_form.vue @@ -0,0 +1,18 @@ +<script> +import RoleNameDropdown from './role_name_dropdown.vue'; +import SecurityGroupDropdown from './security_group_dropdown.vue'; +import SubnetDropdown from './subnet_dropdown.vue'; +import VPCDropdown from './vpc_dropdown.vue'; + +export default { + components: { + RoleNameDropdown, + SecurityGroupDropdown, + SubnetDropdown, + VPCDropdown, + }, +}; +</script> +<template> + <form name="eks-cluster-configuration-form"></form> +</template> diff --git a/app/assets/javascripts/create_cluster/eks_cluster/components/role_name_dropdown.vue b/app/assets/javascripts/create_cluster/eks_cluster/components/role_name_dropdown.vue new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/app/assets/javascripts/create_cluster/eks_cluster/components/role_name_dropdown.vue diff --git a/app/assets/javascripts/create_cluster/eks_cluster/components/security_group_dropdown.vue b/app/assets/javascripts/create_cluster/eks_cluster/components/security_group_dropdown.vue new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/app/assets/javascripts/create_cluster/eks_cluster/components/security_group_dropdown.vue diff --git a/app/assets/javascripts/create_cluster/eks_cluster/components/service_credentials_form.vue b/app/assets/javascripts/create_cluster/eks_cluster/components/service_credentials_form.vue new file mode 100644 index 00000000000..79029b8cfa8 --- /dev/null +++ b/app/assets/javascripts/create_cluster/eks_cluster/components/service_credentials_form.vue @@ -0,0 +1,3 @@ +<template> + <form name="service-credentials-form"></form> +</template> diff --git a/app/assets/javascripts/create_cluster/eks_cluster/components/subnet_dropdown.vue b/app/assets/javascripts/create_cluster/eks_cluster/components/subnet_dropdown.vue new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/app/assets/javascripts/create_cluster/eks_cluster/components/subnet_dropdown.vue diff --git a/app/assets/javascripts/create_cluster/eks_cluster/components/vpc_dropdown.vue b/app/assets/javascripts/create_cluster/eks_cluster/components/vpc_dropdown.vue new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/app/assets/javascripts/create_cluster/eks_cluster/components/vpc_dropdown.vue diff --git a/app/assets/javascripts/create_cluster/eks_cluster/index.js b/app/assets/javascripts/create_cluster/eks_cluster/index.js new file mode 100644 index 00000000000..c62e5ec101d --- /dev/null +++ b/app/assets/javascripts/create_cluster/eks_cluster/index.js @@ -0,0 +1,19 @@ +import Vue from 'vue'; +import Vuex from 'vuex'; +import CreateEksCluster from './components/create_eks_cluster.vue'; +import createStore from './store'; + +Vue.use(Vuex); + +export default () => + new Vue({ + el: '.js-create-eks-cluster-form-container', + store: createStore(), + components: { + CreateEksCluster, + }, + data() {}, + render(createElement) { + return createElement('create-eks-cluster'); + }, + }); diff --git a/app/assets/javascripts/create_cluster/eks_cluster/services/aws_services_facade.js b/app/assets/javascripts/create_cluster/eks_cluster/services/aws_services_facade.js new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/app/assets/javascripts/create_cluster/eks_cluster/services/aws_services_facade.js diff --git a/app/assets/javascripts/create_cluster/eks_cluster/store/actions.js b/app/assets/javascripts/create_cluster/eks_cluster/store/actions.js new file mode 100644 index 00000000000..861bcddfcc7 --- /dev/null +++ b/app/assets/javascripts/create_cluster/eks_cluster/store/actions.js @@ -0,0 +1,3 @@ +// import awsServices from '../services/aws_services_facade'; + +export default () => {}; diff --git a/app/assets/javascripts/create_cluster/eks_cluster/store/getters.js b/app/assets/javascripts/create_cluster/eks_cluster/store/getters.js new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/app/assets/javascripts/create_cluster/eks_cluster/store/getters.js diff --git a/app/assets/javascripts/create_cluster/eks_cluster/store/index.js b/app/assets/javascripts/create_cluster/eks_cluster/store/index.js new file mode 100644 index 00000000000..99e9e35fd1a --- /dev/null +++ b/app/assets/javascripts/create_cluster/eks_cluster/store/index.js @@ -0,0 +1,15 @@ +import Vuex from 'vuex'; +import * as actions from './actions'; +import * as getters from './getters'; +import mutations from './mutations'; +import state from './state'; + +const createStore = () => + new Vuex.Store({ + actions, + getters, + mutations, + state, + }); + +export default createStore; diff --git a/app/assets/javascripts/create_cluster/eks_cluster/store/mutation_types.js b/app/assets/javascripts/create_cluster/eks_cluster/store/mutation_types.js new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/app/assets/javascripts/create_cluster/eks_cluster/store/mutation_types.js diff --git a/app/assets/javascripts/create_cluster/eks_cluster/store/mutations.js b/app/assets/javascripts/create_cluster/eks_cluster/store/mutations.js new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/app/assets/javascripts/create_cluster/eks_cluster/store/mutations.js diff --git a/app/assets/javascripts/create_cluster/eks_cluster/store/state.js b/app/assets/javascripts/create_cluster/eks_cluster/store/state.js new file mode 100644 index 00000000000..9754ccfeeaf --- /dev/null +++ b/app/assets/javascripts/create_cluster/eks_cluster/store/state.js @@ -0,0 +1,19 @@ +export default () => ({ + isValidatingCredentials: false, + validCredentials: false, + + isLoadingRoles: false, + isLoadingVPCs: false, + isLoadingSubnets: false, + isLoadingSecurityGroups: false, + + roles: [], + vpcs: [], + subnets: [], + securityGroups: [], + + selectedRole: '', + selectedVPC: '', + selectedSubnet: '', + selectedSecurityGroup: '', +}); diff --git a/app/assets/javascripts/pages/projects/clusters/new/index.js b/app/assets/javascripts/pages/projects/clusters/new/index.js new file mode 100644 index 00000000000..55aa29c9797 --- /dev/null +++ b/app/assets/javascripts/pages/projects/clusters/new/index.js @@ -0,0 +1,7 @@ +document.addEventListener('DOMContentLoaded', () => { + if (gon.features.createEksClusters) { + import(/* webpackChunkName: 'eks_cluster' */ '~/create_cluster/eks_cluster') + .then(({ default: initCreateEKSCluster }) => initCreateEKSCluster()) + .catch(() => {}); + } +}); diff --git a/app/controllers/clusters/clusters_controller.rb b/app/controllers/clusters/clusters_controller.rb index bcd771dafcf..97f59da7885 100644 --- a/app/controllers/clusters/clusters_controller.rb +++ b/app/controllers/clusters/clusters_controller.rb @@ -12,6 +12,9 @@ class Clusters::ClustersController < Clusters::BaseController before_action :authorize_update_cluster!, only: [:update] before_action :authorize_admin_cluster!, only: [:destroy] before_action :update_applications_status, only: [:cluster_status] + before_action only: [:new, :create_gcp] do + push_frontend_feature_flag(:create_eks_clusters) + end helper_method :token_in_session |