{$layout "layout_popup"}

<!-- <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>
			<td>
				<input type="text" name="name" value="" v-model="headerConfig.name" maxlength="200" placeholder="类似于Server、Content-Type之类" ref="focus"/>
                <p class="comment"><http-header-assistant :v-type="type" :v-value="headerConfig.name" @select="selectHeader"></http-header-assistant>请注意报头名称的大小写，如无特殊需求，报头名称的格式通常为<code-label>Xxx</code-label>或者<code-label>Xxx-Yyy</code-label>。</p>
			</td>
		</tr>
		<tr>
			<td>值<em>（Value）</em></td>
			<td>
				<input type="text" name="value" v-model="headerConfig.value" maxlength="500"/>
                <p class="comment">可以包含请求变量。</p>
			</td>
		</tr>
        <tr>
            <td colspan="2"><more-options-indicator>更多选项</more-options-indicator></td>
        </tr>
        <tbody v-show="moreOptionsVisible">
            <tr v-show="type == 'response'">
                <td>支持的状态码</td>
                <td>
                    <http-status-box :v-status-list="statusList"></http-status-box>
                    <p class="comment">不填表示支持所有的状态码。</p>
                </td>
            </tr>
            <tr>
                <td>支持的请求方法</td>
                <td><http-methods-box :v-methods="headerConfig.methods"></http-methods-box></td>
            </tr>
            <tr>
                <td>支持的域名</td>
                <td><domains-box :v-domains="headerConfig.domains"></domains-box></td>
            </tr>
            <tr>
                <td>只附加不替换</td>
                <td>
                    <checkbox name="shouldAppend" v-model="headerConfig.shouldAppend"></checkbox>
                    <p class="comment">选中后表示如果已经存在同名的报头，则只会附加在原有的报头之后，不会覆盖。</p>
                </td>
            </tr>
            <tr v-show="type == 'response'">
                <td>不在跳转时启用</td>
                <td>
                    <checkbox name="disableRedirect" v-model="headerConfig.disableRedirect"></checkbox>
                    <p class="comment">选中后表示在30X跳转时不启用当前报头。</p>
                </td>
            </tr>
            <tr>
                <td class="color-border">启用内容替换</td>
                <td>
                    <checkbox name="shouldReplace" v-model="shouldReplace"></checkbox>
                    <p class="comment">可以替换原有报头中的内容。</p>
                </td>
            </tr>
            <tr v-show="shouldReplace">
                <td class="color-border">替换内容</td>
                <td>
                    <http-header-replace-values :v-replace-values="headerConfig.replaceValues"></http-header-replace-values>
                </td>
            </tr>
        </tbody>
	</table>
	<submit-btn></submit-btn>
</form>
