mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-24 18:50:26 +08:00
将公用IP名单默认改成全局名单,自动应用于所有服务
This commit is contained in:
@@ -29,6 +29,7 @@ func (this *CreatePopupAction) RunPost(params struct {
|
|||||||
Name string
|
Name string
|
||||||
Type string
|
Type string
|
||||||
Description string
|
Description string
|
||||||
|
IsGlobal bool
|
||||||
|
|
||||||
Must *actions.Must
|
Must *actions.Must
|
||||||
CSRF *actionutils.CSRF
|
CSRF *actionutils.CSRF
|
||||||
@@ -49,6 +50,7 @@ func (this *CreatePopupAction) RunPost(params struct {
|
|||||||
TimeoutJSON: nil,
|
TimeoutJSON: nil,
|
||||||
IsPublic: true,
|
IsPublic: true,
|
||||||
Description: params.Description,
|
Description: params.Description,
|
||||||
|
IsGlobal: params.IsGlobal,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ func (this *IndexAction) RunGet(params struct {
|
|||||||
"description": list.Description,
|
"description": list.Description,
|
||||||
"countItems": countItems,
|
"countItems": countItems,
|
||||||
"type": list.Type,
|
"type": list.Type,
|
||||||
|
"isGlobal": list.IsGlobal,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.Data["lists"] = listMaps
|
this.Data["lists"] = listMaps
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ func InitIPList(action *actionutils.ParentAction, listId int64) error {
|
|||||||
"description": list.Description,
|
"description": list.Description,
|
||||||
"isOn": list.IsOn,
|
"isOn": list.IsOn,
|
||||||
"countItems": countItems,
|
"countItems": countItems,
|
||||||
|
"isGlobal": list.IsGlobal,
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,13 @@
|
|||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>是否全局</td>
|
||||||
|
<td>
|
||||||
|
<checkbox name="isGlobal" checked="checked"></checkbox>
|
||||||
|
<p class="comment">如果选择为全局有效,则所有服务都自动使用此名单,否则只有在WAF策略中绑定此名单后才会生效。</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>备注</td>
|
<td>备注</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -33,7 +33,10 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tr v-for="list in lists">
|
<tr v-for="list in lists">
|
||||||
<td class="center">{{list.id}}</td>
|
<td class="center">{{list.id}}</td>
|
||||||
<td><a :href="'/servers/iplists/list?listId=' + list.id"><keyword :v-word="keyword">{{list.name}}</keyword></a></td>
|
<td>
|
||||||
|
<a :href="'/servers/iplists/list?listId=' + list.id"><keyword :v-word="keyword">{{list.name}}</keyword></a>
|
||||||
|
<div v-if="list.isGlobal" style="margin-top: 0.3em"><grey-label>全局</grey-label></div>
|
||||||
|
</td>
|
||||||
<td class="center">
|
<td class="center">
|
||||||
<span v-if="list.type == 'black'">黑名单</span>
|
<span v-if="list.type == 'black'">黑名单</span>
|
||||||
<span v-if="list.type == 'white'">白名单</span>
|
<span v-if="list.type == 'white'">白名单</span>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
Tea.context(function () {
|
Tea.context(function () {
|
||||||
this.createList = function () {
|
this.createList = function () {
|
||||||
teaweb.popup(Tea.url(".createPopup", {type: this.type}), {
|
teaweb.popup(Tea.url(".createPopup", {type: this.type}), {
|
||||||
|
height: "24em",
|
||||||
callback: function (resp) {
|
callback: function (resp) {
|
||||||
teaweb.success("保存成功", function () {
|
teaweb.success("保存成功", function () {
|
||||||
window.location = "/servers/iplists?type=" + resp.data.list.type
|
window.location = "/servers/iplists?type=" + resp.data.list.type
|
||||||
|
|||||||
@@ -14,6 +14,13 @@
|
|||||||
{{list.typeName}}
|
{{list.typeName}}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>是否全局</td>
|
||||||
|
<td>
|
||||||
|
<span v-if="list.isGlobal" class="green">Y</span>
|
||||||
|
<span v-else class="disabled">N</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>备注</td>
|
<td>备注</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
Reference in New Issue
Block a user