mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2026-05-20 20:35:24 +08:00
实现自动匹配证书和批量选择证书功能
This commit is contained in:
@@ -11,4 +11,67 @@ Tea.context(function () {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.encodeURL = function (arg) {
|
||||
return window.encodeURIComponent(arg)
|
||||
}
|
||||
|
||||
/**
|
||||
* 复选框
|
||||
*/
|
||||
this.countChecked = 0
|
||||
|
||||
this.certs.forEach(function (cert) {
|
||||
cert.isChecked = false
|
||||
})
|
||||
|
||||
this.changeAll = function (b) {
|
||||
let that = this
|
||||
this.certs.forEach(function (cert) {
|
||||
cert.isChecked = b
|
||||
})
|
||||
|
||||
if (b) {
|
||||
let countChecked = 0
|
||||
this.certs.forEach(function (cert, index) {
|
||||
if (cert.isChecked && !that.certInfos[index].isSelected) {
|
||||
countChecked++
|
||||
}
|
||||
})
|
||||
this.countChecked = countChecked
|
||||
} else {
|
||||
this.countChecked = 0
|
||||
}
|
||||
}
|
||||
|
||||
this.changeCertChecked = function () {
|
||||
let countChecked = 0
|
||||
this.certs.forEach(function (cert) {
|
||||
if (cert.isChecked) {
|
||||
countChecked++
|
||||
}
|
||||
})
|
||||
this.countChecked = countChecked
|
||||
}
|
||||
|
||||
this.confirmChecked = function () {
|
||||
let resultCerts = []
|
||||
let resultCertRefs = []
|
||||
this.certs.forEach(function (cert) {
|
||||
if (cert.isChecked) {
|
||||
resultCerts.push(cert)
|
||||
resultCertRefs.push({
|
||||
isOn: true,
|
||||
certId: cert.id
|
||||
})
|
||||
}
|
||||
})
|
||||
NotifyPopup({
|
||||
code: 200,
|
||||
data: {
|
||||
certs: resultCerts,
|
||||
certRefs: resultCertRefs
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user