socks.html 1.6 KB

12345678910111213141516171819202122232425262728293031323334
  1. {{define "form/socks"}}
  2. <a-form :colon="false" :label-col="{ md: {span:8} }" :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'" @change="checked => inbound.settings.auth = checked ? 'password' : 'noauth'"></a-switch>
  11. </a-form-item>
  12. <template v-if="inbound.settings.auth === 'password'">
  13. <table style="width: 100%; text-align: center; margin: 1rem 0;">
  14. <tr>
  15. <td width="45%">{{ i18n "username" }}</td>
  16. <td width="45%">{{ i18n "password" }}</td>
  17. <td>
  18. <a-button icon="plus" size="small" @click="inbound.settings.addAccount(new Inbound.SocksSettings.SocksAccount())"></a-button>
  19. </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 icon="minus" size="small" @click="inbound.settings.delAccount(index)"></a-button>
  29. </template>
  30. </a-input>
  31. </a-input-group>
  32. </template>
  33. </a-form>
  34. {{end}}