debian-mirror-gitlab/app/assets/javascripts/token_access/index.js

33 lines
725 B
JavaScript
Raw Normal View History

2021-09-30 23:02:18 +05:30
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql';
2023-04-23 21:23:45 +05:30
import TokenAccessApp from './components/token_access_app.vue';
2021-09-30 23:02:18 +05:30
Vue.use(VueApollo);
const apolloProvider = new VueApollo({
2021-12-11 22:18:48 +05:30
defaultClient: createDefaultClient(),
2021-09-30 23:02:18 +05:30
});
export const initTokenAccess = (containerId = 'js-ci-token-access-app') => {
const containerEl = document.getElementById(containerId);
if (!containerEl) {
return false;
}
const { fullPath } = containerEl.dataset;
return new Vue({
el: containerEl,
2023-07-09 08:55:56 +05:30
name: 'TokenAccessAppsRoot',
2021-09-30 23:02:18 +05:30
apolloProvider,
provide: {
fullPath,
},
render(createElement) {
2023-04-23 21:23:45 +05:30
return createElement(TokenAccessApp);
2021-09-30 23:02:18 +05:30
},
});
};