Files
EdgeAdmin/web/public/js/components/server/server-uam.js

68 lines
1.9 KiB
JavaScript
Raw Normal View History

2022-03-29 21:25:30 +08:00
// UAM模式配置
Vue.component("uam-config-box", {
props: ["v-uam-config", "v-is-location", "v-is-group"],
2022-03-29 21:25:30 +08:00
data: function () {
let config = this.vUamConfig
if (config == null) {
config = {
isPrior: false,
2023-03-06 21:48:29 +08:00
isOn: false,
onlyURLPatterns: [],
exceptURLPatterns: []
2022-03-29 21:25:30 +08:00
}
}
2023-03-06 21:48:29 +08:00
if (config.onlyURLPatterns == null) {
config.onlyURLPatterns = []
}
if (config.exceptURLPatterns == null) {
config.exceptURLPatterns = []
}
2022-03-29 21:25:30 +08:00
return {
2023-03-06 21:48:29 +08:00
config: config,
moreOptionsVisible: false
}
},
methods: {
showMoreOptions: function () {
this.moreOptionsVisible = !this.moreOptionsVisible
2022-03-29 21:25:30 +08:00
}
},
template: `<div>
<input type="hidden" name="uamJSON" :value="JSON.stringify(config)"/>
<table class="ui table definition selectable">
<prior-checkbox :v-config="config" v-if="vIsLocation || vIsGroup"></prior-checkbox>
<tbody v-show="((!vIsLocation && !vIsGroup) || config.isPrior)">
<tr>
<td class="title">启用5秒盾</td>
<td>
<checkbox v-model="config.isOn"></checkbox>
<p class="comment"><plus-label></plus-label>访访</p>
</td>
</tr>
</tbody>
2023-03-06 21:48:29 +08:00
<tbody>
<tr>
<td colspan="2"><more-options-indicator @change="showMoreOptions"></more-options-indicator></td>
</tr>
</tbody>
<tbody v-show="moreOptionsVisible">
<tr>
<td>例外URL</td>
<td>
<url-patterns-box v-model="config.exceptURLPatterns"></url-patterns-box>
<p class="comment">如果填写了例外URL表示这些URL跳过5秒盾不做处理</p>
</td>
</tr>
<tr>
<td>限制URL</td>
<td>
<url-patterns-box v-model="config.onlyURLPatterns"></url-patterns-box>
<p class="comment">如果填写了支持URL表示只对这些URL进行5秒盾处理如果不填则表示支持所有的URL</p>
</td>
</tr>
</tr>
</tbody>
2022-03-29 21:25:30 +08:00
</table>
<div class="margin"></div>
</div>`
})