Feature worker recording storage path (#299)

* refactor: 💡 refactor worker form fieldset to use HDS

* feat: 🎸 add recording_storage_path optional config for workers

* chore: 🤖 tweak language and add learn-more link

* chore: 🤖 add additional feature check

* Update addons/core/translations/resources/en-us.yaml

Co-authored-by: Zhihe Li <zhihe.li@hashicorp.com>

* chore: 🤖 use hds inline link

---------

Co-authored-by: Zhihe Li <zhihe.li@hashicorp.com>
This commit is contained in:
Randall MoreyandZhihe Li authored and GitHub committed 2023-05-31 11:28:27 -07:00
1 parent 55b1ea7350
commit 2cd4995c92
4 files changed
+70 -8

No files matched your search

@@ -718,6 +718,14 @@ worker:
worker_tags:
label: Worker Tags
help: Boundary can use tags to define key-value pairs which targets can use to determine where they should route connections.
local_session_recording_storage:
label: Local Session Recording Storage
help: To record sessions using this worker, specify a local storage path and ensure that it is provisioned with sufficient capacity. In progress recordings are stored locally until they complete, and then moved to the remote storage bucket associated with their target.
enable_recording_storage_path:
label: Enable Recording Storage
recording_storage_path:
label: Recording Storage Path
help: Local path on the worker node for temporary file storage.
steps:
1:
title: 1. Configure your new worker
@@ -51,12 +51,12 @@
/>
{{/if}}
<Rose::Form::Fieldset>
<:title>{{t 'resources.worker.form.worker_tags.label'}}</:title>
<:description>{{t
<Hds::Form::Fieldset as |F|>
<F.Legend>{{t 'resources.worker.form.worker_tags.label'}}</F.Legend>
<F.HelperText>{{t
'resources.worker.form.worker_tags.help'
}}</:description>
<:body>
}}</F.HelperText>
<F.Control>
<Rose::Table @style='condensed' as |table|>
<table.body as |body|>
{{#each this.workerTags as |tag index|}}
@@ -108,8 +108,46 @@
</body.row>
</table.body>
</Rose::Table>
</:body>
</Rose::Form::Fieldset>
</F.Control>
</Hds::Form::Fieldset>
{{#if (feature-flag 'ssh-session-recording')}}
<Hds::Form::Fieldset as |F|>
<F.Legend>{{t
'resources.worker.form.local_session_recording_storage.label'
}}</F.Legend>
<F.HelperText>
{{t 'resources.worker.form.local_session_recording_storage.help'}}
<Hds::Link::Inline @href={{doc-url 'session-recording'}}>{{t
'actions.learn-more'
}}</Hds::Link::Inline>
</F.HelperText>
<F.Control>
<Hds::Form::Toggle::Field
name='enableRecordingStoragePath'
checked={{this.enableRecordingStoragePath}}
{{on 'change' this.toggleEnableRecordingStoragePath}}
as |F|
>
<F.Label>{{t
'resources.worker.form.enable_recording_storage_path.label'
}}</F.Label>
</Hds::Form::Toggle::Field>
</F.Control>
{{#if this.enableRecordingStoragePath}}
<F.Control>
<form.input
@name='recording_storage_path'
@value={{this.recording_storage_path}}
@label={{t 'resources.worker.form.recording_storage_path.label'}}
@helperText={{t
'resources.worker.form.recording_storage_path.help'
}}
/>
</F.Control>
{{/if}}
</Hds::Form::Fieldset>
{{/if}}
<Rose::CodeEditor @codeValue={{this.createConfigText}} as |c|>
<c.toolbar>
@@ -33,6 +33,8 @@ export default class FormWorkerCreateWorkerLedComponent extends Component {
@tracked workerTags = A([]);
@tracked newWorkerKey;
@tracked newWorkerValue;
@tracked enableRecordingStoragePath = false;
@tracked recording_storage_path = '';
get clusterIDFromURL() {
const hostname = this.window?.location?.hostname;
@@ -55,6 +57,14 @@ export default class FormWorkerCreateWorkerLedComponent extends Component {
touch ${this.configFilePath || '<path>'}/pki-worker.hcl`;
}
get recordingStoragePathText() {
const path = this.recording_storage_path || '<recording_storage_path>';
return this.features.isEnabled('ssh-session-recording') &&
this.enableRecordingStoragePath
? `\n recording_storage_path = "${path}"`
: '';
}
/**
* Returns config creation text for `<Rose::CodeEditor>`. The user will see
* different outputs based on if they are using `hcp` or `oss` binaries.
@@ -93,7 +103,7 @@ worker {
this.features.isEnabled('byow-pki-hcp-cluster-id')
? `${tagsText}`
: `${tagsText}${upstreamText}`
}
}${this.recordingStoragePathText}
}`;
if (this.features.isEnabled('byow-pki-hcp-cluster-id')) {
@@ -187,4 +197,9 @@ unzip *.zip ;\\
removeWorkerTagByIndex(index) {
this.workerTags.removeAt(index);
}
@action
toggleEnableRecordingStoragePath() {
this.enableRecordingStoragePath = !this.enableRecordingStoragePath;
}
}
+1
View File
@@ -104,6 +104,7 @@ module.exports = function (environment) {
'worker.manage-workers': '/workers/manage-workers-on-hcp',
'worker-filters': '/worker-filters',
'storage-bucket': '/storage-buckets',
'session-recording': '/session-recordings',
},
},