appUpdate.ftl 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. $("#generateSecret").on("click",function(){
  16. $.post("<@base/>/apps/generate/secret/oauth20", {_method:"post",currTime:(new Date()).getTime()}, function(data) {
  17. $("#secret").val(data+"");
  18. $("#secret_text").html(data+"");
  19. });
  20. });
  21. $("input[name='credential']").on("click",function(){
  22. if($(this).val()=="3"){
  23. $("#sharedconfigure").hide();
  24. $("#systemconfigure").hide();
  25. }else if($(this).val()=="1"){
  26. $("#sharedconfigure").hide();
  27. $("#systemconfigure").show();
  28. }else if($(this).val()=="2"){
  29. $("#sharedconfigure").show();
  30. $("#systemconfigure").hide();
  31. }
  32. });
  33. });
  34. //-->
  35. </script>
  36. </head>
  37. <body>
  38. <form id="actionForm_app" method="post" type="label" autoclose="true"
  39. action="<@base/>/apps/extendapi/update"
  40. forward="<@base/>/apps/list"
  41. enctype="multipart/form-data">
  42. <!-- content -->
  43. <!--table-->
  44. <table class="table table-bordered" >
  45. <tbody>
  46. <tr>
  47. <td ><#include "../appUpdateCommon.ftl"/></td>
  48. </tr>
  49. <tr>
  50. <td>
  51. <table class="table table-bordered" >
  52. <tbody>
  53. <tr>
  54. <th ><@locale code="apps.principal"/>:</th>
  55. <td >
  56. <input type="text" class="form-control" id="principal" name="principal" title="" value="${model.principal}"/>
  57. </td>
  58. <th ><@locale code="apps.credentials"/>:</th>
  59. <td >
  60. <input type="text" class="form-control" id="credentials" name="credentials" title="" value="${model.credentials}"/>
  61. </td>
  62. </tr>
  63. <tr>
  64. <th style="width:15%;"><@locale code="apps.credential"/>:</th>
  65. <td style="width:35%;">
  66. <input type="radio" id="credential1" name="credential" class="credential" value="3" <#if 3==model.credential >checked</#if> />
  67. <@locale code="apps.credential.user-defined"/>
  68. <input type="radio" id="credential3" name="credential" class="credential" value="2" <#if 2==model.credential >checked</#if> />
  69. <@locale code="apps.credential.shared"/>
  70. <input type="radio" id="credential2" name="credential" class="credential" value="1" <#if 1==model.credential >checked</#if> />
  71. <@locale code="apps.credential.system"/>
  72. </td>
  73. <th style="width:15%;"><@locale code="apps.isAdapter"/>:</th>
  74. <td style="width:35%;" >
  75. <select id="isAdapter" name="isAdapter" class="form-control" >
  76. <option value="0" <#if 0==model.isAdapter >selected</#if> ><@locale code="apps.isAdapter.no"/></option>
  77. <option value="1" <#if 1==model.isAdapter >selected</#if> ><@locale code="apps.isAdapter.yes"/></option>
  78. </select>
  79. </td>
  80. </tr>
  81. <tr>
  82. <th><@locale code="apps.adapter"/>:</th>
  83. <td colspan =3>
  84. <input type="text" class="form-control" id="adapter" name="adapter" title="" value="${model.adapter}"/>
  85. </td>
  86. </tr>
  87. <tr id="systemconfigure" <#if 1!=model.credential > style="display:none"</#if> >
  88. <th><@locale code="apps.systemUserAttr"/>:</th>
  89. <td colspan="3">
  90. <select id="systemUserAttr" name="systemUserAttr" class="form-control" >
  91. <option value="uid" <#if 'uid'==model.systemUserAttr >selected</#if> >
  92. <@locale code="userinfo.uid"/></option>
  93. <option value="employeeNumber" <#if 'employeeNumber'==model.systemUserAttr >selected</#if> >
  94. <@locale code="userinfo.employeeNumber"/></option>
  95. <option value="username" <#if 'username'==model.systemUserAttr >selected</#if> >
  96. <@locale code="userinfo.username"/></option>
  97. <option value="email" <#if 'email'==model.systemUserAttr >selected</#if> >
  98. <@locale code="userinfo.email"/></option>
  99. <option value="windowsaccount" <#if 'windowsaccount'==model.systemUserAttr >selected</#if> >
  100. <@locale code="userinfo.windowsAccount"/></option>
  101. </select>
  102. </td>
  103. </tr>
  104. <tr id="sharedconfigure" <#if 2!=model.credential > style="display:none"</#if>>
  105. <th><@locale code="apps.credential.sharedUsername"/>:</th>
  106. <td>
  107. <input type="text" class="form-control" id="sharedUsername" name="sharedUsername" value="${model.sharedUsername}" />
  108. </td>
  109. <th><@locale code="apps.credential.sharedPassword"/>:</th>
  110. <td>
  111. <input type="text" class="form-control" id="sharedPassword" name="sharedPassword" value="${model.sharedPassword}" />
  112. </td>
  113. </tr>
  114. </tbody>
  115. </table>
  116. </td>
  117. </tr>
  118. </tbody>
  119. </table>
  120. <input class="button btn btn-primary mr-3" id="submitBtn" type="submit" value="<@locale code="button.text.save" />"/>
  121. <input class="button btn btn-secondary mr-3" id="backBtn" type="button" value="<@locale code="button.text.cancel" />"/>
  122. </form>
  123. </body>
  124. </html>