-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: split XTLS and Reality form tls into separate files
- Loading branch information
Showing
4 changed files
with
123 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{{define "form/realitySettings"}} | ||
<template> | ||
<a-form-item label='Show'> | ||
<a-switch v-model="inbound.stream.reality.show"></a-switch> | ||
</a-form-item> | ||
<a-form-item label='Xver'> | ||
<a-input-number v-model.number="inbound.stream.reality.xver" :min="0"></a-input-number> | ||
</a-form-item> | ||
<a-form-item label='uTLS'> | ||
<a-select v-model="inbound.stream.reality.settings.fingerprint" style="width: 50%" | ||
:dropdown-class-name="themeSwitcher.currentTheme"> | ||
<a-select-option v-for="key in UTLS_FINGERPRINT" :value="key">[[ key ]]</a-select-option> | ||
</a-select> | ||
</a-form-item> | ||
<a-form-item label='Dest'> | ||
<a-input v-model.trim="inbound.stream.reality.dest"></a-input> | ||
</a-form-item> | ||
<a-form-item label='SNI'> | ||
<a-input v-model.trim="inbound.stream.reality.serverNames"></a-input> | ||
</a-form-item> | ||
<a-form-item label='Max Time Diff (ms)'> | ||
<a-input-number v-model.number="inbound.stream.reality.maxTimediff" :min="0"></a-input-number> | ||
</a-form-item> | ||
<a-form-item> | ||
<template slot="label"> | ||
<a-tooltip> | ||
<template slot="title"> | ||
<span>{{ i18n "reset" }}</span> | ||
</template> Short IDs <a-icon @click="inbound.stream.reality.shortIds = RandomUtil.randomShortIds()" | ||
type="sync"></a-icon> | ||
</a-tooltip> | ||
</template> | ||
<a-input v-model.trim="inbound.stream.reality.shortIds"></a-input> | ||
</a-form-item> | ||
<a-form-item label='SpiderX'> | ||
<a-input v-model.trim="inbound.stream.reality.settings.spiderX"></a-input> | ||
</a-form-item> | ||
<a-form-item label='{{ i18n "pages.inbounds.privatekey" }}'> | ||
<a-input v-model.trim="inbound.stream.reality.privateKey"></a-input> | ||
</a-form-item> | ||
<a-form-item label='{{ i18n "pages.inbounds.publicKey" }}'> | ||
<a-input v-model.trim="inbound.stream.reality.settings.publicKey"></a-input> | ||
</a-form-item> | ||
<a-form-item label=" "> | ||
<a-button type="primary" icon="import" @click="getNewX25519Cert">Get New Cert</a-button> | ||
</a-form-item> | ||
</template> | ||
{{end}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{{define "form/xtlsSettings"}} | ||
<template> | ||
<a-form-item label="SNI" placeholder="Server Name Indication"> | ||
<a-input v-model.trim="inbound.stream.xtls.sni"></a-input> | ||
</a-form-item> | ||
<a-form-item label="ALPN"> | ||
<a-select mode="multiple" :dropdown-class-name="themeSwitcher.currentTheme" v-model="inbound.stream.xtls.alpn"> | ||
<a-select-option v-for="alpn in ALPN_OPTION" :value="alpn">[[ alpn ]]</a-select-option> | ||
</a-select> | ||
</a-form-item> | ||
<a-form-item label="Allow Insecure"> | ||
<a-switch v-model="inbound.stream.xtls.settings.allowInsecure"></a-switch> | ||
</a-form-item> | ||
<template v-for="cert,index in inbound.stream.xtls.certs"> | ||
<a-form-item label='{{ i18n "certificate" }}'> | ||
<a-radio-group v-model="cert.useFile" button-style="solid"> | ||
<a-radio-button :value="true">{{ i18n "pages.inbounds.certificatePath" }}</a-radio-button> | ||
<a-radio-button :value="false">{{ i18n "pages.inbounds.certificateContent" }}</a-radio-button> | ||
</a-radio-group> | ||
<a-button icon="plus" v-if="index === 0" type="primary" size="small" @click="inbound.stream.xtls.addCert()" | ||
style="margin-left: 10px"></a-button> | ||
<a-button icon="minus" v-if="inbound.stream.xtls.certs.length>1" type="primary" size="small" | ||
@click="inbound.stream.xtls.removeCert(index)" style="margin-left: 10px"></a-button> | ||
</a-form-item> | ||
<template v-if="cert.useFile"> | ||
<a-form-item label='{{ i18n "pages.inbounds.publicKey" }}'> | ||
<a-input v-model.trim="cert.certFile"></a-input> | ||
</a-form-item> | ||
<a-form-item label='{{ i18n "pages.inbounds.privatekey" }}'> | ||
<a-input v-model.trim="cert.keyFile"></a-input> | ||
</a-form-item> | ||
<a-form-item label=" "> | ||
<a-button type="primary" icon="import" @click="setDefaultCertXtls(index)"> | ||
{{ i18n "pages.inbounds.setDefaultCert" }}</a-button> | ||
</a-form-item> | ||
</template> | ||
<template v-else> | ||
<a-form-item label='{{ i18n "pages.inbounds.publicKey" }}'> | ||
<a-input type="textarea" :rows="3" v-model="cert.cert"></a-input> | ||
</a-form-item> | ||
<a-form-item label='{{ i18n "pages.inbounds.privatekey" }}'> | ||
<a-input type="textarea" :rows="3" v-model="cert.key"></a-input> | ||
</a-form-item> | ||
</template> | ||
<a-form-item label='OCSP stapling'> | ||
<a-input-number v-model.number="cert.ocspStapling" :min="0"></a-input-number> | ||
</a-form-item> | ||
<a-form-item label="One Time Loading"> | ||
<a-switch v-model="cert.oneTimeLoading"></a-switch> | ||
</a-form-item> | ||
<a-form-item label='Usage Option'> | ||
<a-select v-model="cert.usage" style="width: 50%" :dropdown-class-name="themeSwitcher.currentTheme"> | ||
<a-select-option v-for="key in USAGE_OPTION" :value="key">[[ key ]]</a-select-option> | ||
</a-select> | ||
</a-form-item> | ||
</template> | ||
</template> | ||
{{end}} |