mirror of
				https://github.com/TeaOSLab/EdgeAdmin.git
				synced 2025-11-04 05:00:25 +08:00 
			
		
		
		
	优化证书上传和修改界面
This commit is contained in:
		@@ -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>
 | 
			
		||||
 
 | 
			
		||||
@@ -5,5 +5,10 @@ Tea.context(function () {
 | 
			
		||||
 | 
			
		||||
	this.switchTextMode = function () {
 | 
			
		||||
		this.textMode = !this.textMode
 | 
			
		||||
		if (this.textMode) {
 | 
			
		||||
			this.$delay(function () {
 | 
			
		||||
				this.$refs.certTextField.focus()
 | 
			
		||||
			})
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
})
 | 
			
		||||
@@ -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>
 | 
			
		||||
 
 | 
			
		||||
@@ -5,5 +5,10 @@ Tea.context(function () {
 | 
			
		||||
 | 
			
		||||
	this.switchTextMode = function () {
 | 
			
		||||
		this.textMode = !this.textMode
 | 
			
		||||
		if (this.textMode) {
 | 
			
		||||
			this.$delay(function () {
 | 
			
		||||
				this.$refs.certTextField.focus()
 | 
			
		||||
			})
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
})
 | 
			
		||||
		Reference in New Issue
	
	Block a user