mirror of
				https://github.com/TeaOSLab/EdgeAdmin.git
				synced 2025-11-04 21:50:28 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			33 lines
		
	
	
		
			817 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
		
			817 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
Vue.component("ssl-certs-view", {
 | 
						|
	props: ["v-certs"],
 | 
						|
	data: function () {
 | 
						|
		let certs = this.vCerts
 | 
						|
		if (certs == null) {
 | 
						|
			certs = []
 | 
						|
		}
 | 
						|
		return {
 | 
						|
			certs: certs
 | 
						|
		}
 | 
						|
	},
 | 
						|
	methods: {
 | 
						|
		// 格式化时间
 | 
						|
		formatTime: function (timestamp) {
 | 
						|
			return new Date(timestamp * 1000).format("Y-m-d")
 | 
						|
		},
 | 
						|
 | 
						|
		// 查看详情
 | 
						|
		viewCert: function (certId) {
 | 
						|
			teaweb.popup("/servers/certs/certPopup?certId=" + certId, {
 | 
						|
				height: "28em",
 | 
						|
				width: "48em"
 | 
						|
			})
 | 
						|
		}
 | 
						|
	},
 | 
						|
	template: `<div>
 | 
						|
	<div v-if="certs != null && certs.length > 0">
 | 
						|
		<div class="ui label small" v-for="(cert, index) in certs">
 | 
						|
			{{cert.name}} / {{cert.dnsNames}} / 有效至{{formatTime(cert.timeEndAt)}}  <a href="" title="查看" @click.prevent="viewCert(cert.id)"><i class="icon external alternate"></i></a>
 | 
						|
		</div>
 | 
						|
	</div>
 | 
						|
</div>`
 | 
						|
}) |