inbounds_client_row.html 2.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. {{define "client_row"}}
  2. <template slot="actions" slot-scope="text, client, index">
  3. <a-dropdown>
  4. <a-icon @click="e => e.preventDefault()" type="menu"></a-icon>
  5. <template #overlay>
  6. <a-menu>
  7. <a-menu-item v-if="record.hasLink()" @click="showQrcode(record,index);"><a-icon type="qrcode"></a-icon>{{ i18n "qrCode" }}</a-menu-item>
  8. <a-menu-item @click="showInfo(record,index);"><a-icon type="info-circle"></a-icon>{{ i18n "info" }}</a-menu-item>
  9. <a-menu-item @click="resetClientTraffic(client,record,$event)" v-if="client.email != ''"><a-icon type="retweet"></a-icon>{{ i18n "pages.inbounds.resetTraffic" }}</a-menu-item>
  10. </a-menu>
  11. </template>
  12. </a-dropdown>
  13. </template>
  14. <template slot="client" slot-scope="text, client">
  15. [[ client.email ]]
  16. <a-tag v-if="!isClientEnabled(record, client.email)" color="red">{{ i18n "disabled" }}</a-tag>
  17. </template>
  18. <template slot="traffic" slot-scope="text, client">
  19. <a-tag v-if="client._totalGB === 0" color="blue">{{ i18n "used" }}: [[ sizeFormat(getUpStats(record, client.email) + getDownStats(record, client.email)) ]]</a-tag>
  20. <a-tag v-if="client._totalGB > 0 && !isTrafficExhausted(record, client.email)" color="green">{{ i18n "used" }}: [[ sizeFormat(getUpStats(record, client.email) + getDownStats(record, client.email)) ]] / [[client._totalGB]]GB</a-tag>
  21. <a-tag v-if="client._totalGB > 0 && isTrafficExhausted(record, client.email)" color="red">{{ i18n "used" }}: [[ sizeFormat(getUpStats(record, client.email) + getDownStats(record, client.email)) ]] / [[client._totalGB]]GB</a-tag>
  22. </template>
  23. <template slot="expiryTime" slot-scope="text, client, index">
  24. <template v-if="client._expiryTime > 0">
  25. <a-tag v-if="isExpiry(record, index)" color="red">
  26. [[ DateUtil.formatMillis(client._expiryTime) ]]
  27. </a-tag>
  28. <a-tag v-else color="blue">
  29. [[ DateUtil.formatMillis(client._expiryTime) ]]
  30. </a-tag>
  31. </template>
  32. <a-tag v-else color="green">{{ i18n "indefinite" }}</a-tag>
  33. </template>
  34. {{end}}