mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-05 14:20:25 +08:00
HTTP Header中支持设置非标Header
This commit is contained in:
@@ -45,14 +45,14 @@ func (this *CreateDeletePopupAction) RunPost(params struct {
|
|||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
policyConfig := &shared.HTTPHeaderPolicy{}
|
var policyConfig = &shared.HTTPHeaderPolicy{}
|
||||||
err = json.Unmarshal(policyConfigResp.HttpHeaderPolicyJSON, policyConfig)
|
err = json.Unmarshal(policyConfigResp.HttpHeaderPolicyJSON, policyConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteHeaders := policyConfig.DeleteHeaders
|
var deleteHeaders = policyConfig.DeleteHeaders
|
||||||
deleteHeaders = append(deleteHeaders, params.Name)
|
deleteHeaders = append(deleteHeaders, params.Name)
|
||||||
_, err = this.RPC().HTTPHeaderPolicyRPC().UpdateHTTPHeaderPolicyDeletingHeaders(this.AdminContext(), &pb.UpdateHTTPHeaderPolicyDeletingHeadersRequest{
|
_, err = this.RPC().HTTPHeaderPolicyRPC().UpdateHTTPHeaderPolicyDeletingHeaders(this.AdminContext(), &pb.UpdateHTTPHeaderPolicyDeletingHeadersRequest{
|
||||||
HttpHeaderPolicyId: params.HeaderPolicyId,
|
HttpHeaderPolicyId: params.HeaderPolicyId,
|
||||||
|
|||||||
@@ -0,0 +1,67 @@
|
|||||||
|
package headers
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"github.com/TeaOSLab/EdgeAdmin/internal/oplogs"
|
||||||
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||||
|
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||||
|
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/shared"
|
||||||
|
"github.com/iwind/TeaGo/actions"
|
||||||
|
)
|
||||||
|
|
||||||
|
type CreateNonStandardPopupAction struct {
|
||||||
|
actionutils.ParentAction
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *CreateNonStandardPopupAction) Init() {
|
||||||
|
this.Nav("", "", "")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *CreateNonStandardPopupAction) RunGet(params struct {
|
||||||
|
HeaderPolicyId int64
|
||||||
|
Type string
|
||||||
|
}) {
|
||||||
|
this.Data["headerPolicyId"] = params.HeaderPolicyId
|
||||||
|
this.Data["type"] = params.Type
|
||||||
|
|
||||||
|
this.Show()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *CreateNonStandardPopupAction) RunPost(params struct {
|
||||||
|
HeaderPolicyId int64
|
||||||
|
Name string
|
||||||
|
|
||||||
|
Must *actions.Must
|
||||||
|
}) {
|
||||||
|
// 日志
|
||||||
|
defer this.CreateLog(oplogs.LevelInfo, "添加非标的Header HeaderPolicyId: %d, Name: %s", params.HeaderPolicyId, params.Name)
|
||||||
|
|
||||||
|
params.Must.
|
||||||
|
Field("name", params.Name).
|
||||||
|
Require("名称不能为空")
|
||||||
|
|
||||||
|
policyConfigResp, err := this.RPC().HTTPHeaderPolicyRPC().FindEnabledHTTPHeaderPolicyConfig(this.AdminContext(), &pb.FindEnabledHTTPHeaderPolicyConfigRequest{HttpHeaderPolicyId: params.HeaderPolicyId})
|
||||||
|
if err != nil {
|
||||||
|
this.ErrorPage(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var policyConfig = &shared.HTTPHeaderPolicy{}
|
||||||
|
err = json.Unmarshal(policyConfigResp.HttpHeaderPolicyJSON, policyConfig)
|
||||||
|
if err != nil {
|
||||||
|
this.ErrorPage(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var nonStandardHeaders = policyConfig.NonStandardHeaders
|
||||||
|
nonStandardHeaders = append(nonStandardHeaders, params.Name)
|
||||||
|
_, err = this.RPC().HTTPHeaderPolicyRPC().UpdateHTTPHeaderPolicyNonStandardHeaders(this.AdminContext(), &pb.UpdateHTTPHeaderPolicyNonStandardHeadersRequest{
|
||||||
|
HttpHeaderPolicyId: params.HeaderPolicyId,
|
||||||
|
HeaderNames: nonStandardHeaders,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
this.ErrorPage(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
this.Success()
|
||||||
|
}
|
||||||
@@ -17,22 +17,22 @@ func (this *DeleteDeletingHeaderAction) RunPost(params struct {
|
|||||||
HeaderName string
|
HeaderName string
|
||||||
}) {
|
}) {
|
||||||
// 日志
|
// 日志
|
||||||
defer this.CreateLog(oplogs.LevelInfo, "删除需要删除的请求Header,HeaderPolicyId:%d, HeaderName:%s", params.HeaderPolicyId, params.HeaderName)
|
defer this.CreateLog(oplogs.LevelInfo, "删除需要删除的Header,HeaderPolicyId:%d, HeaderName:%s", params.HeaderPolicyId, params.HeaderName)
|
||||||
|
|
||||||
policyConfigResp, err := this.RPC().HTTPHeaderPolicyRPC().FindEnabledHTTPHeaderPolicyConfig(this.AdminContext(), &pb.FindEnabledHTTPHeaderPolicyConfigRequest{HttpHeaderPolicyId: params.HeaderPolicyId})
|
policyConfigResp, err := this.RPC().HTTPHeaderPolicyRPC().FindEnabledHTTPHeaderPolicyConfig(this.AdminContext(), &pb.FindEnabledHTTPHeaderPolicyConfigRequest{HttpHeaderPolicyId: params.HeaderPolicyId})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
policyConfigJSON := policyConfigResp.HttpHeaderPolicyJSON
|
var policyConfigJSON = policyConfigResp.HttpHeaderPolicyJSON
|
||||||
policyConfig := &shared.HTTPHeaderPolicy{}
|
var policyConfig = &shared.HTTPHeaderPolicy{}
|
||||||
err = json.Unmarshal(policyConfigJSON, policyConfig)
|
err = json.Unmarshal(policyConfigJSON, policyConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
headerNames := []string{}
|
var headerNames = []string{}
|
||||||
for _, h := range policyConfig.DeleteHeaders {
|
for _, h := range policyConfig.DeleteHeaders {
|
||||||
if h == params.HeaderName {
|
if h == params.HeaderName {
|
||||||
continue
|
continue
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
package headers
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"github.com/TeaOSLab/EdgeAdmin/internal/oplogs"
|
||||||
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||||
|
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||||
|
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/shared"
|
||||||
|
)
|
||||||
|
|
||||||
|
type DeleteNonStandardHeaderAction struct {
|
||||||
|
actionutils.ParentAction
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *DeleteNonStandardHeaderAction) RunPost(params struct {
|
||||||
|
HeaderPolicyId int64
|
||||||
|
HeaderName string
|
||||||
|
}) {
|
||||||
|
// 日志
|
||||||
|
defer this.CreateLog(oplogs.LevelInfo, "删除需要非标的Header,HeaderPolicyId:%d, HeaderName:%s", params.HeaderPolicyId, params.HeaderName)
|
||||||
|
|
||||||
|
policyConfigResp, err := this.RPC().HTTPHeaderPolicyRPC().FindEnabledHTTPHeaderPolicyConfig(this.AdminContext(), &pb.FindEnabledHTTPHeaderPolicyConfigRequest{HttpHeaderPolicyId: params.HeaderPolicyId})
|
||||||
|
if err != nil {
|
||||||
|
this.ErrorPage(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var policyConfigJSON = policyConfigResp.HttpHeaderPolicyJSON
|
||||||
|
var policyConfig = &shared.HTTPHeaderPolicy{}
|
||||||
|
err = json.Unmarshal(policyConfigJSON, policyConfig)
|
||||||
|
if err != nil {
|
||||||
|
this.ErrorPage(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var headerNames = []string{}
|
||||||
|
for _, h := range policyConfig.NonStandardHeaders {
|
||||||
|
if h == params.HeaderName {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
headerNames = append(headerNames, h)
|
||||||
|
}
|
||||||
|
_, err = this.RPC().HTTPHeaderPolicyRPC().UpdateHTTPHeaderPolicyNonStandardHeaders(this.AdminContext(), &pb.UpdateHTTPHeaderPolicyNonStandardHeadersRequest{
|
||||||
|
HttpHeaderPolicyId: params.HeaderPolicyId,
|
||||||
|
HeaderNames: headerNames,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
this.ErrorPage(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
this.Success()
|
||||||
|
}
|
||||||
@@ -18,6 +18,8 @@ func init() {
|
|||||||
GetPost("/updateSetPopup", new(UpdateSetPopupAction)).
|
GetPost("/updateSetPopup", new(UpdateSetPopupAction)).
|
||||||
GetPost("/createDeletePopup", new(CreateDeletePopupAction)).
|
GetPost("/createDeletePopup", new(CreateDeletePopupAction)).
|
||||||
Post("/deleteDeletingHeader", new(DeleteDeletingHeaderAction)).
|
Post("/deleteDeletingHeader", new(DeleteDeletingHeaderAction)).
|
||||||
|
GetPost("/createNonStandardPopup", new(CreateNonStandardPopupAction)).
|
||||||
|
Post("/deleteNonStandardHeader", new(DeleteNonStandardHeaderAction)).
|
||||||
Post("/delete", new(DeleteAction)).
|
Post("/delete", new(DeleteAction)).
|
||||||
GetPost("/updateCORSPopup", new(UpdateCORSPopupAction)).
|
GetPost("/updateCORSPopup", new(UpdateCORSPopupAction)).
|
||||||
EndAll()
|
EndAll()
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ Vue.component("http-header-policy-box", {
|
|||||||
// 请求相关
|
// 请求相关
|
||||||
let requestSettingHeaders = []
|
let requestSettingHeaders = []
|
||||||
let requestDeletingHeaders = []
|
let requestDeletingHeaders = []
|
||||||
|
let requestNonStandardHeaders = []
|
||||||
|
|
||||||
let requestPolicy = this.vRequestHeaderPolicy
|
let requestPolicy = this.vRequestHeaderPolicy
|
||||||
if (requestPolicy != null) {
|
if (requestPolicy != null) {
|
||||||
@@ -38,11 +39,15 @@ Vue.component("http-header-policy-box", {
|
|||||||
if (requestPolicy.deleteHeaders != null) {
|
if (requestPolicy.deleteHeaders != null) {
|
||||||
requestDeletingHeaders = requestPolicy.deleteHeaders
|
requestDeletingHeaders = requestPolicy.deleteHeaders
|
||||||
}
|
}
|
||||||
|
if (requestPolicy.nonStandardHeaders != null) {
|
||||||
|
requestNonStandardHeaders = requestPolicy.nonStandardHeaders
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 响应相关
|
// 响应相关
|
||||||
let responseSettingHeaders = []
|
let responseSettingHeaders = []
|
||||||
let responseDeletingHeaders = []
|
let responseDeletingHeaders = []
|
||||||
|
let responseNonStandardHeaders = []
|
||||||
|
|
||||||
let responsePolicy = this.vResponseHeaderPolicy
|
let responsePolicy = this.vResponseHeaderPolicy
|
||||||
if (responsePolicy != null) {
|
if (responsePolicy != null) {
|
||||||
@@ -52,6 +57,9 @@ Vue.component("http-header-policy-box", {
|
|||||||
if (responsePolicy.deleteHeaders != null) {
|
if (responsePolicy.deleteHeaders != null) {
|
||||||
responseDeletingHeaders = responsePolicy.deleteHeaders
|
responseDeletingHeaders = responsePolicy.deleteHeaders
|
||||||
}
|
}
|
||||||
|
if (responsePolicy.nonStandardHeaders != null) {
|
||||||
|
responseNonStandardHeaders = responsePolicy.nonStandardHeaders
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let responseCORS = {
|
let responseCORS = {
|
||||||
@@ -64,12 +72,16 @@ Vue.component("http-header-policy-box", {
|
|||||||
return {
|
return {
|
||||||
type: type,
|
type: type,
|
||||||
typeName: (type == "request") ? "请求" : "响应",
|
typeName: (type == "request") ? "请求" : "响应",
|
||||||
|
|
||||||
requestHeaderRef: requestHeaderRef,
|
requestHeaderRef: requestHeaderRef,
|
||||||
responseHeaderRef: responseHeaderRef,
|
responseHeaderRef: responseHeaderRef,
|
||||||
requestSettingHeaders: requestSettingHeaders,
|
requestSettingHeaders: requestSettingHeaders,
|
||||||
requestDeletingHeaders: requestDeletingHeaders,
|
requestDeletingHeaders: requestDeletingHeaders,
|
||||||
|
requestNonStandardHeaders: requestNonStandardHeaders,
|
||||||
|
|
||||||
responseSettingHeaders: responseSettingHeaders,
|
responseSettingHeaders: responseSettingHeaders,
|
||||||
responseDeletingHeaders: responseDeletingHeaders,
|
responseDeletingHeaders: responseDeletingHeaders,
|
||||||
|
responseNonStandardHeaders: responseNonStandardHeaders,
|
||||||
responseCORS: responseCORS
|
responseCORS: responseCORS
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -93,6 +105,13 @@ Vue.component("http-header-policy-box", {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
addNonStandardHeader: function (policyId, type) {
|
||||||
|
teaweb.popup("/servers/server/settings/headers/createNonStandardPopup?" + this.vParams + "&headerPolicyId=" + policyId + "&type=" + type, {
|
||||||
|
callback: function () {
|
||||||
|
teaweb.successRefresh("保存成功")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
updateSettingPopup: function (policyId, headerId) {
|
updateSettingPopup: function (policyId, headerId) {
|
||||||
teaweb.popup("/servers/server/settings/headers/updateSetPopup?" + this.vParams + "&headerPolicyId=" + policyId + "&headerId=" + headerId + "&type=" + this.type, {
|
teaweb.popup("/servers/server/settings/headers/updateSetPopup?" + this.vParams + "&headerPolicyId=" + policyId + "&headerId=" + headerId + "&type=" + this.type, {
|
||||||
callback: function () {
|
callback: function () {
|
||||||
@@ -111,6 +130,17 @@ Vue.component("http-header-policy-box", {
|
|||||||
.refresh()
|
.refresh()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
deleteNonStandardHeader: function (policyId, headerName) {
|
||||||
|
teaweb.confirm("确定要删除'" + headerName + "'吗?", function () {
|
||||||
|
Tea.action("/servers/server/settings/headers/deleteNonStandardHeader")
|
||||||
|
.params({
|
||||||
|
headerPolicyId: policyId,
|
||||||
|
headerName: headerName
|
||||||
|
})
|
||||||
|
.post()
|
||||||
|
.refresh()
|
||||||
|
})
|
||||||
|
},
|
||||||
deleteHeader: function (policyId, type, headerId) {
|
deleteHeader: function (policyId, type, headerId) {
|
||||||
teaweb.confirm("确定要删除此Header吗?", function () {
|
teaweb.confirm("确定要删除此Header吗?", function () {
|
||||||
this.$post("/servers/server/settings/headers/delete")
|
this.$post("/servers/server/settings/headers/delete")
|
||||||
@@ -186,12 +216,12 @@ Vue.component("http-header-policy-box", {
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h4>删除请求Header</h4>
|
<h4>其他设置</h4>
|
||||||
<p class="comment">这里可以设置需要从请求中删除的Header。</p>
|
|
||||||
|
|
||||||
<table class="ui table definition selectable">
|
<table class="ui table definition selectable">
|
||||||
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="title">需要删除的Header</td>
|
<td class="title">删除Header <tip-icon content="可以通过此功能删除转发到源站的请求报文中不需要的Header"></tip-icon></td>
|
||||||
<td>
|
<td>
|
||||||
<div v-if="requestDeletingHeaders.length > 0">
|
<div v-if="requestDeletingHeaders.length > 0">
|
||||||
<div class="ui label small basic" v-for="headerName in requestDeletingHeaders">{{headerName}} <a href=""><i class="icon remove" title="删除" @click.prevent="deleteDeletingHeader(vRequestHeaderPolicy.id, headerName)"></i></a> </div>
|
<div class="ui label small basic" v-for="headerName in requestDeletingHeaders">{{headerName}} <a href=""><i class="icon remove" title="删除" @click.prevent="deleteDeletingHeader(vRequestHeaderPolicy.id, headerName)"></i></a> </div>
|
||||||
@@ -200,6 +230,17 @@ Vue.component("http-header-policy-box", {
|
|||||||
<button class="ui button small" type="button" @click.prevent="addDeletingHeader(vRequestHeaderPolicy.id, 'request')">+</button>
|
<button class="ui button small" type="button" @click.prevent="addDeletingHeader(vRequestHeaderPolicy.id, 'request')">+</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="title">非标Header <tip-icon content="可以通过此功能设置转发到源站的请求报文中非标准的Header,比如hello_world"></tip-icon></td>
|
||||||
|
<td>
|
||||||
|
<div v-if="requestNonStandardHeaders.length > 0">
|
||||||
|
<div class="ui label small basic" v-for="headerName in requestNonStandardHeaders">{{headerName}} <a href=""><i class="icon remove" title="删除" @click.prevent="deleteNonStandardHeader(vRequestHeaderPolicy.id, headerName)"></i></a> </div>
|
||||||
|
<div class="ui divider" ></div>
|
||||||
|
</div>
|
||||||
|
<button class="ui button small" type="button" @click.prevent="addNonStandardHeader(vRequestHeaderPolicy.id, 'request')">+</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -254,25 +295,30 @@ Vue.component("http-header-policy-box", {
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h4>删除响应Header</h4>
|
<h4>其他设置</h4>
|
||||||
<p class="comment">这里可以设置需要从响应中删除的Header。</p>
|
|
||||||
|
|
||||||
<table class="ui table definition selectable">
|
<table class="ui table definition selectable">
|
||||||
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="title">需要删除的Header</td>
|
<td class="title">删除Header <tip-icon content="可以通过此功能删除响应报文中不需要的Header"></tip-icon></td>
|
||||||
<td>
|
<td>
|
||||||
<div v-if="responseDeletingHeaders.length > 0">
|
<div v-if="responseDeletingHeaders.length > 0">
|
||||||
<div class="ui label small basic" v-for="headerName in responseDeletingHeaders">{{headerName}} <a href=""><i class="icon remove" title="删除" @click.prevent="deleteDeletingHeader(vResponseHeaderPolicy.id, headerName)"></i></a> </div>
|
<div class="ui label small basic" v-for="headerName in responseDeletingHeaders">{{headerName}} <a href=""><i class="icon remove small" title="删除" @click.prevent="deleteDeletingHeader(vResponseHeaderPolicy.id, headerName)"></i></a></div>
|
||||||
<div class="ui divider" ></div>
|
<div class="ui divider" ></div>
|
||||||
</div>
|
</div>
|
||||||
<button class="ui button small" type="button" @click.prevent="addDeletingHeader(vResponseHeaderPolicy.id, 'response')">+</button>
|
<button class="ui button small" type="button" @click.prevent="addDeletingHeader(vResponseHeaderPolicy.id, 'response')">+</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
<tr>
|
||||||
|
<td>非标Header <tip-icon content="可以通过此功能设置响应报文中非标准的Header,比如hello_world"></tip-icon></td>
|
||||||
<h4>其他设置</h4>
|
<td>
|
||||||
|
<div v-if="responseNonStandardHeaders.length > 0">
|
||||||
<table class="ui table definition selectable">
|
<div class="ui label small basic" v-for="headerName in responseNonStandardHeaders">{{headerName}} <a href=""><i class="icon remove small" title="删除" @click.prevent="deleteNonStandardHeader(vResponseHeaderPolicy.id, headerName)"></i></a></div>
|
||||||
|
<div class="ui divider" ></div>
|
||||||
|
</div>
|
||||||
|
<button class="ui button small" type="button" @click.prevent="addNonStandardHeader(vResponseHeaderPolicy.id, 'response')">+</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="title">CORS自适应跨域</td>
|
<td class="title">CORS自适应跨域</td>
|
||||||
<td>
|
<td>
|
||||||
@@ -280,6 +326,7 @@ Vue.component("http-header-policy-box", {
|
|||||||
<p class="comment"><span v-if="!responseCORS.isOn">启用后,服务器可以</span><span v-else>服务器会</span>自动生成<code-label>Access-Control-*-*</code-label>相关的Header。</p>
|
<p class="comment"><span v-if="!responseCORS.isOn">启用后,服务器可以</span><span v-else>服务器会</span>自动生成<code-label>Access-Control-*-*</code-label>相关的Header。</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
{$layout "layout_popup"}
|
||||||
|
|
||||||
|
<h3>添加非标Header</h3>
|
||||||
|
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
||||||
|
<input type="hidden" name="headerPolicyId" :value="headerPolicyId"/>
|
||||||
|
<table class="ui table definition selectable">
|
||||||
|
<tr>
|
||||||
|
<td class="title">名称<em>(Name)</em></td>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="name" maxlength="100" ref="focus" v-model="headerName"/>
|
||||||
|
<p class="comment">比如<code-label>hello_world</code-label>。</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<submit-btn></submit-btn>
|
||||||
|
</form>
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
Tea.context(function () {
|
||||||
|
this.headerName = ""
|
||||||
|
|
||||||
|
this.selectHeader = function (headerName) {
|
||||||
|
this.headerName = headerName
|
||||||
|
}
|
||||||
|
})
|
||||||
Reference in New Issue
Block a user