subpage.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. {{ template "page/head_start" .}}
  2. <script src="{{ .base_path }}assets/moment/moment.min.js"></script>
  3. <script src="{{ .base_path }}assets/moment/moment-jalali.min.js?{{ .cur_ver }}"></script>
  4. <script src="{{ .base_path }}assets/vue/vue.min.js?{{ .cur_ver }}"></script>
  5. <script src="{{ .base_path }}assets/ant-design-vue/antd.min.js"></script>
  6. <script src="{{ .base_path }}assets/js/util/index.js?{{ .cur_ver }}"></script>
  7. <script src="{{ .base_path }}assets/qrcode/qrious2.min.js?{{ .cur_ver }}"></script>
  8. <style>
  9. .subscription-page .subscription-link-box {
  10. cursor: pointer;
  11. border-radius: 12px;
  12. padding: 25px 20px 15px 20px;
  13. margin-top: -12px;
  14. word-break: break-all;
  15. font-size: 13px;
  16. line-height: 1.5;
  17. text-align: left;
  18. font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  19. transition: all 0.3s;
  20. box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  21. }
  22. .dark.subscription-page .subscription-link-box {
  23. background: rgba(0, 0, 0, 0.2);
  24. border: 1px solid rgba(255, 255, 255, 0.1);
  25. color: #fff;
  26. }
  27. .dark.subscription-page .subscription-link-box:hover {
  28. background: rgba(0, 0, 0, 0.3);
  29. border-color: rgba(255, 255, 255, 0.2);
  30. }
  31. .light.subscription-page .subscription-link-box {
  32. background: rgba(0, 0, 0, 0.03);
  33. border: 1px solid rgba(0, 0, 0, 0.08);
  34. color: rgba(0, 0, 0, 0.85);
  35. }
  36. .light.subscription-page .subscription-link-box:hover {
  37. background: rgba(0, 0, 0, 0.05);
  38. border-color: rgba(0, 0, 0, 0.14);
  39. }
  40. </style>
  41. {{ template "page/head_end" .}}
  42. {{ template "page/body_start" .}}
  43. <a-layout id="app" v-cloak :class="themeSwitcher.currentTheme + ' subscription-page'">
  44. <a-layout-content class="p-2">
  45. <a-row type="flex" justify="center" class="mt-2">
  46. <a-col :xs="24" :sm="22" :md="18" :lg="14" :xl="12">
  47. <a-card hoverable class="subscription-card">
  48. <template #title>
  49. <a-space>
  50. <span>{{ i18n "subscription.title" }}</span>
  51. <a-tag>{{ .sId }}</a-tag>
  52. </a-space>
  53. </template>
  54. <template #extra>
  55. <a-popover :overlay-class-name="themeSwitcher.currentTheme" title='{{ i18n "menu.settings" }}'
  56. placement="bottomRight" trigger="click">
  57. <template #content>
  58. <a-space direction="vertical" :size="10">
  59. <a-theme-switch-login></a-theme-switch-login>
  60. <span>{{ i18n "pages.settings.language"
  61. }}</span>
  62. <a-select ref="selectLang" class="w-100" v-model="lang"
  63. @change="LanguageManager.setLanguage(lang)"
  64. :dropdown-class-name="themeSwitcher.currentTheme">
  65. <a-select-option :value="l.value" label="English"
  66. v-for="l in LanguageManager.supportedLanguages" :key="l.value">
  67. <span role="img" :aria-label="l.name" v-text="l.icon"></span>
  68. &nbsp;&nbsp;<span v-text="l.name"></span>
  69. </a-select-option>
  70. </a-select>
  71. </a-space>
  72. </template>
  73. <a-button shape="circle" icon="setting"></a-button>
  74. </a-popover>
  75. </template>
  76. <a-form layout="vertical">
  77. <a-form-item>
  78. <a-space direction="vertical" align="center">
  79. <a-row type="flex" :gutter="[8,8]" justify="center" style="width:100%">
  80. <a-col :xs="24" :sm="app.subJsonUrl ? 12 : 24" style="text-align:center;">
  81. <tr-qr-box class="qr-box">
  82. <a-tag color="purple" class="qr-tag">
  83. <span>{{ i18n
  84. "pages.settings.subSettings"}}</span>
  85. </a-tag>
  86. <tr-qr-bg class="qr-bg-sub">
  87. <tr-qr-bg-inner class="qr-bg-sub-inner">
  88. <canvas id="qrcode" class="qr-cv" title='{{ i18n "copy" }}'
  89. @click="copy(app.subUrl)"></canvas>
  90. </tr-qr-bg-inner>
  91. </tr-qr-bg>
  92. </tr-qr-box>
  93. </a-col>
  94. <a-col v-if="app.subJsonUrl" :xs="24" :sm="12" style="text-align:center;">
  95. <tr-qr-box class="qr-box">
  96. <a-tag color="purple" class="qr-tag">
  97. <span>{{ i18n
  98. "pages.settings.subSettings"}}
  99. Json</span>
  100. </a-tag>
  101. <tr-qr-bg class="qr-bg-sub">
  102. <tr-qr-bg-inner class="qr-bg-sub-inner">
  103. <canvas id="qrcode-subjson" class="qr-cv" title='{{ i18n "copy" }}'
  104. @click="copy(app.subJsonUrl)"></canvas>
  105. </tr-qr-bg-inner>
  106. </tr-qr-bg>
  107. </tr-qr-box>
  108. </a-col>
  109. </a-row>
  110. </a-space>
  111. </a-form-item>
  112. <a-form-item>
  113. <a-descriptions bordered :column="1" size="small">
  114. <a-descriptions-item label='{{ i18n "subscription.subId" }}'>[[
  115. app.sId
  116. ]]</a-descriptions-item>
  117. <a-descriptions-item label='{{ i18n "subscription.status" }}'>
  118. <template v-if="isUnlimited">
  119. <a-tag color="purple">{{ i18n
  120. "subscription.unlimited" }}</a-tag>
  121. </template>
  122. <template v-else>
  123. <a-tag :color="isActive ? 'green' : 'red'">[[
  124. isActive ? '{{ i18n
  125. "subscription.active" }}' : '{{ i18n
  126. "subscription.inactive" }}'
  127. ]]</a-tag>
  128. </template>
  129. </a-descriptions-item>
  130. <a-descriptions-item label='{{ i18n "subscription.downloaded" }}'>[[
  131. app.download
  132. ]]</a-descriptions-item>
  133. <a-descriptions-item label='{{ i18n "subscription.uploaded" }}'>[[
  134. app.upload
  135. ]]</a-descriptions-item>
  136. <a-descriptions-item label='{{ i18n "usage" }}'>[[ app.used
  137. ]]</a-descriptions-item>
  138. <a-descriptions-item label='{{ i18n "subscription.totalQuota" }}'>[[
  139. app.total
  140. ]]</a-descriptions-item>
  141. <a-descriptions-item v-if="app.totalByte > 0" label='{{ i18n "remained" }}'>[[
  142. app.remained ]]</a-descriptions-item>
  143. <a-descriptions-item label='{{ i18n "lastOnline" }}'>
  144. <template v-if="app.lastOnlineMs > 0">
  145. [[ IntlUtil.formatDate(app.lastOnlineMs) ]]
  146. </template>
  147. <template v-else>
  148. <span>-</span>
  149. </template>
  150. </a-descriptions-item>
  151. <a-descriptions-item label='{{ i18n "subscription.expiry" }}'>
  152. <template v-if="app.expireMs === 0">
  153. {{ i18n "subscription.noExpiry" }}
  154. </template>
  155. <template v-else>
  156. [[ IntlUtil.formatDate(app.expireMs) ]]
  157. </template>
  158. </a-descriptions-item>
  159. </a-descriptions>
  160. </a-form-item>
  161. </a-form>
  162. <br />
  163. <div v-for="(link, idx) in links" :key="link"
  164. style="position: relative; margin-bottom: 20px; text-align: center;">
  165. <div class="qr-box" style="display: inline-block; width: 100%; max-width: 100%;">
  166. <a-tag color="purple"
  167. style="margin-bottom: -10px; position: relative; z-index: 2; box-shadow: 0 2px 4px rgba(0,0,0,0.2);">
  168. <span>[[ linkName(link, idx) ]]</span>
  169. </a-tag>
  170. <div @click="copy(link)" class="subscription-link-box">
  171. [[ link ]]
  172. </div>
  173. </div>
  174. </div>
  175. </div>
  176. <br />
  177. <a-form layout="vertical">
  178. <a-form-item>
  179. <a-row type="flex" justify="center" :gutter="[8,8]" style="width:100%">
  180. <a-col :xs="24" :sm="12" style="text-align:center;">
  181. <!-- Android dropdown -->
  182. <a-dropdown :trigger="['click']">
  183. <a-button icon="android" :block="isMobile"
  184. :style="{ marginTop: isMobile ? '6px' : 0 }" size="large" type="primary">
  185. Android <a-icon type="down" />
  186. </a-button>
  187. <a-menu slot="overlay" :class="themeSwitcher.currentTheme">
  188. <a-menu-item key="android-v2box"
  189. @click="open('v2box://install-sub?url=' + encodeURIComponent(app.subUrl) + '&name=' + encodeURIComponent(app.sId))">V2Box</a-menu-item>
  190. <a-menu-item key="android-v2rayng"
  191. @click="open('v2rayng://install-config?url=' + encodeURIComponent(app.subUrl))">V2RayNG</a-menu-item>
  192. <a-menu-item key="android-singbox"
  193. @click="copy(app.subUrl)">Sing-box</a-menu-item>
  194. <a-menu-item key="android-v2raytun"
  195. @click="copy(app.subUrl)">V2RayTun</a-menu-item>
  196. <a-menu-item key="android-npvtunnel" @click="copy(app.subUrl)">NPV
  197. Tunnel</a-menu-item>
  198. <a-menu-item key="android-happ"
  199. @click="open('happ://add/' + encodeURIComponent(app.subUrl))">Happ</a-menu-item>
  200. </a-menu>
  201. </a-dropdown>
  202. </a-col>
  203. <a-col :xs="24" :sm="12" style="text-align:center;">
  204. <!-- iOS dropdown -->
  205. <a-dropdown :trigger="['click']">
  206. <a-button icon="apple" :block="isMobile"
  207. :style="{ marginTop: isMobile ? '6px' : 0 }" size="large" type="primary">
  208. iOS <a-icon type="down" />
  209. </a-button>
  210. <a-menu slot="overlay" :class="themeSwitcher.currentTheme">
  211. <a-menu-item key="ios-shadowrocket"
  212. @click="open(shadowrocketUrl)">Shadowrocket</a-menu-item>
  213. <a-menu-item key="ios-v2box" @click="open(v2boxUrl)">V2Box</a-menu-item>
  214. <a-menu-item key="ios-streisand"
  215. @click="open(streisandUrl)">Streisand</a-menu-item>
  216. <a-menu-item key="ios-v2raytun"
  217. @click="copy(v2raytunUrl)">V2RayTun</a-menu-item>
  218. <a-menu-item key="ios-npvtunnel" @click="copy(npvtunUrl)">NPV
  219. Tunnel
  220. </a-menu-item>
  221. <a-menu-item key="ios-happ" @click="open(happUrl)">Happ</a-menu-item>
  222. </a-menu>
  223. </a-dropdown>
  224. </a-col>
  225. </a-row>
  226. </a-form-item>
  227. </a-form>
  228. </a-card>
  229. </a-col>
  230. </a-row>
  231. </a-layout-content>
  232. </a-layout>
  233. <!-- Bootstrap data for external JS -->
  234. <template id="subscription-data" data-sid="{{ .sId }}" data-sub-url="{{ .subUrl }}" data-subjson-url="{{ .subJsonUrl }}"
  235. data-download="{{ .download }}" data-upload="{{ .upload }}" data-used="{{ .used }}" data-total="{{ .total }}"
  236. data-remained="{{ .remained }}" data-expire="{{ .expire }}" data-lastonline="{{ .lastOnline }}"
  237. data-downloadbyte="{{ .downloadByte }}" data-uploadbyte="{{ .uploadByte }}" data-totalbyte="{{ .totalByte }}"
  238. data-datepicker="{{ .datepicker }}"></template>
  239. <textarea id="subscription-links" style="display:none">{{ range .result }}{{ . }}
  240. {{ end }}</textarea>
  241. {{template "component/aThemeSwitch" .}}
  242. <script src="{{ .base_path }}assets/js/subscription.js?{{ .cur_ver }}"></script>
  243. {{ template "page/body_end" .}}