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

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

37 lines
818 B
JavaScript
Raw Normal View History

2022-04-04 11:22:00 +05:30
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql';
2022-07-16 23:28:13 +05:30
import { showAlertFromLocalStorage } from '../local_storage_alert/show_alert_from_local_storage';
2022-04-04 11:22:00 +05:30
import AdminRunnerShowApp from './admin_runner_show_app.vue';
Vue.use(VueApollo);
export const initAdminRunnerShow = (selector = '#js-admin-runner-show') => {
2022-07-16 23:28:13 +05:30
showAlertFromLocalStorage();
2022-04-04 11:22:00 +05:30
const el = document.querySelector(selector);
if (!el) {
return null;
}
2022-07-16 23:28:13 +05:30
const { runnerId, runnersPath } = el.dataset;
2022-04-04 11:22:00 +05:30
const apolloProvider = new VueApollo({
defaultClient: createDefaultClient(),
});
return new Vue({
el,
apolloProvider,
render(h) {
return h(AdminRunnerShowApp, {
props: {
runnerId,
2022-07-16 23:28:13 +05:30
runnersPath,
2022-04-04 11:22:00 +05:30
},
});
},
});
};