debian-mirror-gitlab/app/assets/javascripts/runner/group_runner_show/index.js

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

35 lines
740 B
JavaScript
Raw Normal View History

2022-07-23 23:45:48 +05:30
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql';
import GroupRunnerShowApp from './group_runner_show_app.vue';
Vue.use(VueApollo);
2022-08-13 15:12:31 +05:30
export const initGroupRunnerShow = (selector = '#js-group-runner-show') => {
2022-07-23 23:45:48 +05:30
const el = document.querySelector(selector);
if (!el) {
return null;
}
2022-08-13 15:12:31 +05:30
const { runnerId, runnersPath, editGroupRunnerPath } = el.dataset;
2022-07-23 23:45:48 +05:30
const apolloProvider = new VueApollo({
defaultClient: createDefaultClient(),
});
return new Vue({
el,
apolloProvider,
render(h) {
return h(GroupRunnerShowApp, {
props: {
runnerId,
runnersPath,
2022-08-13 15:12:31 +05:30
editGroupRunnerPath,
2022-07-23 23:45:48 +05:30
},
});
},
});
};