outbounds.html 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. {{define "settings/xray/outbounds"}}
  2. <a-space direction="vertical" size="middle">
  3. <a-row>
  4. <a-col :xs="12" :sm="12" :lg="12">
  5. <a-space direction="horizontal" size="small">
  6. <a-button type="primary" icon="plus" @click="addOutbound()">
  7. {{ i18n "pages.xray.outbound.addOutbound" }}
  8. </a-button>
  9. <a-button type="primary" icon="cloud" @click="showWarp()">WARP</a-button>
  10. </a-space>
  11. </a-col>
  12. <a-col :xs="12" :sm="12" :lg="12" style="text-align: right;">
  13. <a-icon type="sync" :spin="refreshing" @click="refreshOutboundTraffic()" style="margin: 0 5px;"></a-icon>
  14. <a-popconfirm placement="topRight" @confirm="resetOutboundTraffic(-1)"
  15. title='{{ i18n "pages.inbounds.resetTrafficContent"}}' :overlay-class-name="themeSwitcher.currentTheme"
  16. ok-text='{{ i18n "reset"}}' cancel-text='{{ i18n "cancel"}}'>
  17. <a-icon slot="icon" type="question-circle-o"
  18. :style="themeSwitcher.isDarkTheme ? 'color: #008771' : 'color: #008771'"></a-icon>
  19. <a-icon type="retweet" style="cursor: pointer;"></a-icon>
  20. </a-popconfirm>
  21. </a-col>
  22. </a-row>
  23. <a-table :columns="outboundColumns" bordered :row-key="r => r.key" :data-source="outboundData"
  24. :scroll="isMobile ? {} : { x: 800 }" :pagination="false" :indent-size="0">
  25. <template slot="action" slot-scope="text, outbound, index">
  26. <span>[[ index+1 ]]</span>
  27. <a-dropdown :trigger="['click']">
  28. <a-icon @click="e => e.preventDefault()" type="more"
  29. style="font-size: 16px; text-decoration: bold;"></a-icon>
  30. <a-menu slot="overlay" :theme="themeSwitcher.currentTheme">
  31. <a-menu-item v-if="index>0" @click="setFirstOutbound(index)">
  32. <a-icon type="vertical-align-top"></a-icon>
  33. <span>{{ i18n "pages.xray.rules.first"}}</span>
  34. </a-menu-item>
  35. <a-menu-item @click="editOutbound(index)">
  36. <a-icon type="edit"></a-icon>
  37. <span>{{ i18n "edit" }}</span>
  38. </a-menu-item>
  39. <a-menu-item @click="resetOutboundTraffic(index)">
  40. <span>
  41. <a-icon type="retweet"></a-icon>
  42. <span>{{ i18n "pages.inbounds.resetTraffic"}}</span>
  43. </span>
  44. </a-menu-item>
  45. <a-menu-item @click="deleteOutbound(index)">
  46. <span style="color: #FF4D4F">
  47. <a-icon type="delete"></a-icon>
  48. <span>{{ i18n "delete"}}</span>
  49. </span>
  50. </a-menu-item>
  51. </a-menu>
  52. </a-dropdown>
  53. </template>
  54. <template slot="address" slot-scope="text, outbound, index">
  55. <p style="margin: 0 5px;" v-for="addr in findOutboundAddress(outbound)">[[ addr ]]</p>
  56. </template>
  57. <template slot="protocol" slot-scope="text, outbound, index">
  58. <a-tag style="margin:0;" color="purple">[[ outbound.protocol ]]</a-tag>
  59. <template
  60. v-if="[Protocols.VMess, Protocols.VLESS, Protocols.Trojan, Protocols.Shadowsocks].includes(outbound.protocol)">
  61. <a-tag style="margin:0;" color="blue">[[ outbound.streamSettings.network ]]</a-tag>
  62. <a-tag style="margin:0;" v-if="outbound.streamSettings.security=='tls'" color="green">tls</a-tag>
  63. <a-tag style="margin:0;" v-if="outbound.streamSettings.security=='reality'"
  64. color="green">reality</a-tag>
  65. </template>
  66. </template>
  67. <template slot="traffic" slot-scope="text, outbound, index">
  68. <a-tag color="green">[[ findOutboundTraffic(outbound) ]]</a-tag>
  69. </template>
  70. </a-table>
  71. </a-space>
  72. {{end}}