优化证书上传和修改界面

This commit is contained in:
GoEdgeLab
2022-04-01 11:12:42 +08:00
parent e84b12a6ec
commit 67602604dd
4 changed files with 16 additions and 6 deletions

View File

@@ -23,15 +23,15 @@
</td>
</tr>
<tr>
<td>选择证书文件</td>
<td><span v-if="textMode">输入证书内容</span><span v-else>选择证书文件</span></td>
<td>
<input type="file" name="certFile" accept="application/x-pem-file, application/pkcs10, application/x-pkcs12, application/x-x509-user-cert, application/x-x509-ca-cert, application/pkix-cert" v-if="!textMode"/>
<textarea class="wide-code" spellcheck="false" name="certText" placeholder="-----BEGIN CERTIFICATE-----" v-if="textMode" style="font-size: 0.7em"></textarea>
<textarea class="wide-code" ref="certTextField" spellcheck="false" name="certText" placeholder="-----BEGIN CERTIFICATE-----" v-if="textMode" style="font-size: 0.7em"></textarea>
<p class="comment"><a href="" @click.prevent="switchTextMode">[<span v-if="!textMode">输入内容</span><span v-else>上传文件</span>]</a>。文件内容中通常含有"-----BEGIN CERTIFICATE-----"类似的信息。</p>
</td>
</tr>
<tr v-show="isCA == 0">
<td>选择私钥文件</td>
<td><span v-if="textMode">输入私钥内容</span><span v-else>选择私钥文件</span></td>
<td>
<input type="file" name="keyFile" accept="application/pkcs8" v-if="!textMode"/>
<textarea class="wide-code" spellcheck="false" name="keyText" placeholder="-----BEGIN RSA PRIVATE KEY-----" v-if="textMode" style="font-size: 0.7em"></textarea>

View File

@@ -5,5 +5,10 @@ Tea.context(function () {
this.switchTextMode = function () {
this.textMode = !this.textMode
if (this.textMode) {
this.$delay(function () {
this.$refs.certTextField.focus()
})
}
}
})

View File

@@ -22,15 +22,15 @@
</td>
</tr>
<tr>
<td>选择证书文件 *</td>
<td><span v-if="textMode">输入证书内容</span><span v-else>选择证书文件</span> *</td>
<td>
<input type="file" name="certFile" accept="application/x-pem-file, application/pkcs10, application/x-pkcs12, application/x-x509-user-cert, application/x-x509-ca-cert, application/pkix-cert" v-if="!textMode"/>
<textarea class="wide-code" spellcheck="false" name="certText" placeholder="-----BEGIN CERTIFICATE-----" v-if="textMode" style="font-size: 0.7em"></textarea>
<textarea class="wide-code" ref="certTextField" spellcheck="false" name="certText" placeholder="-----BEGIN CERTIFICATE-----" v-if="textMode" style="font-size: 0.7em"></textarea>
<p class="comment"><a href="" @click.prevent="switchTextMode">[<span v-if="!textMode">输入内容</span><span v-else>上传文件</span>]</a>。文件内容中通常含有"-----BEGIN CERTIFICATE-----"类似的信息。</p>
</td>
</tr>
<tr v-show="isCA == 0">
<td>选择私钥文件 *</td>
<td><span v-if="textMode">输入私钥内容</span><span v-else>选择私钥文件</span> *</td>
<td>
<input type="file" name="keyFile" accept="application/pkcs8" v-if="!textMode"/>
<textarea class="wide-code" spellcheck="false" name="keyText" placeholder="-----BEGIN RSA PRIVATE KEY-----" v-if="textMode" style="font-size: 0.7em"></textarea>

View File

@@ -5,5 +5,10 @@ Tea.context(function () {
this.switchTextMode = function () {
this.textMode = !this.textMode
if (this.textMode) {
this.$delay(function () {
this.$refs.certTextField.focus()
})
}
}
})