Welcome to mirror list, hosted at ThFree Co, Russian Federation.

subpage.html « subscription « panel « settings « html « web - github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 222352ffb9b0c65cc9721d0cb53ffc55b70eaf01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
{{ 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 + ' subscription-page'">
    <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>
                                            &nbsp;&nbsp;<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="app.subJsonUrl ? 12 : 24" 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 v-if="app.subJsonUrl" :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">
                                        [[ IntlUtil.formatDate(app.lastOnlineMs) ]]
                                    </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>
                                        [[ IntlUtil.formatDate(app.expireMs) ]]
                                    </template>
                                </a-descriptions-item>
                            </a-descriptions>
                        </a-form-item>
                    </a-form>

                    <br />
                    <div v-for="(link, idx) in links" :key="link"
                        style="position: relative; margin-bottom: 20px; text-align: center;">
                        <div class="qr-box" style="display: inline-block; width: 100%; max-width: 100%;">
                            <a-tag color="purple"
                                style="margin-bottom: -10px; position: relative; z-index: 2; box-shadow: 0 2px 4px rgba(0,0,0,0.2);">
                                <span>[[ linkName(link, idx) ]]</span>
                            </a-tag>
                            <div @click="copy(link)" style="
                                cursor: pointer;
                                background: rgba(0, 0, 0, 0.2);
                                border: 1px solid rgba(255, 255, 255, 0.1);
                                border-radius: 12px;
                                padding: 25px 20px 15px 20px;
                                margin-top: -12px;
                                word-break: break-all;
                                color: #fff;
                                font-size: 13px;
                                line-height: 1.5;
                                text-align: left;
                                font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
                                transition: all 0.3s;
                                box-shadow: 0 4px 6px rgba(0,0,0,0.1);
                            " onmouseover="this.style.background='rgba(0, 0, 0, 0.3)'; this.style.borderColor='rgba(255, 255, 255, 0.2)'"
                                onmouseout="this.style.background='rgba(0, 0, 0, 0.2)'; this.style.borderColor='rgba(255, 255, 255, 0.1)'">
                                [[ link ]]
                            </div>
                        </div>
                    </div>
                    </div>
                    <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 icon="android" :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-item key="android-happ"
                                                @click="open('happ://add/' + encodeURIComponent(app.subUrl))">Happ</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 icon="apple" :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(shadowrocketUrl)">Shadowrocket</a-menu-item>
                                            <a-menu-item key="ios-v2box" @click="open(v2boxUrl)">V2Box</a-menu-item>
                                            <a-menu-item key="ios-streisand"
                                                @click="open(streisandUrl)">Streisand</a-menu-item>
                                            <a-menu-item key="ios-v2raytun"
                                                @click="copy(v2raytunUrl)">V2RayTun</a-menu-item>
                                            <a-menu-item key="ios-npvtunnel" @click="copy(npvtunUrl)">NPV
                                                Tunnel
                                            </a-menu-item>
                                            <a-menu-item key="ios-happ" @click="open(happUrl)">Happ</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" .}}