debian-mirror-gitlab/app/assets/javascripts/clusters/agents/index.js
2022-07-17 14:43:12 +02:00

43 lines
956 B
JavaScript

import Vue from 'vue';
import { parseBoolean } from '~/lib/utils/common_utils';
import AgentShowPage from 'ee_else_ce/clusters/agents/components/show.vue';
import apolloProvider from './graphql/provider';
import createRouter from './router';
export default () => {
const el = document.querySelector('#js-cluster-agent-details');
if (!el) {
return null;
}
const {
activityEmptyStateImage,
agentName,
canAdminVulnerability,
emptyStateSvgPath,
projectPath,
kasAddress,
kasVersion,
canAdminCluster,
} = el.dataset;
return new Vue({
el,
apolloProvider,
router: createRouter(),
provide: {
activityEmptyStateImage,
agentName,
canAdminVulnerability,
emptyStateSvgPath,
projectPath,
kasAddress,
kasVersion,
canAdminCluster: parseBoolean(canAdminCluster),
},
render(createElement) {
return createElement(AgentShowPage);
},
});
};