2020-10-10 18:38:09 -06:00
|
|
|
{{if .AllowPrincipals}}
|
|
|
|
<h4 class="ui top attached header">
|
2022-06-27 14:58:46 -06:00
|
|
|
{{.locale.Tr "settings.manage_ssh_principals"}}
|
2020-10-10 18:38:09 -06:00
|
|
|
<div class="ui right">
|
|
|
|
{{if not .DisableSSH}}
|
2023-03-13 21:34:09 -06:00
|
|
|
<button class="ui primary tiny show-panel button" data-panel="#add-ssh-principal-panel">{{.locale.Tr "settings.add_new_principal"}}</button>
|
2020-10-10 18:38:09 -06:00
|
|
|
{{else}}
|
2023-03-13 21:34:09 -06:00
|
|
|
<button class="ui primary tiny button disabled">{{.locale.Tr "settings.ssh_disabled"}}</button>
|
2020-10-10 18:38:09 -06:00
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</h4>
|
|
|
|
<div class="ui attached segment">
|
2023-07-31 16:13:42 -06:00
|
|
|
<div class="flex-list">
|
|
|
|
<div class="flex-item">
|
2022-06-27 14:58:46 -06:00
|
|
|
{{.locale.Tr "settings.principal_desc"}}
|
2020-10-10 18:38:09 -06:00
|
|
|
</div>
|
|
|
|
{{range .Principals}}
|
2023-07-31 16:13:42 -06:00
|
|
|
<div class="flex-item">
|
|
|
|
<div class="flex-item-leading">
|
|
|
|
<span class="text {{if .HasRecentActivity}}green{{end}}" {{if .HasRecentActivity}}data-tooltip-content="{{$.locale.Tr "settings.principal_state_desc"}}"{{end}}>{{svg "octicon-key" 32}}</span>
|
2020-10-10 18:38:09 -06:00
|
|
|
</div>
|
2023-07-31 16:13:42 -06:00
|
|
|
<div class="flex-item-main">
|
|
|
|
<div class="flex-item-title">{{.Name}}</div>
|
|
|
|
<div class="flex-item-body">
|
2023-05-06 07:11:27 -06:00
|
|
|
<i>{{$.locale.Tr "settings.added_on" (DateTime "short" .CreatedUnix) | Safe}} — {{svg "octicon-info" 16}} {{if .HasUsed}}{{$.locale.Tr "settings.last_used"}} <span {{if .HasRecentActivity}}class="green"{{end}}>{{DateTime "short" .UpdatedUnix}}</span>{{else}}{{$.locale.Tr "settings.no_activity"}}{{end}}</i>
|
2020-10-10 18:38:09 -06:00
|
|
|
</div>
|
|
|
|
</div>
|
2023-07-31 16:13:42 -06:00
|
|
|
<div class="flex-item-trailing">
|
|
|
|
<button class="ui red tiny button delete-button" data-modal-id="delete-principal" data-url="{{$.Link}}/delete?type=principal" data-id="{{.ID}}">
|
|
|
|
{{$.locale.Tr "settings.delete_key"}}
|
|
|
|
</button>
|
|
|
|
</div>
|
2020-10-10 18:38:09 -06:00
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<br>
|
|
|
|
|
2023-02-18 21:06:14 -07:00
|
|
|
<div {{if not .HasPrincipalError}}class="gt-hidden"{{end}} id="add-ssh-principal-panel">
|
2020-10-10 18:38:09 -06:00
|
|
|
<h4 class="ui top attached header">
|
2022-06-27 14:58:46 -06:00
|
|
|
{{.locale.Tr "settings.add_new_principal"}}
|
2020-10-10 18:38:09 -06:00
|
|
|
</h4>
|
|
|
|
<div class="ui attached segment">
|
|
|
|
<form class="ui form" action="{{.Link}}" method="post">
|
|
|
|
{{.CsrfTokenHtml}}
|
|
|
|
<div class="field {{if .Err_Content}}error{{end}}">
|
2022-06-27 14:58:46 -06:00
|
|
|
<label for="content">{{.locale.Tr "settings.principal_content"}}</label>
|
2020-10-10 18:38:09 -06:00
|
|
|
<input id="ssh-principal-content" name="content" value="{{.content}}" autofocus required>
|
|
|
|
</div>
|
|
|
|
<input name="title" type="hidden" value="principal">
|
|
|
|
<input name="type" type="hidden" value="principal">
|
|
|
|
<button class="ui green button">
|
2022-06-27 14:58:46 -06:00
|
|
|
{{.locale.Tr "settings.add_new_principal"}}
|
2020-10-10 18:38:09 -06:00
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2023-04-24 05:08:59 -06:00
|
|
|
<div class="ui g-modal-confirm delete modal" id="delete-principal">
|
2023-04-23 03:24:19 -06:00
|
|
|
<div class="header">
|
2021-03-21 22:04:19 -06:00
|
|
|
{{svg "octicon-trash"}}
|
2022-06-27 14:58:46 -06:00
|
|
|
{{.locale.Tr "settings.ssh_principal_deletion"}}
|
2020-10-10 18:38:09 -06:00
|
|
|
</div>
|
|
|
|
<div class="content">
|
2022-06-27 14:58:46 -06:00
|
|
|
<p>{{.locale.Tr "settings.ssh_principal_deletion_desc"}}</p>
|
2020-10-10 18:38:09 -06:00
|
|
|
</div>
|
2023-04-23 03:24:19 -06:00
|
|
|
{{template "base/modal_actions_confirm" .}}
|
2020-10-10 18:38:09 -06:00
|
|
|
</div>
|
|
|
|
{{end}}
|