<page-title title="Datasource Manager: Add API"></page-title>

<div class="container-fluid">
	<div class="row mt-5">	
		<div class="col">
			
			<form>
				
				<form-textfield-static label="Datasource" value="dsName"></form-textfield-static>
				<form-textfield-with-prefix label="API Id" prefix="{{prefix}}" value="api.id"></form-textfield-with-prefix>
				<form-select label="Compatibility level" terms="compatibilityLevels" value="api.compliance"></form-select>				
				<form-select label="Content description" terms="contentDescTypes" value="api.contentdescription"></form-select>				
				<form-select label="Protocol" terms="protocols" value="api.protocol"></form-select>				
				<form-textfield label="BaseURL" value="api.baseUrl" regex="^(http|https|ftp|file|sftp|jar|mongodb):\/\/"></form-textfield>
				
				<div ng-show="api.protocol" ng-repeat="p in selProtParams">
					<form-textfield label="Parameter: {{p.label}}"  value="api.apiParams[p.name]" type="{{p.type}}" optional="{{p.optional}}"></form-textfield>				
				</div>

				{{api}}<br />
				
				<button type="submit" class="btn btn-sm btn-primary">Add API</button>

			</form>


		</div>
	</div>
</div>
