socks.html 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. {{define "form/socks"}}
  2. <a-form layout="inline">
  3. <table width="100%" class="ant-table-tbody">
  4. <tr>
  5. <td style="width: 30%;">{{ i18n "password" }}</td>
  6. <td>
  7. <a-form-item>
  8. <a-switch :checked="inbound.settings.auth === 'password'"
  9. @change="checked => inbound.settings.auth = checked ? 'password' : 'noauth'"></a-switch>
  10. </a-form-item>
  11. </td>
  12. </tr>
  13. <tr v-if="inbound.settings.auth === 'password'">
  14. <td colspan="2">
  15. <table style="width: 100%; text-align: center; margin-bottom: 10px;">
  16. <tr>
  17. <td width="45%">{{ i18n "username" }}</td>
  18. <td width="45%">{{ i18n "password" }}</td>
  19. <td><a-button size="small" @click="inbound.settings.addAccount(new Inbound.SocksSettings.SocksAccount())">+</a-button></td>
  20. </tr>
  21. </table>
  22. <a-input-group compact v-for="(account, index) in inbound.settings.accounts" style="margin-bottom: 10px;">
  23. <a-input style="width: 50%" v-model.trim="account.user" placeholder='{{ i18n "username" }}'>
  24. <template slot="addonBefore" style="margin: 0;">[[ index+1 ]]</template>
  25. </a-input>
  26. <a-input style="width: 50%" v-model.trim="account.pass" placeholder='{{ i18n "password" }}'>
  27. <template slot="addonAfter">
  28. <a-button size="small" @click="inbound.settings.delAccount(index)">-</a-button>
  29. </template>
  30. </a-input>
  31. </a-input-group>
  32. </td>
  33. </tr>
  34. <tr>
  35. <td>{{ i18n "pages.inbounds.enable" }} udp</td>
  36. <td>
  37. <a-form-item>
  38. <a-switch v-model="inbound.settings.udp"></a-switch>
  39. </a-form-item>
  40. </td>
  41. </tr>
  42. <tr v-if="inbound.settings.udp">
  43. <td>IP</td>
  44. <td>
  45. <a-form-item>
  46. <a-input v-model.trim="inbound.settings.ip"></a-input>
  47. </a-form-item>
  48. </td>
  49. </tr>
  50. </table>
  51. </a-form>
  52. {{end}}