diff --git a/changelog/11256.txt b/changelog/11256.txt new file mode 100644 index 000000000..63f22f614 --- /dev/null +++ b/changelog/11256.txt @@ -0,0 +1,3 @@ +```release-note:bug +ui: Fixed and updated lease renewal picker +``` \ No newline at end of file diff --git a/ui/app/adapters/lease.js b/ui/app/adapters/lease.js index 67fff5e2d..4911864c7 100644 --- a/ui/app/adapters/lease.js +++ b/ui/app/adapters/lease.js @@ -14,12 +14,12 @@ export default ApplicationAdapter.extend({ return this.ajax(url, 'PUT'); }, - renew(lease_id, interval) { + renew(lease_id, increment) { let url = this.buildURL() + '/leases/renew'; return this.ajax(url, 'PUT', { data: { lease_id, - interval, + increment, }, }); }, diff --git a/ui/app/controllers/vault/cluster/access/leases/show.js b/ui/app/controllers/vault/cluster/access/leases/show.js index 343bc0b23..45ab19adc 100644 --- a/ui/app/controllers/vault/cluster/access/leases/show.js +++ b/ui/app/controllers/vault/cluster/access/leases/show.js @@ -24,11 +24,11 @@ export default Controller.extend({ }); }, - renewLease(model, interval) { + renewLease(model, increment) { const adapter = model.store.adapterFor('lease'); const flash = this.flashMessages; adapter - .renew(model.id, interval) + .renew(model.id, increment?.seconds) .then(() => { this.send('refreshModel'); // lol this is terrible, but there's no way to get the promise from the route refresh diff --git a/ui/app/templates/vault/cluster/access/leases/show.hbs b/ui/app/templates/vault/cluster/access/leases/show.hbs index 04d53f100..8cffd74ae 100644 --- a/ui/app/templates/vault/cluster/access/leases/show.hbs +++ b/ui/app/templates/vault/cluster/access/leases/show.hbs @@ -52,16 +52,22 @@ {{model.expireTime}} - + {{/if}} {{#if (and (not model.isAuthLease) model.renewable capabilities.renew.canUpdate)}}

Renew Lease

-
- -
+ + +