open-vault/ui/app/components/token-expire-warning.js
Matthew Irish 85d7412107
UI access sidebar (#4658)
* add error template to access so that we can see the sidebar even if you don't have permissions

* identity template cleanup

* make the token expiry warning friendlier and style it
2018-05-30 12:26:54 -05:00

33 lines
669 B
JavaScript

import Ember from 'ember';
export default Ember.Component.extend({
classNames: 'token-expire-warning',
auth: Ember.inject.service(),
routing: Ember.inject.service('-routing'),
transitionToRoute: function() {
var router = this.get('routing.router');
router.transitionTo.apply(router, arguments);
},
isDismissed: false,
actions: {
reauthenticate() {
this.get('auth').deleteCurrentToken();
this.transitionToRoute('vault.cluster');
},
renewToken() {
const auth = this.get('auth');
auth.renew();
auth.setLastFetch(Date.now());
},
dismiss() {
this.set('isDismissed', true);
},
},
});