2023-03-15 16:00:52 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) HashiCorp, Inc.
|
|
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
|
|
*/
|
|
|
|
|
2021-06-07 17:57:36 +00:00
|
|
|
import Component from '@glimmer/component';
|
|
|
|
import { action } from '@ember/object';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @module ConfigureSshSecretComponent
|
|
|
|
*
|
|
|
|
* @example
|
|
|
|
* ```js
|
2023-03-08 17:37:53 +00:00
|
|
|
* <ConfigureSshSecret
|
|
|
|
* @model={{this.model}}
|
|
|
|
* @configured={{this.configured}}
|
|
|
|
* @saveConfig={{action "saveConfig"}}
|
|
|
|
* @loading={{this.loading}}
|
|
|
|
* />
|
2021-06-07 17:57:36 +00:00
|
|
|
* ```
|
|
|
|
*
|
|
|
|
* @param {string} model - ssh secret engine model
|
|
|
|
* @param {Function} saveConfig - parent action which updates the configuration
|
2023-03-08 17:37:53 +00:00
|
|
|
* @param {boolean} loading - property in parent that updates depending on status of parent's action
|
|
|
|
*
|
2021-06-07 17:57:36 +00:00
|
|
|
*/
|
|
|
|
export default class ConfigureSshSecretComponent extends Component {
|
|
|
|
@action
|
2023-03-08 17:37:53 +00:00
|
|
|
delete() {
|
|
|
|
this.args.saveConfig({ delete: true });
|
|
|
|
}
|
|
|
|
|
|
|
|
@action
|
|
|
|
saveConfig(event) {
|
2022-10-18 15:46:02 +00:00
|
|
|
event.preventDefault();
|
2023-03-08 17:37:53 +00:00
|
|
|
this.args.saveConfig({ delete: false });
|
2021-06-07 17:57:36 +00:00
|
|
|
}
|
|
|
|
}
|