/
addspin
/
tlss
Обзор
Документация
Войти
/
addspin
/
tlss
Код
Пакеты
0
Релизы
1
CI/CD
Аналитика
Безопасность
main
template/add_ssh/sshKeyList-tpl.html
87 строк
4 KB
addspin
update: add key langht, lang fix
28 окт 2025, 15:31
28 окт 2025, 15:31
07e4515
Код
Авторство
О чём код?
{{define "sshKeyList-tpl"}} <table class="table" id="sshKeyListTable"> <thead> <tr> <th scope="col" class="sortable-header" onclick="sortTable(0, 'sshKeyListTable')"> Name ssh key <span class="sort-arrow" id="arrow-0">▼</span> </th> <th scope="col" class="sortable-header" onclick="sortTable(1, 'sshKeyListTable')"> Algorithm <span class="sort-arrow" id="arrow-1">▼</span> </th> <th scope="col" class="sortable-header" onclick="sortTable(2, 'sshKeyListTable')"> KeyLength <span class="sort-arrow" id="arrow-2">▼</span> </th> <th scope="col">Take key</th> <th scope="col" class="th-text-center">Remove</th> </tr> </thead> <tbody> {{ range .sshKeyList }} <tr class="ssh_key_id_{{ .Id }}"> <td>{{ .NameSSHKey }}</td> <td>{{ .Algorithm }}</td> <td>{{ .KeyLength }}</td> <!-- Take key --> <td> <div class="btn-group"> <button type="button" class="select_cert_take dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"> <img src="/static/svg/take_cert.svg" alt="Select format" style="cursor: pointer;" width="15" height="15"> Select format </button> <ul class="dropdown-menu"> <li><a class="dropdown-item-take" href="/take_cert?NameSSHKey={{ .NameSSHKey }}&format=zip">zip</a></li> </ul> </div> </td> <!-- Remove ssh key --> <td class="th-text-center"> <button class="btn-trash" name="id" value="{{ .Id }}" hx-trigger='remove' hx-post="/remove_ssh_key" hx-target=".ssh_key_id_{{ .Id }}" hx-ext="json-enc-custom" parse-types="false" onClick="const { value: nameSSHKey } = Swal.fire({ showClass: { popup: ` animate__animated animate__fadeInUp animate__fast ` }, hideClass: { popup: ` animate__animated animate__fadeOutDown animate__fast ` }, customClass: 'custom-alert', input: 'text', title: 'Are you sure you want to delete ssh key - {{ .NameSSHKey }}?', text: 'To confirm, enter {{ .NameSSHKey }}', showCancelButton: true, confirmButtonColor: '#983636', cancelButtonColor: '#3085d6', confirmButtonText: 'Yes, delete!', inputValidator: (value) => { if (value != '{{ .NameSSHKey }}') { return 'You entered an invalid ssh key name, enter {{ .NameSSHKey }}'; } } }).then((result) => { if (result.isConfirmed) { htmx.trigger(this, 'remove'); } });" > <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" class="trash" viewBox="0 0 16 16"> <path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0z"/> <path d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4zM2.5 3h11V2h-11z"/> </svg> </button> </td> </tr> {{ end }} </tbody> </table> {{end}}