1
0

inbound_client_table.html 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. {{define "client_table"}}
  2. <template slot="actions" slot-scope="text, client, index">
  3. <a-tooltip>
  4. <template slot="title">{{ i18n "qrCode" }}</template>
  5. <a-icon style="font-size: 24px;" type="qrcode" v-if="record.hasLink()" @click="showQrcode(record,index);"></a-icon>
  6. </a-tooltip>
  7. <a-tooltip>
  8. <template slot="title">{{ i18n "pages.client.edit" }}</template>
  9. <a-icon style="font-size: 24px;" type="edit" @click="openEditClient(record.id,client);"></a-icon>
  10. </a-tooltip>
  11. <a-tooltip>
  12. <template slot="title">{{ i18n "info" }}</template>
  13. <a-icon style="font-size: 24px;" type="info-circle" @click="showInfo(record,index);"></a-icon>
  14. </a-tooltip>
  15. <a-tooltip>
  16. <template slot="title">{{ i18n "pages.inbounds.resetTraffic" }}</template>
  17. <a-icon style="font-size: 24px;" type="retweet" @click="resetClientTraffic(client,record.id)" v-if="client.email.length > 0"></a-icon>
  18. </a-tooltip>
  19. <a-tooltip>
  20. <template slot="title"><span style="color: #FF4D4F"> {{ i18n "delete"}}</span></template>
  21. <a-icon style="font-size: 24px;" type="delete" v-if="isRemovable(record.id)" @click="delClient(record.id,client)"></a-icon>
  22. </a-tooltip>
  23. </template>
  24. <template slot="enable" slot-scope="text, client, index">
  25. <a-switch v-model="client.enable" @change="switchEnableClient(record.id,client)"></a-switch>
  26. </template>
  27. <template slot="client" slot-scope="text, client">
  28. [[ client.email ]]
  29. <a-tag v-if="!isClientEnabled(record, client.email)" color="red">{{ i18n "depleted" }}</a-tag>
  30. </template>
  31. <template slot="traffic" slot-scope="text, client">
  32. <a-tag :color="statsColor(record, client.email)">[[ sizeFormat(getUpStats(record, client.email)) ]] / [[ sizeFormat(getDownStats(record, client.email)) ]]</a-tag>
  33. <template v-if="client._totalGB > 0">
  34. <a-tag :color="statsColor(record, client.email)">[[client._totalGB]]GB</a-tag>
  35. </template>
  36. <a-tag v-else color="green">{{ i18n "indefinite" }}</a-tag>
  37. </template>
  38. <template slot="expiryTime" slot-scope="text, client, index">
  39. <template v-if="client.expiryTime > 0">
  40. <a-tag :color="usageColor(new Date().getTime(), app.expireDiff, client.expiryTime)">
  41. [[ DateUtil.formatMillis(client._expiryTime) ]]
  42. </a-tag>
  43. </template>
  44. <a-tag v-else-if="client.expiryTime < 0" color="cyan">
  45. [[ client._expiryTime ]] {{ i18n "pages.client.days" }}
  46. </a-tag>
  47. <a-tag v-else color="green">{{ i18n "indefinite" }}</a-tag>
  48. </template>
  49. {{end}}