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;
|
|
|
|
}
|
|
|
|
|
|
|
|
const { runnerId } = el.dataset;
|
|
|
|
|
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,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|