diff options
| author | Sanaei <ho3ein.sanaei@gmail.com> | 2025-09-14 21:03:32 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-14 21:03:32 +0300 |
| commit | 6d41320ed7994c651a4d0d3e5837c4f31000f541 (patch) | |
| tree | 57129d50af7aa9ccde6b0539423e92bee7919806 /web/html | |
| parent | 5ee62b25ca9a3bf0ce683adbba5b1b64ddea074e (diff) | |
| parent | bf9d2e6aeb47e980305e10be2a0d8545113013e6 (diff) | |
Merge pull request #3466 from MHSanaei/Subscription
Subscription,tgbot,rule
Diffstat (limited to 'web/html')
| -rw-r--r-- | web/html/modals/xray_rule_modal.html | 26 | ||||
| -rw-r--r-- | web/html/settings/xray/routing.html | 12 | ||||
| -rw-r--r-- | web/html/subscription.html | 274 | ||||
| -rw-r--r-- | web/html/xray.html | 5 |
4 files changed, 305 insertions, 12 deletions
diff --git a/web/html/modals/xray_rule_modal.html b/web/html/modals/xray_rule_modal.html index d367600b..487bf197 100644 --- a/web/html/modals/xray_rule_modal.html +++ b/web/html/modals/xray_rule_modal.html @@ -9,7 +9,7 @@ </template> Source IPs <a-icon type="question-circle"></a-icon> </a-tooltip> </template> - <a-input v-model.trim="ruleModal.rule.sourceIP"></a-input> + <a-input v-model.trim="ruleModal.rule.sourceIP" placeholder="e.g. 0.0.0.0/8, fc00::/7, geoip:ir"></a-input> </a-form-item> <a-form-item> <template slot="label"> @@ -19,7 +19,17 @@ </template> Source Port <a-icon type="question-circle"></a-icon> </a-tooltip> </template> - <a-input v-model.trim="ruleModal.rule.sourcePort"></a-input> + <a-input v-model.trim="ruleModal.rule.sourcePort" placeholder="e.g. 53,443,1000-2000"></a-input> + </a-form-item> + <a-form-item> + <template slot="label"> + <a-tooltip> + <template slot="title"> + <span>{{ i18n "pages.xray.rules.useComma" }}</span> + </template> VLESS Route <a-icon type="question-circle"></a-icon> + </a-tooltip> + </template> + <a-input v-model.trim="ruleModal.rule.vlessRoute" placeholder="e.g. 53,443,1000-2000"></a-input> </a-form-item> <a-form-item label='Network'> <a-select v-model="ruleModal.rule.network" :dropdown-class-name="themeSwitcher.currentTheme"> @@ -52,7 +62,7 @@ </template> IP <a-icon type="question-circle"></a-icon> </a-tooltip> </template> - <a-input v-model.trim="ruleModal.rule.ip"></a-input> + <a-input v-model.trim="ruleModal.rule.ip" placeholder="e.g. 0.0.0.0/8, fc00::/7, geoip:ir"></a-input> </a-form-item> <a-form-item> <template slot="label"> @@ -62,7 +72,7 @@ </template> Domain <a-icon type="question-circle"></a-icon> </a-tooltip> </template> - <a-input v-model.trim="ruleModal.rule.domain"></a-input> + <a-input v-model.trim="ruleModal.rule.domain" placeholder="e.g. google.com, geosite:cn"></a-input> </a-form-item> <a-form-item> <template slot="label"> @@ -72,7 +82,7 @@ </template> User <a-icon type="question-circle"></a-icon> </a-tooltip> </template> - <a-input v-model.trim="ruleModal.rule.user"></a-input> + <a-input v-model.trim="ruleModal.rule.user" placeholder="e.g. email address"></a-input> </a-form-item> <a-form-item> <template slot="label"> @@ -82,7 +92,7 @@ </template> Port <a-icon type="question-circle"></a-icon> </a-tooltip> </template> - <a-input v-model.trim="ruleModal.rule.port"></a-input> + <a-input v-model.trim="ruleModal.rule.port" placeholder="e.g. 53,443,1000-2000"></a-input> </a-form-item> <a-form-item label='Inbound Tags'> <a-select v-model="ruleModal.rule.inboundTag" mode="multiple" :dropdown-class-name="themeSwitcher.currentTheme"> @@ -122,6 +132,7 @@ ip: "", port: "", sourcePort: "", + vlessRoute: "", network: "", sourceIP: "", user: "", @@ -155,6 +166,7 @@ this.rule.ip = rule.ip ? rule.ip.join(',') : []; this.rule.port = rule.port; this.rule.sourcePort = rule.sourcePort; + this.rule.vlessRoute = rule.vlessRoute; this.rule.network = rule.network; this.rule.sourceIP = rule.sourceIP ? rule.sourceIP.join(',') : []; this.rule.user = rule.user ? rule.user.join(',') : []; @@ -169,6 +181,7 @@ ip: "", port: "", sourcePort: "", + vlessRoute: "", network: "", sourceIP: "", user: "", @@ -210,6 +223,7 @@ rule.ip = value.ip.length > 0 ? value.ip.split(',') : []; rule.port = value.port; rule.sourcePort = value.sourcePort; + rule.vlessRoute = value.vlessRoute; rule.network = value.network; rule.sourceIP = value.sourceIP.length > 0 ? value.sourceIP.split(',') : []; rule.user = value.user.length > 0 ? value.user.split(',') : []; diff --git a/web/html/settings/xray/routing.html b/web/html/settings/xray/routing.html index e5b9b6c6..487f7963 100644 --- a/web/html/settings/xray/routing.html +++ b/web/html/settings/xray/routing.html @@ -67,18 +67,22 @@ </template> <template slot="info" slot-scope="text, rule, index"> <a-popover placement="bottomRight" - v-if="(rule.source+rule.sourcePort+rule.network+rule.protocol+rule.attrs+rule.ip+rule.domain+rule.port).length>0" + v-if="(rule.sourceIP+rule.sourcePort+rule.vlessRoute+rule.network+rule.protocol+rule.attrs+rule.ip+rule.domain+rule.port).length>0" :overlay-class-name="themeSwitcher.currentTheme" trigger="click"> <template slot="content"> <table cellpadding="2" :style="{ maxWidth: '300px' }"> - <tr v-if="rule.source"> - <td>Source</td> - <td><a-tag color="blue" v-for="r in rule.source.split(',')">[[ r ]]</a-tag></td> + <tr v-if="rule.sourceIP"> + <td>Source IP</td> + <td><a-tag color="blue" v-for="r in rule.sourceIP.split(',')">[[ r ]]</a-tag></td> </tr> <tr v-if="rule.sourcePort"> <td>Source Port</td> <td><a-tag color="green" v-for="r in rule.sourcePort.split(',')">[[ r ]]</a-tag></td> </tr> + <tr v-if="rule.vlessRoute"> + <td>VLESS Route</td> + <td><a-tag color="geekblue" v-for="r in rule.vlessRoute.split(',')">[[ r ]]</a-tag></td> + </tr> <tr v-if="rule.network"> <td>Network</td> <td><a-tag color="blue" v-for="r in rule.network.split(',')">[[ r ]]</a-tag></td> diff --git a/web/html/subscription.html b/web/html/subscription.html new file mode 100644 index 00000000..710bfe43 --- /dev/null +++ b/web/html/subscription.html @@ -0,0 +1,274 @@ +{{ template "page/head_start" .}} +<script src="{{ .base_path }}assets/moment/moment.min.js"></script> +<script src="{{ .base_path }}assets/moment/moment-jalali.min.js?{{ .cur_ver }}"></script> +<script src="{{ .base_path }}assets/vue/vue.min.js?{{ .cur_ver }}"></script> +<script src="{{ .base_path }}assets/ant-design-vue/antd.min.js"></script> +<script src="{{ .base_path }}assets/js/util/index.js?{{ .cur_ver }}"></script> +<script src="{{ .base_path }}assets/qrcode/qrious2.min.js?{{ .cur_ver }}"></script> +{{ template "page/head_end" .}} + +{{ template "page/body_start" .}} +<a-layout id="app" v-cloak :class="themeSwitcher.currentTheme"> + <a-layout-content class="p-2"> + <a-row type="flex" justify="center" class="mt-2"> + <a-col :xs="24" :sm="22" :md="18" :lg="14" :xl="12"> + <a-card hoverable class="subscription-card"> + <template #title> + <a-space> + <span>{{ i18n "subscription.title" }}</span> + <a-tag>{{ .sId }}</a-tag> + </a-space> + </template> + <template #extra> + <a-popover + :overlay-class-name="themeSwitcher.currentTheme" + title='{{ i18n "menu.settings" }}' + placement="bottomRight" trigger="click"> + <template #content> + <a-space direction="vertical" :size="10"> + <a-theme-switch-login></a-theme-switch-login> + <span>{{ i18n "pages.settings.language" + }}</span> + <a-select ref="selectLang" class="w-100" + v-model="lang" + @change="LanguageManager.setLanguage(lang)" + :dropdown-class-name="themeSwitcher.currentTheme"> + <a-select-option :value="l.value" + label="English" + v-for="l in LanguageManager.supportedLanguages" + :key="l.value"> + <span role="img" + :aria-label="l.name" + v-text="l.icon"></span> + <span + v-text="l.name"></span> + </a-select-option> + </a-select> + </a-space> + </template> + <a-button shape="circle" icon="setting"></a-button> + </a-popover> + </template> + + <a-form layout="vertical"> + <a-form-item> + <a-space direction="vertical" align="center"> + <a-row type="flex" :gutter="[8,8]" + justify="center" style="width:100%"> + <a-col :xs="24" :sm="12" + style="text-align:center;"> + <tr-qr-box class="qr-box"> + <a-tag color="purple" + class="qr-tag"> + <span>{{ i18n + "pages.settings.subSettings"}}</span> + </a-tag> + <tr-qr-bg class="qr-bg-sub"> + <tr-qr-bg-inner + class="qr-bg-sub-inner"> + <canvas id="qrcode" + class="qr-cv" + title='{{ i18n "copy" }}' + @click="copy(app.subUrl)"></canvas> + </tr-qr-bg-inner> + </tr-qr-bg> + </tr-qr-box> + </a-col> + <a-col :xs="24" :sm="12" + style="text-align:center;"> + <tr-qr-box class="qr-box"> + <a-tag color="purple" + class="qr-tag"> + <span>{{ i18n + "pages.settings.subSettings"}} + Json</span> + </a-tag> + <tr-qr-bg class="qr-bg-sub"> + <tr-qr-bg-inner + class="qr-bg-sub-inner"> + <canvas id="qrcode-subjson" + class="qr-cv" + title='{{ i18n "copy" }}' + @click="copy(app.subJsonUrl)"></canvas> + </tr-qr-bg-inner> + </tr-qr-bg> + </tr-qr-box> + </a-col> + </a-row> + </a-space> + </a-form-item> + + <a-form-item> + <a-descriptions bordered :column="1" size="small"> + <a-descriptions-item + label='{{ i18n "subscription.subId" }}'>[[ + app.sId + ]]</a-descriptions-item> + <a-descriptions-item + label='{{ i18n "subscription.status" }}'> + <template v-if="isUnlimited"> + <a-tag color="purple">{{ i18n + "subscription.unlimited" }}</a-tag> + </template> + <template v-else> + <a-tag + :color="isActive ? 'green' : 'red'">[[ + isActive ? '{{ i18n + "subscription.active" }}' : '{{ i18n + "subscription.inactive" }}' + ]]</a-tag> + </template> + </a-descriptions-item> + <a-descriptions-item + label='{{ i18n "subscription.downloaded" }}'>[[ + app.download + ]]</a-descriptions-item> + <a-descriptions-item + label='{{ i18n "subscription.uploaded" }}'>[[ + app.upload + ]]</a-descriptions-item> + <a-descriptions-item + label='{{ i18n "usage" }}'>[[ app.used + ]]</a-descriptions-item> + <a-descriptions-item + label='{{ i18n "subscription.totalQuota" }}'>[[ + app.total + ]]</a-descriptions-item> + <a-descriptions-item v-if="app.totalByte > 0" + label='{{ i18n "remained" }}'>[[ + app.remained ]]</a-descriptions-item> + <a-descriptions-item + label='{{ i18n "lastOnline" }}'> + <template v-if="app.lastOnlineMs > 0"> + <template + v-if="app.datepicker === 'gregorian'"> + [[ + DateUtil.formatMillis(app.lastOnlineMs) + ]] + </template> + <template v-else> + [[ + DateUtil.convertToJalalian(moment(app.lastOnlineMs)) + ]] + </template> + </template> + <template v-else> + <span>-</span> + </template> + </a-descriptions-item> + <a-descriptions-item + label='{{ i18n "subscription.expiry" }}'> + <template v-if="app.expireMs === 0"> + {{ i18n "subscription.noExpiry" }} + </template> + <template v-else> + <template + v-if="app.datepicker === 'gregorian'"> + [[ + DateUtil.formatMillis(app.expireMs) + ]] + </template> + <template v-else> + [[ + DateUtil.convertToJalalian(moment(app.expireMs)) + ]] + </template> + </template> + </a-descriptions-item> + </a-descriptions> + </a-form-item> + </a-form> + + <br /> + <a-list bordered> + <a-list-item v-for="(link, idx) in links" :key="link"> + <div style="width:100%; text-align:center;"> + <a-button type="primary" :block="isMobile" + @click="copy(link)">[[ linkName(link, idx) + ]]</a-button> + </div> + </a-list-item> + </a-list> + <br /> + + <a-form layout="vertical"> + <a-form-item> + <a-row type="flex" justify="center" :gutter="[8,8]" + style="width:100%"> + <a-col :xs="24" :sm="12" + style="text-align:center;"> + <!-- Android dropdown --> + <a-dropdown :trigger="['click']"> + <a-button :block="isMobile" + :style="{ marginTop: isMobile ? '6px' : 0 }" + size="large" type="primary"> + Android <a-icon type="down" /> + </a-button> + <a-menu slot="overlay" + :class="themeSwitcher.currentTheme"> + <a-menu-item key="android-v2box" + @click="open('v2box://install-sub?url=' + encodeURIComponent(app.subUrl) + '&name=' + encodeURIComponent(app.sId))">V2Box</a-menu-item> + <a-menu-item key="android-v2rayng" + @click="open('v2rayng://install-config?url=' + encodeURIComponent(app.subUrl))">V2RayNG</a-menu-item> + <a-menu-item key="android-singbox" + @click="copy(app.subUrl)">Sing-box</a-menu-item> + <a-menu-item key="android-v2raytun" + @click="copy(app.subUrl)">V2RayTun</a-menu-item> + <a-menu-item key="android-npvtunnel" + @click="copy(app.subUrl)">NPV + Tunnel</a-menu-item> + </a-menu> + </a-dropdown> + </a-col> + <a-col :xs="24" :sm="12" + style="text-align:center;"> + <!-- iOS dropdown --> + <a-dropdown :trigger="['click']"> + <a-button :block="isMobile" + :style="{ marginTop: isMobile ? '6px' : 0 }" + size="large" type="primary"> + iOS <a-icon type="down" /> + </a-button> + <a-menu slot="overlay" + :class="themeSwitcher.currentTheme"> + <a-menu-item key="ios-shadowrocket" + @click="open('shadowrocket://add/subscription?url=' + encodeURIComponent(app.subUrl) + '&remark=' + encodeURIComponent(app.sId))">Shadowrocket</a-menu-item> + <a-menu-item key="ios-v2box" + @click="open('v2box://install-sub?url=' + encodeURIComponent(app.subUrl) + '&name=' + encodeURIComponent(app.sId))">V2Box</a-menu-item> + <a-menu-item key="ios-streisand" + @click="open('streisand://import/' + encodeURIComponent(app.subUrl))">Streisand</a-menu-item> + <a-menu-item key="ios-v2raytun" + @click="copy(app.subUrl)">V2RayTun</a-menu-item> + <a-menu-item key="ios-npvtunnel" + @click="copy(app.subUrl)">NPV + Tunnel</a-menu-item> + </a-menu> + </a-dropdown> + </a-col> + </a-row> + </a-form-item> + </a-form> + </a-card> + </a-col> + </a-row> + </a-layout-content> +</a-layout> + +<!-- Bootstrap data for external JS --> +<template id="subscription-data" data-sid="{{ .sId }}" + data-sub-url="{{ .subUrl }}" data-subjson-url="{{ .subJsonUrl }}" + data-download="{{ .download }}" + data-upload="{{ .upload }}" data-used="{{ .used }}" + data-total="{{ .total }}" data-remained="{{ .remained }}" + data-expire="{{ .expire }}" data-lastonline="{{ .lastOnline }}" + data-downloadbyte="{{ .downloadByte }}" + data-uploadbyte="{{ .uploadByte }}" data-totalbyte="{{ .totalByte }}" + data-datepicker="{{ .datepicker }}"></template> +<textarea id="subscription-links" + style="display:none">{{ range .result }}{{ . }} +{{ end }}</textarea> + +{{template "component/aThemeSwitch" .}} +<script src="{{ .base_path }}assets/js/subscription.js?{{ .cur_ver }}"></script> + +{{ template "page/body_end" .}}
\ No newline at end of file diff --git a/web/html/xray.html b/web/html/xray.html index 5b1b8026..9f528e03 100644 --- a/web/html/xray.html +++ b/web/html/xray.html @@ -146,8 +146,9 @@ { title: "#", align: 'center', width: 15, scopedSlots: { customRender: 'action' } }, { title: '{{ i18n "pages.xray.rules.source"}}', children: [ - { title: 'IP', dataIndex: "source", align: 'center', width: 20, ellipsis: true }, - { title: '{{ i18n "pages.inbounds.port" }}', dataIndex: 'sourcePort', align: 'center', width: 10, ellipsis: true }] + { title: 'IP', dataIndex: "sourceIP", align: 'center', width: 20, ellipsis: true }, + { title: '{{ i18n "pages.inbounds.port" }}', dataIndex: 'sourcePort', align: 'center', width: 10, ellipsis: true }, + { title: 'VLESS Route', dataIndex: 'vlessRoute', align: 'center', width: 15, ellipsis: true }] }, { title: '{{ i18n "pages.inbounds.network"}}', children: [ |
