debian-mirror-gitlab/app/assets/javascripts/runner/admin_runner_edit/index.js
2022-07-16 19:58:13 +02:00

33 lines
686 B
JavaScript

import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql';
import AdminRunnerEditApp from './admin_runner_edit_app.vue';
Vue.use(VueApollo);
export const initAdminRunnerEdit = (selector = '#js-admin-runner-edit') => {
const el = document.querySelector(selector);
if (!el) {
return null;
}
const { runnerId, runnerPath } = el.dataset;
const apolloProvider = new VueApollo({
defaultClient: createDefaultClient(),
});
return new Vue({
el,
apolloProvider,
render(h) {
return h(AdminRunnerEditApp, {
props: {
runnerId,
runnerPath,
},
});
},
});
};