本站源代码
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

101 lines
3.8KB

  1. {{template "base/head" .}}
  2. <div class="repository settings">
  3. {{template "repo/header" .}}
  4. {{template "repo/settings/navbar" .}}
  5. <div class="ui container">
  6. {{template "base/alert" .}}
  7. <h4 class="ui top attached header">
  8. {{.i18n.Tr "repo.settings.deploy_keys"}}
  9. <div class="ui right">
  10. {{if not .DisableSSH}}
  11. <div class="ui blue tiny show-panel button" data-panel="#add-deploy-key-panel">{{.i18n.Tr "repo.settings.add_deploy_key"}}</div>
  12. {{else}}
  13. <div class="ui blue tiny button disabled">{{.i18n.Tr "settings.ssh_disabled"}}</div>
  14. {{end}}
  15. </div>
  16. </h4>
  17. <div class="ui attached segment">
  18. {{if .Deploykeys}}
  19. <div class="ui key list">
  20. {{range .Deploykeys}}
  21. <div class="item">
  22. <div class="right floated content">
  23. <button class="ui red tiny button delete-button" data-url="{{$.Link}}/delete" data-id="{{.ID}}">
  24. {{$.i18n.Tr "settings.delete_key"}}
  25. </button>
  26. </div>
  27. <i class="mega-octicon octicon-key {{if .HasRecentActivity}}green{{end}}" {{if .HasRecentActivity}}data-content="{{$.i18n.Tr "settings.key_state_desc"}}" data-variation="inverted"{{end}}></i>
  28. <div class="content">
  29. <strong>{{.Name}}</strong>
  30. <div class="print meta">
  31. {{.Fingerprint}}
  32. </div>
  33. <div class="activity meta">
  34. <i>{{$.i18n.Tr "settings.add_on"}} <span>{{.CreatedUnix.FormatShort}}</span> — <i class="octicon octicon-info"></i> {{if .HasUsed}}{{$.i18n.Tr "settings.last_used"}} <span {{if .HasRecentActivity}}class="green"{{end}}>{{.UpdatedUnix.FormatShort}}</span>{{else}}{{$.i18n.Tr "settings.no_activity"}}{{end}} - <span>{{$.i18n.Tr "settings.can_read_info"}}{{if not .IsReadOnly}} / {{$.i18n.Tr "settings.can_write_info"}} {{end}}</span></i>
  35. </div>
  36. </div>
  37. </div>
  38. {{end}}
  39. </div>
  40. {{else}}
  41. {{.i18n.Tr "repo.settings.no_deploy_keys"}}
  42. {{end}}
  43. </div>
  44. <br>
  45. <div {{if not .HasError}}class="hide"{{end}} id="add-deploy-key-panel">
  46. <h4 class="ui top attached header">
  47. {{.i18n.Tr "repo.settings.add_deploy_key"}}
  48. </h4>
  49. <div class="ui attached segment">
  50. <form class="ui form" action="{{.Link}}" method="post">
  51. {{.CsrfTokenHtml}}
  52. <div class="field">
  53. {{.i18n.Tr "repo.settings.deploy_key_desc"}}
  54. </div>
  55. <div class="field {{if .Err_Title}}error{{end}}">
  56. <label for="title">{{.i18n.Tr "repo.settings.title"}}</label>
  57. <input id="ssh-key-title" name="title" value="{{.title}}" autofocus required>
  58. </div>
  59. <div class="field {{if .Err_Content}}error{{end}}">
  60. <label for="content">{{.i18n.Tr "repo.settings.deploy_key_content"}}</label>
  61. <textarea id="ssh-key-content" name="content" required>{{.content}}</textarea>
  62. </div>
  63. <div class="field">
  64. <div class="ui checkbox {{if .Err_IsWritable}}error{{end}}">
  65. <input id="ssh-key-is-writable" name="is_writable" class="hidden" type="checkbox" value="1">
  66. <label for="is_writable">
  67. {{.i18n.Tr "repo.settings.is_writable"}}
  68. </label>
  69. <small style="padding-left: 26px;">{{$.i18n.Tr "repo.settings.is_writable_info" | Str2html}}</small>
  70. </div>
  71. </div>
  72. <button class="ui green button">
  73. {{.i18n.Tr "repo.settings.add_deploy_key"}}
  74. </button>
  75. </form>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. <div class="ui small basic delete modal">
  81. <div class="ui icon header">
  82. <i class="trash icon"></i>
  83. {{.i18n.Tr "repo.settings.deploy_key_deletion"}}
  84. </div>
  85. <div class="content">
  86. <p>{{.i18n.Tr "repo.settings.deploy_key_deletion_desc"}}</p>
  87. </div>
  88. <div class="actions">
  89. <div class="ui red basic inverted cancel button">
  90. <i class="remove icon"></i>
  91. {{.i18n.Tr "modal.no"}}
  92. </div>
  93. <div class="ui green basic inverted ok button">
  94. <i class="checkmark icon"></i>
  95. {{.i18n.Tr "modal.yes"}}
  96. </div>
  97. </div>
  98. </div>
  99. {{template "base/footer" .}}
上海开阖软件有限公司 沪ICP备12045867号-1