setting.html 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  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.generalConfigs"}}</a-divider>
  90. <setting-list-item type="switch" title='{{ i18n "pages.setting.xrayConfigTorrent"}}' desc='{{ i18n "pages.setting.xrayConfigTorrentDesc"}}' v-model="torrentSettings"></setting-list-item>
  91. <setting-list-item type="switch" title='{{ i18n "pages.setting.xrayConfigPrivateIp"}}' desc='{{ i18n "pages.setting.xrayConfigPrivateIpDesc"}}' v-model="privateIpSettings"></setting-list-item>
  92. <setting-list-item type="switch" title='{{ i18n "pages.setting.xrayConfigAds"}}' desc='{{ i18n "pages.setting.xrayConfigAdsDesc"}}' v-model="AdsSettings"></setting-list-item>
  93. <setting-list-item type="switch" title='{{ i18n "pages.setting.xrayConfigPorn"}}' desc='{{ i18n "pages.setting.xrayConfigPornDesc"}}' v-model="PornSettings"></setting-list-item>
  94. <a-divider>{{ i18n "pages.setting.countryConfigs"}}</a-divider>
  95. <setting-list-item type="switch" title='{{ i18n "pages.setting.xrayConfigIRIp"}}' desc='{{ i18n "pages.setting.xrayConfigIRIpDesc"}}' v-model="IRIpSettings"></setting-list-item>
  96. <setting-list-item type="switch" title='{{ i18n "pages.setting.xrayConfigIRDomain"}}' desc='{{ i18n "pages.setting.xrayConfigIRDomainDesc"}}' v-model="IRDomainSettings"></setting-list-item>
  97. <setting-list-item type="switch" title='{{ i18n "pages.setting.xrayConfigChinaIp"}}' desc='{{ i18n "pages.setting.xrayConfigChinaIpDesc"}}' v-model="ChinaIpSettings"></setting-list-item>
  98. <setting-list-item type="switch" title='{{ i18n "pages.setting.xrayConfigChinaDomain"}}' desc='{{ i18n "pages.setting.xrayConfigChinaDomainDesc"}}' v-model="ChinaDomainSettings"></setting-list-item>
  99. <a-divider>{{ i18n "pages.setting.ipv4Configs"}}</a-divider>
  100. <setting-list-item type="switch" title='{{ i18n "pages.setting.xrayConfigGoogleIPv4"}}' desc='{{ i18n "pages.setting.xrayConfigGoogleIPv4Desc"}}' v-model="GoogleIPv4Settings"></setting-list-item>
  101. <setting-list-item type="switch" title='{{ i18n "pages.setting.xrayConfigNetflixIPv4"}}' desc='{{ i18n "pages.setting.xrayConfigNetflixIPv4Desc"}}' v-model="NetflixIPv4Settings"></setting-list-item>
  102. <a-divider>{{ i18n "pages.setting.warpConfigs"}}</a-divider>
  103. <setting-list-item type="switch" title='{{ i18n "pages.setting.xrayConfigGoogleWARP"}}' desc='{{ i18n "pages.setting.xrayConfigGoogleWARPDesc"}}' v-model="GoogleWARPSettings"></setting-list-item>
  104. <setting-list-item type="switch" title='{{ i18n "pages.setting.xrayConfigOpenAIWARP"}}' desc='{{ i18n "pages.setting.xrayConfigOpenAIWARPDesc"}}' v-model="OpenAIWARPSettings"></setting-list-item>
  105. <setting-list-item type="switch" title='{{ i18n "pages.setting.xrayConfigNetflixWARP"}}' desc='{{ i18n "pages.setting.xrayConfigNetflixWARPDesc"}}' v-model="NetflixWARPSettings"></setting-list-item>
  106. <setting-list-item type="switch" title='{{ i18n "pages.setting.xrayConfigSpotifyWARP"}}' desc='{{ i18n "pages.setting.xrayConfigSpotifyWARPDesc"}}' v-model="SpotifyWARPSettings"></setting-list-item>
  107. <setting-list-item type="switch" title='{{ i18n "pages.setting.xrayConfigIRWARP"}}' desc='{{ i18n "pages.setting.xrayConfigIRWARPDesc"}}' v-model="IRWARPSettings"></setting-list-item>
  108. <a-divider>{{ i18n "pages.setting.advancedTemplate"}}</a-divider>
  109. <a-collapse>
  110. <a-collapse-panel header='{{ i18n "pages.setting.xrayConfigInbounds"}}'>
  111. <setting-list-item type="textarea" title='{{ i18n "pages.setting.xrayConfigInbounds"}}' desc='{{ i18n "pages.setting.xrayConfigInboundsDesc"}}' v-model="inboundSettings"></setting-list-item>
  112. </a-collapse-panel>
  113. <a-collapse-panel header='{{ i18n "pages.setting.xrayConfigOutbounds"}}'>
  114. <setting-list-item type="textarea" title='{{ i18n "pages.setting.xrayConfigOutbounds"}}' desc='{{ i18n "pages.setting.xrayConfigOutboundsDesc"}}' v-model="outboundSettings"></setting-list-item>
  115. </a-collapse-panel>
  116. <a-collapse-panel header='{{ i18n "pages.setting.xrayConfigRoutings"}}'>
  117. <setting-list-item type="textarea" title='{{ i18n "pages.setting.xrayConfigRoutings"}}' desc='{{ i18n "pages.setting.xrayConfigRoutingsDesc"}}' v-model="routingRuleSettings"></setting-list-item>
  118. </a-collapse-panel>
  119. </a-collapse>
  120. <a-divider>{{ i18n "pages.setting.completeTemplate"}}</a-divider>
  121. <setting-list-item type="textarea" title='{{ i18n "pages.setting.xrayConfigTemplate"}}' desc='{{ i18n "pages.setting.xrayConfigTemplateDesc"}}' v-model="allSetting.xrayTemplateConfig"></setting-list-item>
  122. </a-list>
  123. </a-tab-pane>
  124. <a-tab-pane key="4" tab='{{ i18n "pages.setting.TGReminder"}}'>
  125. <a-list item-layout="horizontal" :style="siderDrawer.isDarkTheme ? 'color: hsla(0,0%,100%,.65);': 'background: white;'">
  126. <setting-list-item type="switch" title='{{ i18n "pages.setting.telegramBotEnable" }}' desc='{{ i18n "pages.setting.telegramBotEnableDesc" }}' v-model="allSetting.tgBotEnable"></setting-list-item>
  127. <setting-list-item type="text" title='{{ i18n "pages.setting.telegramToken"}}' desc='{{ i18n "pages.setting.telegramTokenDesc"}}' v-model="allSetting.tgBotToken"></setting-list-item>
  128. <setting-list-item type="text" title='{{ i18n "pages.setting.telegramChatId"}}' desc='{{ i18n "pages.setting.telegramChatIdDesc"}}' v-model="allSetting.tgBotChatId"></setting-list-item>
  129. <setting-list-item type="text" title='{{ i18n "pages.setting.telegramNotifyTime"}}' desc='{{ i18n "pages.setting.telegramNotifyTimeDesc"}}' v-model="allSetting.tgRunTime"></setting-list-item>
  130. <setting-list-item type="switch" title='{{ i18n "pages.setting.tgNotifyBackup" }}' desc='{{ i18n "pages.setting.tgNotifyBackupDesc" }}' v-model="allSetting.tgBotBackup"></setting-list-item>
  131. <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>
  132. </a-list>
  133. </a-tab-pane>
  134. <a-tab-pane key="5" tab='{{ i18n "pages.setting.otherSetting"}}'>
  135. <a-list item-layout="horizontal" :style="siderDrawer.isDarkTheme ? 'color: hsla(0,0%,100%,.65);': 'background: white;'">
  136. <setting-list-item type="text" title='{{ i18n "pages.setting.timeZonee"}}' desc='{{ i18n "pages.setting.timeZoneDesc"}}' v-model="allSetting.timeLocation"></setting-list-item>
  137. </a-list>
  138. </a-tab-pane>
  139. </a-tabs>
  140. </a-space>
  141. </a-spin>
  142. </a-layout-content>
  143. </a-layout>
  144. </a-layout>
  145. {{template "js" .}}
  146. {{template "component/setting"}}
  147. <script>
  148. const app = new Vue({
  149. delimiters: ['[[', ']]'],
  150. el: '#app',
  151. data: {
  152. siderDrawer,
  153. spinning: false,
  154. oldAllSetting: new AllSetting(),
  155. allSetting: new AllSetting(),
  156. saveBtnDisable: true,
  157. user: {},
  158. lang: getLang(),
  159. ipv4Settings: {
  160. tag: "IPv4",
  161. protocol: "freedom",
  162. settings: {
  163. domainStrategy: "UseIPv4"
  164. }
  165. },
  166. warpSettings: {
  167. tag: "WARP",
  168. protocol: "socks",
  169. settings: {
  170. servers: [
  171. {
  172. address: "127.0.0.1",
  173. port: 40000
  174. }
  175. ]
  176. }
  177. },
  178. settingsData: {
  179. protocols: {
  180. bittorrent: ["bittorrent"],
  181. },
  182. ips: {
  183. local: ["geoip:private"],
  184. google: ["geoip:google"],
  185. cn: ["geoip:cn"],
  186. ir: ["geoip:ir"],
  187. ru: ["geoip:ru"],
  188. },
  189. domains: {
  190. ads: [
  191. "geosite:category-ads-all",
  192. "geosite:category-ads",
  193. "geosite:google-ads",
  194. "geosite:spotify-ads"
  195. ],
  196. porn: ["geosite:category-porn"],
  197. openai: ["geosite:openai"],
  198. google: ["geosite:google"],
  199. spotify: ["geosite:spotify"],
  200. netflix: ["geosite:netflix"],
  201. cn: ["geosite:cn"],
  202. ru: ["geosite:category-ru-gov"],
  203. ir: [
  204. "regexp:.*\\.ir$",
  205. "ext:iran.dat:ir",
  206. "ext:iran.dat:other",
  207. "ext:iran.dat:ads",
  208. "geosite:category-ir"
  209. ]
  210. },
  211. }
  212. },
  213. methods: {
  214. loading(spinning = true) {
  215. this.spinning = spinning;
  216. },
  217. async getAllSetting() {
  218. this.loading(true);
  219. const msg = await HttpUtil.post("/xui/setting/all");
  220. this.loading(false);
  221. if (msg.success) {
  222. this.oldAllSetting = new AllSetting(msg.obj);
  223. this.allSetting = new AllSetting(msg.obj);
  224. this.saveBtnDisable = true;
  225. }
  226. },
  227. async updateAllSetting() {
  228. this.loading(true);
  229. const msg = await HttpUtil.post("/xui/setting/update", this.allSetting);
  230. this.loading(false);
  231. if (msg.success) {
  232. await this.getAllSetting();
  233. }
  234. },
  235. async updateUser() {
  236. this.loading(true);
  237. const msg = await HttpUtil.post("/xui/setting/updateUser", this.user);
  238. this.loading(false);
  239. if (msg.success) {
  240. this.user = {};
  241. }
  242. },
  243. async restartPanel() {
  244. await new Promise(resolve => {
  245. this.$confirm({
  246. title: '{{ i18n "pages.setting.restartPanel" }}',
  247. content: '{{ i18n "pages.setting.restartPanelDesc" }}',
  248. okText: '{{ i18n "sure" }}',
  249. cancelText: '{{ i18n "cancel" }}',
  250. onOk: () => resolve(),
  251. });
  252. });
  253. this.loading(true);
  254. const msg = await HttpUtil.post("/xui/setting/restartPanel");
  255. this.loading(false);
  256. if (msg.success) {
  257. this.loading(true);
  258. await PromiseUtil.sleep(5000);
  259. location.reload();
  260. }
  261. },
  262. async resetXrayConfigToDefault() {
  263. this.loading(true);
  264. const msg = await HttpUtil.get("/xui/setting/getDefaultJsonConfig");
  265. this.loading(false);
  266. if (msg.success) {
  267. this.templateSettings = JSON.parse(JSON.stringify(msg.obj, null, 2));
  268. this.saveBtnDisable = true;
  269. }
  270. },
  271. checkRequiredOutbounds() {
  272. const newTemplateSettings = this.templateSettings;
  273. const haveIPv4Outbounds = newTemplateSettings.outbounds.some((o) => o?.tag === "IPv4");
  274. const haveIPv4Rules = newTemplateSettings.routing.rules.some((r) => r?.outboundTag === "IPv4");
  275. const haveWARPOutbounds = newTemplateSettings.outbounds.some((o) => o?.tag === "WARP");
  276. const haveWARPRules = newTemplateSettings.routing.rules.some((r) => r?.outboundTag === "WARP");
  277. if (haveWARPRules && !haveWARPOutbounds) {
  278. newTemplateSettings.outbounds.push(this.warpSettings);
  279. }
  280. if (haveIPv4Rules && !haveIPv4Outbounds) {
  281. newTemplateSettings.outbounds.push(this.ipv4Settings);
  282. }
  283. this.templateSettings = newTemplateSettings;
  284. },
  285. templateRuleGetter(routeSettings) {
  286. const { data, property, outboundTag } = routeSettings;
  287. let result = false;
  288. if (this.templateSettings != null) {
  289. this.templateSettings.routing.rules.forEach(
  290. (routingRule) => {
  291. if (
  292. routingRule.hasOwnProperty(property) &&
  293. routingRule.hasOwnProperty("outboundTag") &&
  294. routingRule.outboundTag === outboundTag
  295. ) {
  296. if (data.includes(routingRule[property][0])) {
  297. result = true;
  298. }
  299. }
  300. }
  301. );
  302. }
  303. return result;
  304. },
  305. templateRuleSetter(routeSettings) {
  306. const { newValue, data, property, outboundTag } = routeSettings;
  307. const oldTemplateSettings = this.templateSettings;
  308. const newTemplateSettings = oldTemplateSettings;
  309. if (newValue) {
  310. const propertyRule = {
  311. type: "field",
  312. outboundTag,
  313. [property]: data
  314. };
  315. newTemplateSettings.routing.rules.push(propertyRule);
  316. }
  317. else {
  318. const newRules = [];
  319. newTemplateSettings.routing.rules.forEach(
  320. (routingRule) => {
  321. if (
  322. routingRule.hasOwnProperty(property) &&
  323. routingRule.hasOwnProperty("outboundTag") &&
  324. routingRule.outboundTag === outboundTag
  325. ) {
  326. if (data.includes(routingRule[property][0])) {
  327. return;
  328. }
  329. }
  330. newRules.push(routingRule);
  331. }
  332. );
  333. newTemplateSettings.routing.rules = newRules;
  334. }
  335. this.templateSettings = newTemplateSettings;
  336. this.checkRequiredOutbounds();
  337. }
  338. },
  339. async mounted() {
  340. await this.getAllSetting();
  341. while (true) {
  342. await PromiseUtil.sleep(1000);
  343. this.saveBtnDisable = this.oldAllSetting.equals(this.allSetting);
  344. }
  345. },
  346. computed: {
  347. templateSettings: {
  348. get: function () { return this.allSetting.xrayTemplateConfig ? JSON.parse(this.allSetting.xrayTemplateConfig) : null; },
  349. set: function (newValue) { this.allSetting.xrayTemplateConfig = JSON.stringify(newValue, null, 2) },
  350. },
  351. inboundSettings: {
  352. get: function () { return this.templateSettings ? JSON.stringify(this.templateSettings.inbounds, null, 2) : null; },
  353. set: function (newValue) {
  354. newTemplateSettings = this.templateSettings;
  355. newTemplateSettings.inbounds = JSON.parse(newValue)
  356. this.templateSettings = newTemplateSettings
  357. },
  358. },
  359. outboundSettings: {
  360. get: function () { return this.templateSettings ? JSON.stringify(this.templateSettings.outbounds, null, 2) : null; },
  361. set: function (newValue) {
  362. newTemplateSettings = this.templateSettings;
  363. newTemplateSettings.outbounds = JSON.parse(newValue)
  364. this.templateSettings = newTemplateSettings
  365. },
  366. },
  367. routingRuleSettings: {
  368. get: function () { return this.templateSettings ? JSON.stringify(this.templateSettings.routing.rules, null, 2) : null; },
  369. set: function (newValue) {
  370. newTemplateSettings = this.templateSettings;
  371. newTemplateSettings.routing.rules = JSON.parse(newValue)
  372. this.templateSettings = newTemplateSettings
  373. },
  374. },
  375. torrentSettings: {
  376. get: function () {
  377. return this.templateRuleGetter({
  378. outboundTag: "blocked",
  379. property: "protocol",
  380. data: this.settingsData.protocols.bittorrent
  381. });
  382. },
  383. set: function (newValue) {
  384. this.templateRuleSetter({
  385. newValue,
  386. outboundTag: "blocked",
  387. property: "protocol",
  388. data: this.settingsData.protocols.bittorrent
  389. });
  390. },
  391. },
  392. privateIpSettings: {
  393. get: function () {
  394. return this.templateRuleGetter({
  395. outboundTag: "blocked",
  396. property: "ip",
  397. data: this.settingsData.ips.local
  398. });
  399. },
  400. set: function (newValue) {
  401. this.templateRuleSetter({
  402. newValue,
  403. outboundTag: "blocked",
  404. property: "ip",
  405. data: this.settingsData.ips.local
  406. });
  407. },
  408. },
  409. AdsSettings: {
  410. get: function () {
  411. return this.templateRuleGetter({
  412. outboundTag: "blocked",
  413. property: "domain",
  414. data: this.settingsData.domains.ads
  415. });
  416. },
  417. set: function (newValue) {
  418. this.templateRuleSetter({
  419. newValue,
  420. outboundTag: "blocked",
  421. property: "domain",
  422. data: this.settingsData.domains.ads
  423. });
  424. },
  425. },
  426. PornSettings: {
  427. get: function () {
  428. return this.templateRuleGetter({
  429. outboundTag: "blocked",
  430. property: "domain",
  431. data: this.settingsData.domains.porn
  432. });
  433. },
  434. set: function (newValue) {
  435. this.templateRuleSetter({
  436. newValue,
  437. outboundTag: "blocked",
  438. property: "domain",
  439. data: this.settingsData.domains.porn
  440. });
  441. },
  442. },
  443. GoogleIPv4Settings: {
  444. get: function () {
  445. return this.templateRuleGetter({
  446. outboundTag: "IPv4",
  447. property: "domain",
  448. data: this.settingsData.domains.google
  449. });
  450. },
  451. set: function (newValue) {
  452. this.templateRuleSetter({
  453. newValue,
  454. outboundTag: "IPv4",
  455. property: "domain",
  456. data: this.settingsData.domains.google
  457. });
  458. },
  459. },
  460. NetflixIPv4Settings: {
  461. get: function () {
  462. return this.templateRuleGetter({
  463. outboundTag: "IPv4",
  464. property: "domain",
  465. data: this.settingsData.domains.netflix
  466. });
  467. },
  468. set: function (newValue) {
  469. this.templateRuleSetter({
  470. newValue,
  471. outboundTag: "IPv4",
  472. property: "domain",
  473. data: this.settingsData.domains.netflix
  474. });
  475. },
  476. },
  477. IRIpSettings: {
  478. get: function () {
  479. return this.templateRuleGetter({
  480. outboundTag: "blocked",
  481. property: "ip",
  482. data: this.settingsData.ips.ir
  483. });
  484. },
  485. set: function (newValue) {
  486. this.templateRuleSetter({
  487. newValue,
  488. outboundTag: "blocked",
  489. property: "ip",
  490. data: this.settingsData.ips.ir
  491. });
  492. },
  493. },
  494. IRDomainSettings: {
  495. get: function () {
  496. return this.templateRuleGetter({
  497. outboundTag: "blocked",
  498. property: "domain",
  499. data: this.settingsData.domains.ir
  500. });
  501. },
  502. set: function (newValue) {
  503. this.templateRuleSetter({
  504. newValue,
  505. outboundTag: "blocked",
  506. property: "domain",
  507. data: this.settingsData.domains.ir
  508. });
  509. },
  510. },
  511. ChinaIpSettings: {
  512. get: function () {
  513. return this.templateRuleGetter({
  514. outboundTag: "blocked",
  515. property: "ip",
  516. data: this.settingsData.ips.cn
  517. });
  518. },
  519. set: function (newValue) {
  520. this.templateRuleSetter({
  521. newValue,
  522. outboundTag: "blocked",
  523. property: "ip",
  524. data: this.settingsData.ips.cn
  525. });
  526. },
  527. },
  528. ChinaDomainSettings: {
  529. get: function () {
  530. return this.templateRuleGetter({
  531. outboundTag: "blocked",
  532. property: "domain",
  533. data: this.settingsData.domains.cn
  534. });
  535. },
  536. set: function (newValue) {
  537. this.templateRuleSetter({
  538. newValue,
  539. outboundTag: "blocked",
  540. property: "domain",
  541. data: this.settingsData.domains.cn
  542. });
  543. },
  544. },
  545. GoogleWARPSettings: {
  546. get: function () {
  547. return this.templateRuleGetter({
  548. outboundTag: "WARP",
  549. property: "domain",
  550. data: this.settingsData.domains.google
  551. });
  552. },
  553. set: function (newValue) {
  554. this.templateRuleSetter({
  555. newValue,
  556. outboundTag: "WARP",
  557. property: "domain",
  558. data: this.settingsData.domains.google
  559. });
  560. },
  561. },
  562. OpenAIWARPSettings: {
  563. get: function () {
  564. return this.templateRuleGetter({
  565. outboundTag: "WARP",
  566. property: "domain",
  567. data: this.settingsData.domains.openai
  568. });
  569. },
  570. set: function (newValue) {
  571. this.templateRuleSetter({
  572. newValue,
  573. outboundTag: "WARP",
  574. property: "domain",
  575. data: this.settingsData.domains.openai
  576. });
  577. },
  578. },
  579. NetflixWARPSettings: {
  580. get: function () {
  581. return this.templateRuleGetter({
  582. outboundTag: "WARP",
  583. property: "domain",
  584. data: this.settingsData.domains.netflix
  585. });
  586. },
  587. set: function (newValue) {
  588. this.templateRuleSetter({
  589. newValue,
  590. outboundTag: "WARP",
  591. property: "domain",
  592. data: this.settingsData.domains.netflix
  593. });
  594. },
  595. },
  596. SpotifyWARPSettings: {
  597. get: function () {
  598. return this.templateRuleGetter({
  599. outboundTag: "WARP",
  600. property: "domain",
  601. data: this.settingsData.domains.spotify
  602. });
  603. },
  604. set: function (newValue) {
  605. this.templateRuleSetter({
  606. newValue,
  607. outboundTag: "WARP",
  608. property: "domain",
  609. data: this.settingsData.domains.spotify
  610. });
  611. },
  612. },
  613. IRWARPSettings: {
  614. get: function () {
  615. return this.templateRuleGetter({
  616. outboundTag: "WARP",
  617. property: "domain",
  618. data: this.settingsData.domains.ir
  619. });
  620. },
  621. set: function (newValue) {
  622. this.templateRuleSetter({
  623. newValue,
  624. outboundTag: "WARP",
  625. property: "domain",
  626. data: this.settingsData.domains.ir
  627. });
  628. },
  629. },
  630. }
  631. });
  632. </script>
  633. </body>
  634. </html>