2021-04-01 11:08:54 -04:00
|
|
|
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-03-01 10:22:06 -05:00
|
|
|
const { token, revokePath } = el.dataset;
|
2021-04-01 11:08:54 -04:00
|
|
|
|
|
|
|
return new Vue({
|
|
|
|
el,
|
|
|
|
provide: {
|
|
|
|
token: JSON.parse(token),
|
|
|
|
revokePath,
|
|
|
|
},
|
|
|
|
render(h) {
|
|
|
|
return h(RevokeButton);
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|