host-edit.html 6.73 KB
Newer Older
1 2 3 4 5
<form class="form-horizontal">
  <div class="span5">
    <div class="control-group">
      <label class="control-label" for="ID">ID</label>
      <div class="controls">
6 7 8 9 10 11 12 13 14
        <span class="has-tooltip" title="Built in ID, do not change this">
          <input
            class="input-mini"
            type="text"
            id="ID"
            placeholder="ID"
            value="{{entity.id}}"
            disabled="disabled" />
        </span>
15 16 17 18 19
      </div>
    </div>
    <div class="control-group">
      <label class="control-label" for="created_at">Created at</label>
      <div class="controls">
20 21 22 23 24 25 26 27
        <span class="has-tooltip" title="Entity was created at this date">
          <input
            class="input"
            type="text"
            id="created_at"
            ng-model="entity.created_at"
            disabled="disabled">
        </span>
28 29 30 31 32
      </div>
    </div>
    <div class="control-group">
      <label class="control-label" for="modified_at">Modified at</label>
      <div class="controls">
33 34 35 36 37 38 39 40
        <span class="has-tooltip" title="Entity was last modified at this date">
          <input
            class="input"
            type="text"
            id="modified_at"
            ng-model="entity.modified_at"
            disabled="disabled" />
        </span>
41 42
      </div>
    </div>
Bence Dányi committed
43
    <div class="control-group" ng-class="hasError('name')">
44 45
      <label class="control-label" for="name">Name</label>
      <div class="controls">
46 47 48 49 50
        <input
          type="text"
          id="name"
          ng-model="entity.name"
          title="Name of the host" />
Bence Dányi committed
51
        <span class="help-inline" ng-bind="getError('name')"></span>
52 53
      </div>
    </div>
Bence Dányi committed
54
    <div class="control-group" ng-class="hasError('mac')">
55 56
      <label class="control-label" for="mac">MAC</label>
      <div class="controls">
57 58 59 60 61
        <input
          type="text"
          id="mac"
          ng-model="entity.mac"
          title="MAC address" />
Bence Dányi committed
62
        <span class="help-inline" ng-bind="getError('mac')"></span>
63 64
      </div>
    </div>
Bence Dányi committed
65
    <div class="control-group" ng-class="hasError('ipv4')">
66 67
      <label class="control-label" for="ipv4">IPv4</label>
      <div class="controls">
68 69 70 71 72
        <input
          type="text"
          id="ipv4"
          ng-model="entity.ipv4"
          title="IPv4 address" />
Bence Dányi committed
73
        <span class="help-inline" ng-bind="getError('ipv4')"></span>
74 75
      </div>
    </div>
Bence Dányi committed
76
    <div class="control-group" ng-class="hasError('pub_ipv4')">
77 78
      <label class="control-label" for="pub_ipv4">Public IPv4</label>
      <div class="controls">
79 80 81 82 83
        <input
          type="text"
          id="pub_ipv4"
          ng-model="entity.pub_ipv4"
          title="Public IPv4 address" />
Bence Dányi committed
84
        <span class="help-inline" ng-bind="getError('pub_ipv4')"></span>
85 86
      </div>
    </div>
Bence Dányi committed
87
    <div class="control-group" ng-class="hasError('ipv6')">
88 89
      <label class="control-label" for="ipv6">IPv6</label>
      <div class="controls">
90 91 92 93 94 95
        <input
          type="text"
          class="input-xlarge"
          id="ipv6"
          ng-model="entity.ipv6"
          title="IPv6 address" />
Bence Dányi committed
96
        <span class="help-inline" ng-bind="getError('ipv6')"></span>
97 98
      </div>
    </div>
Bence Dányi committed
99
    <div class="control-group" ng-class="hasError('owner')">
100 101
      <label class="control-label" for="owner">Owner</label>
      <div class="controls">
102 103 104 105 106 107 108
        <input
          type="text"
          class="owner"
          autocomplete="off"
          id="owner"
          ng-model="entity.owner.name"
          title="Owners name" />
Bence Dányi committed
109
        <span class="help-inline" ng-bind="getError('owner')"></span>
110 111
      </div>
    </div>
Bence Dányi committed
112
    <div class="control-group" ng-class="hasError('vlan')">
113 114
      <label class="control-label" for="vlan">Vlan</label>
      <div class="controls">
115 116 117 118 119 120 121
        <input
          type="text"
          autocomplete="off"
          class="vlan"
          id="vlan"
          ng-model="entity.vlan.name"
          title="Vlan of this host #TODO" />
Bence Dányi committed
122
        <span class="help-inline" ng-bind="getError('vlan')"></span>
123 124
      </div>
    </div>
125 126
  </div>
  <div class="span5">
Bence Dányi committed
127
    <div class="control-group" ng-class="hasError('description')">
128 129
      <label class="control-label" for="description">Description</label>
      <div class="controls">
130 131 132 133
        <textarea rows="4"
          id="description"
          ng-model="entity.description"
          title="Short description">
134
        </textarea>
Bence Dányi committed
135
        <span class="help-inline" ng-bind="getError('description')"></span>
136 137 138 139 140 141 142 143 144
      </div>
    </div>
    <div class="control-group">
      <div class="controls">
        <label class="checkbox">
          <input type="checkbox" ng-model="entity.shared_ip"> Shared IP
        </label>
      </div>
    </div>
Bence Dányi committed
145
    <div class="control-group" ng-class="hasError('comment')">
146 147
      <label class="control-label" for="comment">Comment</label>
      <div class="controls">
148 149 150 151
        <textarea rows="2"
          id="comment"
          ng-model="entity.comment"
          title="Some comments... or something like that #TODO">
152
        </textarea>
Bence Dányi committed
153
        <span class="help-inline" ng-bind="getError('comment')"></span>
154 155
      </div>
    </div>
Bence Dányi committed
156
    <div class="control-group" ng-class="hasError('groups')">
157 158 159
      <label class="control-label" for="hostgroups">Host groups</label>
      <div class="controls">
        <div class="well well-small">
160
          <span class="label label-info" ng-repeat="group in entity.groups | filter: destroyed">
161
            <a href="#/hostgroups/{{group.id}}">{{group.name}}</a>
162
            <a href ng-click="removeHostGroup(group)"><i class="icon-remove"></i></a>
163 164
          </span>
        </div>
165
        <div class="input-append has-tooltip" title="Hostgroups of this host">
166
          <input class="span2 hostgroup" id="groups" type="text" ng-model="newGroup">
167
          <button class="btn" type="button" ng-click="addHostGroup(newGroup)">Add</button>
Bence Dányi committed
168
          <span class="help-inline" ng-bind="getError('groups')"></span>
169 170 171 172
        </div>
      </div>
    </div>
    <div class="control-group">
173
      <div class="controls">
Bence Dányi committed
174
        <button type="submit" class="btn" ng-click="save()">Save</button>
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205
      </div>
    </div>
  </div>
</form>
<div class="span12">
  <h3>Rules belonging to this host</h3>
  <table class="table table-striped">
    <thead>
      <tr>
        <th>Direction</th>
        <th>Protocol</th>
        <th>Accept</th>
        <th>NAT</th>
        <th colspan="2">Owner</th>
      </tr>
    </thead>
    <tbody>
      <tr ng-repeat="rule in entity.rules">
        <td>{{rule.direction}}</td>
        <td>{{rule.proto}}</td>
        <td>{{rule.accept}}</td>
        <td>{{rule.nat}}</td>
        <td>{{rule.owner.name}}</td>
        <td>
          <a class="btn" href="#/rules/{{rule.id}}/">Edit</a>
          <a class="btn btn-danger" href="#/rules/{{rule.id}}/delete/">Delete</a>
        </td>
      </tr>
    </tbody>
  </table>
</div>