diff --git a/lemur/certificates/models.py b/lemur/certificates/models.py index d8354d94..63d2ea7c 100644 --- a/lemur/certificates/models.py +++ b/lemur/certificates/models.py @@ -102,7 +102,7 @@ class Certificate(db.Model): serial = Column(String(128)) cn = Column(String(128)) deleted = Column(Boolean, index=True) - dns_provider = Column(Integer(), nullable=True) + dns_provider_id = Column(Integer(), nullable=True) not_before = Column(ArrowType) not_after = Column(ArrowType) diff --git a/lemur/dns_providers/models.py b/lemur/dns_providers/models.py index 809c5247..f43aac0b 100644 --- a/lemur/dns_providers/models.py +++ b/lemur/dns_providers/models.py @@ -6,15 +6,13 @@ from lemur.database import db class DnsProviders(db.Model): - 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')) \ No newline at end of file + __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) diff --git a/lemur/dns_providers/service.py b/lemur/dns_providers/service.py index 0ed27315..fa752d09 100644 --- a/lemur/dns_providers/service.py +++ b/lemur/dns_providers/service.py @@ -7,4 +7,10 @@ def get_all_dns_providers(status="active"): :return: """ - return DnsProviders.query.all(status=status) + 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 diff --git a/lemur/static/app/angular/certificates/certificate/options.tpl.html b/lemur/static/app/angular/certificates/certificate/options.tpl.html index a498a6c8..14fc3de8 100644 --- a/lemur/static/app/angular/certificates/certificate/options.tpl.html +++ b/lemur/static/app/angular/certificates/certificate/options.tpl.html @@ -234,14 +234,18 @@ - +
+ +
+ +
+ +
+
+ +
diff --git a/lemur/static/app/angular/destinations/destination/destination.js b/lemur/static/app/angular/destinations/destination/destination.js index f5210074..21f624c8 100644 --- a/lemur/static/app/angular/destinations/destination/destination.js +++ b/lemur/static/app/angular/destinations/destination/destination.js @@ -47,8 +47,8 @@ angular.module('lemur') PluginService.getByType('destination').then(function (plugins) { $scope.plugins = plugins; - _.each($scope.plugins, function (plugin) { + _.each($scope.plugins, function (plugin) { if (plugin.slug === $scope.destination.plugin.slug) { plugin.pluginOptions = $scope.destination.plugin.pluginOptions; $scope.destination.plugin = plugin;