1.5.0
This commit is contained in:
@@ -12,10 +12,18 @@ Vue.component("http-auth-config-box", {
|
||||
if (authConfig.policyRefs == null) {
|
||||
authConfig.policyRefs = []
|
||||
}
|
||||
return {
|
||||
return {
|
||||
authConfig: authConfig
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
"authConfig.isOn": function () {
|
||||
this.change()
|
||||
},
|
||||
"authConfig.isPrior": function () {
|
||||
this.change()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
isOn: function () {
|
||||
return (!this.vIsLocation || this.authConfig.isPrior) && this.authConfig.isOn
|
||||
@@ -27,18 +35,17 @@ Vue.component("http-auth-config-box", {
|
||||
that.authConfig.policyRefs.push(resp.data.policyRef)
|
||||
that.change()
|
||||
},
|
||||
height: "28em"
|
||||
height: "32em"
|
||||
})
|
||||
},
|
||||
update: function (index, policyId) {
|
||||
let that = this
|
||||
teaweb.popup("/servers/server/settings/access/updatePopup?policyId=" + policyId, {
|
||||
callback: function (resp) {
|
||||
callback: function () {
|
||||
teaweb.success("保存成功", function () {
|
||||
teaweb.reload()
|
||||
})
|
||||
},
|
||||
height: "28em"
|
||||
height: "32em"
|
||||
})
|
||||
},
|
||||
remove: function (index) {
|
||||
@@ -59,14 +66,15 @@ Vue.component("http-auth-config-box", {
|
||||
return "URL鉴权C"
|
||||
case "typeD":
|
||||
return "URL鉴权D"
|
||||
case "typeE":
|
||||
return "URL鉴权E"
|
||||
}
|
||||
return ""
|
||||
},
|
||||
change: function () {
|
||||
let that = this
|
||||
setTimeout(function () {
|
||||
// 延时通知,是为了让表单有机会变更数据
|
||||
that.$emit("change", this.authConfig)
|
||||
that.$emit("change", that.authConfig)
|
||||
}, 100)
|
||||
}
|
||||
},
|
||||
@@ -87,7 +95,6 @@ Vue.component("http-auth-config-box", {
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="margin"></div>
|
||||
<!-- 鉴权方式 -->
|
||||
<div v-show="isOn()">
|
||||
<h4>鉴权方式</h4>
|
||||
<table class="ui table selectable celled" v-show="authConfig.policyRefs.length > 0">
|
||||
@@ -103,9 +110,7 @@ Vue.component("http-auth-config-box", {
|
||||
<tbody v-for="(ref, index) in authConfig.policyRefs" :key="ref.authPolicyId">
|
||||
<tr>
|
||||
<td>{{ref.authPolicy.name}}</td>
|
||||
<td>
|
||||
{{methodName(ref.authPolicy.type)}}
|
||||
</td>
|
||||
<td>{{methodName(ref.authPolicy.type)}}</td>
|
||||
<td>
|
||||
<span v-if="ref.authPolicy.type == 'basicAuth'">{{ref.authPolicy.params.users.length}}个用户</span>
|
||||
<span v-if="ref.authPolicy.type == 'subRequest'">
|
||||
@@ -116,7 +121,7 @@ Vue.component("http-auth-config-box", {
|
||||
<span v-if="ref.authPolicy.type == 'typeB'">有效期{{ref.authPolicy.params.life}}秒</span>
|
||||
<span v-if="ref.authPolicy.type == 'typeC'">有效期{{ref.authPolicy.params.life}}秒</span>
|
||||
<span v-if="ref.authPolicy.type == 'typeD'">{{ref.authPolicy.params.signParamName}}/{{ref.authPolicy.params.timestampParamName}}/有效期{{ref.authPolicy.params.life}}秒</span>
|
||||
|
||||
<span v-if="ref.authPolicy.type == 'typeE'">路径模式/有效期{{ref.authPolicy.params.life}}秒</span>
|
||||
<div v-if="(ref.authPolicy.params.exts != null && ref.authPolicy.params.exts.length > 0) || (ref.authPolicy.params.domains != null && ref.authPolicy.params.domains.length > 0)">
|
||||
<grey-label v-if="ref.authPolicy.params.exts != null" v-for="ext in ref.authPolicy.params.exts">扩展名:{{ext}}</grey-label>
|
||||
<grey-label v-if="ref.authPolicy.params.domains != null" v-for="domain in ref.authPolicy.params.domains">域名:{{domain}}</grey-label>
|
||||
@@ -136,4 +141,4 @@ Vue.component("http-auth-config-box", {
|
||||
</div>
|
||||
<div class="margin"></div>
|
||||
</div>`
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user