inbounds_client_row.html 1.8 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 color="blue">[[ sizeFormat(getUpStats(record, client.email)) ]] / [[ sizeFormat(getDownStats(record, client.email)) ]]</a-tag>
  20. <template v-if="client._totalGB > 0">
  21. <a-tag v-if="isTrafficExhausted(record, client.email)" color="red">[[client._totalGB]]GB</a-tag>
  22. <a-tag v-else color="cyan">[[client._totalGB]]GB</a-tag>
  23. </template>
  24. <a-tag v-else color="green">{{ i18n "indefinite" }}</a-tag>
  25. </template>
  26. <template slot="expiryTime" slot-scope="text, client, index">
  27. <template v-if="client._expiryTime > 0">
  28. <a-tag :color="isExpiry(record, index)? 'red' : '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}}