2020-10-11 06:08:09 +05:30
|
|
|
{{if .AllowPrincipals}}
|
|
|
|
<h4 class="ui top attached header">
|
2022-06-28 02:28:46 +05:30
|
|
|
{{.locale.Tr "settings.manage_ssh_principals"}}
|
2020-10-11 06:08:09 +05:30
|
|
|
<div class="ui right">
|
|
|
|
{{if not .DisableSSH}}
|
2023-03-14 09:04:09 +05:30
|
|
|
<button class="ui primary tiny show-panel button" data-panel="#add-ssh-principal-panel">{{.locale.Tr "settings.add_new_principal"}}</button>
|
2020-10-11 06:08:09 +05:30
|
|
|
{{else}}
|
2023-03-14 09:04:09 +05:30
|
|
|
<button class="ui primary tiny button disabled">{{.locale.Tr "settings.ssh_disabled"}}</button>
|
2020-10-11 06:08:09 +05:30
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</h4>
|
|
|
|
<div class="ui attached segment">
|
|
|
|
<div class="ui key list">
|
|
|
|
<div class="item">
|
2022-06-28 02:28:46 +05:30
|
|
|
{{.locale.Tr "settings.principal_desc"}}
|
2020-10-11 06:08:09 +05:30
|
|
|
</div>
|
|
|
|
{{range .Principals}}
|
|
|
|
<div class="item">
|
|
|
|
<div class="right floated content">
|
2021-08-27 08:27:40 +05:30
|
|
|
<button class="ui red tiny button delete-button" data-modal-id="delete-principal" data-url="{{$.Link}}/delete?type=principal" data-id="{{.ID}}">
|
2022-06-28 02:28:46 +05:30
|
|
|
{{$.locale.Tr "settings.delete_key"}}
|
2020-10-11 06:08:09 +05:30
|
|
|
</button>
|
|
|
|
</div>
|
2023-03-24 16:05:38 +05:30
|
|
|
<i class="text {{if .HasRecentActivity}}green{{end}}" {{if .HasRecentActivity}}data-tooltip-content="{{$.locale.Tr "settings.principal_state_desc"}}"{{end}}>{{svg "octicon-key" 36}}</i>
|
2020-10-11 06:08:09 +05:30
|
|
|
<div class="content">
|
|
|
|
<strong>{{.Name}}</strong>
|
|
|
|
<div class="activity meta">
|
2023-04-11 04:31:20 +05:30
|
|
|
<i>{{$.locale.Tr "settings.add_on"}} <span>{{template "shared/datetime/short" (dict "Datetime" .CreatedUnix.FormatLong "Fallback" .CreatedUnix.FormatShort)}}</span> — {{svg "octicon-info" 16}} {{if .HasUsed}}{{$.locale.Tr "settings.last_used"}} <span {{if .HasRecentActivity}}class="green"{{end}}>{{template "shared/datetime/short" (dict "Datetime" .UpdatedUnix.FormatLong "Fallback" .UpdatedUnix.FormatShort)}}</span>{{else}}{{$.locale.Tr "settings.no_activity"}}{{end}}</i>
|
2020-10-11 06:08:09 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<br>
|
|
|
|
|
2023-02-19 09:36:14 +05:30
|
|
|
<div {{if not .HasPrincipalError}}class="gt-hidden"{{end}} id="add-ssh-principal-panel">
|
2020-10-11 06:08:09 +05:30
|
|
|
<h4 class="ui top attached header">
|
2022-06-28 02:28:46 +05:30
|
|
|
{{.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}}">
|
2022-06-28 02:28:46 +05:30
|
|
|
<label for="content">{{.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">
|
|
|
|
<button class="ui green button">
|
2022-06-28 02:28:46 +05:30
|
|
|
{{.locale.Tr "settings.add_new_principal"}}
|
2020-10-11 06:08:09 +05:30
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="ui small basic delete modal" id="delete-principal">
|
|
|
|
<div class="ui icon header">
|
2021-03-22 09:34:19 +05:30
|
|
|
{{svg "octicon-trash"}}
|
2022-06-28 02:28:46 +05:30
|
|
|
{{.locale.Tr "settings.ssh_principal_deletion"}}
|
2020-10-11 06:08:09 +05:30
|
|
|
</div>
|
|
|
|
<div class="content">
|
2022-06-28 02:28:46 +05:30
|
|
|
<p>{{.locale.Tr "settings.ssh_principal_deletion_desc"}}</p>
|
2020-10-11 06:08:09 +05:30
|
|
|
</div>
|
|
|
|
{{template "base/delete_modal_actions" .}}
|
|
|
|
</div>
|
|
|
|
{{end}}
|