maatma: Display a message for domain without dnssec

This commit is contained in:
nemunaire 2022-03-10 18:14:12 +01:00
parent 6e89a8011f
commit 52b218f2ea
3 changed files with 21 additions and 2 deletions

View File

@ -1,5 +1,9 @@
const dn_without_dnssec = ["driivve.com.", "driivee.cloud."];
function dn_has_dnssec(dn) {
return dn_without_dnssec.reduce((s, e) => (s && dn.indexOf(e) === -1), true)
}
const tuto_legend = {
"danger": "Test jamais réussi",
"warning": "Test réussi il y a plus de 5 minutes",

View File

@ -644,6 +644,9 @@ angular.module("AdLinApp")
})
.controller("DSDomainsController", function($scope, $http) {
$scope.dn_has_dnssec = dn_has_dnssec;
$scope.dn_without_dnssec = dn_without_dnssec;
console.log(dn_without_dnssec)
var updateDS = function() {
$http({
method: 'GET',

View File

@ -178,12 +178,24 @@
</td>
</tr>
</tbody>
<tbody style="font-family: monospace" ng-if="!domainDS">
<tbody style="font-family: monospace" ng-if="!domainDS && dn_has_dnssec(domain)">
<tr>
<td colspan="4">Vous n'avez défini aucun enregistrement DS pour l'instant</td>
</tr>
</tbody>
<tfoot>
<tbody style="font-family: monospace" ng-if="!domainDS && !dn_has_dnssec(domain)">
<tr>
<td colspan="4" class="bg-warning">
<ng-pluralize count="dn_without_dnssec.length" when="{'one': 'Le domaine', 'other': 'Les domaines'}"></ng-pluralize>
<span ng-repeat="(i,dn) in dn_without_dnssec"><span ng-if="$middle">, </span><span ng-if="!$first && $last"> et </span>{{ dn }}</span>
ne
<ng-pluralize count="dn_without_dnssec.length" when="{'one': 'permet', 'other': 'permettent'}"></ng-pluralize>
pas de réaliser ce bonus.
Pour le réaliser, demande à <a href="https://matrix.to/#/#maatma:nemunai.re" target="_blank">@nemunaire</a> de passer sur un des autres domaines, ou utilise ton propre domaine si tu en as un.
</td>
</tr>
</tbody>
<tfoot ng-if="dn_has_dnssec(domain)">
<tr>
<td colspan="5">
<button class="btn btn-primary" ng-click="addDS(domain)">Ajouter un enregistrement DS</button>