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

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

55 lines
1.2 KiB
JavaScript
Raw Normal View History

2021-12-11 22:18:48 +05:30
import { GlToast } from '@gitlab/ui';
2021-09-04 01:27:46 +05:30
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql';
2021-10-27 15:23:28 +05:30
import GroupRunnersApp from './group_runners_app.vue';
2021-09-04 01:27:46 +05:30
2021-12-11 22:18:48 +05:30
Vue.use(GlToast);
2021-09-04 01:27:46 +05:30
Vue.use(VueApollo);
2021-10-27 15:23:28 +05:30
export const initGroupRunners = (selector = '#js-group-runners') => {
2021-09-04 01:27:46 +05:30
const el = document.querySelector(selector);
if (!el) {
return null;
}
2021-11-11 11:23:49 +05:30
const {
registrationToken,
runnerInstallHelpPage,
groupId,
groupFullPath,
groupRunnersLimitedCount,
2022-06-21 17:19:12 +05:30
onlineContactTimeoutSecs,
staleTimeoutSecs,
2022-07-23 23:45:48 +05:30
emptyStateSvgPath,
emptyStateFilteredSvgPath,
2021-11-11 11:23:49 +05:30
} = el.dataset;
2021-09-04 01:27:46 +05:30
const apolloProvider = new VueApollo({
2021-12-11 22:18:48 +05:30
defaultClient: createDefaultClient(),
2021-09-04 01:27:46 +05:30
});
return new Vue({
el,
apolloProvider,
provide: {
2021-11-11 11:23:49 +05:30
runnerInstallHelpPage,
2021-10-27 15:23:28 +05:30
groupId,
2022-06-21 17:19:12 +05:30
onlineContactTimeoutSecs: parseInt(onlineContactTimeoutSecs, 10),
staleTimeoutSecs: parseInt(staleTimeoutSecs, 10),
2022-07-23 23:45:48 +05:30
emptyStateSvgPath,
emptyStateFilteredSvgPath,
2021-09-04 01:27:46 +05:30
},
render(h) {
2021-10-27 15:23:28 +05:30
return h(GroupRunnersApp, {
2021-09-04 01:27:46 +05:30
props: {
registrationToken,
2021-11-11 11:23:49 +05:30
groupFullPath,
groupRunnersLimitedCount: parseInt(groupRunnersLimitedCount, 10),
2021-09-04 01:27:46 +05:30
},
});
},
});
};