Files
trihuy-russian/frontend/src/models/setting.js
T

109 lines
3.4 KiB
JavaScript
Raw Normal View History

2026-05-09 17:38:48 +02:00
// Mirrors web/assets/js/model/setting.js — every field on this class is
// round-tripped through `/panel/setting/all` and `/panel/setting/update`,
// so adding a field here without a matching Go-side change will silently
// drop it on save. Defaults match the legacy panel.
import { ObjectUtil } from '@/utils';
export class AllSetting {
2023-12-05 18:13:36 +01:00
constructor(data) {
this.webListen = "";
this.webDomain = "";
2023-12-10 15:06:42 +01:00
this.webPort = 2053;
2023-12-05 18:13:36 +01:00
this.webCertFile = "";
this.webKeyFile = "";
this.webBasePath = "/";
2025-08-04 11:37:53 +02:00
this.sessionMaxAge = 360;
this.trustedProxyCIDRs = "127.0.0.1/32,::1/128";
2025-09-21 20:47:34 +02:00
this.pageSize = 25;
2024-08-06 21:17:12 +02:00
this.expireDiff = 0;
this.trafficDiff = 0;
2023-12-08 20:31:17 +01:00
this.remarkModel = "-ieo";
2024-01-02 09:32:21 +01:00
this.datepicker = "gregorian";
2023-12-05 18:13:36 +01:00
this.tgBotEnable = false;
this.tgBotToken = "";
this.tgBotProxy = "";
this.tgBotAPIServer = "";
2023-12-05 18:13:36 +01:00
this.tgBotChatId = "";
this.tgRunTime = "@daily";
this.tgBotBackup = false;
2024-08-06 21:17:12 +02:00
this.tgBotLoginNotify = true;
this.tgCpu = 80;
2023-12-10 15:06:42 +01:00
this.tgLang = "en-US";
2025-05-08 21:20:58 +07:00
this.twoFactorEnable = false;
this.twoFactorToken = "";
2023-12-10 15:06:42 +01:00
this.xrayTemplateConfig = "";
2025-09-18 13:56:04 +02:00
this.subEnable = true;
this.subJsonEnable = false;
this.subTitle = "";
this.subSupportUrl = "";
this.subProfileUrl = "";
this.subAnnounce = "";
this.subEnableRouting = true;
this.subRoutingRules = "";
2023-12-05 18:13:36 +01:00
this.subListen = "";
2024-08-06 17:06:39 +02:00
this.subPort = 2096;
2023-12-05 18:13:36 +01:00
this.subPath = "/sub/";
2024-02-21 14:17:52 +03:30
this.subJsonPath = "/json/";
2026-04-20 04:26:13 +08:00
this.subClashEnable = true;
this.subClashPath = "/clash/";
2023-12-05 18:13:36 +01:00
this.subDomain = "";
this.externalTrafficInformEnable = false;
this.externalTrafficInformURI = "";
this.restartXrayOnClientDisable = true;
2023-12-05 18:13:36 +01:00
this.subCertFile = "";
this.subKeyFile = "";
2024-08-06 21:17:12 +02:00
this.subUpdates = 12;
2023-12-05 18:13:36 +01:00
this.subEncrypt = true;
2024-08-06 21:17:12 +02:00
this.subShowInfo = true;
this.subEmailInRemark = true;
2024-03-12 19:44:51 +03:30
this.subURI = "";
this.subJsonURI = "";
2026-04-20 04:26:13 +08:00
this.subClashURI = "";
2024-03-12 19:44:51 +03:30
this.subJsonFragment = "";
2024-09-17 09:33:44 +02:00
this.subJsonNoises = "";
2024-03-12 19:44:51 +03:30
this.subJsonMux = "";
this.subJsonRules = "";
2023-12-05 18:13:36 +01:00
2025-01-11 15:13:49 +01:00
this.timeLocation = "Local";
2023-12-05 18:13:36 +01:00
2025-09-28 22:00:16 +03:00
// LDAP settings
this.ldapEnable = false;
this.ldapHost = "";
this.ldapPort = 389;
this.ldapUseTLS = false;
this.ldapBindDN = "";
this.ldapPassword = "";
this.ldapBaseDN = "";
this.ldapUserFilter = "(objectClass=person)";
this.ldapUserAttr = "mail";
this.ldapVlessField = "vless_enabled";
this.ldapSyncCron = "@every 1m";
this.ldapFlagField = "";
this.ldapTruthyValues = "true,1,yes,on";
this.ldapInvertFlag = false;
this.ldapInboundTags = "";
this.ldapAutoCreate = false;
this.ldapAutoDelete = false;
this.ldapDefaultTotalGB = 0;
this.ldapDefaultExpiryDays = 0;
this.ldapDefaultLimitIP = 0;
this.hasTgBotToken = false;
this.hasTwoFactorToken = false;
this.hasLdapPassword = false;
this.hasApiToken = false;
this.hasWarpSecret = false;
this.hasNordSecret = false;
2025-09-28 22:00:16 +03:00
2023-12-05 18:13:36 +01:00
if (data == null) {
return
}
ObjectUtil.cloneProps(this, data);
}
equals(other) {
return ObjectUtil.equals(this, other);
}
}