inbound_info_modal.html 20 KB

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