debian-mirror-gitlab/app/assets/javascripts/clusters_list/index.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

66 lines
1.6 KiB
JavaScript
Raw Normal View History

2022-03-02 08:16:31 +05:30
import { GlToast } from '@gitlab/ui';
2020-04-08 14:13:33 +05:30
import Vue from 'vue';
2021-11-18 22:05:49 +05:30
import VueApollo from 'vue-apollo';
2022-05-07 20:08:51 +05:30
import { parseBoolean } from '~/lib/utils/common_utils';
import createDefaultClient from '~/lib/graphql';
import ClustersMainView from './components/clusters_main_view.vue';
import { createStore } from './store';
2021-11-18 22:05:49 +05:30
2022-03-02 08:16:31 +05:30
Vue.use(GlToast);
2021-11-18 22:05:49 +05:30
Vue.use(VueApollo);
2020-04-08 14:13:33 +05:30
export default () => {
2022-05-07 20:08:51 +05:30
const el = document.querySelector('.js-clusters-main-view');
if (!el) {
return null;
}
const defaultClient = createDefaultClient();
const {
emptyStateImage,
defaultBranchName,
projectPath,
kasAddress,
newClusterPath,
addClusterPath,
2022-06-21 17:19:12 +05:30
newClusterDocsPath,
2022-05-07 20:08:51 +05:30
emptyStateHelpText,
clustersEmptyStateImage,
canAddCluster,
canAdminCluster,
gitlabVersion,
displayClusterAgents,
certificateBasedClustersEnabled,
} = el.dataset;
return new Vue({
el,
apolloProvider: new VueApollo({ defaultClient }),
provide: {
emptyStateImage,
projectPath,
kasAddress,
newClusterPath,
addClusterPath,
2022-06-21 17:19:12 +05:30
newClusterDocsPath,
2022-05-07 20:08:51 +05:30
emptyStateHelpText,
clustersEmptyStateImage,
canAddCluster: parseBoolean(canAddCluster),
canAdminCluster: parseBoolean(canAdminCluster),
gitlabVersion,
displayClusterAgents: parseBoolean(displayClusterAgents),
certificateBasedClustersEnabled: parseBoolean(certificateBasedClustersEnabled),
},
store: createStore(el.dataset),
render(createElement) {
return createElement(ClustersMainView, {
props: {
defaultBranchName,
},
});
},
});
2020-04-08 14:13:33 +05:30
};