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

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

34 lines
686 B
JavaScript
Raw Normal View History

2021-04-29 21:17:54 +05:30
import Vue from 'vue';
2021-06-08 01:23:25 +05:30
import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql';
2022-03-02 08:16:31 +05:30
import AdminRunnerEditApp from './admin_runner_edit_app.vue';
2021-04-29 21:17:54 +05:30
2021-06-08 01:23:25 +05:30
Vue.use(VueApollo);
2022-03-02 08:16:31 +05:30
export const initAdminRunnerEdit = (selector = '#js-admin-runner-edit') => {
2021-04-29 21:17:54 +05:30
const el = document.querySelector(selector);
if (!el) {
return null;
}
2022-07-16 23:28:13 +05:30
const { runnerId, runnerPath } = el.dataset;
2021-04-29 21:17:54 +05:30
2021-06-08 01:23:25 +05:30
const apolloProvider = new VueApollo({
2021-12-11 22:18:48 +05:30
defaultClient: createDefaultClient(),
2021-06-08 01:23:25 +05:30
});
2021-04-29 21:17:54 +05:30
return new Vue({
el,
2021-06-08 01:23:25 +05:30
apolloProvider,
2021-04-29 21:17:54 +05:30
render(h) {
2022-03-02 08:16:31 +05:30
return h(AdminRunnerEditApp, {
2021-04-29 21:17:54 +05:30
props: {
runnerId,
2022-07-16 23:28:13 +05:30
runnerPath,
2021-04-29 21:17:54 +05:30
},
});
},
});
};