xtls_settings.html 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. {{define "form/xtlsSettings"}}
  2. <template>
  3. <a-form-item label="SNI" placeholder="Server Name Indication">
  4. <a-input v-model.trim="inbound.stream.xtls.sni"></a-input>
  5. </a-form-item>
  6. <a-form-item label="ALPN">
  7. <a-select mode="multiple" :dropdown-class-name="themeSwitcher.currentTheme" v-model="inbound.stream.xtls.alpn">
  8. <a-select-option v-for="alpn in ALPN_OPTION" :value="alpn">[[ alpn ]]</a-select-option>
  9. </a-select>
  10. </a-form-item>
  11. <a-form-item label="Allow Insecure">
  12. <a-switch v-model="inbound.stream.xtls.settings.allowInsecure"></a-switch>
  13. </a-form-item>
  14. <template v-for="cert,index in inbound.stream.xtls.certs">
  15. <a-form-item label='{{ i18n "certificate" }}'>
  16. <a-radio-group v-model="cert.useFile" button-style="solid">
  17. <a-radio-button :value="true">{{ i18n "pages.inbounds.certificatePath" }}</a-radio-button>
  18. <a-radio-button :value="false">{{ i18n "pages.inbounds.certificateContent" }}</a-radio-button>
  19. </a-radio-group>
  20. <a-button icon="plus" v-if="index === 0" type="primary" size="small" @click="inbound.stream.xtls.addCert()"
  21. style="margin-left: 10px"></a-button>
  22. <a-button icon="minus" v-if="inbound.stream.xtls.certs.length>1" type="primary" size="small"
  23. @click="inbound.stream.xtls.removeCert(index)" style="margin-left: 10px"></a-button>
  24. </a-form-item>
  25. <template v-if="cert.useFile">
  26. <a-form-item label='{{ i18n "pages.inbounds.publicKey" }}'>
  27. <a-input v-model.trim="cert.certFile"></a-input>
  28. </a-form-item>
  29. <a-form-item label='{{ i18n "pages.inbounds.privatekey" }}'>
  30. <a-input v-model.trim="cert.keyFile"></a-input>
  31. </a-form-item>
  32. <a-form-item label=" ">
  33. <a-button type="primary" icon="import" @click="setDefaultCertXtls(index)">
  34. {{ i18n "pages.inbounds.setDefaultCert" }}</a-button>
  35. </a-form-item>
  36. </template>
  37. <template v-else>
  38. <a-form-item label='{{ i18n "pages.inbounds.publicKey" }}'>
  39. <a-input type="textarea" :rows="3" v-model="cert.cert"></a-input>
  40. </a-form-item>
  41. <a-form-item label='{{ i18n "pages.inbounds.privatekey" }}'>
  42. <a-input type="textarea" :rows="3" v-model="cert.key"></a-input>
  43. </a-form-item>
  44. </template>
  45. <a-form-item label='OCSP stapling'>
  46. <a-input-number v-model.number="cert.ocspStapling" :min="0"></a-input-number>
  47. </a-form-item>
  48. <a-form-item label="One Time Loading">
  49. <a-switch v-model="cert.oneTimeLoading"></a-switch>
  50. </a-form-item>
  51. <a-form-item label='Usage Option'>
  52. <a-select v-model="cert.usage" style="width: 50%" :dropdown-class-name="themeSwitcher.currentTheme">
  53. <a-select-option v-for="key in USAGE_OPTION" :value="key">[[ key ]]</a-select-option>
  54. </a-select>
  55. </a-form-item>
  56. </template>
  57. </template>
  58. {{end}}