debian-mirror-gitlab/app/assets/javascripts/deploy_tokens/init_revoke_button.js

26 lines
512 B
JavaScript
Raw Normal View History

2021-04-29 21:17:54 +05:30
import Vue from 'vue';
import RevokeButton from './components/revoke_button.vue';
export default () => {
const containers = document.querySelectorAll('.js-deploy-token-revoke-button');
if (!containers.length) {
return false;
}
return containers.forEach((el) => {
2022-05-07 20:08:51 +05:30
const { token, revokePath } = el.dataset;
2021-04-29 21:17:54 +05:30
return new Vue({
el,
provide: {
token: JSON.parse(token),
revokePath,
},
render(h) {
return h(RevokeButton);
},
});
});
};