setting.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. // Mirrors web/assets/js/model/setting.js — every field on this class is
  2. // round-tripped through `/panel/setting/all` and `/panel/setting/update`,
  3. // so adding a field here without a matching Go-side change will silently
  4. // drop it on save. Defaults match the legacy panel.
  5. import { ObjectUtil } from '@/utils';
  6. export class AllSetting {
  7. constructor(data) {
  8. this.webListen = "";
  9. this.webDomain = "";
  10. this.webPort = 2053;
  11. this.webCertFile = "";
  12. this.webKeyFile = "";
  13. this.webBasePath = "/";
  14. this.sessionMaxAge = 360;
  15. this.pageSize = 25;
  16. this.expireDiff = 0;
  17. this.trafficDiff = 0;
  18. this.remarkModel = "-ieo";
  19. this.datepicker = "gregorian";
  20. this.tgBotEnable = false;
  21. this.tgBotToken = "";
  22. this.tgBotProxy = "";
  23. this.tgBotAPIServer = "";
  24. this.tgBotChatId = "";
  25. this.tgRunTime = "@daily";
  26. this.tgBotBackup = false;
  27. this.tgBotLoginNotify = true;
  28. this.tgCpu = 80;
  29. this.tgLang = "en-US";
  30. this.twoFactorEnable = false;
  31. this.twoFactorToken = "";
  32. this.xrayTemplateConfig = "";
  33. this.subEnable = true;
  34. this.subJsonEnable = false;
  35. this.subTitle = "";
  36. this.subSupportUrl = "";
  37. this.subProfileUrl = "";
  38. this.subAnnounce = "";
  39. this.subEnableRouting = true;
  40. this.subRoutingRules = "";
  41. this.subListen = "";
  42. this.subPort = 2096;
  43. this.subPath = "/sub/";
  44. this.subJsonPath = "/json/";
  45. this.subClashEnable = true;
  46. this.subClashPath = "/clash/";
  47. this.subDomain = "";
  48. this.externalTrafficInformEnable = false;
  49. this.externalTrafficInformURI = "";
  50. this.restartXrayOnClientDisable = true;
  51. this.subCertFile = "";
  52. this.subKeyFile = "";
  53. this.subUpdates = 12;
  54. this.subEncrypt = true;
  55. this.subShowInfo = true;
  56. this.subURI = "";
  57. this.subJsonURI = "";
  58. this.subClashURI = "";
  59. this.subJsonFragment = "";
  60. this.subJsonNoises = "";
  61. this.subJsonMux = "";
  62. this.subJsonRules = "";
  63. this.timeLocation = "Local";
  64. // LDAP settings
  65. this.ldapEnable = false;
  66. this.ldapHost = "";
  67. this.ldapPort = 389;
  68. this.ldapUseTLS = false;
  69. this.ldapBindDN = "";
  70. this.ldapPassword = "";
  71. this.ldapBaseDN = "";
  72. this.ldapUserFilter = "(objectClass=person)";
  73. this.ldapUserAttr = "mail";
  74. this.ldapVlessField = "vless_enabled";
  75. this.ldapSyncCron = "@every 1m";
  76. this.ldapFlagField = "";
  77. this.ldapTruthyValues = "true,1,yes,on";
  78. this.ldapInvertFlag = false;
  79. this.ldapInboundTags = "";
  80. this.ldapAutoCreate = false;
  81. this.ldapAutoDelete = false;
  82. this.ldapDefaultTotalGB = 0;
  83. this.ldapDefaultExpiryDays = 0;
  84. this.ldapDefaultLimitIP = 0;
  85. if (data == null) {
  86. return
  87. }
  88. ObjectUtil.cloneProps(this, data);
  89. }
  90. equals(other) {
  91. return ObjectUtil.equals(this, other);
  92. }
  93. }