appUpdate.ftl 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <!DOCTYPE HTML>
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <#include "../../layout/header.ftl"/>
  5. <#include "../../layout/common.cssjs.ftl"/>
  6. <style type="text/css">
  7. .table th, .table td {
  8. padding: .2rem;
  9. vertical-align: middle;
  10. }
  11. </style>
  12. <script type="text/javascript">
  13. <!--
  14. $(function(){
  15. $("#algorithm").change(function(){
  16. $.post("<@base/>/apps/generate/secret/"+$(this).val(), {_method:"post",currTime:(new Date()).getTime()}, function(data) {
  17. $("#algorithmKey").val(data+"");
  18. $("#algorithmKey_text").html(data+"");
  19. $("#secret").val(data+"");
  20. $("#secret_text").html(data+"");
  21. });
  22. });
  23. $("#selectAdapter").change(function(){
  24. $("#adapter").val($("#selectAdapter").val());
  25. });
  26. $("#generateSecret").on("click",function(){
  27. $.post("<@base/>/apps/generate/secret/"+$("#algorithm").val(), {_method:"post",currTime:(new Date()).getTime()}, function(data) {
  28. $("#algorithmKey").val(data+"");
  29. $("#algorithmKey_text").html(data+"");
  30. $("#secret").val(data+"");
  31. $("#secret_text").html(data+"");
  32. });
  33. });
  34. });
  35. //-->
  36. </script>
  37. </head>
  38. <body>
  39. <form id="actionForm_app" method="post" type="label" autoclose="true"
  40. action="<@base/>/apps/tokenbased/update"
  41. forward="<@base/>/apps/list"
  42. enctype="multipart/form-data">
  43. <!-- content -->
  44. <!--table-->
  45. <table width="960" class="table table-bordered" >
  46. <tbody>
  47. <tr>
  48. <td ><#include "../appUpdateCommon.ftl"/></td>
  49. </tr>
  50. <tr>
  51. <td>
  52. <table width="960" class="table table-bordered" >
  53. <tbody>
  54. <tr>
  55. <td colspan=4><@locale code="apps.tokenbased.info" /></td>
  56. </tr>
  57. <tr>
  58. <th style="width:15%;"><@locale code="apps.tokenbased.redirectUri" />:</th>
  59. <td colspan=3>
  60. <input type="text" id="redirectUri" class="form-control" name="redirectUri" title="" value="${model.redirectUri}"/>
  61. </td>
  62. </tr>
  63. <tr>
  64. <th ><@locale code="apps.tokenbased.tokenType" />:</th>
  65. <td >
  66. <select id="tokenType" name="tokenType" class="form-control">
  67. <option value="POST" <#if 'POST'==model.tokenType>selected</#if> >安全令牌(TOKEN POST)</option>
  68. <option value="LTPA" <#if 'LTPA'==model.tokenType>selected</#if> >轻量级认证(LTPA COOKIE)</option>
  69. </select>
  70. </td>
  71. <th ><@locale code="apps.tokenbased.cookieName" />:</th>
  72. <td >
  73. <input type="text" class="form-control" id="cookieName" name="cookieName" title="" value="${model.cookieName!}"/>
  74. <b class="orange">*</b><label for="cookieName"></label>
  75. </td>
  76. </tr>
  77. <tr>
  78. <th style="width:15%;"><@locale code="apps.tokenbased.algorithm" />:</th>
  79. <td style="width:35%;">
  80. <select id="algorithm" name="algorithm" class="form-control" >
  81. <option value="DES" <#if 'DES'==model.algorithm>selected</#if> >DES</option>
  82. <option value="DESede" <#if 'DESede'==model.algorithm>selected</#if>>DESede</option>
  83. <option value="Blowfish" <#if 'Blowfish'==model.algorithm>selected</#if>>Blowfish</option>
  84. <option value="AES" <#if 'AES'==model.algorithm>selected</#if>>AES</option>
  85. <option value="HS256" <#if 'HS256'==model.algorithm>selected</#if>>HMAC SHA-256</option>
  86. <option value="RS256" <#if 'RS256'==model.algorithm>selected</#if>>RSA SHA-256</option>
  87. </select>
  88. </td>
  89. <th style="width:15%;"><@locale code="apps.tokenbased.algorithmKey" />:</th>
  90. <td style="width:35%;">
  91. <span id="algorithmKey_text">${model.algorithmKey}</span>
  92. <input type="hidden" id="algorithmKey" name="algorithmKey" title="" value="${model.algorithmKey}"/>
  93. </td>
  94. </tr>
  95. <tr>
  96. <th><@locale code="apps.tokenbased.token.content" />:</th>
  97. <td colspan=3>
  98. <table class="hidetable" style="width:100%;">
  99. <tr>
  100. <td><@locale code="userinfo.id" /><input type="checkbox" id="uid" name="uid" value="1" <#if 1==model.uid>checked</#if> /></td>
  101. <td><@locale code="userinfo.username" /><input type="checkbox" id="username" name="username" value="1" <#if 1==model.username>checked</#if>/></td>
  102. <td><@locale code="userinfo.email" /><input type="checkbox" id="email" name="email" value="1" <#if 1==model.email>checked</#if>/></td>
  103. <td><@locale code="userinfo.windowsAccount" /><input type="checkbox" id="windowsAccount" name="windowsAccount" value="1" <#if 1==model.windowsAccount>checked</#if>/></td>
  104. <td><@locale code="userinfo.employeeNumber" /><input type="checkbox" id="employeeNumber" name="employeeNumber" value="1" <#if 1==model.employeeNumber>checked</#if>/></td>
  105. <td><@locale code="userinfo.departmentId" /><input type="checkbox" id="departmentId" name="departmentId" value="1" <#if 1==model.departmentId>checked</#if>/></td>
  106. <td><@locale code="userinfo.department" /><input type="checkbox" id="department" name="department" value="1" <#if 1==model.department>checked</#if>/></td>
  107. </tr>
  108. </table>
  109. </td>
  110. </tr>
  111. <tr>
  112. <th><@locale code="apps.tokenbased.expires" />:</th>
  113. <td>
  114. <input type="text" class="form-control" id="expires" name="expires" title="" value="${model.expires}"/>
  115. </td>
  116. <th><@locale code="apps.isAdapter" />:</th>
  117. <td>
  118. <select id="isAdapter" name="isAdapter" class="form-control">
  119. <option value="0" <#if 0==model.isAdapter>selected</#if> ><@locale code="apps.isAdapter.no" /></option>
  120. <option value="1" <#if 1==model.isAdapter>selected</#if> ><@locale code="apps.isAdapter.yes" /></option>
  121. </select>
  122. </td>
  123. </tr>
  124. <tr>
  125. <th><@locale code="apps.adapter" />:</th>
  126. <td colspan =3>
  127. <select id="selectAdapter" name="selectAdapter" class="form-control">
  128. <option value="">No Adapter</option>
  129. <option value="org.maxkey.authz.token.endpoint.adapter.TokenBasedDefaultAdapter" <#if 'org.maxkey.authz.token.endpoint.adapter.TokenBasedDefaultAdapter'==model.adapter!false>selected</#if>>DefaultAdapter</option>
  130. <option value="org.maxkey.authz.token.endpoint.adapter.TokenBasedSimpleAdapter" <#if 'org.maxkey.authz.token.endpoint.adapter.TokenBasedSimpleAdapter'==model.adapter!>selected</#if> >SimpleAdapter</option>
  131. <option value="org.maxkey.authz.token.endpoint.adapter.TokenBasedJWTAdapter" <#if 'org.maxkey.authz.token.endpoint.adapter.TokenBasedJWTAdapter'==model.adapter!>selected</#if>>JWTAdapter</option>
  132. <option value="org.maxkey.authz.token.endpoint.adapter.TokenBasedJWTHS256Adapter" <#if 'org.maxkey.authz.token.endpoint.adapter.TokenBasedJWTHS256Adapter'==model.adapter!>selected</#if>>JWTHS256Adapter</option>
  133. </select>
  134. </td>
  135. </tr>
  136. <tr>
  137. <th><@locale code="apps.adapter" />:</th>
  138. <td colspan =3>
  139. <input type="text" class="form-control" id="adapter" name="adapter" title="" value="${model.adapter!}"/>
  140. </td>
  141. </tr>
  142. <tr>
  143. <td colspan =4>
  144. <input class="button" id="status" type="hidden" name="status" value="1"/>
  145. <input class="button btn btn-primary mr-3" id="submitBtn" type="submit" value="<@locale code="button.text.save" />"/>
  146. <input class="button btn btn-secondary mr-3" id="backBtn" type="button" value="<@locale code="button.text.cancel" />"/>
  147. </td>
  148. </tr>
  149. </tbody>
  150. </table>
  151. </td>
  152. </tr>
  153. </tbody>
  154. </table>
  155. </form>
  156. </body>
  157. </html>