diff options
Diffstat (limited to 'app/assets/javascripts/clusters_list/load_agents.js')
-rw-r--r-- | app/assets/javascripts/clusters_list/load_agents.js | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/app/assets/javascripts/clusters_list/load_agents.js b/app/assets/javascripts/clusters_list/load_agents.js new file mode 100644 index 00000000000..b77d386df20 --- /dev/null +++ b/app/assets/javascripts/clusters_list/load_agents.js @@ -0,0 +1,44 @@ +import createDefaultClient from '~/lib/graphql'; +import Agents from './components/agents.vue'; + +export default (Vue, VueApollo) => { + const el = document.querySelector('#js-cluster-agents-list'); + + if (!el) { + return null; + } + + const defaultClient = createDefaultClient({}, { assumeImmutableResults: true }); + + const { + emptyStateImage, + defaultBranchName, + projectPath, + agentDocsUrl, + installDocsUrl, + getStartedDocsUrl, + integrationDocsUrl, + kasAddress, + } = el.dataset; + + return new Vue({ + el, + apolloProvider: new VueApollo({ defaultClient }), + provide: { + emptyStateImage, + projectPath, + agentDocsUrl, + installDocsUrl, + getStartedDocsUrl, + integrationDocsUrl, + kasAddress, + }, + render(createElement) { + return createElement(Agents, { + props: { + defaultBranchName, + }, + }); + }, + }); +}; |