mirror of
				https://github.com/TeaOSLab/EdgeAdmin.git
				synced 2025-11-04 13:10:26 +08:00 
			
		
		
		
	优化HTTP报头界面
This commit is contained in:
		@@ -29,6 +29,8 @@ func (this *CreateSetPopupAction) RunGet(params struct {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (this *CreateSetPopupAction) RunPost(params struct {
 | 
			
		||||
	Type string
 | 
			
		||||
 | 
			
		||||
	HeaderPolicyId int64
 | 
			
		||||
	Name           string
 | 
			
		||||
	Value          string
 | 
			
		||||
@@ -44,7 +46,11 @@ func (this *CreateSetPopupAction) RunPost(params struct {
 | 
			
		||||
	Must *actions.Must
 | 
			
		||||
}) {
 | 
			
		||||
	// 日志
 | 
			
		||||
	defer this.CreateLogInfo(codes.ServerHTTPHeader_LogCreateSettingHeader, params.HeaderPolicyId, params.Name, params.Value)
 | 
			
		||||
	if params.Type == "request" {
 | 
			
		||||
		defer this.CreateLogInfo(codes.ServerHTTPHeader_LogCreateSettingRequestHeader, params.HeaderPolicyId, params.Name, params.Value)
 | 
			
		||||
	} else {
 | 
			
		||||
		defer this.CreateLogInfo(codes.ServerHTTPHeader_LogCreateSettingResponseHeader, params.HeaderPolicyId, params.Name, params.Value)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	params.Name = strings.TrimSuffix(params.Name, ":")
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -200,7 +200,7 @@ Vue.component("http-header-policy-box", {
 | 
			
		||||
				<tbody v-for="header in requestSettingHeaders">
 | 
			
		||||
					<tr>
 | 
			
		||||
						<td class="five wide">
 | 
			
		||||
							{{header.name}}
 | 
			
		||||
							<a href="" @click.prevent="updateSettingPopup(vRequestHeaderPolicy.id, header.id)">{{header.name}} <i class="icon expand small"></i></a>
 | 
			
		||||
							<div>
 | 
			
		||||
								<span v-if="header.status != null && header.status.codes != null && !header.status.always"><grey-label v-for="code in header.status.codes" :key="code">{{code}}</grey-label></span>
 | 
			
		||||
								<span v-if="header.methods != null && header.methods.length > 0"><grey-label v-for="method in header.methods" :key="method">{{method}}</grey-label></span>
 | 
			
		||||
@@ -274,7 +274,7 @@ Vue.component("http-header-policy-box", {
 | 
			
		||||
				<tbody v-for="header in responseSettingHeaders">
 | 
			
		||||
					<tr>
 | 
			
		||||
						<td class="five wide">
 | 
			
		||||
							{{header.name}}
 | 
			
		||||
							<a href="" @click.prevent="updateSettingPopup(vResponseHeaderPolicy.id, header.id)">{{header.name}} <i class="icon expand small"></i></a>
 | 
			
		||||
							<div>
 | 
			
		||||
								<span v-if="header.status != null && header.status.codes != null && !header.status.always"><grey-label v-for="code in header.status.codes" :key="code">{{code}}</grey-label></span>
 | 
			
		||||
								<span v-if="header.methods != null && header.methods.length > 0"><grey-label v-for="method in header.methods" :key="method">{{method}}</grey-label></span>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,10 @@
 | 
			
		||||
{$layout "layout_popup"}
 | 
			
		||||
<h3>设置报头</h3>
 | 
			
		||||
<h3 v-if="type == 'request'">添加自定义请求报头</h3>
 | 
			
		||||
<h3 v-if="type == 'response'">添加自定义响应报头</h3>
 | 
			
		||||
 | 
			
		||||
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
 | 
			
		||||
	<input type="hidden" name="headerPolicyId" :value="headerPolicyId"/>
 | 
			
		||||
    <input type="hidden" name="type" :value="type"/>
 | 
			
		||||
	<table class="ui table definition selectable">
 | 
			
		||||
		<tr>
 | 
			
		||||
			<td class="title">报头名称<em>(Name)</em> *</td>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,9 +1,11 @@
 | 
			
		||||
{$layout "layout_popup"}
 | 
			
		||||
<h3>修改报头</h3>
 | 
			
		||||
<h3 v-if="type == 'request'">修改自定义请求报头</h3>
 | 
			
		||||
<h3 v-if="type == 'response'">修改自定义响应报头</h3>
 | 
			
		||||
 | 
			
		||||
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
 | 
			
		||||
	<input type="hidden" name="headerPolicyId" :value="headerPolicyId"/>
 | 
			
		||||
	<input type="hidden" name="headerId" :value="headerId"/>
 | 
			
		||||
    <input type="hidden" name="type" :value="type"/>
 | 
			
		||||
	<table class="ui table definition selectable">
 | 
			
		||||
		<tr>
 | 
			
		||||
			<td class="title">报头名称<em>(Name)</em> *</td>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user