Skip to content

Commit

Permalink
freedom redirect
Browse files Browse the repository at this point in the history
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
  • Loading branch information
MHSanaei and alireza0 committed Sep 2, 2024
1 parent f0165c1 commit f2ebe12
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions web/assets/js/model/outbound.js
Original file line number Diff line number Diff line change
Expand Up @@ -864,12 +864,14 @@ Outbound.FreedomSettings = class extends CommonClass {
constructor(
domainStrategy = '',
timeout = '',
redirect = '',
fragment = {},
noise = {}
) {
super();
this.domainStrategy = domainStrategy;
this.timeout = timeout;
this.redirect = redirect;
this.fragment = fragment;
this.noise = noise;
}
Expand All @@ -878,6 +880,7 @@ Outbound.FreedomSettings = class extends CommonClass {
return new Outbound.FreedomSettings(
json.domainStrategy,
json.timeout,
json.redirect,
json.fragment ? Outbound.FreedomSettings.Fragment.fromJson(json.fragment) : undefined,
json.noise ? Outbound.FreedomSettings.Noise.fromJson(json.noise) : undefined,
);
Expand All @@ -887,6 +890,7 @@ Outbound.FreedomSettings = class extends CommonClass {
return {
domainStrategy: ObjectUtil.isEmpty(this.domainStrategy) ? undefined : this.domainStrategy,
timeout: this.timeout,
redirect: this.redirect,
fragment: Object.keys(this.fragment).length === 0 ? undefined : this.fragment,
noise: Object.keys(this.noise).length === 0 ? undefined : this.noise,
};
Expand Down
7 changes: 6 additions & 1 deletion web/html/xui/form/outbound.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@
<a-form-item label='Timeout'>
<a-input-number v-model.number="outbound.settings.timeout" min="0" ></a-input-number>
</a-form-item>
<a-form-item label='Redirect'>
<a-input v-model="outbound.settings.redirect"></a-input>
</a-form-item>
<a-form-item label='Fragment'>
<a-switch :checked="Object.keys(outbound.settings.fragment).length >0" @change="checked => outbound.settings.fragment = checked ? new Outbound.FreedomSettings.Fragment() : {}"></a-switch>
<a-switch :checked="Object.keys(outbound.settings.fragment).length >0"
@change="checked => outbound.settings.fragment = checked ? new Outbound.FreedomSettings.Fragment() : {}">
</a-switch>
</a-form-item>
<template v-if="Object.keys(outbound.settings.fragment).length >0">
<a-form-item label='Packets'>
Expand Down

0 comments on commit f2ebe12

Please sign in to comment.