-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Network page boiler plate (though very incomplete) Moved attributes to be loaded (and reloaded) on modal show event Changed tables to be condensed Added more validation on network create/update form
- Loading branch information
Showing
8 changed files
with
234 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,83 @@ | ||
<form novalidate name="networkForm" class="nsot-form"> | ||
<div class="form-group" ng-class="{ | ||
'has-error' : networkForm.name.$invalid, | ||
'has-success' : networkForm.name.$valid, | ||
}"> | ||
<input type="text" | ||
class="form-control" | ||
name="cidr" | ||
placeholder="Network (required)" | ||
ng-model="network.cidr" | ||
ng-minlength="1" | ||
required | ||
> | ||
<div class="form-group" ng-class="{ | ||
'has-error' : networkForm.cidr.$invalid, | ||
'has-success' : networkForm.cidr.$valid, | ||
}"> | ||
<input type="text" | ||
class="form-control" | ||
name="cidr" | ||
placeholder="Network (required)" | ||
ng-model="network.cidr" | ||
ng-minlength="1" | ||
required | ||
> | ||
</div> | ||
<h4 class="form-subheading">Attributes</h4> | ||
|
||
<div class="row" ng-repeat="(idx, attr) in attributes | ||
|filter:{required:true}"> | ||
<div class="col-sm-5"> | ||
<select name="attribute" class="form-control" disabled> | ||
<option>[[attr.name]]</option> | ||
</select> | ||
</div> | ||
<h4 class="form-subheading">Attributes</h4> | ||
<div class="form-group" ng-repeat="(idx, attr) in attributes | ||
|filter:{required:true}"> | ||
<div class="row"> | ||
<div class="col-sm-5 text-right"> | ||
<h4>[[attr.name]]</h4> | ||
</div> | ||
<div class="col-sm-6" style="padding-left: 0px;"> | ||
<input type="text" | ||
class="form-control" | ||
name="value" | ||
placeholder="Value (required)" | ||
ng-model="network.attributes[attr.name]" | ||
required | ||
> | ||
</div> | ||
<div class="col-sm-6" style="padding-left: 0px;"> | ||
<div class="form-group" | ||
ng-class="{ | ||
'has-error' : networkForm['value_' + $index].$invalid, | ||
'has-success' : networkForm['value_' + $index].$valid, | ||
}"> | ||
<input type="text" | ||
class="form-control" | ||
name="value_[[$index]]" | ||
placeholder="Value (required)" | ||
ng-model="network.attributes[attr.name]" | ||
required | ||
> | ||
</div> | ||
</div> | ||
<div class="form-group" ng-repeat="form_attr in form_attrs"> | ||
<div class="row"> | ||
<div class="col-sm-5"> | ||
<select | ||
name="attribute" | ||
class="form-control" | ||
ng-model="form_attr.name"> | ||
<option value="" disabled selected></option> | ||
<option value="[[attr.name]]" | ||
ng-repeat="(idx, attr) in attributes | ||
|filter:{required:false}"> | ||
[[attr.name]] | ||
</option> | ||
</select> | ||
</div> | ||
<div class="col-sm-6" style="padding-left: 0px;"> | ||
<input type="text" | ||
class="form-control" | ||
name="value" | ||
placeholder="Value" | ||
ng-model="form_attr.value" | ||
> | ||
</div> | ||
<div class="col-sm-1"> | ||
<span class="attr-buttons"> | ||
<span class="fa fa-lg fa-minus-circle rm-attr-btn" | ||
ng-click="removeAttr($index);" | ||
></span> | ||
</span> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="row" ng-repeat="form_attr in form_attrs"> | ||
<div class="col-sm-5"> | ||
<select | ||
name="attribute" | ||
class="form-control" | ||
required | ||
ng-model="form_attr.name"> | ||
<option value="" disabled selected></option> | ||
<option value="[[attr.name]]" | ||
ng-repeat="(idx, attr) in attributes | ||
|filter:{required:false}"> | ||
[[attr.name]] | ||
</option> | ||
</select> | ||
</div> | ||
<div class="row"> | ||
<div class="col-sm-12 text-right"> | ||
<a ng-click="addAttr($index)" class="add-attr-btn"> | ||
Add an attribute | ||
<i class="fa fa-lg fa-plus-circle add-attr-btn"></i> | ||
</a> | ||
<div class="col-sm-6" style="padding-left: 0px;"> | ||
|
||
<div class="form-group"> | ||
<input type="text" | ||
class="form-control" | ||
name="value" | ||
placeholder="Value" | ||
ng-model="form_attr.value" | ||
required | ||
> | ||
</div> | ||
</div> | ||
</form> | ||
<div class="col-sm-1"> | ||
<span class="attr-buttons"> | ||
<span class="fa fa-lg fa-minus-circle rm-attr-btn" | ||
ng-click="removeAttr($index);" | ||
></span> | ||
</span> | ||
</div> | ||
</div> | ||
|
||
<div class="row"> | ||
<div class="col-sm-12 text-right"> | ||
<a ng-click="addAttr()" class="add-attr-btn"> | ||
Add an attribute | ||
<i class="fa fa-lg fa-plus-circle add-attr-btn"></i> | ||
</a> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,61 @@ | ||
<loading-panel ng-if="loading"></loading-panel> | ||
<div ng-if="!loading"> | ||
<heading-bar heading="Network" | ||
subheading="[[network.network_address]]/[[network.prefix_length]]"> | ||
<button ng-if="admin" | ||
class="btn btn-info" | ||
data-toggle="modal" | ||
data-target="#updateNetworkModal" | ||
>Update Network</button> | ||
<button ng-if="admin" | ||
class="btn btn-danger" | ||
data-toggle="modal" | ||
data-target="#deleteNetworkModal" | ||
>Delete Network</button> | ||
</heading-bar> | ||
|
||
<nsot-modal title="Update Network" modal-id="updateNetworkModal"> | ||
<div class="modal-body"> | ||
<div ng-if="updateError" class="alert alert-danger"> | ||
[[updateError.code]] - [[updateError.message]] | ||
</div> | ||
<form novalidate name="networkForm" class="nsot-form"> | ||
<div ng-include="form_url"></div> | ||
</form> | ||
|
||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-default" data-dismiss="modal"> | ||
Close | ||
</button> | ||
<button type="submit" ng-click="updateNetwork()" | ||
class="btn btn-primary" ng-disabled="networkForm.$invalid" | ||
> | ||
Update | ||
</button> | ||
</div> | ||
</nsot-modal> | ||
|
||
<nsot-modal title="Delete Network" modal-id="deleteNetworkModal"> | ||
<div class="modal-body"> | ||
<div ng-if="deleteError" class="alert alert-danger"> | ||
[[deleteError.code]] - [[deleteError.message]] | ||
</div> | ||
Are you sure you want to delete this network? | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-default" data-dismiss="modal"> | ||
Close | ||
</button> | ||
<button type="submit" | ||
ng-click="deleteNetwork()" | ||
class="btn btn-primary" | ||
> | ||
Delete | ||
</button> | ||
</div> | ||
</nsot-modal> | ||
|
||
|
||
|
||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.