appUpdate.ftl 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <script type="text/javascript">
  2. <!--
  3. $(function(){
  4. $("#generateSecret").on("click",function(){
  5. $.post("<@base/>/apps/generate/secret/oauth20", {_method:"post",currTime:(new Date()).getTime()}, function(data) {
  6. $("#secret").val(data+"");
  7. $("#secret_text").html(data+"");
  8. });
  9. });
  10. $("#isExtendAttr").on('click',function(){
  11. if(this.checked){
  12. $("#showExtendAttr").show();
  13. } else {
  14. $("#showExtendAttr").hide();
  15. $('#extendAttrBody').empty();
  16. }
  17. });
  18. var attrIndex = 0;
  19. function addExtendAttr(attribute,attributeValue){
  20. var html = '<tr id="extendTr_' + attrIndex + '"><th><@locale code="common.text.parameter"/>:';
  21. html += '<input class="button delExtendTr" type="button" name="delExtendTr" attrTrId="extendTr_'+attrIndex+'" value="<@locale code="button.text.delete" />"/>';
  22. html += '</th><td>';
  23. html += '<input type="text" id="attribute_' + attrIndex + '" name="attribute" class="int" title="" value="'+attribute+'"/>';
  24. html += '</span></td><th><@locale code="common.text.parameter.value"/>:</th> <td><span class="intspan">';
  25. html += '<input type="text" id="attributeValue_' + attrIndex + '" name="attributeValue" class="int" title="" value="'+attributeValue+'"/>';
  26. html += '</span>';
  27. html += '</td></tr>';
  28. $('#extendAttrBody').append(html);
  29. attrIndex++;
  30. }
  31. <c:if test="${1==model.isExtendAttr}">
  32. var extendAttrJson = eval("("+'${model.extendAttr}'+")");
  33. for(extendAttrIndex in extendAttrJson){
  34. addExtendAttr(extendAttrJson[extendAttrIndex].attr,extendAttrJson[extendAttrIndex].value);
  35. };
  36. </c:if>
  37. $("#addExtendAttr").on('click',function(){
  38. addExtendAttr("","");
  39. });
  40. $("#extendAttrBody").delegate(".delExtendTr",'click',function(){
  41. $("#"+$(this).attr("attrTrId")).remove();
  42. });
  43. $("input[name='credential']").on("click",function(){
  44. if($(this).val()=="3"){
  45. $("#sharedconfigure").hide();
  46. $("#systemconfigure").hide();
  47. }else if($(this).val()=="1"){
  48. $("#sharedconfigure").hide();
  49. $("#systemconfigure").show();
  50. }else if($(this).val()=="2"){
  51. $("#sharedconfigure").show();
  52. $("#systemconfigure").hide();
  53. }
  54. });
  55. });
  56. //-->
  57. </script>
  58. <form id="actionForm_app" method="post" type="label" autoclose="true"
  59. action="<s:Base/>/apps/formbased/update"
  60. forward="<s:Base/>/apps/list"
  61. enctype="multipart/form-data">
  62. <!-- content -->
  63. <!--table-->
  64. <table class="datatable" >
  65. <tbody>
  66. <tr>
  67. <td ><jsp:include page="../appUpdateCommon.jsp"/></td>
  68. </tr>
  69. <tr>
  70. <td>
  71. <table class="datatable">
  72. <tbody>
  73. <tr>
  74. <td colspan=4><@locale code="apps.formbased.info"/></td>
  75. </tr>
  76. <tr>
  77. <th><@locale code="apps.formbased.redirectUri"/>:</th>
  78. <td colspan="3">
  79. <input type="text" id="redirectUri" name="redirectUri" title="" value="${model.redirectUri}"/>
  80. <b class="orange">*</b><label for="redirectUri"></label>
  81. </td>
  82. </tr>
  83. <tr>
  84. <th style="width:15%;"><@locale code="apps.formbased.usernameMapping"/>:</th>
  85. <td style="width:35%;">
  86. <input type="text" id="usernameMapping" name="usernameMapping" title="" value="${model.usernameMapping}"/>
  87. <b class="orange">*</b><label for="submit"></label>
  88. </td>
  89. <th style="width:15%;"><@locale code="apps.formbased.passwordMapping"/>:</th>
  90. <td style="width:35%;">
  91. <input type="text" id="passwordMapping" name="passwordMapping" title="" value="${model.passwordMapping}"/>
  92. <b class="orange">*</b><label for="algorithmKey"></label>
  93. </td>
  94. </tr>
  95. <tr>
  96. <th><@locale code="apps.formbased.credential"/>:</th>
  97. <td >
  98. <input type="radio" id="credential1" name="credential" class="credential" value="3" <c:if test="${3==model.credential}">checked</c:if> />
  99. <@locale code="apps.formbased.credential.user-defined"/>
  100. <input type="radio" id="credential3" name="credential" class="credential" value="2" <c:if test="${2==model.credential}">checked</c:if> />
  101. <@locale code="apps.formbased.credential.shared"/>
  102. <input type="radio" id="credential2" name="credential" class="credential" value="1" <c:if test="${1==model.credential}">checked</c:if> />
  103. <@locale code="apps.formbased.credential.system"/>
  104. <b class="orange">*</b><label for="credential"></label>
  105. </td>
  106. <th><@locale code="apps.isAdapter"/>:</th>
  107. <td >
  108. <select id="isAdapter" name="isAdapter" >
  109. <option value="0" <c:if test="${0==model.isAdapter}">selected</c:if> ><@locale code="apps.isAdapter.no"/></option>
  110. <option value="1" <c:if test="${1==model.isAdapter}">selected</c:if> ><@locale code="apps.isAdapter.yes"/></option>
  111. </select>
  112. </td>
  113. </tr>
  114. <tr>
  115. <th><@locale code="apps.adapter"/>:</th>
  116. <td colspan =3>
  117. <input type="text" id="adapter" name="adapter" title="" value="${model.adapter}"/>
  118. </td>
  119. </tr>
  120. <tr>
  121. <th><@locale code="apps.formbased.authorizeView"/>:</th>
  122. <td colspan =3>
  123. <input type="text" id="authorizeView" name="authorizeView" title="" value="${model.authorizeView}"/>
  124. </td>
  125. </tr>
  126. <tr id="systemconfigure" <c:if test="${1!=model.credential}"> style="display:none"</c:if> >
  127. <th><@locale code="apps.formbased.systemUserAttr"/>:</th>
  128. <td colspan="3">
  129. <select id="systemUserAttr" name="systemUserAttr">
  130. <option value="uid" <c:if test="${'uid'==model.systemUserAttr}">selected</c:if> >
  131. <@locale code="userinfo.uid"/></option>
  132. <option value="employeeNumber" <c:if test="${'employeeNumber'==model.systemUserAttr}">selected</c:if> >
  133. <@locale code="userinfo.employeeNumber"/></option>
  134. <option value="username" <c:if test="${'username'==model.systemUserAttr}">selected</c:if> >
  135. <@locale code="userinfo.username"/></option>
  136. <option value="email" <c:if test="${'email'==model.systemUserAttr}">selected</c:if> >
  137. <@locale code="userinfo.email"/></option>
  138. <option value="windowsaccount" <c:if test="${'windowsaccount'==model.systemUserAttr}">selected</c:if> >
  139. <@locale code="userinfo.windowsAccount"/></option>
  140. </select>
  141. <b class="orange">*</b><label for="systemUserAttr"></label>
  142. </td>
  143. </tr>
  144. <tr id="sharedconfigure" <c:if test="${2!=model.credential}"> style="display:none"</c:if>>
  145. <th><@locale code="apps.formbased.sharedUsername"/>:</th>
  146. <td>
  147. <input type="text" id="sharedUsername" name="sharedUsername" value="${model.sharedUsername}" />
  148. <b class="orange">*</b><label for="sharedUsername"></label>
  149. </td>
  150. <th><@locale code="apps.formbased.sharedPassword"/>:</th>
  151. <td>
  152. <input type="text" id="sharedPassword" name="sharedPassword" value="${model.sharedPassword}" />
  153. <b class="orange">*</b><label for="sharedPassword"></label>
  154. </td>
  155. </tr>
  156. <tr>
  157. <th><@locale code="apps.formbased.extendAttr"/>:</th>
  158. <td colspan="3">
  159. <input type="checkbox" id="isExtendAttr" name="isExtendAttr" value="1" <c:if test="${1==model.isExtendAttr}">checked</c:if> />
  160. <@locale code="apps.formbased.isExtendAttr"/>
  161. <span id="showExtendAttr" <c:if test="${0==model.isExtendAttr}">style="display:none"</c:if>>
  162. <input class="button" type="button" value='<@locale code="button.text.add.parameter"/>' id="addExtendAttr"/>
  163. </span>
  164. </td>
  165. </tr>
  166. </tbody>
  167. <tbody id="extendAttrBody">
  168. </tbody>
  169. </table>
  170. </td>
  171. </tr>
  172. </tbody>
  173. </table>
  174. <input class="button" id="submitBtn" type="submit" value="<@locale code="button.text.save" />"/>
  175. <input class="button" id="backBtn" type="button" value="<@locale code="button.text.cancel" />"/>
  176. </form>