-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create ssh type target in admin-ui (#1027)
* feat: 🎸 create ssh type target in admin-UI
- Loading branch information
1 parent
a7bcc0c
commit 9fae8f2
Showing
7 changed files
with
261 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
<Rose::Form | ||
@onSubmit={{@submit}} | ||
@cancel={{@cancel}} | ||
@disabled={{@model.isSaving}} | ||
@error={{@model.errors.base}} | ||
@showEditToggle={{if @model.isNew false true}} | ||
as |form| | ||
> | ||
<form.input | ||
@name='name' | ||
@type='text' | ||
@value={{@model.name}} | ||
@label={{t 'form.name.label'}} | ||
@helperText={{t 'form.name.help'}} | ||
@error={{@model.errors.name}} | ||
as |field| | ||
> | ||
{{#if @model.errors.name}} | ||
<field.errors as |errors|> | ||
{{#each @model.errors.name as |error|}} | ||
<errors.message>{{error.message}}</errors.message> | ||
{{/each}} | ||
</field.errors> | ||
{{/if}} | ||
</form.input> | ||
|
||
<form.textarea | ||
@name='description' | ||
@type='text' | ||
@value={{@model.description}} | ||
@label={{t 'form.description.label'}} | ||
@helperText={{t 'form.description.help'}} | ||
@error={{@model.errors.description}} | ||
as |field| | ||
> | ||
{{#if @model.errors.description}} | ||
<field.errors as |errors|> | ||
{{#each @model.errors.description as |error|}} | ||
<errors.message>{{error.message}}</errors.message> | ||
{{/each}} | ||
</field.errors> | ||
{{/if}} | ||
</form.textarea> | ||
|
||
<form.fieldset> | ||
<:title>{{t 'form.type.label'}}</:title> | ||
<:body> | ||
<form.radioGroup | ||
@name='types' | ||
@selectedValue={{@model.type}} | ||
@changed={{@changeType}} | ||
as |radioGroup| | ||
> | ||
<radioGroup.card | ||
@label={{t (concat 'resources.target.types.' @model.type)}} | ||
@helperText={{t (concat 'resources.target.help.' @model.type)}} | ||
@value={{@model.type}} | ||
@layout='wide' | ||
readonly={{true}} | ||
@disabled={{true}} | ||
/> | ||
</form.radioGroup> | ||
</:body> | ||
</form.fieldset> | ||
|
||
<form.input | ||
@name='session_max_seconds' | ||
@type='number' | ||
@value={{@model.session_max_seconds}} | ||
@label={{t 'form.session_max_seconds.label'}} | ||
@error={{@model.errors.session_max_seconds}} | ||
@helperText={{t 'form.session_max_seconds.help'}} | ||
min='0' | ||
step='1' | ||
as |field| | ||
> | ||
{{#if @model.errors.session_max_seconds}} | ||
<field.errors as |errors|> | ||
{{#each @model.errors.session_max_seconds as |error|}} | ||
<errors.message>{{error.message}}</errors.message> | ||
{{/each}} | ||
</field.errors> | ||
{{/if}} | ||
</form.input> | ||
|
||
<form.input | ||
@name='session_connection_limit' | ||
@type='number' | ||
@value={{@model.session_connection_limit}} | ||
@label={{t 'form.session_connection_limit.label'}} | ||
@error={{@model.errors.session_connection_limit}} | ||
@helperText={{t 'form.session_connection_limit.help'}} | ||
min='-1' | ||
step='1' | ||
as |field| | ||
> | ||
{{#if @model.errors.session_connection_limit}} | ||
<field.errors as |errors|> | ||
{{#each @model.errors.session_connection_limit as |error|}} | ||
<errors.message>{{error.message}}</errors.message> | ||
{{/each}} | ||
</field.errors> | ||
{{/if}} | ||
</form.input> | ||
|
||
<form.input | ||
@name='default_port' | ||
@type='number' | ||
@value={{@model.default_port}} | ||
@label={{t 'form.default_port.label'}} | ||
@error={{@model.errors.default_port}} | ||
@helperText={{t 'form.default_port.help'}} | ||
placeholder={{@defaultPort}} | ||
min='0' | ||
step='1' | ||
as |field| | ||
> | ||
{{#if @model.errors.default_port}} | ||
<field.errors as |errors|> | ||
{{#each @model.errors.default_port as |error|}} | ||
<errors.message>{{error.message}}</errors.message> | ||
{{/each}} | ||
</field.errors> | ||
{{/if}} | ||
</form.input> | ||
{{#if (can 'save model' @model)}} | ||
<form.actions | ||
@disabled={{if @model.cannotSave @model.cannotSave}} | ||
@enableEditText={{t 'actions.edit-form'}} | ||
@submitText={{t 'actions.save'}} | ||
@cancelText={{t 'actions.cancel'}} | ||
/> | ||
{{/if}} | ||
</Rose::Form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,122 +1,6 @@ | ||
<Rose::Form | ||
@onSubmit={{@submit}} | ||
@cancel={{@cancel}} | ||
@disabled={{@model.isSaving}} | ||
@error={{@model.errors.base}} | ||
@showEditToggle={{if @model.isNew false true}} | ||
as |form| | ||
> | ||
|
||
<form.input | ||
@value={{@model.type}} | ||
@label={{t 'form.type.label'}} | ||
readonly={{true}} | ||
@disabled={{true}} | ||
/> | ||
|
||
<form.input | ||
@name='name' | ||
@type='text' | ||
@value={{@model.name}} | ||
@label={{t 'form.name.label'}} | ||
@helperText={{t 'form.name.help'}} | ||
@error={{@model.errors.name}} | ||
as |field| | ||
> | ||
{{#if @model.errors.name}} | ||
<field.errors as |errors|> | ||
{{#each @model.errors.name as |error|}} | ||
<errors.message>{{error.message}}</errors.message> | ||
{{/each}} | ||
</field.errors> | ||
{{/if}} | ||
</form.input> | ||
|
||
<form.textarea | ||
@name='description' | ||
@type='text' | ||
@value={{@model.description}} | ||
@label={{t 'form.description.label'}} | ||
@helperText={{t 'form.description.help'}} | ||
@error={{@model.errors.description}} | ||
as |field| | ||
> | ||
{{#if @model.errors.description}} | ||
<field.errors as |errors|> | ||
{{#each @model.errors.description as |error|}} | ||
<errors.message>{{error.message}}</errors.message> | ||
{{/each}} | ||
</field.errors> | ||
{{/if}} | ||
</form.textarea> | ||
|
||
<form.input | ||
@name='session_max_seconds' | ||
@type='number' | ||
@value={{@model.session_max_seconds}} | ||
@label={{t 'form.session_max_seconds.label'}} | ||
@error={{@model.errors.session_max_seconds}} | ||
@helperText={{t 'form.session_max_seconds.help'}} | ||
min='0' | ||
step='1' | ||
as |field| | ||
> | ||
{{#if @model.errors.session_max_seconds}} | ||
<field.errors as |errors|> | ||
{{#each @model.errors.session_max_seconds as |error|}} | ||
<errors.message>{{error.message}}</errors.message> | ||
{{/each}} | ||
</field.errors> | ||
{{/if}} | ||
</form.input> | ||
|
||
<form.input | ||
@name='session_connection_limit' | ||
@type='number' | ||
@value={{@model.session_connection_limit}} | ||
@label={{t 'form.session_connection_limit.label'}} | ||
@error={{@model.errors.session_connection_limit}} | ||
@helperText={{t 'form.session_connection_limit.help'}} | ||
min='-1' | ||
step='1' | ||
as |field| | ||
> | ||
{{#if @model.errors.session_connection_limit}} | ||
<field.errors as |errors|> | ||
{{#each @model.errors.session_connection_limit as |error|}} | ||
<errors.message>{{error.message}}</errors.message> | ||
{{/each}} | ||
</field.errors> | ||
{{/if}} | ||
</form.input> | ||
|
||
{{! TODO this is a type-specific field }} | ||
<form.input | ||
@name='default_port' | ||
@type='number' | ||
@value={{@model.default_port}} | ||
@label={{t 'form.default_port.label'}} | ||
@error={{@model.errors.default_port}} | ||
@helperText={{t 'form.default_port.help'}} | ||
min='0' | ||
step='1' | ||
as |field| | ||
> | ||
{{! TODO need to figure out how to reference `attributes.errors` here }} | ||
{{#if @model.errors.default_port}} | ||
<field.errors as |errors|> | ||
{{#each @model.errors.default_port as |error|}} | ||
<errors.message>{{error.message}}</errors.message> | ||
{{/each}} | ||
</field.errors> | ||
{{/if}} | ||
</form.input> | ||
{{#if (can 'save model' @model)}} | ||
<form.actions | ||
@disabled={{if @model.cannotSave @model.cannotSave}} | ||
@enableEditText={{t 'actions.edit-form'}} | ||
@submitText={{t 'actions.save'}} | ||
@cancelText={{t 'actions.cancel'}} | ||
/> | ||
{{/if}} | ||
</Rose::Form> | ||
{{component | ||
(concat 'form/target/' @model.type) | ||
model=@model | ||
submit=@submit | ||
cancel=@cancel | ||
}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<Form::Target::Details | ||
@model={{@model}} | ||
@defaultPort='22' | ||
@submit={{@submit}} | ||
@cancel={{@cancel}} | ||
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<Form::Target::Details | ||
@model={{@model}} | ||
@defaultPort='443' | ||
@submit={{@submit}} | ||
@cancel={{@cancel}} | ||
/> |
Oops, something went wrong.
9fae8f2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
boundary-ui-desktop – ./ui/desktop
boundary-ui-desktop.vercel.app
boundary-ui-desktop-git-main-hashicorp.vercel.app
boundary-ui-desktop-hashicorp.vercel.app
9fae8f2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
boundary-ui-storybook – ./addons/rose
boundary-ui-storybook-hashicorp.vercel.app
boundary-ui-storybook.vercel.app
boundary-ui-storybook-git-main-hashicorp.vercel.app
9fae8f2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
boundary-ui – ./ui/admin
boundary-ui-git-main-hashicorp.vercel.app
boundary-ui.vercel.app
boundary-ui-hashicorp.vercel.app