diff --git a/admin/static/js/app.js b/admin/static/js/app.js index 9eb08d49..fb1fd593 100644 --- a/admin/static/js/app.js +++ b/admin/static/js/app.js @@ -593,11 +593,13 @@ angular.module("FICApp") }) .controller("PKIController", function($scope, $rootScope, Certificate, CACertificate, Team, $location, $http) { - var ts = Date.now() - Date.now() % 86400000; + var ts = Date.now() - Date.now() % 86400000; var d = new Date(ts); - $scope.notBefore = d.toISOString(); var f = new Date(ts + 3 * 86400000); - $scope.notAfter = f.toISOString(); + $scope.newca = { + notAfter: f.toISOString(), + notBefore: d.toISOString(), + }; $scope.teams = Team.query(); $scope.certificates = Certificate.query(); @@ -636,12 +638,15 @@ angular.module("FICApp") }; $scope.generateCA = function() { - $http.post("/api/ca/new", {"notbefore": $scope.notBefore, "notafter": $scope.notAfter}).then(function() { + $http.post("/api/ca/new", $scope.newca).then(function() { $scope.ca = CACertificate.get(); }, function(response) { $rootScope.newBox('danger', 'An error occurs when generating CA:', response.data.errmsg); }); }; + $scope.renewCA = function() { + $scope.ca = {}; + }; $scope.generateCert = function() { $http.post("/api/certs").then(function() { diff --git a/admin/static/views/pki.html b/admin/static/views/pki.html index 84477eb3..deb4b373 100644 --- a/admin/static/views/pki.html +++ b/admin/static/views/pki.html @@ -111,6 +111,7 @@ Générée Introuvable +
@@ -119,13 +120,13 @@
- +
- +