rule-edit.html 6.42 KB
Newer Older
1
<form class="form-horizontal">
2 3 4 5
  <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
      </div>
16
    </div>
17 18 19
    <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="The entity was created at this date">
          <input
            class="input"
            type="text"
            id="created_at"
            ng-model="entity.created_at"
            disabled="disabled" />
        </span>
28
      </div>
29
    </div>
30 31 32
    <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="The entity was last modified at this date">
          <input
          class="input"
          type="text"
          id="modified_at"
          ng-model="entity.modified_at"
          disabled="disabled" />
        </span>
41
      </div>
42
    </div>
43 44 45
    <div class="control-group">
      <label class="control-label" for="targetType">Target type</label>
      <div class="controls">
46 47 48
        <select id="targetType"
          ng-model="entity.target.type"
          title="Entity type of the rules target">
49 50 51 52 53 54 55
          <option value="vlan">Vlan</option>
          <option value="vlangroup">VlanGroup</option>
          <option value="host">Host</option>
          <option value="hostgroup">HostGroup</option>
          <option value="firewall">Firewall</option>
        </select>
      </div>
56
    </div>
57
    <div class="control-group" ng-class="hasError('targetName')">
58 59
      <label class="control-label" for="targetName">Target</label>
      <div class="controls">
60 61 62 63 64 65
        <input
          title="Target of the rule, can be a Vlan, Vlangroup, Host, Hostgroup or a Firewall"
          type="text"
          autocomplete="off"
          id="targetName"
          ng-model="entity.target.name" />
66
        <span class="help-inline" ng-bind="getError('targetName')"></span>
67
      </div>
68
    </div>
69 70 71
    <div class="control-group">
      <label class="control-label" for="direction">Direction</label>
      <div class="controls">
72 73 74 75
        <select id="direction"
          ng-options="choice[0] as choice[1] for choice in entity.direction.choices"
          ng-model="entity.direction.value"
          title="Traffic direction">
76 77
        </select>
      </div>
78
    </div>
79 80 81
    <div class="control-group">
      <label class="control-label" for="proto">Protocol</label>
      <div class="controls">
82 83 84 85 86
        <select id="proto"
          ng-options="choice[0] as choice[1] for choice in entity.proto.choices"
          ng-model="entity.proto.value"
          title="Protocol filter">
          <option value="">all</option>
87 88
        </select>
      </div>
89
    </div>
90
    <div class="control-group" ng-class="hasError('owner')">
91 92
      <label class="control-label" for="owner">Owner</label>
      <div class="controls">
93 94 95 96 97 98 99
        <input
          title="Owner of this rule"
          type="text"
          class="owner"
          autocomplete="off"
          id="owner"
          ng-model="entity.owner.name" />
100
        <span class="help-inline" ng-bind="getError('owner')"></span>
101
      </div>
102
    </div>
103 104
    <div class="control-group" ng-class="hasError('foreign_network')">
      <label class="control-label" for="foreign_network">Foreign network</label>
105
      <div class="controls">
106 107 108 109 110 111 112 113
        <input
          title="Foreign Network"
          type="text"
          data-provide="typeahead"
          autocomplete="off"
          id="foreign_network"
          class="vlangroup"
          ng-model="entity.foreignNetwork.name" />
114
        <span class="help-inline" ng-bind="getError('foreign_network')"></span>
115
      </div>
116 117
    </div>
  </div>
118 119 120 121
  <div class="span5">
    <div class="control-group">
      <label class="control-label" for="description">Description</label>
      <div class="controls">
122 123 124 125
        <textarea id="description"
          ng-model="entity.description"
          rows="2"
          title="Short description of the rule">
126 127
        </textarea>
      </div>
128
    </div>
129 130 131
    <div class="control-group">
      <div class="controls">
        <label class="checkbox">
132
          <input type="checkbox" ng-model="entity.nat"> NAT
133 134
        </label>
      </div>
135
    </div>
136 137 138
    <div class="control-group">
      <div class="controls">
        <label class="checkbox">
139
          <input type="checkbox" ng-model="entity.accept"> Accept
140 141 142
        </label>
      </div>
    </div>
143
    <div class="control-group" ng-class="hasError('dport')">
144 145
      <label class="control-label" for="dport">Destination port</label>
      <div class="controls">
146 147 148 149 150 151
        <input
          class="input-mini"
          type="number"
          id="dport"
          ng-model="entity.dport"
          title="Destination port">
152
        <span class="help-inline" ng-bind="getError('dport')"></span>
153 154
      </div>
    </div>
155
    <div class="control-group" ng-class="hasError('nat_dport')">
156 157
      <label class="control-label" for="nat_dport">NAT Destination port</label>
      <div class="controls">
158 159 160 161 162 163
        <input
          class="input-mini"
          type="number"
          id="nat_dport"
          ng-model="entity.nat_dport"
          title="NAT Destination port">
164
        <span class="help-inline" ng-bind="getError('nat_dport')"></span>
165 166
      </div>
    </div>
167
    <div class="control-group" ng-class="hasError('sport')">
168 169
      <label class="control-label" for="sport">Source port</label>
      <div class="controls">
170 171 172 173 174 175
        <input
          class="input-mini"
          type="number"
          id="sport"
          ng-model="entity.sport"
          title="Source port">
176
        <span class="help-inline" ng-bind="getError('sport')"></span>
177
      </div>
178
    </div>
179 180 181
    <div class="control-group">
      <label class="control-label" for="extra">Extra</label>
      <div class="controls">
182 183 184 185
        <textarea id="extra"
          ng-model="entity.extra"
          rows="2"
          title="I have no idea what is this... #TODO">
186 187 188 189 190
        </textarea>
      </div>
    </div>
    <div class="control-group">
      <div class="controls">
191
        <button type="submit" class="btn" ng-click="save()">Save</button>
192 193
      </div>
    </div>
194 195
  </div>
</form>