2020-10-11 06:08:09 +05:30
|
|
|
{{if .AllowPrincipals}}
|
|
|
|
<h4 class="ui top attached header">
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "settings.manage_ssh_principals"}}
|
2020-10-11 06:08:09 +05:30
|
|
|
<div class="ui right">
|
|
|
|
{{if not .DisableSSH}}
|
2023-09-25 14:26:50 +05:30
|
|
|
<button class="ui primary tiny show-panel button" data-panel="#add-ssh-principal-panel">{{ctx.Locale.Tr "settings.add_new_principal"}}</button>
|
2020-10-11 06:08:09 +05:30
|
|
|
{{else}}
|
2023-09-25 14:26:50 +05:30
|
|
|
<button class="ui primary tiny button disabled">{{ctx.Locale.Tr "settings.ssh_disabled"}}</button>
|
2020-10-11 06:08:09 +05:30
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</h4>
|
|
|
|
<div class="ui attached segment">
|
2023-08-01 03:43:42 +05:30
|
|
|
<div class="flex-list">
|
|
|
|
<div class="flex-item">
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "settings.principal_desc"}}
|
2020-10-11 06:08:09 +05:30
|
|
|
</div>
|
|
|
|
{{range .Principals}}
|
2023-08-01 03:43:42 +05:30
|
|
|
<div class="flex-item">
|
|
|
|
<div class="flex-item-leading">
|
2023-09-25 14:26:50 +05:30
|
|
|
<span class="text {{if .HasRecentActivity}}green{{end}}" {{if .HasRecentActivity}}data-tooltip-content="{{ctx.Locale.Tr "settings.principal_state_desc"}}"{{end}}>{{svg "octicon-key" 32}}</span>
|
2020-10-11 06:08:09 +05:30
|
|
|
</div>
|
2023-08-01 03:43:42 +05:30
|
|
|
<div class="flex-item-main">
|
|
|
|
<div class="flex-item-title">{{.Name}}</div>
|
|
|
|
<div class="flex-item-body">
|
2024-02-22 22:32:33 +05:30
|
|
|
<i>{{ctx.Locale.Tr "settings.added_on" (DateTime "short" .CreatedUnix)}} — {{svg "octicon-info" 16}} {{if .HasUsed}}{{ctx.Locale.Tr "settings.last_used"}} <span {{if .HasRecentActivity}}class="green"{{end}}>{{DateTime "short" .UpdatedUnix}}</span>{{else}}{{ctx.Locale.Tr "settings.no_activity"}}{{end}}</i>
|
2020-10-11 06:08:09 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
2023-08-01 03:43:42 +05:30
|
|
|
<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}}">
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "settings.delete_key"}}
|
2023-08-01 03:43:42 +05:30
|
|
|
</button>
|
|
|
|
</div>
|
2020-10-11 06:08:09 +05:30
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<br>
|
|
|
|
|
2024-03-24 23:53:38 +05:30
|
|
|
<div {{if not .HasPrincipalError}}class="tw-hidden"{{end}} id="add-ssh-principal-panel">
|
2020-10-11 06:08:09 +05:30
|
|
|
<h4 class="ui top attached header">
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "settings.add_new_principal"}}
|
2020-10-11 06:08:09 +05:30
|
|
|
</h4>
|
|
|
|
<div class="ui attached segment">
|
|
|
|
<form class="ui form" action="{{.Link}}" method="post">
|
|
|
|
{{.CsrfTokenHtml}}
|
|
|
|
<div class="field {{if .Err_Content}}error{{end}}">
|
2024-02-16 19:29:48 +05:30
|
|
|
<label for="ssh-principal-content">{{ctx.Locale.Tr "settings.principal_content"}}</label>
|
2020-10-11 06:08:09 +05:30
|
|
|
<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">
|
2023-09-19 03:35:31 +05:30
|
|
|
<button class="ui primary button">
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "settings.add_new_principal"}}
|
2020-10-11 06:08:09 +05:30
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2023-04-24 16:38:59 +05:30
|
|
|
<div class="ui g-modal-confirm delete modal" id="delete-principal">
|
2023-04-23 14:54:19 +05:30
|
|
|
<div class="header">
|
2021-03-22 09:34:19 +05:30
|
|
|
{{svg "octicon-trash"}}
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "settings.ssh_principal_deletion"}}
|
2020-10-11 06:08:09 +05:30
|
|
|
</div>
|
|
|
|
<div class="content">
|
2023-09-25 14:26:50 +05:30
|
|
|
<p>{{ctx.Locale.Tr "settings.ssh_principal_deletion_desc"}}</p>
|
2020-10-11 06:08:09 +05:30
|
|
|
</div>
|
2023-04-23 14:54:19 +05:30
|
|
|
{{template "base/modal_actions_confirm" .}}
|
2020-10-11 06:08:09 +05:30
|
|
|
</div>
|
|
|
|
{{end}}
|