inbound_info_modal.html 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516
  1. {{define "inboundInfoModal"}}
  2. <a-modal id="inbound-info-modal" v-model="infoModal.visible" title='{{ i18n "pages.inbounds.details"}}' :closable="true" :mask-closable="true" :footer="null" width="600px" :class="themeSwitcher.currentTheme">
  3. <a-row>
  4. <a-col :xs="24" :md="12">
  5. <table>
  6. <tr>
  7. <td>{{ i18n "protocol" }}</td>
  8. <td>
  9. <a-tag color="purple">[[ dbInbound.protocol ]]</a-tag>
  10. </td>
  11. </tr>
  12. <tr>
  13. <td>{{ i18n "pages.inbounds.address" }}</td>
  14. <td>
  15. <a-tooltip :title="[[ dbInbound.address ]]">
  16. <a-tag class="info-large-tag">[[ dbInbound.address ]]</a-tag>
  17. </a-tooltip>
  18. </td>
  19. </tr>
  20. <tr>
  21. <td>{{ i18n "pages.inbounds.port" }}</td>
  22. <td>
  23. <a-tag>[[ dbInbound.port ]]</a-tag>
  24. </td>
  25. </tr>
  26. </table>
  27. </a-col>
  28. <a-col :xs="24" :md="12">
  29. <template v-if="dbInbound.isVMess || dbInbound.isVLess || dbInbound.isTrojan || dbInbound.isSS">
  30. <table>
  31. <tr>
  32. <td>{{ i18n "transmission" }}</td>
  33. <td>
  34. <a-tag color="green">[[ inbound.network ]]</a-tag>
  35. </td>
  36. </tr>
  37. <template v-if="inbound.isTcp || inbound.isWs || inbound.isH2 || inbound.isHttpupgrade || inbound.isSplithttp">
  38. <tr>
  39. <td>{{ i18n "host" }}</td>
  40. <td v-if="inbound.host">
  41. <a-tooltip :title="[[ inbound.host ]]">
  42. <a-tag class="info-large-tag">[[ inbound.host ]]</a-tag>
  43. </a-tooltip>
  44. </td>
  45. <td v-else>
  46. <a-tag color="orange">{{ i18n "none" }}</a-tag>
  47. </td>
  48. </tr>
  49. </tr>
  50. <tr>
  51. <td>{{ i18n "path" }}</td>
  52. <td v-if="inbound.path">
  53. <a-tooltip :title="[[ inbound.path ]]">
  54. <a-tag class="info-large-tag">[[ inbound.path ]]</a-tag>
  55. </a-tooltip>
  56. <td v-else>
  57. <a-tag color="orange">{{ i18n "none" }}</a-tag>
  58. </td>
  59. </tr>
  60. </template>
  61. <template v-if="inbound.isQuic">
  62. <tr>
  63. <td>quic {{ i18n "encryption" }}</td>
  64. <td>
  65. <a-tag>[[ inbound.quicSecurity ]]</a-tag>
  66. </td>
  67. </tr>
  68. <tr>
  69. <td>quic {{ i18n "password" }}</td>
  70. <td>
  71. <a-tag>[[ inbound.quicKey ]]</a-tag>
  72. </td>
  73. </tr>
  74. <tr>
  75. <td>quic {{ i18n "camouflage" }}</td>
  76. <td>
  77. <a-tag>[[ inbound.quicType ]]</a-tag>
  78. </td>
  79. </tr>
  80. </template>
  81. <template v-if="inbound.isKcp">
  82. <tr>
  83. <td>kcp {{ i18n "encryption" }}</td>
  84. <td>
  85. <a-tag>[[ inbound.kcpType ]]</a-tag>
  86. </td>
  87. </tr>
  88. <tr>
  89. <td>kcp {{ i18n "password" }}</td>
  90. <td>
  91. <a-tag>[[ inbound.kcpSeed ]]</a-tag>
  92. </td>
  93. </tr>
  94. </template>
  95. <template v-if="inbound.isGrpc">
  96. <tr>
  97. <td>grpc serviceName</td>
  98. <td>
  99. <a-tooltip :title="[[ inbound.serviceName ]]">
  100. <a-tag class="info-large-tag">[[ inbound.serviceName ]]</a-tag>
  101. </a-tooltip>
  102. <tr>
  103. <td>grpc multiMode</td>
  104. <td>
  105. <a-tag>[[ inbound.stream.grpc.multiMode ]]</a-tag>
  106. </td>
  107. </tr>
  108. </template>
  109. </table>
  110. </template>
  111. </a-col>
  112. <template v-if="dbInbound.hasLink()">
  113. {{ i18n "security" }}
  114. <a-tag :color="inbound.stream.security == 'none' ? 'red' : 'green'">[[ inbound.stream.security ]]</a-tag>
  115. <br />
  116. <template v-if="inbound.stream.security != 'none'">
  117. {{ i18n "domainName" }}
  118. <a-tag v-if="inbound.serverName" :color="inbound.serverName ? 'green' : 'orange'">[[ inbound.serverName ? inbound.serverName : '' ]]</a-tag>
  119. <a-tag v-else color="orange">{{ i18n "none" }}</a-tag>
  120. </template>
  121. </template>
  122. <table v-if="dbInbound.isSS" style="margin-bottom: 10px; width: 100%;">
  123. <tr>
  124. <td>{{ i18n "encryption" }}</td>
  125. <td>
  126. <a-tag color="green">[[ inbound.settings.method ]]</a-tag>
  127. </td>
  128. </tr>
  129. <tr v-if="inbound.isSS2022">
  130. <td>{{ i18n "password" }}</td>
  131. <td>
  132. <a-tooltip :title="[[ inbound.settings.password ]]">
  133. <a-tag class="info-large-tag">[[ inbound.settings.password ]]</a-tag>
  134. </a-tooltip>
  135. </td>
  136. </tr>
  137. <tr>
  138. <td>{{ i18n "pages.inbounds.network" }}</td>
  139. <td>
  140. <a-tag color="green">[[ inbound.settings.network ]]</a-tag>
  141. </td>
  142. </tr>
  143. </table>
  144. <template v-if="infoModal.clientSettings">
  145. <a-divider>{{ i18n "pages.inbounds.client" }}</a-divider>
  146. <table style="margin-bottom: 10px;">
  147. <tr>
  148. <td>{{ i18n "pages.inbounds.email" }}</td>
  149. <td v-if="infoModal.clientSettings.email">
  150. <a-tag color="green">[[ infoModal.clientSettings.email ]]</a-tag>
  151. </td>
  152. <td v-else>
  153. <a-tag color="red">{{ i18n "none" }}</a-tag>
  154. </td>
  155. </tr>
  156. <tr v-if="infoModal.clientSettings.id">
  157. <td>ID</td>
  158. <td>
  159. <a-tag>[[ infoModal.clientSettings.id ]]</a-tag>
  160. </td>
  161. </tr>
  162. <tr v-if="infoModal.inbound.canEnableTlsFlow()">
  163. <td>Flow</td>
  164. <td v-if="infoModal.clientSettings.flow">
  165. <a-tag>[[ infoModal.clientSettings.flow ]]</a-tag>
  166. </td>
  167. <td v-else>
  168. <a-tag color="orange">{{ i18n "none" }}</a-tag>
  169. </td>
  170. </tr>
  171. <tr v-if="infoModal.inbound.xtls">
  172. <td>Flow</td>
  173. <td v-if="infoModal.clientSettings.flow">
  174. <a-tag>[[ infoModal.clientSettings.flow ]]</a-tag>
  175. </td>
  176. <td v-else>
  177. <a-tag color="orange">{{ i18n "none" }}</a-tag>
  178. </td>
  179. </tr>
  180. <tr v-if="infoModal.clientSettings.password">
  181. <td>{{ i18n "password" }}</td>
  182. <td>
  183. <a-tooltip :title="[[ infoModal.clientSettings.password ]]">
  184. <a-tag class="info-large-tag">[[ infoModal.clientSettings.password ]]</a-tag>
  185. </a-tooltip>
  186. </td>
  187. </tr>
  188. <tr>
  189. <td>{{ i18n "status" }}</td>
  190. <td>
  191. <a-tag v-if="isEnable" color="green">{{ i18n "enabled" }}</a-tag>
  192. <a-tag v-else>{{ i18n "disabled" }}</a-tag>
  193. <a-tag v-if="!isActive" color="red">{{ i18n "depleted" }}</a-tag>
  194. </td>
  195. </tr>
  196. <tr v-if="infoModal.clientStats">
  197. <td>{{ i18n "usage" }}</td>
  198. <td>
  199. <a-tag color="green">[[ sizeFormat(infoModal.clientStats.up + infoModal.clientStats.down) ]]</a-tag>
  200. <a-tag>↑ [[ sizeFormat(infoModal.clientStats.up) ]] / [[ sizeFormat(infoModal.clientStats.down) ]] ↓</a-tag>
  201. </td>
  202. </tr>
  203. </table>
  204. <table style="display: inline-table; margin-block: 10px; width: 100%; text-align: center;">
  205. <tr>
  206. <th>{{ i18n "remained" }}</th>
  207. <th>{{ i18n "pages.inbounds.totalFlow" }}</th>
  208. <th>{{ i18n "pages.inbounds.expireDate" }}</th>
  209. </tr>
  210. <tr>
  211. <td>
  212. <a-tag v-if="infoModal.clientStats && infoModal.clientSettings.totalGB > 0" :color="statsColor(infoModal.clientStats)"> [[ getRemStats() ]] </a-tag>
  213. </td>
  214. <td>
  215. <a-tag v-if="infoModal.clientSettings.totalGB > 0" :color="statsColor(infoModal.clientStats)"> [[ sizeFormat(infoModal.clientSettings.totalGB) ]] </a-tag>
  216. <a-tag v-else color="purple" class="infinite-tag">
  217. <svg height="10px" width="14px" viewBox="0 0 640 512" fill="currentColor">
  218. <path d="M484.4 96C407 96 349.2 164.1 320 208.5C290.8 164.1 233 96 155.6 96C69.75 96 0 167.8 0 256s69.75 160 155.6 160C233.1 416 290.8 347.9 320 303.5C349.2 347.9 407 416 484.4 416C570.3 416 640 344.2 640 256S570.3 96 484.4 96zM155.6 368C96.25 368 48 317.8 48 256s48.25-112 107.6-112c67.75 0 120.5 82.25 137.1 112C276 285.8 223.4 368 155.6 368zM484.4 368c-67.75 0-120.5-82.25-137.1-112C364 226.2 416.6 144 484.4 144C543.8 144 592 194.2 592 256S543.8 368 484.4 368z" fill="currentColor"></path>
  219. </svg>
  220. </a-tag>
  221. </td>
  222. <td>
  223. <template v-if="infoModal.clientSettings.expiryTime > 0">
  224. <a-tag :color="usageColor(new Date().getTime(), app.expireDiff, infoModal.clientSettings.expiryTime)"> [[ DateUtil.formatMillis(infoModal.clientSettings.expiryTime) ]] </a-tag>
  225. </template>
  226. <a-tag v-else-if="infoModal.clientSettings.expiryTime < 0" color="green">[[ infoModal.clientSettings.expiryTime / -86400000 ]] {{ i18n "pages.client.days" }}
  227. </a-tag>
  228. <a-tag v-else color="purple" class="infinite-tag">
  229. <svg height="10px" width="14px" viewBox="0 0 640 512" fill="currentColor">
  230. <path d="M484.4 96C407 96 349.2 164.1 320 208.5C290.8 164.1 233 96 155.6 96C69.75 96 0 167.8 0 256s69.75 160 155.6 160C233.1 416 290.8 347.9 320 303.5C349.2 347.9 407 416 484.4 416C570.3 416 640 344.2 640 256S570.3 96 484.4 96zM155.6 368C96.25 368 48 317.8 48 256s48.25-112 107.6-112c67.75 0 120.5 82.25 137.1 112C276 285.8 223.4 368 155.6 368zM484.4 368c-67.75 0-120.5-82.25-137.1-112C364 226.2 416.6 144 484.4 144C543.8 144 592 194.2 592 256S543.8 368 484.4 368z" fill="currentColor"></path>
  231. </svg>
  232. </a-tag>
  233. </td>
  234. </tr>
  235. </table>
  236. <template v-if="app.subSettings.enable && infoModal.clientSettings.subId">
  237. <a-divider>Subscription URL</a-divider>
  238. <tr-info-row class="tr-info-row">
  239. <tr-info-title class="tr-info-title">
  240. <a-tag color="purple">Subscription Link</a-tag>
  241. <a-tooltip title='{{ i18n "copy" }}'>
  242. <a-button size="small" icon="snippets" id="copy-sub-link" @click="copyToClipboard('copy-sub-link', infoModal.subLink)"></a-button>
  243. </a-tooltip>
  244. </tr-info-title>
  245. <a :href="[[ infoModal.subLink ]]" target="_blank">[[ infoModal.subLink ]]</a>
  246. </tr-info-row>
  247. <tr-info-row class="tr-info-row">
  248. <tr-info-title class="tr-info-title">
  249. <a-tag color="purple">Json Link</a-tag>
  250. <a-tooltip title='{{ i18n "copy" }}'>
  251. <a-button size="small" icon="snippets" id="copy-subJson-link" @click="copyToClipboard('copy-subJson-link', infoModal.subJsonLink)"></a-button>
  252. </a-tooltip>
  253. </tr-info-title>
  254. <a :href="[[ infoModal.subJsonLink ]]" target="_blank">[[ infoModal.subJsonLink ]]</a>
  255. </tr-info-row>
  256. </template>
  257. <template v-if="app.tgBotEnable && infoModal.clientSettings.tgId">
  258. <a-divider>Telegram ChatID</a-divider>
  259. <tr-info-row class="tr-info-row">
  260. <tr-info-title class="tr-info-title">
  261. <a-tag color="blue">[[ infoModal.clientSettings.tgId ]]</a-tag>
  262. <a-tooltip title='{{ i18n "copy" }}'>
  263. <a-button size="small" icon="snippets" id="copy-tg-link" @click="copyToClipboard('copy-tg-link', infoModal.clientSettings.tgId)"></a-button>
  264. </a-tooltip>
  265. </tr-info-title>
  266. </tr-info-row>
  267. </template>
  268. <template v-if="dbInbound.hasLink()">
  269. <a-divider>URL</a-divider>
  270. <tr-info-row v-for="(link,index) in infoModal.links" class="tr-info-row">
  271. <tr-info-title class="tr-info-title">
  272. <a-tag class="tr-info-tag" color="green">[[ link.remark ]]</a-tag>
  273. <a-tooltip title='{{ i18n "copy" }}'>
  274. <a-button style="min-width: 24px;" size="small" icon="snippets" :id="'copy-url-link-'+index" @click="copyToClipboard('copy-url-link-'+index, link.link)"></a-button>
  275. </a-tooltip>
  276. </tr-info-title>
  277. <code>[[ link.link ]]</code>
  278. </tr-info-row>
  279. </template>
  280. </template>
  281. <template v-else>
  282. <template v-if="dbInbound.isSS && !inbound.isSSMultiUser">
  283. <a-divider>URL</a-divider>
  284. <tr-info-row v-for="(link,index) in infoModal.links" class="tr-info-row">
  285. <tr-info-title class="tr-info-title">
  286. <a-tag class="tr-info-tag" color="green">[[ link.remark ]]</a-tag>
  287. <a-tooltip title='{{ i18n "copy" }}'>
  288. <a-button style="min-width: 24px;" size="small" icon="snippets" :id="'copy-url-link-'+index" @click="copyToClipboard('copy-url-link-'+index, link.link)"></a-button>
  289. </a-tooltip>
  290. </tr-info-title>
  291. <code>[[ link.link ]]</code>
  292. </tr-info-row>
  293. </template>
  294. <table v-if="inbound.protocol == Protocols.DOKODEMO" class="tr-info-table">
  295. <tr>
  296. <th>{{ i18n "pages.inbounds.targetAddress" }}</th>
  297. <th>{{ i18n "pages.inbounds.destinationPort" }}</th>
  298. <th>{{ i18n "pages.inbounds.network" }}</th>
  299. <th>FollowRedirect</th>
  300. </tr>
  301. <tr>
  302. <td>
  303. <a-tag color="green">[[ inbound.settings.address ]]</a-tag>
  304. </td>
  305. <td>
  306. <a-tag color="green">[[ inbound.settings.port ]]</a-tag>
  307. </td>
  308. <td>
  309. <a-tag color="green">[[ inbound.settings.network ]]</a-tag>
  310. </td>
  311. <td>
  312. <a-tag color="green">[[ inbound.settings.followRedirect ]]</a-tag>
  313. </td>
  314. </tr>
  315. </table>
  316. <table v-if="dbInbound.isSocks" class="tr-info-table">
  317. <tr>
  318. <th>{{ i18n "password" }} Auth</th>
  319. <th>{{ i18n "pages.inbounds.enable" }} udp</th>
  320. <th>IP</th>
  321. </tr>
  322. <tr>
  323. <td>
  324. <a-tag color="green">[[ inbound.settings.auth ]]</a-tag>
  325. </td>
  326. <td>
  327. <a-tag color="green">[[ inbound.settings.udp]]</a-tag>
  328. </td>
  329. <td>
  330. <a-tag color="green">[[ inbound.settings.ip ]]</a-tag>
  331. </td>
  332. </tr>
  333. <template v-if="inbound.settings.auth == 'password'">
  334. <tr>
  335. <td></td>
  336. <td>{{ i18n "username" }}</td>
  337. <td>{{ i18n "password" }}</td>
  338. </tr>
  339. <tr v-for="account,index in inbound.settings.accounts">
  340. <td>[[ index ]]</td>
  341. <td>
  342. <a-tag color="green">[[ account.user ]]</a-tag>
  343. </td>
  344. <td>
  345. <a-tag color="green">[[ account.pass ]]</a-tag>
  346. </td>
  347. </tr>
  348. </template>
  349. </table>
  350. <table v-if="dbInbound.isHTTP" class="tr-info-table">
  351. <tr>
  352. <th></th>
  353. <th>{{ i18n "username" }}</th>
  354. <th>{{ i18n "password" }}</th>
  355. </tr>
  356. <tr v-for="account,index in inbound.settings.accounts">
  357. <td>[[ index ]]</td>
  358. <td>
  359. <a-tag color="green">[[ account.user ]]</a-tag>
  360. </td>
  361. <td>
  362. <a-tag color="green">[[ account.pass ]]</a-tag>
  363. </td>
  364. </tr>
  365. </table>
  366. <table v-if="dbInbound.isWireguard" class="tr-info-table">
  367. <tr class="client-table-odd-row">
  368. <td>{{ i18n "pages.xray.wireguard.secretKey" }}</td>
  369. <td>[[ inbound.settings.secretKey ]]</td>
  370. </tr>
  371. <tr>
  372. <td>{{ i18n "pages.xray.wireguard.publicKey" }}</td>
  373. <td>[[ inbound.settings.pubKey ]]</td>
  374. </tr>
  375. <tr class="client-table-odd-row">
  376. <td>MTU</td>
  377. <td>[[ inbound.settings.mtu ]]</td>
  378. </tr>
  379. <tr>
  380. <td>Kernel Mode</td>
  381. <td>[[ inbound.settings.kernelMode ]]</td>
  382. </tr>
  383. <template v-for="(peer, index) in inbound.settings.peers">
  384. <tr>
  385. <td colspan="2">
  386. <a-divider>Peer [[ index + 1 ]]</a-divider>
  387. </td>
  388. </tr>
  389. <tr class="client-table-odd-row">
  390. <td>{{ i18n "pages.xray.wireguard.secretKey" }}</td>
  391. <td>[[ peer.privateKey ]]</td>
  392. </tr>
  393. <tr>
  394. <td>{{ i18n "pages.xray.wireguard.publicKey" }}</td>
  395. <td>[[ peer.publicKey ]]</td>
  396. </tr>
  397. <tr class="client-table-odd-row">
  398. <td>{{ i18n "pages.xray.wireguard.psk" }}</td>
  399. <td>[[ peer.psk ]]</td>
  400. </tr>
  401. <tr>
  402. <td>{{ i18n "pages.xray.wireguard.allowedIPs" }}</td>
  403. <td>[[ peer.allowedIPs.join(",") ]]</td>
  404. </tr>
  405. <tr class="client-table-odd-row">
  406. <td>Keep Alive</td>
  407. <td>[[ peer.keepAlive ]]</td>
  408. </tr>
  409. <tr>
  410. <td colspan="2">
  411. <tr-info-row v-for="(link,index) in infoModal.links" class="tr-info-row">
  412. <tr-info-title class="tr-info-title">
  413. <a-tag color="blue">Config</a-tag>
  414. <a-tooltip title='{{ i18n "copy" }}'>
  415. <a-button style="min-width: 24px;" size="small" icon="snippets" :id="'copy-url-link-'+index" @click="copyToClipboard('copy-url-link-'+index, infoModal.links[index])"></a-button>
  416. </a-tooltip>
  417. </tr-info-title>
  418. <div v-html="infoModal.links[index].replaceAll(`\n`,`<br />`)" style="border-radius: 1rem; padding: 0.5rem;" class="client-table-odd-row">
  419. </div>
  420. </tr-info-row>
  421. </td>
  422. </tr>
  423. </table>
  424. </template>
  425. </template>
  426. </a-modal>
  427. <script>
  428. const infoModal = {
  429. visible: false,
  430. inbound: new Inbound(),
  431. dbInbound: new DBInbound(),
  432. clientSettings: null,
  433. clientStats: [],
  434. upStats: 0,
  435. downStats: 0,
  436. clipboard: null,
  437. links: [],
  438. index: null,
  439. isExpired: false,
  440. subLink: '',
  441. subJsonLink: '',
  442. show(dbInbound, index) {
  443. this.index = index;
  444. this.inbound = dbInbound.toInbound();
  445. this.dbInbound = new DBInbound(dbInbound);
  446. this.clientSettings = this.inbound.clients ? this.inbound.clients[index] : null;
  447. this.isExpired = this.inbound.clients ? this.inbound.isExpiry(index) : this.dbInbound.isExpiry;
  448. this.clientStats = this.inbound.clients ? this.dbInbound.clientStats.find(row => row.email === this.clientSettings.email) : [];
  449. if (this.inbound.protocol == Protocols.WIREGUARD) {
  450. this.links = this.inbound.genInboundLinks(dbInbound.remark).split('\r\n')
  451. } else {
  452. this.links = this.inbound.genAllLinks(this.dbInbound.remark, app.remarkModel, this.clientSettings);
  453. }
  454. if (this.clientSettings) {
  455. if (this.clientSettings.subId) {
  456. this.subLink = this.genSubLink(this.clientSettings.subId);
  457. this.subJsonLink = this.genSubJsonLink(this.clientSettings.subId);
  458. }
  459. }
  460. this.visible = true;
  461. },
  462. close() {
  463. infoModal.visible = false;
  464. },
  465. genSubLink(subID) {
  466. return app.subSettings.subURI + subID;
  467. },
  468. genSubJsonLink(subID) {
  469. return app.subSettings.subJsonURI + subID;
  470. }
  471. };
  472. const infoModalApp = new Vue({
  473. delimiters: ['[[', ']]'],
  474. el: '#inbound-info-modal',
  475. data: {
  476. infoModal,
  477. get dbInbound() {
  478. return this.infoModal.dbInbound;
  479. },
  480. get inbound() {
  481. return this.infoModal.inbound;
  482. },
  483. get isActive() {
  484. if (infoModal.clientStats) {
  485. return infoModal.clientStats.enable;
  486. }
  487. return true;
  488. },
  489. get isEnable() {
  490. if (infoModal.clientSettings) {
  491. return infoModal.clientSettings.enable;
  492. }
  493. return infoModal.dbInbound.isEnable;
  494. },
  495. },
  496. methods: {
  497. copyToClipboard(elementId, content) {
  498. this.infoModal.clipboard = new ClipboardJS('#' + elementId, {
  499. text: () => content,
  500. });
  501. this.infoModal.clipboard.on('success', () => {
  502. app.$message.success('{{ i18n "copied" }}')
  503. this.infoModal.clipboard.destroy();
  504. });
  505. },
  506. statsColor(stats) {
  507. return usageColor(stats.up + stats.down, app.trafficDiff, stats.total);
  508. },
  509. getRemStats() {
  510. remained = this.infoModal.clientStats.total - this.infoModal.clientStats.up - this.infoModal.clientStats.down;
  511. return remained > 0 ? sizeFormat(remained) : '-';
  512. },
  513. },
  514. });
  515. </script>
  516. {{end}}