<div class="panel panel-default">
    <div class="panel-body">{{$project := .project}}
        <!-- Nav tabs -->
        <ul class="nav nav-tabs" role="tablist">
            <li role="presentation" class="active"><a href="#pre_command" aria-controls="pre_command" role="tab" data-toggle="tab">前置命令</a></li>
            <li role="presentation"><a href="#post_command" aria-controls="post_command" role="tab" data-toggle="tab">后置命令</a></li>
        </ul>
        <br>
        <form class="form-horizontal" method="post" action="/project/configSave">
            <input type="hidden" name="project_id" value="{{$project.project_id}}">
        <!-- Tab panes -->
        <div class="tab-content">
            <div role="tabpanel" class="tab-pane active" id="pre_command">
                <div class="form-group">
                    <label class="col-sm-2 control-label"><span class="text-danger"></span> 前置命令 </label>
                    <div class="col-sm-4">
                        <textarea name="pre_command" class="form-control" rows="6">{{$project.pre_command}}</textarea><br/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label"><span class="text-danger"></span> 前置命令执行方式</label>
                    <div class="col-sm-4">
                        <select name="pre_command_exec_type" class="form-control">
                            <option value="1" {{if eq $project.pre_command_exec_type "1" }} selected {{end}}>同步执行，遇到错误停止</option>
                            <option value="2" {{if eq $project.pre_command_exec_type "2" }} selected {{end}}>同步执行，遇到错误继续</option>
                            <option value="3" {{if eq $project.pre_command_exec_type "3" }} selected {{end}}>异步执行</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label"><span class="text-danger"></span> 前置命令超时 </label>
                    <div class="col-sm-4">
                        <div class="input-group">
                            <input type="text" name="pre_command_exec_timeout" value="{{$project.pre_command_exec_timeout}}" class="form-control" placeholder="请输入前置命令执行超时时间" aria-describedby="input-group1" required>
                            <span class="input-group-addon">秒</span>
                        </div>
                    </div>
                </div>
            </div>
            <div role="tabpanel" class="tab-pane" id="post_command">
                <div class="form-group">
                    <label class="col-sm-2 control-label"><span class="text-danger"></span> 后置命令 </label>
                    <div class="col-sm-4">
                        <textarea name="post_command" class="form-control" rows="6">{{$project.post_command}}</textarea><br/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label"><span class="text-danger"></span> 后置命令执行方式</label>
                    <div class="col-sm-4">
                        <select name="post_command_exec_type" class="form-control">
                            <option value="1" {{if eq $project.post_command_exec_type "1" }} selected {{end}}>同步执行，遇到错误停止</option>
                            <option value="2" {{if eq $project.post_command_exec_type "2" }} selected {{end}}>同步执行，遇到错误继续</option>
                            <option value="3" {{if eq $project.post_command_exec_type "3" }} selected {{end}}>异步执行</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label"><span class="text-danger"></span> 后置命令超时 </label>
                    <div class="col-sm-4">
                        <div class="input-group">
                            <input type="text" name="post_command_exec_timeout" class="form-control" value="{{$project.post_command_exec_timeout}}" placeholder="请输入后置命令执行超时时间" aria-describedby="input-group1" required>
                            <span class="input-group-addon">秒</span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="button" onclick="Form.ajaxSubmit(this.form, true);" class="btn btn-primary">保存</button>
            </div>
        </div>
        </form>
    </div>
</div>