debian-mirror-gitlab/app/assets/javascripts/pages/shared/mount_runner_instructions.js

28 lines
721 B
JavaScript
Raw Normal View History

2021-03-11 19:13:27 +05:30
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql';
2021-04-29 21:17:54 +05:30
import RunnerInstructions from '~/vue_shared/components/runner_instructions/runner_instructions.vue';
2021-03-11 19:13:27 +05:30
Vue.use(VueApollo);
export function initInstallRunner(componentId = 'js-install-runner') {
const installRunnerEl = document.getElementById(componentId);
if (installRunnerEl) {
const defaultClient = createDefaultClient();
const apolloProvider = new VueApollo({
defaultClient,
});
// eslint-disable-next-line no-new
new Vue({
el: installRunnerEl,
apolloProvider,
render(createElement) {
2021-04-29 21:17:54 +05:30
return createElement(RunnerInstructions);
2021-03-11 19:13:27 +05:30
},
});
}
}