<div class="panel panel-default">
    <div class="panel-body">
        <div class="row">
            <form action="/nodes/importNode" method="post">
                <div class="col-md-4">{{$otherNodes := .otherNodes}}{{$nodeGroup := .nodeGroup}}
                    <div class="input-group">
                        <select name="node_id" class="selectpicker show-menu-arrow form-control"
                                multiple data-live-search="true"
                                data-max-options="4"
                                title="选择要导入的节点">
                            {{range $otherNode := $otherNodes}}
                            <option title="<span class='label label-success'>{{$otherNode.ip}}:{{$otherNode.port}}</span>" value="{{$otherNode.node_id}}">节点 {{$otherNode.node_id}}: {{$otherNode.ip}}:{{$otherNode.port}}</option>
                            {{end}}
                        </select>
                        <input type="hidden" name="nodes_id" value="{{$nodeGroup.nodes_id}}">
			            <span class="input-group-btn">
                            <button type="button" class="btn btn-primary" onclick="Form.ajaxSubmit(this.form, false);"><i class="glyphicon glyphicon-import"></i> 导入 </button>
			            </span>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <div class="table-responsive">
        <table class="table table-bordered">
            <thead>
            <tr>
                <th class="w13p">ID</th>
                <th class="w13p">节点IP</th>
                <th class="w8p">端口</th>
                <th>备注</th>
                <th class="w15p">修改时间</th>
                <th class="w15p">操作</th>
            </tr>
            </thead>
            <tbody>
            {{range $node := .nodes}}
            <tr>
                <td class="center">{{$node.node_id}}</td>
                <td>{{$node.ip}}</td>
                <td class="center">{{$node.port}}</td>
                <td>{{$node.comment}}</td>
                <td class="center">{{dateFormat $node.update_time "Y-m-d H:i:s"}}</td>
                <td class="center">
                    <a onclick="Layers.confirm('确定将节点从该节点组移除吗？', '/nodes/remove?nodes_id={{$nodeGroup.nodes_id}}&node_id={{$node.node_id}}');" class="remove glyphicon glyphicon-remove">移除 </a>
                </td>
            </tr>
            {{end}}
            </tbody>
        </table>
    </div>
    <div class="panel-footer">
    </div>
</div>