<div class="row tile">
    <div class="col-md-12 col-md-auto">
        <div class="ibox float-e-margins">
            <h3 class="ibox-title">add host</h3>
            <div class="ibox-content">
                <form class="form-horizontal">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">remark</label>
                        <div class="col-sm-10">
                            <input class="form-control" type="text" name="remark" placeholder="remark">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">host</label>
                        <div class="col-sm-10">
                            <input class="form-control" type="text" name="host" placeholder="such as a.proxy.com">
                        </div>
                    </div>
                    <div class="form-group" id="scheme">
                        <label class="control-label col-sm-2">scheme</label>
                        <div class="col-sm-10">
                            <select class="form-control" name="scheme">
                                <option value="all">all</option>
                                <option value="http">http</option>
                                <option value="https">https</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">url router</label>
                        <div class="col-sm-10">
                            <input class="form-control" type="text" name="location"
                                   placeholder="empty means to be unrestricted">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">client id</label>
                        <div class="col-sm-10">
                            <input value="{{.client_id}}" class="form-control" type="text" name="client_id"
                                   placeholder="client id">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">target of Intranet(ip:port)</label>
                        <div class="col-sm-10">
                        <textarea class="form-control" rows="4" type="text" name="target"
                                  placeholder="such as
10.1.50.203:80
10.1.50.202:80"></textarea>
                            <span class="help-block m-b-none">Line break if load balancing</span>

                        </div>
                    </div>
                    <div class="form-group" id="header">
                        <label class="col-sm-2 control-label">header modify</label>
                        <div class="col-sm-10">
                        <textarea class="form-control" rows="4" type="text" name="header"
                                  placeholder="Cache-Control: no-cache"></textarea>
                            <span class="help-block m-b-none"> Colon separated, multiple lines please fill in</span>
                        </div>

                    </div>
                    <div class="form-group" id="hostchange">
                        <label class="col-sm-2 control-label">host modify</label>
                        <div class="col-sm-10">
                            <input class="form-control" value="" type="text" name="hostchange"
                                   placeholder="host modify">
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <div class="col-sm-4 col-sm-offset-2">
                            &nbsp;<button class="btn btn-success" href="#" id="add"><i
                                class="fa fa-fw fa-lg fa-eye"></i>add
                        </button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<script>
    $(function () {
        $("#add").on("click", function () {
            $.ajax({
                type: "POST",
                url: "/index/addhost",
                data: $("form").serializeArray(),
                success: function (res) {
                    alert(res.msg)
                    if (res.status) {
                        history.back(-1)
                    }
                }
            })
        })
    })
</script>