The destination configuration page did not previously support a textarea input as was supported on most other pages. The validation of string inputs was not being performed. This commit addresses both of those issues and corrects the validation expressions for the AWS and S3 destination plugins so that they continue to function. The SFTP destination plugin does not have any string validation. The Kubernetes plugin does not work at all as far as I can tell; there will be another PR in the coming days to address that.
98 lines
5.3 KiB
HTML
98 lines
5.3 KiB
HTML
<div class="modal-header">
|
|
<button type="button" class="close" ng-click="cancel()" aria-label="Close"><span aria-hidden="true">×</span>
|
|
</button>
|
|
<h3><span ng-show="!destination.fromServer">Create</span><span ng-show="destination.fromServer">Edit</span>
|
|
Destination <span class="text-muted"><small>oh the places you will go!</small></span></h3>
|
|
</div>
|
|
<div class="modal-body">
|
|
<form name="createForm" class="form-horizontal" role="form" novalidate>
|
|
<div class="form-group"
|
|
ng-class="{'has-error': createForm.label.$invalid, 'has-success': !createForm.label.$invalid&&createForm.label.$dirty}">
|
|
<label class="control-label col-sm-2">
|
|
Label
|
|
</label>
|
|
<div class="col-sm-10">
|
|
<input name="label" ng-model="destination.label" placeholder="Label" class="form-control" required/>
|
|
<p ng-show="createForm.label.$invalid && !createForm.label.$pristine" class="help-block">You must enter an
|
|
destination label</p>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="control-label col-sm-2">
|
|
Description
|
|
</label>
|
|
<div class="col-sm-10">
|
|
<textarea name="comments" ng-model="destination.description" placeholder="Something elegant"
|
|
class="form-control"></textarea>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="control-label col-sm-2">
|
|
Plugin
|
|
</label>
|
|
<div class="col-sm-10">
|
|
<select class="form-control" ng-model="destination.plugin" ng-options="plugin.title for plugin in plugins"
|
|
required></select>
|
|
</div>
|
|
</div>
|
|
<div class="form-group" ng-repeat="item in destination.plugin.pluginOptions">
|
|
<ng-form name="subForm" class="form-horizontal" role="form" novalidate>
|
|
<div ng-class="{'has-error': subForm.sub.$invalid, 'has-success': !subForm.sub.$invalid&&subForm.sub.$dirty}">
|
|
<label class="control-label col-sm-2">
|
|
{{ item.name | titleCase }}
|
|
</label>
|
|
<div class="col-sm-10">
|
|
<input name="sub" ng-if="item.type == 'int'" type="number" ng-pattern="item.validation?item.validation:'^[0-9]+$'"
|
|
class="form-control" ng-model="item.value"/>
|
|
<select name="sub" ng-if="item.type == 'select'" class="form-control" ng-options="i for i in item.available"
|
|
ng-model="item.value"></select>
|
|
<input name="sub" ng-if="item.type == 'bool'" class="form-control" type="checkbox" ng-model="item.value">
|
|
<input name="sub" ng-if="item.type == 'str'" type="text" class="form-control" ng-model="item.value" ng-pattern="item.validation"/>
|
|
<textarea name="sub" ng-if="item.type == 'textarea'" class="form-control"
|
|
ng-model="item.value" ng-pattern="item.validation"></textarea>
|
|
<div ng-if="item.type == 'export-plugin'">
|
|
<form name="exportForm" class="form-horizontal" role="form" novalidate>
|
|
<select class="form-control" ng-model="item.value"
|
|
ng-options="plugin.title for plugin in exportPlugins" required></select>
|
|
<div class="col-sm-10">
|
|
<div class="form-group" ng-repeat="item in item.value.pluginOptions">
|
|
<ng-form name="subForm" class="form-horizontal" role="form" novalidate>
|
|
<div
|
|
ng-class="{'has-error': subForm.sub.$invalid, 'has-success': !subForm.sub.$invalid&&subForm.sub.$dirty}">
|
|
<label class="control-label col-sm-2">
|
|
{{ item.name | titleCase }}
|
|
</label>
|
|
<div class="col-sm-10">
|
|
<input name="sub" ng-if="item.type == 'int'" type="number" ng-pattern="item.validation?item.validation:'^[0-9]+$'"
|
|
class="form-control" ng-model="item.value"/>
|
|
<select name="sub" ng-if="item.type == 'select'" class="form-control"
|
|
ng-options="i for i in item.available" ng-model="item.value"></select>
|
|
<input name="sub" ng-if="item.type == 'bool'" class="form-control" type="checkbox"
|
|
ng-model="item.value">
|
|
<input name="sub" ng-if="item.type == 'str'" type="text" class="form-control"
|
|
ng-model="item.value" ng-pattern="item.validation"/>
|
|
<textarea name="sub" ng-if="item.type == 'textarea'" class="form-control"
|
|
ng-model="item.value" ng-pattern="item.validation"></textarea>
|
|
<p ng-show="subForm.sub.$invalid && !subForm.sub.$pristine"
|
|
class="help-block">{{ item.helpMessage }}</p>
|
|
</div>
|
|
</div>
|
|
</ng-form>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<p ng-show="subForm.sub.$invalid && !subForm.sub.$pristine" class="help-block">{{ item.helpMessage }}</p>
|
|
</div>
|
|
</div>
|
|
</ng-form>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button ng-click="save(destination)" type="submit" ng-disabled="createForm.$invalid" class="btn btn-primary">Save
|
|
</button>
|
|
<button ng-click="cancel()" class="btn btn-danger">Cancel</button>
|
|
</div>
|
|
|