# Conflicts: # frontend/src/models/setting.ts # frontend/src/pages/settings/GeneralTab.tsx # frontend/src/pages/settings/SettingsPage.tsx # frontend/src/pages/settings/SubscriptionBalancersTab.tsx # frontend/src/pages/xray/outbounds/OutboundsTab.css # frontend/src/schemas/setting.ts
66 lines
1.5 KiB
TypeScript
66 lines
1.5 KiB
TypeScript
import { ObjectUtil } from '@/utils';
|
|
|
|
export class AllSetting {
|
|
webListen = '';
|
|
webDomain = '';
|
|
webPort = 2053;
|
|
webCertFile = '';
|
|
webKeyFile = '';
|
|
webBasePath = '/';
|
|
sessionMaxAge = 360;
|
|
trustedProxyCIDRs = '127.0.0.1/32,::1/128';
|
|
pageSize = 25;
|
|
expireDiff = 0;
|
|
trafficDiff = 0;
|
|
remarkTemplate = '{{INBOUND}}-{{EMAIL}}|📊{{TRAFFIC_LEFT}}|⏳{{DAYS_LEFT}}D';
|
|
subShowIdentityOnAllLinks = false;
|
|
datepicker = 'gregorian' as const;
|
|
tgBotEnable = false;
|
|
tgBotToken = '';
|
|
tgBotAPIServer = '';
|
|
tgBotChatId = '';
|
|
tgRunTime = '@daily';
|
|
tgBotBackup = false;
|
|
tgCpu = 80;
|
|
tgMemory = 80;
|
|
tgLang = 'en-US';
|
|
trafficStatsSwitches = '';
|
|
subEnable = true;
|
|
subTitle = '';
|
|
subSupportUrl = '';
|
|
subProfileUrl = '';
|
|
subAnnounce = '';
|
|
subListen = '';
|
|
subPort = 2096;
|
|
subPath = '/sub/';
|
|
subDomain = '';
|
|
restartXrayOnClientDisable = true;
|
|
subCertFile = '';
|
|
subKeyFile = '';
|
|
subUpdates = 12;
|
|
subEncrypt = true;
|
|
subURI = '';
|
|
subHideSettings = false;
|
|
|
|
timeLocation = 'Local';
|
|
|
|
tgEnabledEvents = 'login.attempt,cpu.high';
|
|
hasTgBotToken = false;
|
|
hasApiToken = false;
|
|
hasWarpSecret = false;
|
|
hasNordSecret = false;
|
|
clearTgBotToken = false;
|
|
|
|
constructor(data?: unknown) {
|
|
if (data != null) {
|
|
ObjectUtil.cloneProps(this, data);
|
|
}
|
|
const cpu = Math.round(Number(this.tgCpu));
|
|
this.tgCpu = Number.isFinite(cpu) ? Math.min(100, Math.max(0, cpu)) : 80;
|
|
}
|
|
|
|
equals(other: AllSetting): boolean {
|
|
return ObjectUtil.equals(this, other);
|
|
}
|
|
}
|