setting.html 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. {{template "head" .}}
  4. <style>
  5. @media (min-width: 769px) {
  6. .ant-layout-content {
  7. margin: 24px 16px;
  8. }
  9. }
  10. .ant-col-sm-24 {
  11. margin-top: 10px;
  12. }
  13. .ant-tabs-bar {
  14. margin: 0;
  15. }
  16. .ant-list-item {
  17. display: block;
  18. }
  19. :not(.ant-card-dark)>.ant-tabs-top-bar {
  20. background: white;
  21. }
  22. </style>
  23. <body>
  24. <a-layout id="app" v-cloak>
  25. {{ template "commonSider" . }}
  26. <a-layout id="content-layout" :style="siderDrawer.isDarkTheme ? bgDarkStyle : ''">
  27. <a-layout-content>
  28. <a-spin :spinning="spinning" :delay="500" tip="loading">
  29. <a-space direction="vertical">
  30. <a-space direction="horizontal">
  31. <a-button type="primary" :disabled="saveBtnDisable" @click="updateAllSetting">{{ i18n "pages.setting.save" }}</a-button>
  32. <a-button type="danger" :disabled="!saveBtnDisable" @click="restartPanel">{{ i18n "pages.setting.restartPanel" }}</a-button>
  33. </a-space>
  34. <a-tabs default-active-key="1" :class="siderDrawer.isDarkTheme ? darkClass : ''">
  35. <a-tab-pane key="1" tab='{{ i18n "pages.setting.panelConfig"}}'>
  36. <a-list item-layout="horizontal" :style="siderDrawer.isDarkTheme ? 'color: hsla(0,0%,100%,.65);': 'background: white;'">
  37. <setting-list-item type="text" title='{{ i18n "pages.setting.panelListeningIP"}}' desc='{{ i18n "pages.setting.panelListeningIPDesc"}}' v-model="allSetting.webListen"></setting-list-item>
  38. <setting-list-item type="number" title='{{ i18n "pages.setting.panelPort"}}' desc='{{ i18n "pages.setting.panelPortDesc"}}' v-model.number="allSetting.webPort"></setting-list-item>
  39. <setting-list-item type="text" title='{{ i18n "pages.setting.publicKeyPath"}}' desc='{{ i18n "pages.setting.publicKeyPathDesc"}}' v-model="allSetting.webCertFile"></setting-list-item>
  40. <setting-list-item type="text" title='{{ i18n "pages.setting.privateKeyPath"}}' desc='{{ i18n "pages.setting.privateKeyPathDesc"}}' v-model="allSetting.webKeyFile"></setting-list-item>
  41. <setting-list-item type="text" title='{{ i18n "pages.setting.panelUrlPath"}}' desc='{{ i18n "pages.setting.panelUrlPathDesc"}}' v-model="allSetting.webBasePath"></setting-list-item>
  42. <setting-list-item type="number" title='{{ i18n "pages.setting.expireTimeDiff" }}' desc='{{ i18n "pages.setting.expireTimeDiffDesc" }}' v-model="allSetting.expireDiff" :min="0"></setting-list-item>
  43. <setting-list-item type="number" title='{{ i18n "pages.setting.trafficDiff" }}' desc='{{ i18n "pages.setting.trafficDiffDesc" }}' v-model="allSetting.trafficDiff" :min="0"></setting-list-item>
  44. <a-list-item>
  45. <a-row style="padding: 20px">
  46. <a-col :lg="24" :xl="12">
  47. <a-list-item-meta title="Language" />
  48. </a-col>
  49. <a-col :lg="24" :xl="12">
  50. <template>
  51. <a-select
  52. ref="selectLang"
  53. v-model="lang"
  54. @change="setLang(lang)"
  55. :dropdown-class-name="siderDrawer.isDarkTheme ? 'ant-card-dark' : ''"
  56. style="width: 100%"
  57. >
  58. <a-select-option :value="l.value" :label="l.value" v-for="l in supportLangs">
  59. <span role="img" aria-label="l.name" v-text="l.icon"></span>&nbsp;&nbsp;<span v-text="l.name"></span>
  60. </a-select-option>
  61. </a-select>
  62. </template>
  63. </a-col>
  64. </a-row>
  65. </a-list-item>
  66. </a-list>
  67. </a-tab-pane>
  68. <a-tab-pane key="2" tab='{{ i18n "pages.setting.userSetting"}}'>
  69. <a-form :style="siderDrawer.isDarkTheme ? 'color: hsla(0,0%,100%,.65); padding: 20px;': 'background: white; padding: 20px;'">
  70. <a-form-item label='{{ i18n "pages.setting.oldUsername"}}'>
  71. <a-input v-model="user.oldUsername" style="max-width: 300px"></a-input>
  72. </a-form-item>
  73. <a-form-item label='{{ i18n "pages.setting.currentPassword"}}'>
  74. <a-input type="password" v-model="user.oldPassword" style="max-width: 300px"></a-input>
  75. </a-form-item>
  76. <a-form-item label='{{ i18n "pages.setting.newUsername"}}'>
  77. <a-input v-model="user.newUsername" style="max-width: 300px"></a-input>
  78. </a-form-item>
  79. <a-form-item label='{{ i18n "pages.setting.newPassword"}}'>
  80. <a-input type="password" v-model="user.newPassword" style="max-width: 300px"></a-input>
  81. </a-form-item>
  82. <a-form-item>
  83. <a-button type="primary" @click="updateUser">{{ i18n "confirm" }}</a-button>
  84. </a-form-item>
  85. </a-form>
  86. </a-tab-pane>
  87. <a-tab-pane key="3" tab='{{ i18n "pages.setting.xrayConfiguration"}}'>
  88. <a-list item-layout="horizontal" :style="siderDrawer.isDarkTheme ? 'color: hsla(0,0%,100%,.65);': 'background: white;'">
  89. <a-divider>{{ i18n "pages.setting.actions"}}</a-divider>
  90. <a-space direction="horizontal" style="padding: 0 20px">
  91. <a-button type="primary" @click="resetXrayConfigToDefault">{{ i18n "pages.setting.resetDefaultConfig" }}</a-button>
  92. </a-space>
  93. <a-divider>{{ i18n "pages.setting.basicTemplate"}}</a-divider>
  94. <a-collapse>
  95. <a-collapse-panel header='{{ i18n "pages.setting.generalConfigs"}}'>
  96. <setting-list-item type="switch" title='{{ i18n "pages.setting.xrayConfigTorrent"}}' desc='{{ i18n "pages.setting.xrayConfigTorrentDesc"}}' v-model="torrentSettings"></setting-list-item>
  97. <setting-list-item type="switch" title='{{ i18n "pages.setting.xrayConfigPrivateIp"}}' desc='{{ i18n "pages.setting.xrayConfigPrivateIpDesc"}}' v-model="privateIpSettings"></setting-list-item>
  98. <setting-list-item type="switch" title='{{ i18n "pages.setting.xrayConfigAds"}}' desc='{{ i18n "pages.setting.xrayConfigAdsDesc"}}' v-model="AdsSettings"></setting-list-item>
  99. <setting-list-item type="switch" title='{{ i18n "pages.setting.xrayConfigPorn"}}' desc='{{ i18n "pages.setting.xrayConfigPornDesc"}}' v-model="PornSettings"></setting-list-item>
  100. </a-collapse-panel>
  101. <a-collapse-panel header='{{ i18n "pages.setting.countryConfigs"}}'>
  102. <setting-list-item type="switch" title='{{ i18n "pages.setting.xrayConfigIRIp"}}' desc='{{ i18n "pages.setting.xrayConfigIRIpDesc"}}' v-model="IRIpSettings"></setting-list-item>
  103. <setting-list-item type="switch" title='{{ i18n "pages.setting.xrayConfigIRDomain"}}' desc='{{ i18n "pages.setting.xrayConfigIRDomainDesc"}}' v-model="IRDomainSettings"></setting-list-item>
  104. <setting-list-item type="switch" title='{{ i18n "pages.setting.xrayConfigChinaIp"}}' desc='{{ i18n "pages.setting.xrayConfigChinaIpDesc"}}' v-model="ChinaIpSettings"></setting-list-item>
  105. <setting-list-item type="switch" title='{{ i18n "pages.setting.xrayConfigChinaDomain"}}' desc='{{ i18n "pages.setting.xrayConfigChinaDomainDesc"}}' v-model="ChinaDomainSettings"></setting-list-item>
  106. <setting-list-item type="switch" title='{{ i18n "pages.setting.xrayConfigRussiaIp"}}' desc='{{ i18n "pages.setting.xrayConfigRussiaIpDesc"}}' v-model="RussiaIpSettings"></setting-list-item>
  107. <setting-list-item type="switch" title='{{ i18n "pages.setting.xrayConfigRussiaDomain"}}' desc='{{ i18n "pages.setting.xrayConfigRussiaDomainDesc"}}' v-model="RussiaDomainSettings"></setting-list-item>
  108. </a-collapse-panel>
  109. <a-collapse-panel header='{{ i18n "pages.setting.ipv4Configs"}}'>
  110. <setting-list-item type="switch" title='{{ i18n "pages.setting.xrayConfigGoogleIPv4"}}' desc='{{ i18n "pages.setting.xrayConfigGoogleIPv4Desc"}}' v-model="GoogleIPv4Settings"></setting-list-item>
  111. <setting-list-item type="switch" title='{{ i18n "pages.setting.xrayConfigNetflixIPv4"}}' desc='{{ i18n "pages.setting.xrayConfigNetflixIPv4Desc"}}' v-model="NetflixIPv4Settings"></setting-list-item>
  112. </a-collapse-panel>
  113. <a-collapse-panel header='{{ i18n "pages.setting.warpConfigs"}}'>
  114. <setting-list-item type="switch" title='{{ i18n "pages.setting.xrayConfigGoogleWARP"}}' desc='{{ i18n "pages.setting.xrayConfigGoogleWARPDesc"}}' v-model="GoogleWARPSettings"></setting-list-item>
  115. <setting-list-item type="switch" title='{{ i18n "pages.setting.xrayConfigOpenAIWARP"}}' desc='{{ i18n "pages.setting.xrayConfigOpenAIWARPDesc"}}' v-model="OpenAIWARPSettings"></setting-list-item>
  116. <setting-list-item type="switch" title='{{ i18n "pages.setting.xrayConfigNetflixWARP"}}' desc='{{ i18n "pages.setting.xrayConfigNetflixWARPDesc"}}' v-model="NetflixWARPSettings"></setting-list-item>
  117. <setting-list-item type="switch" title='{{ i18n "pages.setting.xrayConfigSpotifyWARP"}}' desc='{{ i18n "pages.setting.xrayConfigSpotifyWARPDesc"}}' v-model="SpotifyWARPSettings"></setting-list-item>
  118. </a-collapse-panel>
  119. </a-collapse>
  120. <a-divider>{{ i18n "pages.setting.advancedTemplate"}}</a-divider>
  121. <a-collapse>
  122. <a-collapse-panel header='{{ i18n "pages.setting.xrayConfigInbounds"}}'>
  123. <setting-list-item type="textarea" title='{{ i18n "pages.setting.xrayConfigInbounds"}}' desc='{{ i18n "pages.setting.xrayConfigInboundsDesc"}}' v-model="inboundSettings"></setting-list-item>
  124. </a-collapse-panel>
  125. <a-collapse-panel header='{{ i18n "pages.setting.xrayConfigOutbounds"}}'>
  126. <setting-list-item type="textarea" title='{{ i18n "pages.setting.xrayConfigOutbounds"}}' desc='{{ i18n "pages.setting.xrayConfigOutboundsDesc"}}' v-model="outboundSettings"></setting-list-item>
  127. </a-collapse-panel>
  128. <a-collapse-panel header='{{ i18n "pages.setting.xrayConfigRoutings"}}'>
  129. <setting-list-item type="textarea" title='{{ i18n "pages.setting.xrayConfigRoutings"}}' desc='{{ i18n "pages.setting.xrayConfigRoutingsDesc"}}' v-model="routingRuleSettings"></setting-list-item>
  130. </a-collapse-panel>
  131. </a-collapse>
  132. <a-divider>{{ i18n "pages.setting.completeTemplate"}}</a-divider>
  133. <setting-list-item type="textarea" title='{{ i18n "pages.setting.xrayConfigTemplate"}}' desc='{{ i18n "pages.setting.xrayConfigTemplateDesc"}}' v-model="allSetting.xrayTemplateConfig"></setting-list-item>
  134. </a-list>
  135. </a-tab-pane>
  136. <a-tab-pane key="4" tab='{{ i18n "pages.setting.TGReminder"}}'>
  137. <a-list item-layout="horizontal" :style="siderDrawer.isDarkTheme ? 'color: hsla(0,0%,100%,.65);': 'background: white;'">
  138. <setting-list-item type="switch" title='{{ i18n "pages.setting.telegramBotEnable" }}' desc='{{ i18n "pages.setting.telegramBotEnableDesc" }}' v-model="allSetting.tgBotEnable"></setting-list-item>
  139. <setting-list-item type="text" title='{{ i18n "pages.setting.telegramToken"}}' desc='{{ i18n "pages.setting.telegramTokenDesc"}}' v-model="allSetting.tgBotToken"></setting-list-item>
  140. <setting-list-item type="text" title='{{ i18n "pages.setting.telegramChatId"}}' desc='{{ i18n "pages.setting.telegramChatIdDesc"}}' v-model="allSetting.tgBotChatId"></setting-list-item>
  141. <setting-list-item type="text" title='{{ i18n "pages.setting.telegramNotifyTime"}}' desc='{{ i18n "pages.setting.telegramNotifyTimeDesc"}}' v-model="allSetting.tgRunTime"></setting-list-item>
  142. <setting-list-item type="switch" title='{{ i18n "pages.setting.tgNotifyBackup" }}' desc='{{ i18n "pages.setting.tgNotifyBackupDesc" }}' v-model="allSetting.tgBotBackup"></setting-list-item>
  143. <setting-list-item type="number" title='{{ i18n "pages.setting.tgNotifyCpu" }}' desc='{{ i18n "pages.setting.tgNotifyCpuDesc" }}' v-model="allSetting.tgCpu" :min="0" :max="100"></setting-list-item>
  144. </a-list>
  145. </a-tab-pane>
  146. <a-tab-pane key="5" tab='{{ i18n "pages.setting.otherSetting"}}'>
  147. <a-list item-layout="horizontal" :style="siderDrawer.isDarkTheme ? 'color: hsla(0,0%,100%,.65);': 'background: white;'">
  148. <setting-list-item type="text" title='{{ i18n "pages.setting.timeZonee"}}' desc='{{ i18n "pages.setting.timeZoneDesc"}}' v-model="allSetting.timeLocation"></setting-list-item>
  149. </a-list>
  150. </a-tab-pane>
  151. </a-tabs>
  152. </a-space>
  153. </a-spin>
  154. </a-layout-content>
  155. </a-layout>
  156. </a-layout>
  157. {{template "js" .}}
  158. {{template "component/setting"}}
  159. <script>
  160. const app = new Vue({
  161. delimiters: ['[[', ']]'],
  162. el: '#app',
  163. data: {
  164. siderDrawer,
  165. spinning: false,
  166. oldAllSetting: new AllSetting(),
  167. allSetting: new AllSetting(),
  168. saveBtnDisable: true,
  169. user: {},
  170. lang: getLang(),
  171. ipv4Settings: {
  172. tag: "IPv4",
  173. protocol: "freedom",
  174. settings: {
  175. domainStrategy: "UseIPv4"
  176. }
  177. },
  178. warpSettings: {
  179. tag: "WARP",
  180. protocol: "socks",
  181. settings: {
  182. servers: [
  183. {
  184. address: "127.0.0.1",
  185. port: 40000
  186. }
  187. ]
  188. }
  189. },
  190. settingsData: {
  191. protocols: {
  192. bittorrent: ["bittorrent"],
  193. },
  194. ips: {
  195. local: ["geoip:private"],
  196. google: ["geoip:google"],
  197. cn: ["geoip:cn"],
  198. ir: ["geoip:ir"],
  199. ru: ["geoip:ru"],
  200. },
  201. domains: {
  202. ads: [
  203. "geosite:category-ads-all",
  204. "geosite:category-ads",
  205. "geosite:google-ads",
  206. "geosite:spotify-ads"
  207. ],
  208. porn: ["geosite:category-porn"],
  209. openai: ["geosite:openai"],
  210. google: ["geosite:google"],
  211. spotify: ["geosite:spotify"],
  212. netflix: ["geosite:netflix"],
  213. cn: ["geosite:cn"],
  214. ru: ["geosite:category-ru-gov"],
  215. ir: [
  216. "regexp:.*\\.ir$",
  217. "ext:iran.dat:ir",
  218. "ext:iran.dat:other",
  219. "ext:iran.dat:ads",
  220. "geosite:category-ir"
  221. ]
  222. },
  223. }
  224. },
  225. methods: {
  226. loading(spinning = true) {
  227. this.spinning = spinning;
  228. },
  229. async getAllSetting() {
  230. this.loading(true);
  231. const msg = await HttpUtil.post("/xui/setting/all");
  232. this.loading(false);
  233. if (msg.success) {
  234. this.oldAllSetting = new AllSetting(msg.obj);
  235. this.allSetting = new AllSetting(msg.obj);
  236. this.saveBtnDisable = true;
  237. }
  238. },
  239. async updateAllSetting() {
  240. this.loading(true);
  241. const msg = await HttpUtil.post("/xui/setting/update", this.allSetting);
  242. this.loading(false);
  243. if (msg.success) {
  244. await this.getAllSetting();
  245. }
  246. },
  247. async updateUser() {
  248. this.loading(true);
  249. const msg = await HttpUtil.post("/xui/setting/updateUser", this.user);
  250. this.loading(false);
  251. if (msg.success) {
  252. this.user = {};
  253. }
  254. },
  255. async restartPanel() {
  256. await new Promise(resolve => {
  257. this.$confirm({
  258. title: '{{ i18n "pages.setting.restartPanel" }}',
  259. content: '{{ i18n "pages.setting.restartPanelDesc" }}',
  260. okText: '{{ i18n "sure" }}',
  261. cancelText: '{{ i18n "cancel" }}',
  262. onOk: () => resolve(),
  263. });
  264. });
  265. this.loading(true);
  266. const msg = await HttpUtil.post("/xui/setting/restartPanel");
  267. this.loading(false);
  268. if (msg.success) {
  269. this.loading(true);
  270. await PromiseUtil.sleep(5000);
  271. location.reload();
  272. }
  273. },
  274. async resetXrayConfigToDefault() {
  275. this.loading(true);
  276. const msg = await HttpUtil.get("/xui/setting/getDefaultJsonConfig");
  277. this.loading(false);
  278. if (msg.success) {
  279. this.templateSettings = JSON.parse(JSON.stringify(msg.obj, null, 2));
  280. this.saveBtnDisable = true;
  281. }
  282. },
  283. checkRequiredOutbounds() {
  284. const newTemplateSettings = this.templateSettings;
  285. const haveIPv4Outbounds = newTemplateSettings.outbounds.some((o) => o?.tag === "IPv4");
  286. const haveIPv4Rules = newTemplateSettings.routing.rules.some((r) => r?.outboundTag === "IPv4");
  287. const haveWARPOutbounds = newTemplateSettings.outbounds.some((o) => o?.tag === "WARP");
  288. const haveWARPRules = newTemplateSettings.routing.rules.some((r) => r?.outboundTag === "WARP");
  289. if (haveWARPRules && !haveWARPOutbounds) {
  290. newTemplateSettings.outbounds.push(this.warpSettings);
  291. }
  292. if (haveIPv4Rules && !haveIPv4Outbounds) {
  293. newTemplateSettings.outbounds.push(this.ipv4Settings);
  294. }
  295. this.templateSettings = newTemplateSettings;
  296. },
  297. templateRuleGetter(routeSettings) {
  298. const { data, property, outboundTag } = routeSettings;
  299. let result = false;
  300. if (this.templateSettings != null) {
  301. this.templateSettings.routing.rules.forEach(
  302. (routingRule) => {
  303. if (
  304. routingRule.hasOwnProperty(property) &&
  305. routingRule.hasOwnProperty("outboundTag") &&
  306. routingRule.outboundTag === outboundTag
  307. ) {
  308. if (data.includes(routingRule[property][0])) {
  309. result = true;
  310. }
  311. }
  312. }
  313. );
  314. }
  315. return result;
  316. },
  317. templateRuleSetter(routeSettings) {
  318. const { newValue, data, property, outboundTag } = routeSettings;
  319. const oldTemplateSettings = this.templateSettings;
  320. const newTemplateSettings = oldTemplateSettings;
  321. if (newValue) {
  322. const propertyRule = {
  323. type: "field",
  324. outboundTag,
  325. [property]: data
  326. };
  327. newTemplateSettings.routing.rules.push(propertyRule);
  328. }
  329. else {
  330. const newRules = [];
  331. newTemplateSettings.routing.rules.forEach(
  332. (routingRule) => {
  333. if (
  334. routingRule.hasOwnProperty(property) &&
  335. routingRule.hasOwnProperty("outboundTag") &&
  336. routingRule.outboundTag === outboundTag
  337. ) {
  338. if (data.includes(routingRule[property][0])) {
  339. return;
  340. }
  341. }
  342. newRules.push(routingRule);
  343. }
  344. );
  345. newTemplateSettings.routing.rules = newRules;
  346. }
  347. this.templateSettings = newTemplateSettings;
  348. this.checkRequiredOutbounds();
  349. }
  350. },
  351. async mounted() {
  352. await this.getAllSetting();
  353. while (true) {
  354. await PromiseUtil.sleep(1000);
  355. this.saveBtnDisable = this.oldAllSetting.equals(this.allSetting);
  356. }
  357. },
  358. computed: {
  359. templateSettings: {
  360. get: function () { return this.allSetting.xrayTemplateConfig ? JSON.parse(this.allSetting.xrayTemplateConfig) : null; },
  361. set: function (newValue) { this.allSetting.xrayTemplateConfig = JSON.stringify(newValue, null, 2) },
  362. },
  363. inboundSettings: {
  364. get: function () { return this.templateSettings ? JSON.stringify(this.templateSettings.inbounds, null, 2) : null; },
  365. set: function (newValue) {
  366. newTemplateSettings = this.templateSettings;
  367. newTemplateSettings.inbounds = JSON.parse(newValue)
  368. this.templateSettings = newTemplateSettings
  369. },
  370. },
  371. outboundSettings: {
  372. get: function () { return this.templateSettings ? JSON.stringify(this.templateSettings.outbounds, null, 2) : null; },
  373. set: function (newValue) {
  374. newTemplateSettings = this.templateSettings;
  375. newTemplateSettings.outbounds = JSON.parse(newValue)
  376. this.templateSettings = newTemplateSettings
  377. },
  378. },
  379. routingRuleSettings: {
  380. get: function () { return this.templateSettings ? JSON.stringify(this.templateSettings.routing.rules, null, 2) : null; },
  381. set: function (newValue) {
  382. newTemplateSettings = this.templateSettings;
  383. newTemplateSettings.routing.rules = JSON.parse(newValue)
  384. this.templateSettings = newTemplateSettings
  385. },
  386. },
  387. torrentSettings: {
  388. get: function () {
  389. return this.templateRuleGetter({
  390. outboundTag: "blocked",
  391. property: "protocol",
  392. data: this.settingsData.protocols.bittorrent
  393. });
  394. },
  395. set: function (newValue) {
  396. this.templateRuleSetter({
  397. newValue,
  398. outboundTag: "blocked",
  399. property: "protocol",
  400. data: this.settingsData.protocols.bittorrent
  401. });
  402. },
  403. },
  404. privateIpSettings: {
  405. get: function () {
  406. return this.templateRuleGetter({
  407. outboundTag: "blocked",
  408. property: "ip",
  409. data: this.settingsData.ips.local
  410. });
  411. },
  412. set: function (newValue) {
  413. this.templateRuleSetter({
  414. newValue,
  415. outboundTag: "blocked",
  416. property: "ip",
  417. data: this.settingsData.ips.local
  418. });
  419. },
  420. },
  421. AdsSettings: {
  422. get: function () {
  423. return this.templateRuleGetter({
  424. outboundTag: "blocked",
  425. property: "domain",
  426. data: this.settingsData.domains.ads
  427. });
  428. },
  429. set: function (newValue) {
  430. this.templateRuleSetter({
  431. newValue,
  432. outboundTag: "blocked",
  433. property: "domain",
  434. data: this.settingsData.domains.ads
  435. });
  436. },
  437. },
  438. PornSettings: {
  439. get: function () {
  440. return this.templateRuleGetter({
  441. outboundTag: "blocked",
  442. property: "domain",
  443. data: this.settingsData.domains.porn
  444. });
  445. },
  446. set: function (newValue) {
  447. this.templateRuleSetter({
  448. newValue,
  449. outboundTag: "blocked",
  450. property: "domain",
  451. data: this.settingsData.domains.porn
  452. });
  453. },
  454. },
  455. GoogleIPv4Settings: {
  456. get: function () {
  457. return this.templateRuleGetter({
  458. outboundTag: "IPv4",
  459. property: "domain",
  460. data: this.settingsData.domains.google
  461. });
  462. },
  463. set: function (newValue) {
  464. this.templateRuleSetter({
  465. newValue,
  466. outboundTag: "IPv4",
  467. property: "domain",
  468. data: this.settingsData.domains.google
  469. });
  470. },
  471. },
  472. NetflixIPv4Settings: {
  473. get: function () {
  474. return this.templateRuleGetter({
  475. outboundTag: "IPv4",
  476. property: "domain",
  477. data: this.settingsData.domains.netflix
  478. });
  479. },
  480. set: function (newValue) {
  481. this.templateRuleSetter({
  482. newValue,
  483. outboundTag: "IPv4",
  484. property: "domain",
  485. data: this.settingsData.domains.netflix
  486. });
  487. },
  488. },
  489. IRIpSettings: {
  490. get: function () {
  491. return this.templateRuleGetter({
  492. outboundTag: "blocked",
  493. property: "ip",
  494. data: this.settingsData.ips.ir
  495. });
  496. },
  497. set: function (newValue) {
  498. this.templateRuleSetter({
  499. newValue,
  500. outboundTag: "blocked",
  501. property: "ip",
  502. data: this.settingsData.ips.ir
  503. });
  504. },
  505. },
  506. IRDomainSettings: {
  507. get: function () {
  508. return this.templateRuleGetter({
  509. outboundTag: "blocked",
  510. property: "domain",
  511. data: this.settingsData.domains.ir
  512. });
  513. },
  514. set: function (newValue) {
  515. this.templateRuleSetter({
  516. newValue,
  517. outboundTag: "blocked",
  518. property: "domain",
  519. data: this.settingsData.domains.ir
  520. });
  521. },
  522. },
  523. ChinaIpSettings: {
  524. get: function () {
  525. return this.templateRuleGetter({
  526. outboundTag: "blocked",
  527. property: "ip",
  528. data: this.settingsData.ips.cn
  529. });
  530. },
  531. set: function (newValue) {
  532. this.templateRuleSetter({
  533. newValue,
  534. outboundTag: "blocked",
  535. property: "ip",
  536. data: this.settingsData.ips.cn
  537. });
  538. },
  539. },
  540. ChinaDomainSettings: {
  541. get: function () {
  542. return this.templateRuleGetter({
  543. outboundTag: "blocked",
  544. property: "domain",
  545. data: this.settingsData.domains.cn
  546. });
  547. },
  548. set: function (newValue) {
  549. this.templateRuleSetter({
  550. newValue,
  551. outboundTag: "blocked",
  552. property: "domain",
  553. data: this.settingsData.domains.cn
  554. });
  555. },
  556. },
  557. RussiaIpSettings: {
  558. get: function () {
  559. return this.templateRuleGetter({
  560. outboundTag: "blocked",
  561. property: "ip",
  562. data: this.settingsData.ips.ru
  563. });
  564. },
  565. set: function (newValue) {
  566. this.templateRuleSetter({
  567. newValue,
  568. outboundTag: "blocked",
  569. property: "ip",
  570. data: this.settingsData.ips.ru
  571. });
  572. },
  573. },
  574. RussiaDomainSettings: {
  575. get: function () {
  576. return this.templateRuleGetter({
  577. outboundTag: "blocked",
  578. property: "domain",
  579. data: this.settingsData.domains.ru
  580. });
  581. },
  582. set: function (newValue) {
  583. this.templateRuleSetter({
  584. newValue,
  585. outboundTag: "blocked",
  586. property: "domain",
  587. data: this.settingsData.domains.ru
  588. });
  589. },
  590. },
  591. GoogleWARPSettings: {
  592. get: function () {
  593. return this.templateRuleGetter({
  594. outboundTag: "WARP",
  595. property: "domain",
  596. data: this.settingsData.domains.google
  597. });
  598. },
  599. set: function (newValue) {
  600. this.templateRuleSetter({
  601. newValue,
  602. outboundTag: "WARP",
  603. property: "domain",
  604. data: this.settingsData.domains.google
  605. });
  606. },
  607. },
  608. OpenAIWARPSettings: {
  609. get: function () {
  610. return this.templateRuleGetter({
  611. outboundTag: "WARP",
  612. property: "domain",
  613. data: this.settingsData.domains.openai
  614. });
  615. },
  616. set: function (newValue) {
  617. this.templateRuleSetter({
  618. newValue,
  619. outboundTag: "WARP",
  620. property: "domain",
  621. data: this.settingsData.domains.openai
  622. });
  623. },
  624. },
  625. NetflixWARPSettings: {
  626. get: function () {
  627. return this.templateRuleGetter({
  628. outboundTag: "WARP",
  629. property: "domain",
  630. data: this.settingsData.domains.netflix
  631. });
  632. },
  633. set: function (newValue) {
  634. this.templateRuleSetter({
  635. newValue,
  636. outboundTag: "WARP",
  637. property: "domain",
  638. data: this.settingsData.domains.netflix
  639. });
  640. },
  641. },
  642. SpotifyWARPSettings: {
  643. get: function () {
  644. return this.templateRuleGetter({
  645. outboundTag: "WARP",
  646. property: "domain",
  647. data: this.settingsData.domains.spotify
  648. });
  649. },
  650. set: function (newValue) {
  651. this.templateRuleSetter({
  652. newValue,
  653. outboundTag: "WARP",
  654. property: "domain",
  655. data: this.settingsData.domains.spotify
  656. });
  657. },
  658. },
  659. }
  660. });
  661. </script>
  662. </body>
  663. </html>