优化访问控制,将“认证”两字改为“鉴权”

This commit is contained in:
GoEdgeLab
2022-08-30 11:22:54 +08:00
parent ba0ae51592
commit 977c89f9e1
22 changed files with 756 additions and 77 deletions

View File

@@ -7457,6 +7457,7 @@ Vue.component("http-auth-config-box", {
teaweb.popup("/servers/server/settings/access/createPopup", {
callback: function (resp) {
that.authConfig.policyRefs.push(resp.data.policyRef)
that.change()
},
height: "28em"
})
@@ -7474,6 +7475,7 @@ Vue.component("http-auth-config-box", {
},
remove: function (index) {
this.authConfig.policyRefs.$remove(index)
this.change()
},
methodName: function (methodType) {
switch (methodType) {
@@ -7481,8 +7483,23 @@ Vue.component("http-auth-config-box", {
return "BasicAuth"
case "subRequest":
return "子请求"
case "typeA":
return "URL鉴权A"
case "typeB":
return "URL鉴权B"
case "typeC":
return "URL鉴权C"
case "typeD":
return "URL鉴权D"
}
return ""
},
change: function () {
let that = this
setTimeout(function () {
// 延时通知,是为了让表单有机会变更数据
that.$emit("change", this.authConfig)
}, 100)
}
},
template: `<div>
@@ -7491,7 +7508,7 @@ Vue.component("http-auth-config-box", {
<prior-checkbox :v-config="authConfig" v-if="vIsLocation"></prior-checkbox>
<tbody v-show="!vIsLocation || authConfig.isPrior">
<tr>
<td class="title">启用认证</td>
<td class="title">启用鉴权</td>
<td>
<div class="ui checkbox">
<input type="checkbox" v-model="authConfig.isOn"/>
@@ -7502,14 +7519,14 @@ Vue.component("http-auth-config-box", {
</tbody>
</table>
<div class="margin"></div>
<!-- 认证方式 -->
<!-- 鉴权方式 -->
<div v-show="isOn()">
<h4>认证方式</h4>
<h4>鉴权方式</h4>
<table class="ui table selectable celled" v-show="authConfig.policyRefs.length > 0">
<thead>
<tr>
<th class="three wide">名称</th>
<th class="three wide">认证方法</th>
<th class="three wide">鉴权方法</th>
<th>参数</th>
<th class="two wide">状态</th>
<th class="two op">操作</th>
@@ -7527,6 +7544,15 @@ Vue.component("http-auth-config-box", {
<span v-if="ref.authPolicy.params.method.length > 0" class="grey">[{{ref.authPolicy.params.method}}]</span>
{{ref.authPolicy.params.url}}
</span>
<span v-if="ref.authPolicy.type == 'typeA'">{{ref.authPolicy.params.signParamName}}/有效期{{ref.authPolicy.params.life}}秒</span>
<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>
<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>
</div>
</td>
<td>
<label-on :v-is-on="ref.authPolicy.isOn"></label-on>
@@ -7538,7 +7564,7 @@ Vue.component("http-auth-config-box", {
</tr>
</tbody>
</table>
<button class="ui button small" type="button" @click.prevent="add">+添加认证方式</button>
<button class="ui button small" type="button" @click.prevent="add">+添加鉴权方式</button>
</div>
<div class="margin"></div>
</div>`