@@ -3427,7 +3432,7 @@ example2.com
启用CC无感防护 |
-
+
|
@@ -5307,7 +5312,7 @@ example2.com
`}),Vue.component("second-menu",{template:' \t\t'}),Vue.component("loading-message",{template:`
`}),Vue.component("file-textarea",{props:["value"],data:function(){let e=this.value;return{realValue:e="string"!=typeof e?"":e}},mounted:function(){},methods:{dragover:function(){},drop:function(e){let t=this;e.dataTransfer.items[0].getAsFile().text().then(function(e){t.setValue(e)})},setValue:function(e){this.realValue=e}},template:'
'}),Vue.component("more-options-angle",{data:function(){return{isVisible:!1}},methods:{show:function(){this.isVisible=!this.isVisible,this.$emit("change",this.isVisible)}},template:'
更多选项收起选项'}),Vue.component("columns-grid",{props:[],mounted:function(){this.columns=this.calculateColumns();let e=this;window.addEventListener("resize",function(){e.columns=e.calculateColumns()})},data:function(){return{columns:"four"}},methods:{calculateColumns:function(){var e=window.innerWidth;let i=Math.floor(e/250);0==i&&(i=1);var n=this.$el.getElementsByClassName("column");if(0!=n.length){e=n.length;i>e&&(i=e);for(let t=0;t
+ `}),Vue.component("file-textarea",{props:["value"],data:function(){let e=this.value;return{realValue:e="string"!=typeof e?"":e}},mounted:function(){},methods:{dragover:function(){},drop:function(e){let t=this;e.dataTransfer.items[0].getAsFile().text().then(function(e){t.setValue(e)})},setValue:function(e){this.realValue=e},focus:function(){this.$refs.textarea.focus()}},template:'
'}),Vue.component("more-options-angle",{data:function(){return{isVisible:!1}},methods:{show:function(){this.isVisible=!this.isVisible,this.$emit("change",this.isVisible)}},template:'
更多选项收起选项'}),Vue.component("columns-grid",{props:[],mounted:function(){this.columns=this.calculateColumns();let e=this;window.addEventListener("resize",function(){e.columns=e.calculateColumns()})},data:function(){return{columns:"four"}},methods:{calculateColumns:function(){var e=window.innerWidth;let i=Math.floor(e/250);0==i&&(i=1);var n=this.$el.getElementsByClassName("column");if(0!=n.length){e=n.length;i>e&&(i=e);for(let t=0;t
`}),Vue.component("inner-menu-item",{props:["href","active","code"],data:function(){var e,t=this.active;return void 0===t&&(e="",t=(e=void 0!==window.TEA.ACTION.data.firstMenuItem?window.TEA.ACTION.data.firstMenuItem:e)==this.code),{vHref:null==this.href?"":this.href,vActive:t}},template:'\t\t[] \t\t'}),Vue.component("health-check-config-box",{props:["v-health-check-config","v-check-domain-url"],data:function(){let t=this.vHealthCheckConfig,i="http",n="",s="/",o="";if(null==t){t={isOn:!1,url:"",interval:{count:60,unit:"second"},statusCodes:[200],timeout:{count:10,unit:"second"},countTries:3,tryDelay:{count:100,unit:"ms"},autoDown:!0,countUp:1,countDown:3,userAgent:"",onlyBasicRequest:!0,accessLogIsOn:!0};let e=this;setTimeout(function(){e.changeURL()},500)}else{try{let e=new URL(t.url);i=e.protocol.substring(0,e.protocol.length-1);var a=(o="%24%7Bhost%7D"==(o=e.host)?"${host}":o).indexOf(":");0
@@ -5467,9 +5472,9 @@ example2.com
diff --git a/web/public/js/components.src.js b/web/public/js/components.src.js
index f3b69a38..6941accd 100755
--- a/web/public/js/components.src.js
+++ b/web/public/js/components.src.js
@@ -1139,7 +1139,7 @@ Vue.component("message-row", {
@@ -3616,7 +3616,11 @@ Vue.component("http-request-conds-box", {
})
Vue.component("ssl-config-box", {
- props: ["v-ssl-policy", "v-protocol", "v-server-id"],
+ props: [
+ "v-ssl-policy",
+ "v-protocol",
+ "v-server-id"
+ ],
created: function () {
let that = this
setTimeout(function () {
@@ -3724,12 +3728,23 @@ Vue.component("ssl-config-box", {
selectedCertIds.push(cert.id.toString())
})
}
- teaweb.popup("/servers/certs/selectPopup?selectedCertIds=" + selectedCertIds, {
+ let serverId = this.vServerId
+ if (serverId == null) {
+ serverId = 0
+ }
+ teaweb.popup("/servers/certs/selectPopup?selectedCertIds=" + selectedCertIds + "&serverId=" + serverId, {
width: "50em",
height: "30em",
callback: function (resp) {
- that.policy.certRefs.push(resp.data.certRef)
- that.policy.certs.push(resp.data.cert)
+ if (resp.data.cert != null && resp.data.certRef != null) {
+ that.policy.certRefs.push(resp.data.certRef)
+ that.policy.certs.push(resp.data.cert)
+ }
+ if (resp.data.certs != null && resp.data.certRefs != null) {
+ that.policy.certRefs.$pushAll(resp.data.certRefs)
+ that.policy.certs.$pushAll(resp.data.certs)
+ }
+ that.$forceUpdate()
}
})
},
@@ -3737,8 +3752,12 @@ Vue.component("ssl-config-box", {
// 上传证书
uploadCert: function () {
let that = this
- teaweb.popup("/servers/certs/uploadPopup", {
- height: "28em",
+ let serverId = this.vServerId
+ if (typeof serverId != "number" && typeof serverId != "string") {
+ serverId = 0
+ }
+ teaweb.popup("/servers/certs/uploadPopup?serverId=" + serverId, {
+ height: "30em",
callback: function (resp) {
teaweb.success("上传成功", function () {
that.policy.certRefs.push(resp.data.certRef)
@@ -3748,6 +3767,28 @@ Vue.component("ssl-config-box", {
})
},
+ // 批量上传
+ uploadBatch: function () {
+ let that = this
+ let serverId = this.vServerId
+ if (typeof serverId != "number" && typeof serverId != "string") {
+ serverId = 0
+ }
+ teaweb.popup("/servers/certs/uploadBatchPopup?serverId=" + serverId, {
+ callback: function (resp) {
+ if (resp.data.cert != null) {
+ that.policy.certRefs.push(resp.data.certRef)
+ that.policy.certs.push(resp.data.cert)
+ }
+ if (resp.data.certs != null) {
+ that.policy.certRefs.$pushAll(resp.data.certRefs)
+ that.policy.certs.$pushAll(resp.data.certs)
+ }
+ that.$forceUpdate()
+ }
+ })
+ },
+
// 申请证书
requestCert: function () {
// 已经在证书中的域名
@@ -3929,8 +3970,15 @@ Vue.component("ssl-config-box", {
width: "50em",
height: "30em",
callback: function (resp) {
- that.policy.clientCARefs.push(resp.data.certRef)
- that.policy.clientCACerts.push(resp.data.cert)
+ if (resp.data.cert != null && resp.data.certRef != null) {
+ that.policy.clientCARefs.push(resp.data.certRef)
+ that.policy.clientCACerts.push(resp.data.cert)
+ }
+ if (resp.data.certs != null && resp.data.certRefs != null) {
+ that.policy.clientCARefs.$pushAll(resp.data.certRefs)
+ that.policy.clientCACerts.$pushAll(resp.data.certs)
+ }
+ that.$forceUpdate()
}
})
},
@@ -3986,7 +4034,10 @@ Vue.component("ssl-config-box", {
+ |
+
+ |
@@ -4142,7 +4193,7 @@ Vue.component("ssl-config-box", {
客户端认证CA证书 |
-
+
{{cert.name}} / {{cert.dnsNames}} / 有效至{{formatTime(cert.timeEndAt)}}
@@ -4352,7 +4403,9 @@ Vue.component("ssl-certs-box", {
"v-protocol", // 协议:https|tls
"v-view-size", // 弹窗尺寸:normal, mini
"v-single-mode", // 单证书模式
- "v-description" // 描述文字
+ "v-description", // 描述文字
+ "v-domains", // 搜索的域名列表或者函数
+ "v-user-id" // 用户ID
],
data: function () {
let certs = this.vCerts
@@ -4390,8 +4443,8 @@ Vue.component("ssl-certs-box", {
// 选择证书
selectCert: function () {
let that = this
- let width = "50em"
- let height = "30em"
+ let width = "54em"
+ let height = "32em"
let viewSize = this.vViewSize
if (viewSize == null) {
viewSize = "normal"
@@ -4400,11 +4453,41 @@ Vue.component("ssl-certs-box", {
width = "35em"
height = "20em"
}
- teaweb.popup("/servers/certs/selectPopup?viewSize=" + viewSize, {
+
+ let searchingDomains = []
+ if (this.vDomains != null) {
+ if (typeof this.vDomains == "function") {
+ let resultDomains = this.vDomains()
+ if (resultDomains != null && typeof resultDomains == "object" && (resultDomains instanceof Array)) {
+ searchingDomains = resultDomains
+ }
+ } else if (typeof this.vDomains == "object" && (this.vDomains instanceof Array)) {
+ searchingDomains = this.vDomains
+ }
+ if (searchingDomains.length > 10000) {
+ searchingDomains = searchingDomains.slice(0, 10000)
+ }
+ }
+
+ let selectedCertIds = this.certs.map(function (cert) {
+ return cert.id
+ })
+ let userId = this.vUserId
+ if (userId == null) {
+ userId = 0
+ }
+
+ teaweb.popup("/servers/certs/selectPopup?viewSize=" + viewSize + "&searchingDomains=" + window.encodeURIComponent(searchingDomains.join(",")) + "&selectedCertIds=" + selectedCertIds.join(",") + "&userId=" + userId, {
width: width,
height: height,
callback: function (resp) {
- that.certs.push(resp.data.cert)
+ if (resp.data.cert != null) {
+ that.certs.push(resp.data.cert)
+ }
+ if (resp.data.certs != null) {
+ that.certs.$pushAll(resp.data.certs)
+ }
+ that.$forceUpdate()
}
})
},
@@ -4412,16 +4495,46 @@ Vue.component("ssl-certs-box", {
// 上传证书
uploadCert: function () {
let that = this
- teaweb.popup("/servers/certs/uploadPopup", {
+ let userId = this.vUserId
+ if (typeof userId != "number" && typeof userId != "string") {
+ userId = 0
+ }
+ teaweb.popup("/servers/certs/uploadPopup?userId=" + userId, {
height: "28em",
callback: function (resp) {
teaweb.success("上传成功", function () {
- that.certs.push(resp.data.cert)
+ if (resp.data.cert != null) {
+ that.certs.push(resp.data.cert)
+ }
+ if (resp.data.certs != null) {
+ that.certs.$pushAll(resp.data.certs)
+ }
+ that.$forceUpdate()
})
}
})
},
+ // 批量上传
+ uploadBatch: function () {
+ let that = this
+ let userId = this.vUserId
+ if (typeof userId != "number" && typeof userId != "string") {
+ userId = 0
+ }
+ teaweb.popup("/servers/certs/uploadBatchPopup?userId=" + userId, {
+ callback: function (resp) {
+ if (resp.data.cert != null) {
+ that.certs.push(resp.data.cert)
+ }
+ if (resp.data.certs != null) {
+ that.certs.$pushAll(resp.data.certs)
+ }
+ that.$forceUpdate()
+ }
+ })
+ },
+
// 格式化时间
formatTime: function (timestamp) {
return new Date(timestamp * 1000).format("Y-m-d")
@@ -4447,7 +4560,9 @@ Vue.component("ssl-certs-box", {
+ |
+
`
})
@@ -7026,80 +7141,102 @@ Vue.component("http-rewrite-labels-label", {
})
Vue.component("server-name-box", {
- props: ["v-server-names"],
- data: function () {
- let serverNames = this.vServerNames;
- if (serverNames == null) {
- serverNames = []
- }
- return {
- serverNames: serverNames,
- isSearching: false,
- keyword: ""
- }
- },
- methods: {
- addServerName: function () {
- window.UPDATING_SERVER_NAME = null
- let that = this
- teaweb.popup("/servers/addServerNamePopup", {
- callback: function (resp) {
- var serverName = resp.data.serverName
- that.serverNames.push(serverName)
- }
- });
- },
+ props: ["v-server-names"],
+ data: function () {
+ let serverNames = this.vServerNames;
+ if (serverNames == null) {
+ serverNames = []
+ }
+ return {
+ serverNames: serverNames,
+ isSearching: false,
+ keyword: ""
+ }
+ },
+ methods: {
+ addServerName: function () {
+ window.UPDATING_SERVER_NAME = null
+ let that = this
+ teaweb.popup("/servers/addServerNamePopup", {
+ callback: function (resp) {
+ var serverName = resp.data.serverName
+ that.serverNames.push(serverName)
+ }
+ });
+ },
- removeServerName: function (index) {
- this.serverNames.$remove(index)
- },
+ removeServerName: function (index) {
+ this.serverNames.$remove(index)
+ },
- updateServerName: function (index, serverName) {
- window.UPDATING_SERVER_NAME = teaweb.clone(serverName)
- let that = this
- teaweb.popup("/servers/addServerNamePopup", {
- callback: function (resp) {
- var serverName = resp.data.serverName
- Vue.set(that.serverNames, index, serverName)
- }
- });
- },
- showSearchBox: function () {
- this.isSearching = !this.isSearching
- if (this.isSearching) {
- let that = this
- setTimeout(function () {
- that.$refs.keywordRef.focus()
- }, 200)
- } else {
- this.keyword = ""
- }
- },
- },
- watch: {
- keyword: function (v) {
- this.serverNames.forEach(function (serverName) {
- if (v.length == 0) {
- serverName.isShowing = true
- return
- }
- if (serverName.subNames == null || serverName.subNames.length == 0) {
- if (!teaweb.match(serverName.name, v)) {
- serverName.isShowing = false
- }
- } else {
- let found = false
- serverName.subNames.forEach(function (subName) {
- if (teaweb.match(subName, v)) {
- found = true
- }
- })
- serverName.isShowing = found
- }
- })
- }
- },
- template: `
+ updateServerName: function (index, serverName) {
+ window.UPDATING_SERVER_NAME = teaweb.clone(serverName)
+ let that = this
+ teaweb.popup("/servers/addServerNamePopup", {
+ callback: function (resp) {
+ var serverName = resp.data.serverName
+ Vue.set(that.serverNames, index, serverName)
+ }
+ });
+ },
+ showSearchBox: function () {
+ this.isSearching = !this.isSearching
+ if (this.isSearching) {
+ let that = this
+ setTimeout(function () {
+ that.$refs.keywordRef.focus()
+ }, 200)
+ } else {
+ this.keyword = ""
+ }
+ },
+ allServerNames: function () {
+ if (this.serverNames == null) {
+ return []
+ }
+ let result = []
+ this.serverNames.forEach(function (serverName) {
+ if (serverName.subNames != null && serverName.subNames.length > 0) {
+ serverName.subNames.forEach(function (subName) {
+ if (subName != null && subName.length > 0) {
+ if (!result.$contains(subName)) {
+ result.push(subName)
+ }
+ }
+ })
+ } else if (serverName.name != null && serverName.name.length > 0) {
+ if (!result.$contains(serverName.name)) {
+ result.push(serverName.name)
+ }
+ }
+ })
+ return result
+ }
+ },
+ watch: {
+ keyword: function (v) {
+ this.serverNames.forEach(function (serverName) {
+ if (v.length == 0) {
+ serverName.isShowing = true
+ return
+ }
+ if (serverName.subNames == null || serverName.subNames.length == 0) {
+ if (!teaweb.match(serverName.name, v)) {
+ serverName.isShowing = false
+ }
+ } else {
+ let found = false
+ serverName.subNames.forEach(function (subName) {
+ if (teaweb.match(subName, v)) {
+ found = true
+ }
+ })
+ serverName.isShowing = found
+ }
+ })
+ }
+ },
+ template: `
@@ -9621,8 +9758,6 @@ Vue.component("http-compression-config-box", {
Vue.component("http-cc-config-box", {
props: ["v-cc-config", "v-is-location", "v-is-group"],
data: function () {
-
-
let config = this.vCcConfig
if (config == null) {
config = {
@@ -9667,7 +9802,7 @@ Vue.component("http-cc-config-box", {
启用CC无感防护 |
-
+
|
@@ -15685,6 +15820,9 @@ Vue.component("file-textarea", {
},
setValue: function (value) {
this.realValue = value
+ },
+ focus: function () {
+ this.$refs.textarea.focus()
}
},
template: ` `
@@ -16417,9 +16555,9 @@ Vue.component("combo-box", {
|