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-10-11 01:57:18 +05:30
|
|
|
import RunnerEditApp from './runner_edit_app.vue';
|
2021-04-29 21:17:54 +05:30
|
|
|
|
2021-06-08 01:23:25 +05:30
|
|
|
Vue.use(VueApollo);
|
|
|
|
|
2022-10-11 01:57:18 +05:30
|
|
|
export const initRunnerEdit = (selector) => {
|
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-10-11 01:57:18 +05:30
|
|
|
return h(RunnerEditApp, {
|
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
|
|
|
},
|
|
|
|
});
|
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|