1
0

outbounds.html 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. <span v-if="!isMobile">{{ i18n
  8. "pages.xray.outbound.addOutbound" }}</span>
  9. </a-button>
  10. <a-button type="primary" icon="cloud" @click="showWarp()">WARP</a-button>
  11. <a-button type="primary" icon="api" @click="showNord()">NordVPN</a-button>
  12. </a-space>
  13. </a-col>
  14. <a-col :xs="12" :sm="12" :lg="12" :style="{ textAlign: 'right' }">
  15. <a-button-group>
  16. <a-button icon="sync" @click="refreshOutboundTraffic()" :loading="refreshing"></a-button>
  17. <a-popconfirm placement="topRight" @confirm="resetOutboundTraffic(-1)"
  18. title='{{ i18n "pages.inbounds.resetTrafficContent"}}'
  19. :overlay-class-name="themeSwitcher.currentTheme" ok-text='{{ i18n "reset"}}'
  20. cancel-text='{{ i18n "cancel"}}'>
  21. <a-icon slot="icon" type="question-circle-o"
  22. :style="{ color: themeSwitcher.isDarkTheme ? '#008771' : '#008771' }"></a-icon>
  23. <a-button icon="retweet"></a-button>
  24. </a-popconfirm>
  25. </a-button-group>
  26. </a-col>
  27. </a-row>
  28. <a-table :columns="outboundColumns" bordered :row-key="r => r.key" :data-source="outboundData"
  29. :scroll="isMobile ? {} : { x: 800 }" :pagination="false" :indent-size="0"
  30. :locale='{ filterConfirm: `{{ i18n "confirm" }}`, filterReset: `{{ i18n "reset" }}` }'>
  31. <template slot="action" slot-scope="text, outbound, index">
  32. <span>[[ index+1 ]]</span>
  33. <a-dropdown :trigger="['click']">
  34. <a-icon @click="e => e.preventDefault()" type="more"
  35. :style="{ fontSize: '16px', textDecoration: 'bold' }"></a-icon>
  36. <a-menu slot="overlay" :theme="themeSwitcher.currentTheme">
  37. <a-menu-item v-if="index>0" @click="setFirstOutbound(index)">
  38. <a-icon type="vertical-align-top"></a-icon>
  39. <span>{{ i18n "pages.xray.rules.first"}}</span>
  40. </a-menu-item>
  41. <a-menu-item @click="editOutbound(index)">
  42. <a-icon type="edit"></a-icon>
  43. <span>{{ i18n "edit" }}</span>
  44. </a-menu-item>
  45. <a-menu-item @click="resetOutboundTraffic(index)">
  46. <span>
  47. <a-icon type="retweet"></a-icon>
  48. <span>{{ i18n "pages.inbounds.resetTraffic"}}</span>
  49. </span>
  50. </a-menu-item>
  51. <a-menu-item @click="deleteOutbound(index)">
  52. <span :style="{ color: '#FF4D4F' }">
  53. <a-icon type="delete"></a-icon>
  54. <span>{{ i18n "delete"}}</span>
  55. </span>
  56. </a-menu-item>
  57. </a-menu>
  58. </a-dropdown>
  59. </template>
  60. <template slot="address" slot-scope="text, outbound, index">
  61. <p :style="{ margin: '0 5px' }" v-for="addr in findOutboundAddress(outbound)">[[ addr ]]</p>
  62. </template>
  63. <template slot="protocol" slot-scope="text, outbound, index">
  64. <a-tag :style="{ margin: '0' }" color="purple">[[ outbound.protocol
  65. ]]</a-tag>
  66. <template
  67. v-if="[Protocols.VMess, Protocols.VLESS, Protocols.Trojan, Protocols.Shadowsocks].includes(outbound.protocol)">
  68. <a-tag :style="{ margin: '0' }" color="blue">[[
  69. outbound.streamSettings.network ]]</a-tag>
  70. <a-tag :style="{ margin: '0' }" v-if="outbound.streamSettings.security=='tls'" color="green">tls</a-tag>
  71. <a-tag :style="{ margin: '0' }" v-if="outbound.streamSettings.security=='reality'"
  72. color="green">reality</a-tag>
  73. </template>
  74. </template>
  75. <template slot="traffic" slot-scope="text, outbound, index">
  76. <a-tag color="green">[[ findOutboundTraffic(outbound) ]]</a-tag>
  77. </template>
  78. <template slot="test" slot-scope="text, outbound, index">
  79. <a-tooltip>
  80. <template slot="title">{{ i18n "pages.xray.outbound.test"
  81. }}</template>
  82. <a-button type="primary" shape="circle" icon="thunderbolt"
  83. :loading="outboundTestStates[index] && outboundTestStates[index].testing"
  84. @click="testOutbound(index)"
  85. :disabled="(outbound.protocol === 'blackhole' || outbound.tag === 'blocked') || (outboundTestStates[index] && outboundTestStates[index].testing)">
  86. </a-button>
  87. </a-tooltip>
  88. </template>
  89. <template slot="testResult" slot-scope="text, outbound, index">
  90. <div v-if="outboundTestStates[index] && outboundTestStates[index].result">
  91. <a-tag v-if="outboundTestStates[index].result.success" color="green">
  92. [[ outboundTestStates[index].result.delay ]]ms
  93. <span v-if="outboundTestStates[index].result.statusCode">
  94. ([[ outboundTestStates[index].result.statusCode
  95. ]])</span>
  96. </a-tag>
  97. <a-tooltip v-else :title="outboundTestStates[index].result.error">
  98. <a-tag color="red">
  99. Failed
  100. </a-tag>
  101. </a-tooltip>
  102. </div>
  103. <span v-else-if="outboundTestStates[index] && outboundTestStates[index].testing">
  104. <a-icon type="loading" />
  105. </span>
  106. <span v-else>-</span>
  107. </template>
  108. </a-table>
  109. </a-space>
  110. {{end}}