socks.html 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. {{define "form/mixed"}}
  2. <a-form
  3. :colon="false"
  4. :label-col="{ md: {span:8} }"
  5. :wrapper-col="{ md: {span:14} }"
  6. >
  7. <a-form-item label='{{ i18n "pages.inbounds.enable" }} UDP'>
  8. <a-switch v-model="inbound.settings.udp"></a-switch>
  9. </a-form-item>
  10. <a-form-item label="IP" v-if="inbound.settings.udp">
  11. <a-input v-model.trim="inbound.settings.ip"></a-input>
  12. </a-form-item>
  13. <a-form-item label='{{ i18n "password" }}'>
  14. <a-switch
  15. :checked="inbound.settings.auth === 'password'"
  16. @change="checked => inbound.settings.auth = checked ? 'password' : 'noauth'"
  17. ></a-switch>
  18. </a-form-item>
  19. <template v-if="inbound.settings.auth === 'password'">
  20. <table :style="{ width: '100%', textAlign: 'center', margin: '1rem 0' }">
  21. <tr>
  22. <td width="45%">{{ i18n "username" }}</td>
  23. <td width="45%">{{ i18n "password" }}</td>
  24. <td>
  25. <a-button
  26. icon="plus"
  27. size="small"
  28. @click="inbound.settings.addAccount(new Inbound.MixedSettings.SocksAccount())"
  29. ></a-button>
  30. </td>
  31. </tr>
  32. </table>
  33. <a-input-group
  34. compact
  35. v-for="(account, index) in inbound.settings.accounts"
  36. :style="{ marginBottom: '10px' }"
  37. >
  38. <a-input
  39. :style="{ width: '50%' }"
  40. v-model.trim="account.user"
  41. placeholder='{{ i18n "username" }}'
  42. >
  43. <template slot="addonBefore" :style="{ margin: '0' }"
  44. >[[ index+1 ]]</template
  45. >
  46. </a-input>
  47. <a-input
  48. :style="{ width: '50%' }"
  49. v-model.trim="account.pass"
  50. placeholder='{{ i18n "password" }}'
  51. >
  52. <template slot="addonAfter">
  53. <a-button
  54. icon="minus"
  55. size="small"
  56. @click="inbound.settings.delAccount(index)"
  57. ></a-button>
  58. </template>
  59. </a-input>
  60. </a-input-group>
  61. </template>
  62. </a-form>
  63. {{end}}