Skip to content

Commit

Permalink
Display provider name.
Browse files Browse the repository at this point in the history
  • Loading branch information
kiarn committed Apr 29, 2023
1 parent 2eb700e commit 133cd25
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions plugins/dns_api/resources/js/controllers/index.controller.es
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ angular.module('ajenti.dns_api').controller('DnsAPIIndexController', function($s
$scope.supported_types = ['A', 'AAAA', 'ALIAS', 'CNAME', 'MX', 'NS', 'PTR', 'SPF', 'TXT']

$http.get('/api/dns_api/domains').then((resp) => {
$scope.domains = resp.data;
$scope.domains = resp.data[0];
$scope.provider = resp.data[1];
if ($scope.domains.length > 0) {
$scope.active_domain = resp.data[0];
$scope.active_domain = $scope.domains[0];
$scope.get_records();
} else {
$scope.active_domain = '';
Expand Down
2 changes: 1 addition & 1 deletion plugins/dns_api/resources/partial/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<br/>

<div root-access>
<h1 translate>External DNS</h1>
<h2>{{provider}}</h2>

<div ng:show="domains.length == 0 " class="alert alert-info" translate>
No domain found with this apikey.
Expand Down
2 changes: 1 addition & 1 deletion plugins/dns_api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def __init__(self, context):
@endpoint(api=True)
def handle_api_dns_list_domains(self, http_context):
self.mgr.load()
return list(self.mgr.domains.keys())
return list(self.mgr.domains.keys()), self.mgr.api_provider.name

@get(r'/api/dns_api/domain/(?P<fqdn>[\w\.]+)/records')
@endpoint(api=True)
Expand Down

0 comments on commit 133cd25

Please sign in to comment.