{$layout}
{$template "/left_menu"}

{$var "header"}
<script src="/servers/certs/datajs" type="text/javascript"></script>
<script src="/js/sortable.min.js" type="text/javascript"></script>
{$end}

<div class="right-box http-config-container">
    <div class="http-config-form">
        <div class="form-title">TLS配置</div>
        
        {$if eq .canSpecifyPort false}
        <div class="audit-message warning">
            <i class="icon exclamation triangle"></i>
            <div>根据管理员设定，你不能修改此服务端口信息。</div>
        </div>
        {$end}
        
        <form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
            <input type="hidden" name="serverId" :value="serverId"/>
            <input type="hidden" name="serverType" :value="serverType"/>
            
            <div class="config-section">
                <div class="section-title">
                    <i class="icon globe"></i>
                    <span>端口设置</span>
                </div>
                
                <div class="config-item">
                    <div class="item-label">绑定端口 *</div>
                    <div class="item-content">
                        <div v-show="canSpecifyPort">
                            <network-addresses-box :v-server-type="serverType" :v-addresses="tlsConfig.listen" :v-protocol="'tls'" ></network-addresses-box>
                        </div>
                        <div v-show="!canSpecifyPort" v-if="tlsConfig.listen != null">
                            <span v-for="listen in tlsConfig.listen" class="ui basic small label">tls://*:{{listen.portRange}}</span>
                        </div>
                    </div>
                </div>
            </div>

            <!-- SSL配置 -->
            <ssl-config-box :v-ssl-policy="tlsConfig.sslPolicy" :v-protocol="'tls'" v-show="tlsConfig.isOn"></ssl-config-box>

            <div class="margin"></div>
            <submit-btn></submit-btn>
        </form>
    </div>
</div>