SettingBase.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. MWF.xDesktop.requireApp("Setting", "Document", null, false);
  2. MWF.xApplication.Setting.BaseNameDocument = new Class({
  3. Extends: MWF.xApplication.Setting.Document
  4. });
  5. MWF.xApplication.Setting.BasePersonDocument = new Class({
  6. Extends: MWF.xApplication.Setting.Document,
  7. load: function(){
  8. this.node = new Element("div", {"styles": {"overflow": "hidden", "padding-bottom": "80px"}}).inject(this.contentAreaNode);
  9. this.titleName = new Element("div", {"styles": this.explorer.css.explorerContentTitleNode}).inject(this.node);
  10. this.titleName.set("text", this.lp.base_personSetting);
  11. this.baseUserPasswordInput = new MWF.xApplication.Setting.Document.Input(this.explorer, this.node, {
  12. "lp": {"title": this.lp.base_UserPassword, "infor": this.lp.base_UserPassword_infor, "action": this.lp.base_UserPassword_action},
  13. "data": {"key": "personData", "valueKey": "password", "notEmpty": true, "infor": this.lp.base_UserPassword_empty },
  14. "value": this.explorer.personData.password
  15. });
  16. this.basePasswordPeriodInput = new MWF.xApplication.Setting.Document.Input(this.explorer, this.node, {
  17. "lp": {"title": this.lp.base_passwordPeriod, "infor": this.lp.base_passwordPeriod_infor, "action": this.lp.base_passwordPeriod_action},
  18. "data": {"key": "personData", "valueKey": "passwordPeriod", "notEmpty": false},
  19. "value": this.explorer.personData.passwordPeriod
  20. });
  21. this.baseAdminPasswordInput = new MWF.xApplication.Setting.Document.Input(this.explorer, this.node, {
  22. "lp": {"title": this.lp.base_adminPassword, "infor": this.lp.base_adminPassword_infor, "action": this.lp.base_adminPassword_action, "confirm": this.lp.base_adminPassword_confirm},
  23. "data": {"key": "tokenData", "valueKey": "password", "notEmpty": false},
  24. "value": this.explorer.tokenData.password,
  25. "show": "********"
  26. });
  27. }
  28. });
  29. MWF.xApplication.Setting.BaseLoginDocument = new Class({
  30. Extends: MWF.xApplication.Setting.Document,
  31. load: function(){
  32. this.node = new Element("div", {"styles": {"overflow": "hidden", "padding-bottom": "80px"}}).inject(this.contentAreaNode);
  33. this.titleName = new Element("div", {"styles": this.explorer.css.explorerContentTitleNode}).inject(this.node);
  34. this.titleName.set("text", this.lp.base_loginSetting);
  35. this.baseCaptchaLoginInput = new MWF.xApplication.Setting.Document.Check(this.explorer, this.node, {
  36. "lp": {"title": this.lp.base_captchaLogin, "infor": this.lp.base_captchaLogin_infor, "action": this.lp.base_captchaLogin_action},
  37. "data": {"key": "personData", "valueKey": "captchaLogin", "notEmpty": false },
  38. "value": this.explorer.personData.captchaLogin
  39. });
  40. this.baseCodeLoginInput = new MWF.xApplication.Setting.Document.Check(this.explorer, this.node, {
  41. "lp": {"title": this.lp.base_codeLogin, "infor": this.lp.base_codeLogin_infor, "action": this.lp.base_codeLogin_action},
  42. "data": {"key": "personData", "valueKey": "codeLogin", "notEmpty": false },
  43. "value": this.explorer.personData.codeLogin
  44. });
  45. this.baseBindLoginInput = new MWF.xApplication.Setting.Document.Check(this.explorer, this.node, {
  46. "lp": {"title": this.lp.base_bindLogin, "infor": this.lp.base_bindLogin_infor, "action": this.lp.base_bindLogin_action},
  47. "data": {"key": "personData", "valueKey": "bindLogin", "notEmpty": false },
  48. "value": this.explorer.personData.bindLogin
  49. });
  50. this.baseFaceLoginInput = new MWF.xApplication.Setting.Document.Check(this.explorer, this.node, {
  51. "lp": {"title": this.lp.base_faceLogin, "infor": this.lp.base_faceLogin_infor, "action": this.lp.base_faceLogin_action},
  52. "data": {"key": "personData", "valueKey": "faceLogin", "notEmpty": false },
  53. "value": this.explorer.personData.faceLogin
  54. });
  55. var apiKey = {
  56. "api_key": "",
  57. "api_secret": ""
  58. };
  59. this.baseFaceLoginApiInput = new MWF.xApplication.Setting.Document.List(this.explorer, this.node, {
  60. "lp": {"title": this.lp.base_faceApi, "infor": this.lp.base_faceApi_infor, "action": this.lp.base_faceApi_action},
  61. "data": {"key": "publicData", "valueKey": "api", "notEmpty": false},
  62. "value": this.explorer.publicData.api,
  63. "itemTitle": "API Key: {api_key}",
  64. "addItem": {"api_key": "", "api_secret": ""},
  65. "icon": "sso.png"
  66. });
  67. // this.baseFaceLoginApikeyInput = new MWF.xApplication.Setting.Document.Input(this.explorer, this.node, {
  68. // "lp": {"title": this.lp.base_adminPassword, "infor": this.lp.base_adminPassword_infor, "action": this.lp.base_adminPassword_action, "confirm": this.lp.base_adminPassword_confirm},
  69. // "data": {"key": "tokenData", "valueKey": "password", "notEmpty": false},
  70. // "value": this.explorer.tokenData.password,
  71. // "show": "********"
  72. // });
  73. // this.baseFaceLogiApiSecretInput = new MWF.xApplication.Setting.Document.Input(this.explorer, this.node, {
  74. // "lp": {"title": this.lp.base_adminPassword, "infor": this.lp.base_adminPassword_infor, "action": this.lp.base_adminPassword_action, "confirm": this.lp.base_adminPassword_confirm},
  75. // "data": {"key": "tokenData", "valueKey": "password", "notEmpty": false},
  76. // "value": this.explorer.tokenData.password,
  77. // "show": "********"
  78. // });
  79. this.baseRegisterInput = new MWF.xApplication.Setting.Document.Select(this.explorer, this.node, {
  80. "lp": {"title": this.lp.base_register, "infor": this.lp.base_register_infor, "action": this.lp.base_register_action},
  81. "data": {"key": "personData", "valueKey": "register", "notEmpty": false },
  82. "value": this.explorer.personData.register,
  83. "options": [{"value": "disable", "text": this.lp.register_disable}, {"value": "captcha", "text": this.lp.register_captcha}, {"value": "code", "text": this.lp.register_code}]
  84. });
  85. this.baseLoginPortalTypeInput = new MWF.xApplication.Setting.Document.Check(this.explorer, this.node, {
  86. "lp": {"title": this.lp.base_portalLogin, "infor": this.lp.base_portalLogin_infor, "action": this.lp.base_portalLogin_action},
  87. "data": {"key": "personData", "valueKey": "loginPage.enable", "notEmpty": false },
  88. "value": this.explorer.personData.loginPage.enable
  89. });
  90. var getOptions = function(){
  91. var options = [{"value": "", "text": this.lp.mobile_index_defalue}];
  92. MWF.Actions.get("x_portal_assemble_surface").listApplication(function(json){
  93. json.data.each(function(d){
  94. var o = {"value": d.id, "text": d.name+((d.alias) ? "("+d.alias+")" : "")};
  95. options.push(o);
  96. });
  97. }.bind(this), null, false);
  98. return options;
  99. }.bind(this);
  100. this.baseLoginPortalInput = new MWF.xApplication.Setting.Document.Select(this.explorer, this.node, {
  101. "lp": {"title": this.lp.base_loginPortalId, "infor": this.lp.base_loginPortalId_infor},
  102. "data": {"key": "personData", "valueKey": "loginPage.portal"},
  103. "value": this.explorer.personData.loginPage.portal,
  104. "options": getOptions
  105. });
  106. this.baseIndexPortalTypeInput = new MWF.xApplication.Setting.Document.Check(this.explorer, this.node, {
  107. "lp": {"title": this.lp.base_portalIndex, "infor": this.lp.base_portalIndex_infor, "action": this.lp.base_portalIndex_action},
  108. "data": {"key": "portalData", "valueKey": "indexPage.enable", "notEmpty": false },
  109. "value": this.explorer.portalData.indexPage.enable
  110. });
  111. debugger;
  112. this.baseIndexPortalInput = new MWF.xApplication.Setting.Document.Select(this.explorer, this.node, {
  113. "lp": {"title": this.lp.base_indexPortalId, "infor": this.lp.base_indexPortalId_infor},
  114. "data": {"key": "portalData", "valueKey": "indexPage.portal"},
  115. "value": this.explorer.portalData.indexPage.portal,
  116. "options": getOptions
  117. });
  118. if (!this.explorer.tokenData.ldapAuth) this.explorer.tokenData.ldapAuth = {
  119. "enable": false,
  120. "ldapUrl": "",
  121. "baseDn": "",
  122. "userDn": ""
  123. };
  124. // var ldapEnableText = this.explorer.tokenData.ldapAuth.enable ? this.lp.base_ldap_enable : this.lp.base_ldap_unenable;
  125. this.baseLdapInput = new MWF.xApplication.Setting.Document.List(this.explorer, this.node, {
  126. "lp": {"title": this.lp.base_ldap, "infor": this.lp.base_ldap_infor, "action": this.lp.base_ldap_action},
  127. "data": {"key": "tokenData", "valueKey": "ldapAuth", "notEmpty": true},
  128. "value": this.explorer.tokenData.ldapAuth,
  129. "itemTitle": "ldapUrl: {ldapUrl}",
  130. "addItem": {
  131. "enable": false,
  132. "ldapUrl": "",
  133. "baseDn": "",
  134. "userDn": ""
  135. },
  136. "icon": "ldap.png"
  137. });
  138. this.baseTemaryInput = new MWF.xApplication.Setting.Document.Check(this.explorer, this.node, {
  139. "lp": {"title": this.lp.base_temary, "infor": this.lp.base_temary_info, "action": this.lp.base_temary_action},
  140. "data": {"key": "ternaryData", "valueKey": "enable", "notEmpty": false },
  141. "value": this.explorer.ternaryData.enable
  142. });
  143. }
  144. });
  145. MWF.xApplication.Setting.BaseSSODocument = new Class({
  146. Extends: MWF.xApplication.Setting.Document,
  147. load: function(){
  148. this.node = new Element("div", {"styles": {"overflow": "hidden", "padding-bottom": "80px"}}).inject(this.contentAreaNode);
  149. this.titleName = new Element("div", {"styles": this.explorer.css.explorerContentTitleNode}).inject(this.node);
  150. this.titleName.set("text", this.lp.base_ssoSetting);
  151. this.baseSSOInput = new MWF.xApplication.Setting.Document.List(this.explorer, this.node, {
  152. "lp": {"title": this.lp.base_ssos, "infor": this.lp.base_sso_infor, "action": this.lp.base_sso_action, "editAction": this.lp.base_sso_editAction},
  153. "data": {"key": "tokenData", "valueKey": "ssos", "notEmpty": false },
  154. "value": this.explorer.tokenData.ssos,
  155. "itemTitle": "{client}",
  156. "addItem": {"enable": true, "client": "", "key": ""},
  157. "icon": "sso.png"
  158. });
  159. this.baseOauthsInput = new MWF.xApplication.Setting.Document.List(this.explorer, this.node, {
  160. "lp": {"title": this.lp.base_oauths, "infor": this.lp.base_oauths_infor, "action": this.lp.base_oauths_action, "editAction": this.lp.base_oauths_editAction},
  161. "data": {"key": "tokenData", "valueKey": "oauths", "notEmpty": false },
  162. "value": this.explorer.tokenData.oauths,
  163. "itemTitle": "{clientId}",
  164. "addItem": {"enable": true, "clientId": "","clientSecret": "", "mapping": {}},
  165. "icon": "sso.png"
  166. });
  167. this.baseOauthsServerInput = new MWF.xApplication.Setting.Document.List(this.explorer, this.node, {
  168. "lp": {"title": this.lp.base_oauths_server, "infor": this.lp.base_oauths_infor_server, "action": this.lp.base_oauths_action, "editAction": this.lp.base_oauths_editAction},
  169. "data": {"key": "tokenData", "valueKey": "oauthClients", "notEmpty": false },
  170. "value": this.explorer.tokenData.oauthClients,
  171. "itemTitle": "{name}",
  172. "addItem": {
  173. "enable": false,
  174. "name": "",
  175. "displayName": "",
  176. "icon": "",
  177. "clientId": "",
  178. "clientSecret": "",
  179. "authAddress": "",
  180. "authParameter": "client_id\u003d{$clientId}\u0026redirect_uri\u003d{$redirectUri}",
  181. "authMethod": "GET",
  182. "tokenAddress": "",
  183. "tokenParameter": "client_id\u003d{$clientId}\u0026client_secret\u003d{$clientSecret}\u0026redirect_uri\u003d{$redirectUri}\u0026grant_type\u003dauthorization_code\u0026code\u003d{$code}",
  184. "tokenMethod": "POST",
  185. "tokenType": "json",
  186. "infoAddress": "",
  187. "infoParameter": "access_token\u003d{$access_token}",
  188. "infoMethod": "GET",
  189. "infoType": "json",
  190. "infoCredentialField": "openId",
  191. "infoScriptText": "",
  192. "bindingEnable": false,
  193. "bindingField": ""
  194. },
  195. "icon": "sso.png"
  196. });
  197. if (!this.explorer.tokenData.qyweixin) this.explorer.tokenData.qyweixin = {
  198. "enable": false,
  199. "syncCron": "",
  200. "forceSyncCron": "",
  201. "apiAddress": "",
  202. "corpId": "",
  203. "corpSecret": "",
  204. "agentId": "",
  205. "token": "",
  206. "encodingAesKey": "",
  207. "messageEnable": false
  208. };
  209. this.baseQyweixinInput = new MWF.xApplication.Setting.Document.List(this.explorer, this.node, {
  210. "lp": {"title": this.lp.base_qyweixin, "infor": this.lp.base_qyweixin_infor, "action": this.lp.base_qyweixin_action},
  211. "data": {"key": "tokenData", "valueKey": "qiyeweixin", "notEmpty": false},
  212. "value": this.explorer.tokenData.qiyeweixin,
  213. "itemTitle": "corpId: {corpId}",
  214. "addItem": {"corpId": "", "corpSecret": ""},
  215. "icon": "weixin.png"
  216. });
  217. if (!this.explorer.tokenData.dingding) this.explorer.tokenData.dingding = {
  218. "enable": false,
  219. "corpId": "",
  220. "agentId": "",
  221. "appKey": "",
  222. "appSecret": "",
  223. "syncCron": "",
  224. "forceSyncCron": "",
  225. "oapiAddress": "",
  226. "messageEnable": true
  227. };
  228. this.baseDingdingInput = new MWF.xApplication.Setting.Document.List(this.explorer, this.node, {
  229. "lp": {"title": this.lp.base_dingding, "infor": this.lp.base_dingding_infor, "action": this.lp.base_dingding_action},
  230. "data": {"key": "tokenData", "valueKey": "dingding", "notEmpty": false},
  231. "value": this.explorer.tokenData.dingding,
  232. "itemTitle": "agentId: {agentId}",
  233. "addItem": {"corpId": "", "corpSecret": "", "agentId": ""},
  234. "icon": "dingding.png"
  235. });
  236. }
  237. });