mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-13 03:40:27 +08:00
自定义页面增加例外URL和限制URL设置
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
|||||||
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
|
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
|
||||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
|
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
|
||||||
|
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/shared"
|
||||||
"github.com/iwind/TeaGo/actions"
|
"github.com/iwind/TeaGo/actions"
|
||||||
"github.com/iwind/TeaGo/types"
|
"github.com/iwind/TeaGo/types"
|
||||||
)
|
)
|
||||||
@@ -31,15 +32,21 @@ func (this *CreatePopupAction) RunPost(params struct {
|
|||||||
URL string `alias:"url"`
|
URL string `alias:"url"`
|
||||||
Body string
|
Body string
|
||||||
|
|
||||||
|
ExceptURLPatternsJSON []byte
|
||||||
|
OnlyURLPatternsJSON []byte
|
||||||
|
|
||||||
NewStatus int
|
NewStatus int
|
||||||
Must *actions.Must
|
Must *actions.Must
|
||||||
}) {
|
}) {
|
||||||
// TODO 对状态码进行更多校验
|
|
||||||
|
|
||||||
params.Must.
|
params.Must.
|
||||||
Field("status", params.Status).
|
Field("status", params.Status).
|
||||||
Require("请输入响应状态码")
|
Require("请输入响应状态码")
|
||||||
|
|
||||||
|
if len(params.Status) != 3 {
|
||||||
|
this.FailField("status", "状态码长度必须为3位")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
switch params.BodyType {
|
switch params.BodyType {
|
||||||
case serverconfigs.HTTPPageBodyTypeURL:
|
case serverconfigs.HTTPPageBodyTypeURL:
|
||||||
params.Must.
|
params.Must.
|
||||||
@@ -62,12 +69,32 @@ func (this *CreatePopupAction) RunPost(params struct {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var exceptURLPatterns = []*shared.URLPattern{}
|
||||||
|
if len(params.ExceptURLPatternsJSON) > 0 {
|
||||||
|
err := json.Unmarshal(params.ExceptURLPatternsJSON, &exceptURLPatterns)
|
||||||
|
if err != nil {
|
||||||
|
this.ErrorPage(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var onlyURLPatterns = []*shared.URLPattern{}
|
||||||
|
if len(params.OnlyURLPatternsJSON) > 0 {
|
||||||
|
err := json.Unmarshal(params.OnlyURLPatternsJSON, &onlyURLPatterns)
|
||||||
|
if err != nil {
|
||||||
|
this.ErrorPage(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
createResp, err := this.RPC().HTTPPageRPC().CreateHTTPPage(this.AdminContext(), &pb.CreateHTTPPageRequest{
|
createResp, err := this.RPC().HTTPPageRPC().CreateHTTPPage(this.AdminContext(), &pb.CreateHTTPPageRequest{
|
||||||
StatusList: []string{params.Status},
|
StatusList: []string{params.Status},
|
||||||
BodyType: params.BodyType,
|
BodyType: params.BodyType,
|
||||||
Url: params.URL,
|
Url: params.URL,
|
||||||
Body: params.Body,
|
Body: params.Body,
|
||||||
NewStatus: types.Int32(params.NewStatus),
|
NewStatus: types.Int32(params.NewStatus),
|
||||||
|
ExceptURLPatternsJSON: params.ExceptURLPatternsJSON,
|
||||||
|
OnlyURLPatternsJSON: params.OnlyURLPatternsJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import (
|
|||||||
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
|
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
|
||||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
|
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
|
||||||
|
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/shared"
|
||||||
"github.com/iwind/TeaGo/actions"
|
"github.com/iwind/TeaGo/actions"
|
||||||
"github.com/iwind/TeaGo/types"
|
"github.com/iwind/TeaGo/types"
|
||||||
)
|
)
|
||||||
@@ -29,12 +30,18 @@ func (this *UpdatePopupAction) RunGet(params struct {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
pageConfig := &serverconfigs.HTTPPageConfig{}
|
var pageConfig = &serverconfigs.HTTPPageConfig{}
|
||||||
err = json.Unmarshal(configResp.PageJSON, pageConfig)
|
err = json.Unmarshal(configResp.PageJSON, pageConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if pageConfig.ExceptURLPatterns == nil {
|
||||||
|
pageConfig.ExceptURLPatterns = []*shared.URLPattern{}
|
||||||
|
}
|
||||||
|
if pageConfig.OnlyURLPatterns == nil {
|
||||||
|
pageConfig.OnlyURLPatterns = []*shared.URLPattern{}
|
||||||
|
}
|
||||||
this.Data["pageConfig"] = pageConfig
|
this.Data["pageConfig"] = pageConfig
|
||||||
|
|
||||||
this.Show()
|
this.Show()
|
||||||
@@ -49,6 +56,9 @@ func (this *UpdatePopupAction) RunPost(params struct {
|
|||||||
URL string `alias:"url"`
|
URL string `alias:"url"`
|
||||||
Body string
|
Body string
|
||||||
|
|
||||||
|
ExceptURLPatternsJSON []byte
|
||||||
|
OnlyURLPatternsJSON []byte
|
||||||
|
|
||||||
NewStatus int
|
NewStatus int
|
||||||
|
|
||||||
Must *actions.Must
|
Must *actions.Must
|
||||||
@@ -60,6 +70,11 @@ func (this *UpdatePopupAction) RunPost(params struct {
|
|||||||
Field("status", params.Status).
|
Field("status", params.Status).
|
||||||
Require("请输入响应状态码")
|
Require("请输入响应状态码")
|
||||||
|
|
||||||
|
if len(params.Status) != 3 {
|
||||||
|
this.FailField("status", "状态码长度必须为3位")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
switch params.BodyType {
|
switch params.BodyType {
|
||||||
case serverconfigs.HTTPPageBodyTypeURL:
|
case serverconfigs.HTTPPageBodyTypeURL:
|
||||||
params.Must.
|
params.Must.
|
||||||
@@ -82,6 +97,24 @@ func (this *UpdatePopupAction) RunPost(params struct {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var exceptURLPatterns = []*shared.URLPattern{}
|
||||||
|
if len(params.ExceptURLPatternsJSON) > 0 {
|
||||||
|
err := json.Unmarshal(params.ExceptURLPatternsJSON, &exceptURLPatterns)
|
||||||
|
if err != nil {
|
||||||
|
this.ErrorPage(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var onlyURLPatterns = []*shared.URLPattern{}
|
||||||
|
if len(params.OnlyURLPatternsJSON) > 0 {
|
||||||
|
err := json.Unmarshal(params.OnlyURLPatternsJSON, &onlyURLPatterns)
|
||||||
|
if err != nil {
|
||||||
|
this.ErrorPage(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_, err := this.RPC().HTTPPageRPC().UpdateHTTPPage(this.AdminContext(), &pb.UpdateHTTPPageRequest{
|
_, err := this.RPC().HTTPPageRPC().UpdateHTTPPage(this.AdminContext(), &pb.UpdateHTTPPageRequest{
|
||||||
HttpPageId: params.PageId,
|
HttpPageId: params.PageId,
|
||||||
StatusList: []string{params.Status},
|
StatusList: []string{params.Status},
|
||||||
@@ -89,6 +122,8 @@ func (this *UpdatePopupAction) RunPost(params struct {
|
|||||||
Url: params.URL,
|
Url: params.URL,
|
||||||
Body: params.Body,
|
Body: params.Body,
|
||||||
NewStatus: types.Int32(params.NewStatus),
|
NewStatus: types.Int32(params.NewStatus),
|
||||||
|
ExceptURLPatternsJSON: params.ExceptURLPatternsJSON,
|
||||||
|
OnlyURLPatternsJSON: params.OnlyURLPatternsJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ Vue.component("url-patterns-box", {
|
|||||||
if (this.value != null) {
|
if (this.value != null) {
|
||||||
patterns = this.value
|
patterns = this.value
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
patterns: patterns,
|
patterns: patterns,
|
||||||
isAdding: false,
|
isAdding: false,
|
||||||
@@ -12,7 +13,9 @@ Vue.component("url-patterns-box", {
|
|||||||
addingPattern: {"type": "wildcard", "pattern": ""},
|
addingPattern: {"type": "wildcard", "pattern": ""},
|
||||||
editingIndex: -1,
|
editingIndex: -1,
|
||||||
|
|
||||||
patternIsInvalid: false
|
patternIsInvalid: false,
|
||||||
|
|
||||||
|
windowIsSmall: window.innerWidth < 600
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -105,7 +108,7 @@ Vue.component("url-patterns-box", {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-show="isAdding" style="margin-top: 0.5em">
|
<div v-show="isAdding" style="margin-top: 0.5em">
|
||||||
<div class="ui fields inline">
|
<div :class="{'ui fields inline': !windowIsSmall}">
|
||||||
<div class="ui field">
|
<div class="ui field">
|
||||||
<select class="ui dropdown auto-width" v-model="addingPattern.type">
|
<select class="ui dropdown auto-width" v-model="addingPattern.type">
|
||||||
<option value="wildcard">通配符</option>
|
<option value="wildcard">通配符</option>
|
||||||
|
|||||||
@@ -118,32 +118,38 @@ Vue.component("http-pages-and-shutdown-box", {
|
|||||||
|
|
||||||
<p class="comment" style="padding-top: 0; margin-top: 0">根据响应状态码返回一些自定义页面,比如404,500等错误页面。</p>
|
<p class="comment" style="padding-top: 0; margin-top: 0">根据响应状态码返回一些自定义页面,比如404,500等错误页面。</p>
|
||||||
|
|
||||||
<div v-if="pages.length > 0" style="max-width: 30em">
|
<div v-if="pages.length > 0">
|
||||||
<table class="ui table selectable celled">
|
<table class="ui table selectable celled">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="four wide">响应状态码</th>
|
<th class="two wide">响应状态码</th>
|
||||||
<th>页面类型</th>
|
<th>页面类型</th>
|
||||||
<th style="width: 6.5em">操作</th>
|
<th class="two wide">新状态码</th>
|
||||||
|
<th>例外URL</th>
|
||||||
|
<th>限制URL</th>
|
||||||
|
<th class="two op">操作</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tr v-for="(page,index) in pages">
|
<tr v-for="(page,index) in pages">
|
||||||
<td>
|
<td>
|
||||||
|
<a href="" @click.prevent="updatePage(index, page.id)">
|
||||||
<span v-if="page.status != null && page.status.length == 1">{{page.status[0]}}</span>
|
<span v-if="page.status != null && page.status.length == 1">{{page.status[0]}}</span>
|
||||||
<span v-else>{{page.status}}</span>
|
<span v-else>{{page.status}}</span>
|
||||||
|
|
||||||
|
<i class="icon expand small"></i>
|
||||||
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td style="word-break: break-all">
|
<td style="word-break: break-all">
|
||||||
<div v-if="page.bodyType == 'url'">
|
<div v-if="page.bodyType == 'url'">
|
||||||
{{page.url}}
|
{{page.url}}
|
||||||
<div>
|
<div>
|
||||||
<grey-label>读取</grey-label>
|
<grey-label>读取URL</grey-label>
|
||||||
<grey-label v-if="page.newStatus > 0">{{page.newStatus}}</grey-label>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="page.bodyType == 'redirectURL'">
|
<div v-if="page.bodyType == 'redirectURL'">
|
||||||
{{page.url}}
|
{{page.url}}
|
||||||
<div>
|
<div>
|
||||||
<grey-label>跳转</grey-label>
|
<grey-label>跳转URL</grey-label>
|
||||||
<grey-label v-if="page.newStatus > 0">{{page.newStatus}}</grey-label>
|
<grey-label v-if="page.newStatus > 0">{{page.newStatus}}</grey-label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -154,6 +160,22 @@ Vue.component("http-pages-and-shutdown-box", {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
<span v-if="page.newStatus > 0">{{page.newStatus}}</span>
|
||||||
|
<span v-else class="disabled">保持</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div v-if="page.exceptURLPatterns != null && page.exceptURLPatterns">
|
||||||
|
<span v-for="urlPattern in page.exceptURLPatterns" class="ui basic label small">{{urlPattern.pattern}}</span>
|
||||||
|
</div>
|
||||||
|
<span v-else class="disabled">-</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div v-if="page.onlyURLPatterns != null && page.onlyURLPatterns">
|
||||||
|
<span v-for="urlPattern in page.onlyURLPatterns" class="ui basic label small">{{urlPattern.pattern}}</span>
|
||||||
|
</div>
|
||||||
|
<span v-else class="disabled">-</span>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="" title="修改" @click.prevent="updatePage(index, page.id)">修改</a>
|
<a href="" title="修改" @click.prevent="updatePage(index, page.id)">修改</a>
|
||||||
<a href="" title="删除" @click.prevent="removePage(index)">删除</a>
|
<a href="" title="删除" @click.prevent="removePage(index)">删除</a>
|
||||||
|
|||||||
@@ -59,32 +59,38 @@ Vue.component("http-pages-box", {
|
|||||||
template: `<div>
|
template: `<div>
|
||||||
<input type="hidden" name="pagesJSON" :value="JSON.stringify(pages)"/>
|
<input type="hidden" name="pagesJSON" :value="JSON.stringify(pages)"/>
|
||||||
|
|
||||||
<div v-if="pages.length > 0" style="max-width: 30em">
|
<div v-if="pages.length > 0">
|
||||||
<table class="ui table selectable celled">
|
<table class="ui table selectable celled">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="four wide">响应状态码</th>
|
<th class="two wide">响应状态码</th>
|
||||||
<th>页面类型</th>
|
<th>页面类型</th>
|
||||||
<th style="width: 6.5em">操作</th>
|
<th class="two wide">新状态码</th>
|
||||||
|
<th>例外URL</th>
|
||||||
|
<th>限制URL</th>
|
||||||
|
<th class="two op">操作</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tr v-for="(page,index) in pages">
|
<tr v-for="(page,index) in pages">
|
||||||
<td>
|
<td>
|
||||||
|
<a href="" @click.prevent="updatePage(index, page.id)">
|
||||||
<span v-if="page.status != null && page.status.length == 1">{{page.status[0]}}</span>
|
<span v-if="page.status != null && page.status.length == 1">{{page.status[0]}}</span>
|
||||||
<span v-else>{{page.status}}</span>
|
<span v-else>{{page.status}}</span>
|
||||||
|
|
||||||
|
<i class="icon expand small"></i>
|
||||||
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td style="word-break: break-all">
|
<td style="word-break: break-all">
|
||||||
<div v-if="page.bodyType == 'url'">
|
<div v-if="page.bodyType == 'url'">
|
||||||
{{page.url}}
|
{{page.url}}
|
||||||
<div>
|
<div>
|
||||||
<grey-label>读取</grey-label>
|
<grey-label>读取URL</grey-label>
|
||||||
<grey-label v-if="page.newStatus > 0">{{page.newStatus}}</grey-label>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="page.bodyType == 'redirectURL'">
|
<div v-if="page.bodyType == 'redirectURL'">
|
||||||
{{page.url}}
|
{{page.url}}
|
||||||
<div>
|
<div>
|
||||||
<grey-label>跳转</grey-label>
|
<grey-label>跳转URL</grey-label>
|
||||||
<grey-label v-if="page.newStatus > 0">{{page.newStatus}}</grey-label>
|
<grey-label v-if="page.newStatus > 0">{{page.newStatus}}</grey-label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -95,6 +101,22 @@ Vue.component("http-pages-box", {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
<span v-if="page.newStatus > 0">{{page.newStatus}}</span>
|
||||||
|
<span v-else class="disabled">保持</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div v-if="page.exceptURLPatterns != null && page.exceptURLPatterns">
|
||||||
|
<span v-for="urlPattern in page.exceptURLPatterns" class="ui basic label small">{{urlPattern.pattern}}</span>
|
||||||
|
</div>
|
||||||
|
<span v-else class="disabled">-</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div v-if="page.onlyURLPatterns != null && page.onlyURLPatterns">
|
||||||
|
<span v-for="urlPattern in page.onlyURLPatterns" class="ui basic label small">{{urlPattern.pattern}}</span>
|
||||||
|
</div>
|
||||||
|
<span v-else class="disabled">-</span>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="" title="修改" @click.prevent="updatePage(index, page.id)">修改</a>
|
<a href="" title="修改" @click.prevent="updatePage(index, page.id)">修改</a>
|
||||||
<a href="" title="删除" @click.prevent="removePage(index)">删除</a>
|
<a href="" title="删除" @click.prevent="removePage(index)">删除</a>
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
{$layout "layout_popup"}
|
{$layout "layout_popup"}
|
||||||
<h3>添加自定义页面</h3>
|
<h3>添加自定义页面</h3>
|
||||||
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
||||||
|
<input type="hidden" name="exceptURLPatternsJSON" :value="JSON.stringify(exceptURLPatterns)"/>
|
||||||
|
<input type="hidden" name="onlyURLPatternsJSON" :value="JSON.stringify(onlyURLPatterns)"/>
|
||||||
|
|
||||||
<table class="ui table selectable definition">
|
<table class="ui table selectable definition">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="title">响应状态码 *</td>
|
<td class="title">响应状态码 *</td>
|
||||||
@@ -20,7 +23,7 @@
|
|||||||
<tr v-show="bodyType == 'html'">
|
<tr v-show="bodyType == 'html'">
|
||||||
<td>显示页面HTML *</td>
|
<td>显示页面HTML *</td>
|
||||||
<td>
|
<td>
|
||||||
<textarea name="body" ref="htmlBody"></textarea>
|
<textarea name="body" ref="htmlBody" rows="7"></textarea>
|
||||||
<p class="comment"><a href="" @click.prevent="addHTMLTemplate">[使用模板]</a>。填写页面的HTML内容,支持请求变量。</p>
|
<p class="comment"><a href="" @click.prevent="addHTMLTemplate">[使用模板]</a>。填写页面的HTML内容,支持请求变量。</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -38,6 +41,18 @@
|
|||||||
<p class="comment">将会跳转到此URL。</p>
|
<p class="comment">将会跳转到此URL。</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2"><more-options-indicator></more-options-indicator></td>
|
||||||
|
</tr>
|
||||||
|
<tbody v-show="moreOptionsVisible">
|
||||||
|
<tr>
|
||||||
|
<td>例外URL <tip-icon content="对这些URL将不做任何限制。"></tip-icon></td>
|
||||||
|
<td><url-patterns-box v-model="exceptURLPatterns"></url-patterns-box></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>限制URL <tip-icon content="只对这些URL做限制。"></tip-icon></td>
|
||||||
|
<td><url-patterns-box v-model="onlyURLPatterns"></url-patterns-box></td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>新状态码</td>
|
<td>新状态码</td>
|
||||||
<td>
|
<td>
|
||||||
@@ -45,6 +60,7 @@
|
|||||||
<p class="comment">可以用来修改响应的状态码,不填表示不改变原有状态码。</p>
|
<p class="comment">可以用来修改响应的状态码,不填表示不改变原有状态码。</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<submit-btn></submit-btn>
|
<submit-btn></submit-btn>
|
||||||
</form>
|
</form>
|
||||||
@@ -22,4 +22,7 @@ Tea.context(function () {
|
|||||||
</body>
|
</body>
|
||||||
</html>`
|
</html>`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.exceptURLPatterns = []
|
||||||
|
this.onlyURLPatterns = []
|
||||||
})
|
})
|
||||||
@@ -2,6 +2,8 @@
|
|||||||
<h3>修改自定义页面</h3>
|
<h3>修改自定义页面</h3>
|
||||||
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
||||||
<input type="hidden" name="pageId" :value="pageConfig.id"/>
|
<input type="hidden" name="pageId" :value="pageConfig.id"/>
|
||||||
|
<input type="hidden" name="exceptURLPatternsJSON" :value="JSON.stringify(pageConfig.exceptURLPatterns)"/>
|
||||||
|
<input type="hidden" name="onlyURLPatternsJSON" :value="JSON.stringify(pageConfig.onlyURLPatterns)"/>
|
||||||
<table class="ui table selectable definition">
|
<table class="ui table selectable definition">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="title">响应状态码 *</td>
|
<td class="title">响应状态码 *</td>
|
||||||
@@ -39,6 +41,18 @@
|
|||||||
<p class="comment">将会跳转到此URL。</p>
|
<p class="comment">将会跳转到此URL。</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2"><more-options-indicator></more-options-indicator></td>
|
||||||
|
</tr>
|
||||||
|
<tbody v-show="moreOptionsVisible">
|
||||||
|
<tr>
|
||||||
|
<td>例外URL <tip-icon content="对这些URL将不做任何限制。"></tip-icon></td>
|
||||||
|
<td><url-patterns-box v-model="pageConfig.exceptURLPatterns"></url-patterns-box></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>限制URL <tip-icon content="只对这些URL做限制。"></tip-icon></td>
|
||||||
|
<td><url-patterns-box v-model="pageConfig.onlyURLPatterns"></url-patterns-box></td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>新状态码</td>
|
<td>新状态码</td>
|
||||||
<td>
|
<td>
|
||||||
@@ -46,6 +60,7 @@
|
|||||||
<p class="comment">可以用来修改响应的状态码,不填表示不改变原有状态码。</p>
|
<p class="comment">可以用来修改响应的状态码,不填表示不改变原有状态码。</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<submit-btn></submit-btn>
|
<submit-btn></submit-btn>
|
||||||
</form>
|
</form>
|
||||||
Reference in New Issue
Block a user