subpage.html 15 KB

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