socks.html 1.7 KB

123456789101112131415161718192021222324252627282930313233
  1. {{define "form/socks"}}
  2. <a-form :colon="false" :label-col="{ md: {span:6} }" :wrapper-col="{ md: {span:14} }">
  3. <a-form-item label='{{ i18n "pages.inbounds.enable" }} UDP'>
  4. <a-switch v-model="inbound.settings.udp"></a-switch>
  5. </a-form-item>
  6. <a-form-item label="IP" v-if="inbound.settings.udp">
  7. <a-input v-model.trim="inbound.settings.ip"></a-input>
  8. </a-form-item>
  9. <a-form-item label='{{ i18n "password" }}'>
  10. <a-switch :checked="inbound.settings.auth === 'password'"
  11. @change="checked => inbound.settings.auth = checked ? 'password' : 'noauth'"></a-switch>
  12. </a-form-item>
  13. <template v-if="inbound.settings.auth === 'password'">
  14. <table style="width: 100%; text-align: center; margin-bottom: 10px;">
  15. <tr>
  16. <td width="45%">{{ i18n "username" }}</td>
  17. <td width="45%">{{ i18n "password" }}</td>
  18. <td><a-button size="small" @click="inbound.settings.addAccount(new Inbound.SocksSettings.SocksAccount())">+</a-button></td>
  19. </tr>
  20. </table>
  21. <a-input-group compact v-for="(account, index) in inbound.settings.accounts" style="margin-bottom: 10px;">
  22. <a-input style="width: 50%" v-model.trim="account.user" placeholder='{{ i18n "username" }}'>
  23. <template slot="addonBefore" style="margin: 0;">[[ index+1 ]]</template>
  24. </a-input>
  25. <a-input style="width: 50%" v-model.trim="account.pass" placeholder='{{ i18n "password" }}'>
  26. <template slot="addonAfter">
  27. <a-button size="small" @click="inbound.settings.delAccount(index)">-</a-button>
  28. </template>
  29. </a-input>
  30. </a-input-group>
  31. </template>
  32. </a-form>
  33. {{end}}