more stuff

This commit is contained in:
Curtis Castrapel 2018-04-10 16:04:07 -07:00
parent b2e6938815
commit b0bd0435c4
4 changed files with 21 additions and 42 deletions

View File

@ -6,13 +6,15 @@ from lemur.database import db
class DnsProviders(db.Model):
__tablename__ = 'dns_providers'
id = Column(Integer(), primary_key=True)
name = Column(String(length=256), unique=True, nullable=True)
description = Column(String(length=1024), nullable=True)
provider_type = Column(String(length=256), nullable=True)
credentials = Column(String(length=256), nullable=True)
api_endpoint = Column(String(length=256), nullable=True)
date_created = Column(ArrowType(), server_default=text('now()'), nullable=False)
status = Column(String(length=128), nullable=True)
options = Column(JSON)
db.Table('dns_providers',
Column('id', Integer(), nullable=False),
Column('name', String(length=256), nullable=True),
Column('description', String(length=1024), nullable=True),
Column('provider_type', String(length=256), nullable=True),
Column('credentials', String(length=256), nullable=True),
Column('api_endpoint', String(length=256), nullable=True),
Column('date_created', ArrowType(), server_default=text('now()'), nullable=False),
Column('status', String(length=128), nullable=True),
Column('options', JSON),
PrimaryKeyConstraint('id'),
UniqueConstraint('name'))

View File

@ -7,10 +7,4 @@ def get_all_dns_providers(status="active"):
:return:
"""
all_dns_providers = DnsProviders.query.all()
dns_provider_result = []
for provider in all_dns_providers:
print(provider)
if provider.status == status:
dns_provider_result.append(provider.__dict__)
return dns_provider_result
return DnsProviders.query.all(status=status)

View File

@ -132,16 +132,3 @@ pending_cert_role_associations = db.Table('pending_cert_role_associations',
)
Index('pending_cert_role_associations_ix', pending_cert_role_associations.c.pending_cert_id, pending_cert_role_associations.c.role_id)
dns_providers = db.Table('dns_providers',
Column('id', Integer(), nullable=False),
Column('name', String(length=256), nullable=True),
Column('description', String(length=1024), nullable=True),
Column('provider_type', String(length=256), nullable=True),
Column('credentials', String(length=256), nullable=True),
Column('api_endpoint', String(length=256), nullable=True),
Column('date_created', ArrowType(), server_default=text('now()'), nullable=False),
Column('status', String(length=128), nullable=True),
Column('options', JSON),
PrimaryKeyConstraint('id'),
UniqueConstraint('name'))

View File

@ -234,18 +234,14 @@
</label>
</div>
</div>
<div class="col-sm-10">
<!-- two -->
<div class="form-group">
<label class="control-label col-sm-2">
DNS Provider
</label>
<div class="col-sm-10">
<select class="form-control" ng-model="selected" ng-options="item as item.name for item in dnsProviders"></select>
</div>
</div>
</div>
<!-- <div class="form-group">
<label class="control-label col-sm-2">
DNS Provider (Only needed for LetsEncrypt or ACME implementations)
</label>
<div class="col-sm-10">
<select class="form-control" ng-model="certificate.extensions.crlDistributionPoints.includeCrlDp"
ng-options="item for item in ['yes', 'no', 'default']"></select>
</div> -->
</div>
</div>
</div>