<!-- Faraday Penetration Test IDE -->
<!-- Copyright (C) 2013  Infobyte LLC (http://www.infobytesec.com/) -->
<!-- See the file 'doc/LICENSE' for the license information -->

<form name="form" novalidate>
    <div class="modal-header">
        <div class="modal-button">
            <button class="btn btn-success" ng-click="ok()" ng-disabled="form.$invalid">OK</button>
            <button class="btn btn-danger" ng-click="cancel()">Cancel</button>
        </div>
        <h3 class="modal-title">Edit host</h3>
    </div>
    <div class="modal-body">
        <div class="form-horizontal">
            <div class="form-group" ng-class="{'has-error': form.name.$invalid }">
                <div class="col-md-12">
                    <label class="sr-only" for="name">IP v4 or v6</label>
                    <input type="text" class="form-control" id="name" name="name" placeholder="IP" ng-model="host.name" required/>
                    <span class="help-block normal-size">
                        Example: 192.168.0.1
                    </span>
                </div>
            </div><!-- .form-group -->
            <div class="form-group">
                <div class="col-md-12">
                    <label class="sr-only" for="description">Description</label>
                    <textarea class="form-control" id="description" placeholder="Description" ng-model="host.description"></textarea>
                </div>
            </div><!-- .form-group -->
            <div class="form-group">
                <div class="col-md-12">
                    <label class="sr-only" for="os">Operating System</label>
                    <input type="text" class="form-control" id="os" placeholder="Operating System" ng-model="host.os"/>
                    <span class="help-block normal-size">
                        Example: Linux 3.18.6-1-ARCH
                    </span>
                </div>
            </div><!-- .form-group -->
            <div class="form-group">
                <div class="col-md-12">
                    <div class="checkbox">
                        <label>
                            <input type="checkbox" id="owned" ng-model="host.owned"/>
                            <span class="normal-size">Owned</span>
                        </label>
                    </div><!-- .checkbox -->
                </div>
            </div><!-- .form-group -->
            <div class="form-group">
                <div class="col-md-12">
                    <h5>Hostnames</h5>
                    <span class="input-group-addon button-radius background-blue" ng-click="newHostnames($event)">Add Hostname</span>
                </div>
                <div class="col-md-12 input-margin" ng-repeat="hostname in interface.hostnames">
                    <div class="input-group margin-bottom-sm col-md-12">
                        <label class="sr-only" for="hostsnames">Hostname</label>
                        <input type="text" class="form-control" id="hostsnames" placeholder="Hostname" ng-model="hostname.key"/>
                        <span class="input-group-addon" ng-click="interface.hostnames.splice($index, 1)" ng-hide="interface.hostnames.length == 1"><i class="fa fa-minus-circle"></i></span>
                    </div>
                </div>
            </div><!-- .form-group -->
            <div class="form-group">
                <div class="col-md-6">
                    <label class="sr-only" for="ipv4">IP v4</label>
                    <input type="text" class="form-control" id="ipv4" placeholder="IP v4" ng-model="interface.ipv4.address"/>
                </div>
                <div class="col-md-6">
                    <label class="sr-only" for="ipv6">IP v6</label>
                    <input type="text" class="form-control" id="ipv6" placeholder="IP v6" ng-model="interface.ipv6.address"/>
                </div>
            </div><!-- .form-group -->
            <div class="form-group">
                <div class="col-md-12">
                    <label class="sr-only" for="mac">MAC</label>
                    <input type="text" class="form-control" id="mac" placeholder="MAC" ng-model="interface.mac"/>
                </div>
            </div><!-- .form-group -->
        </div>
    </div><!-- .modal-body -->
    <div class="modal-footer">
        <div class="modal-button">
            <button class="btn btn-danger" ng-click="cancel()">Cancel</button>
            <button class="btn btn-success" ng-disabled="form.$invalid || workspace.readonly == true" ng-click="ok()">OK</button>
        </div>
    </div>
</form>
