vault/ui/app/components/role-ssh-edit.js
Vault Automation 601e2cea29
[UI][VAULT-40916] Update page headers ui/app/components (#11104) (#11417)
* Update page headers for database components

* Update generate forms and license info

* Mount backend form page headers..

* Raft page headers

* Update role-aws-edit page header

* Tools, role-ssh, mount-backend-form and fix tests

* OIDC, TOTP and userpass page headers and tsts

* odic, keymgmt, and dashboard

* Fix dashboard title tests

* Fix breadcrumbs

* MFA, idenitity, and generated item

* Fix mfa enforcement page header tests

* Move tabs out of page header

Co-authored-by: Kianna <30884335+kiannaquach@users.noreply.github.com>
2025-12-18 11:29:04 -05:00

38 lines
857 B
JavaScript

/**
* Copyright IBM Corp. 2016, 2025
* SPDX-License-Identifier: BUSL-1.1
*/
import RoleEdit from './role-edit';
import { computed } from '@ember/object';
export default RoleEdit.extend({
init() {
this._super(...arguments);
this.set('backendType', 'ssh');
},
title: computed('mode', function () {
if (this.mode === 'create') {
return 'Create SSH Role';
} else if (this.mode === 'edit') {
return 'Edit SSH Role';
} else {
return 'SSH Role';
}
}),
subtitle: computed('mode', 'model.id', function () {
if (this.mode === 'create' || this.mode === 'edit') return;
return this.model.id;
}),
actions: {
updateTtl(path, val) {
const model = this.model;
const valueToSet = val.enabled === true ? `${val.seconds}s` : undefined;
model.set(path, valueToSet);
},
},
});