Skip to content

Commit

Permalink
Applied record case on default plugins form
Browse files Browse the repository at this point in the history
  • Loading branch information
Panagis (P.) Tselentis committed May 4, 2020
1 parent e7d7354 commit 1fbc739
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
2 changes: 1 addition & 1 deletion assets/js/app/plugins/edit-plugin-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

// Define the plugins that will have their own custom form
// so that it can be included via ng-include in the .html files
$scope.customPluginForms = ['statsd', 'response-ratelimiting', 'acme'];
$scope.customPluginForms = ['statsd', 'response-ratelimiting'];


//$log.debug("Options", options)
Expand Down
40 changes: 40 additions & 0 deletions assets/js/app/plugins/forms/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,46 @@
<input chip-control/>
</chips>
</div>
<div ng-switch-when="record">
<div class="plugin-field-table">
<div data-ng-repeat="_field in field[getFieldProp(field)].fields" class="well" style="background-color: #f2f2f2;border: 1px solid #eaeaea">
<label>{{getFieldProp(_field)}}</label>
<div>
<div ng-switch on="_field[getFieldProp(_field)].type">
<!-- TYPE: STRING -->
<div ng-switch-when="string">
<textarea ng-model="field[getFieldProp(field)].value[getFieldProp(_field)]" class="form-control"></textarea>
</div>

<!-- TYPE: INTEGER -->
<div ng-switch-when="integer">
<input type="number" ng-model="field[getFieldProp(field)].value[getFieldProp(_field)]" class="form-control"></input>
</div>

<!-- TYPE: NUMBER -->
<div ng-switch-when="number">
<input type="number" ng-model="field[getFieldProp(field)].value[getFieldProp(_field)]" class="form-control"></input>
</div>

<!-- TYPE: BOOLEAN -->
<div ng-switch-when="boolean">
<input
bs-switch
ng-model="field[getFieldProp(field)].value[getFieldProp(_field)]"
switch-size="small"
type="checkbox"
switch-on-text="YES"
switch-off-text="NO"
>

</div>

</div>
</div>

</div>
</div>
</div>
<div ng-switch-default>
<input type="{{field[getFieldProp(field)].type}}" ng-model="field[getFieldProp(field)].value" class="form-control">
</div>
Expand Down

0 comments on commit 1fbc739

Please sign in to comment.