outbounds.html 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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="{ textAlign: 'right' }">
  13. <a-button-group>
  14. <a-button icon="sync" @click="refreshOutboundTraffic()" :loading="refreshing"></a-button>
  15. <a-popconfirm placement="topRight" @confirm="resetOutboundTraffic(-1)"
  16. title='{{ i18n "pages.inbounds.resetTrafficContent"}}'
  17. :overlay-class-name="themeSwitcher.currentTheme" ok-text='{{ i18n "reset"}}'
  18. cancel-text='{{ i18n "cancel"}}'>
  19. <a-icon slot="icon" type="question-circle-o"
  20. :style="{ color: themeSwitcher.isDarkTheme ? '#008771' : '#008771' }"></a-icon>
  21. <a-button icon="retweet"></a-button>
  22. </a-popconfirm>
  23. </a-button-group>
  24. </a-col>
  25. </a-row>
  26. <a-table :columns="outboundColumns" bordered :row-key="r => r.key" :data-source="outboundData"
  27. :scroll="isMobile ? {} : { x: 800 }" :pagination="false" :indent-size="0"
  28. :locale='{ filterConfirm: `{{ i18n "confirm" }}`, filterReset: `{{ i18n "reset" }}` }'>
  29. <template slot="action" slot-scope="text, outbound, index">
  30. <span>[[ index+1 ]]</span>
  31. <a-dropdown :trigger="['click']">
  32. <a-icon @click="e => e.preventDefault()" type="more"
  33. :style="{ fontSize: '16px', textDecoration: 'bold' }"></a-icon>
  34. <a-menu slot="overlay" :theme="themeSwitcher.currentTheme">
  35. <a-menu-item v-if="index>0" @click="setFirstOutbound(index)">
  36. <a-icon type="vertical-align-top"></a-icon>
  37. <span>{{ i18n "pages.xray.rules.first"}}</span>
  38. </a-menu-item>
  39. <a-menu-item @click="editOutbound(index)">
  40. <a-icon type="edit"></a-icon>
  41. <span>{{ i18n "edit" }}</span>
  42. </a-menu-item>
  43. <a-menu-item @click="resetOutboundTraffic(index)">
  44. <span>
  45. <a-icon type="retweet"></a-icon>
  46. <span>{{ i18n "pages.inbounds.resetTraffic"}}</span>
  47. </span>
  48. </a-menu-item>
  49. <a-menu-item @click="deleteOutbound(index)">
  50. <span :style="{ color: '#FF4D4F' }">
  51. <a-icon type="delete"></a-icon>
  52. <span>{{ i18n "delete"}}</span>
  53. </span>
  54. </a-menu-item>
  55. </a-menu>
  56. </a-dropdown>
  57. </template>
  58. <template slot="address" slot-scope="text, outbound, index">
  59. <p :style="{ margin: '0 5px' }" v-for="addr in findOutboundAddress(outbound)">[[ addr ]]</p>
  60. </template>
  61. <template slot="protocol" slot-scope="text, outbound, index">
  62. <a-tag :style="{ margin: '0' }" color="purple">[[ outbound.protocol ]]</a-tag>
  63. <template
  64. v-if="[Protocols.VMess, Protocols.VLESS, Protocols.Trojan, Protocols.Shadowsocks].includes(outbound.protocol)">
  65. <a-tag :style="{ margin: '0' }" color="blue">[[ outbound.streamSettings.network ]]</a-tag>
  66. <a-tag :style="{ margin: '0' }" v-if="outbound.streamSettings.security=='tls'" color="green">tls</a-tag>
  67. <a-tag :style="{ margin: '0' }" v-if="outbound.streamSettings.security=='reality'"
  68. color="green">reality</a-tag>
  69. </template>
  70. </template>
  71. <template slot="traffic" slot-scope="text, outbound, index">
  72. <a-tag color="green">[[ findOutboundTraffic(outbound) ]]</a-tag>
  73. </template>
  74. </a-table>
  75. </a-space>
  76. {{end}}