forked from openshift/origin-web-console
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsecret.js
60 lines (52 loc) · 1.57 KB
/
secret.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
'use strict';
/**
* @ngdoc function
* @name openshiftConsole.controller:SecretController
* @description
* # SecretController
* Controller of the openshiftConsole
*/
angular.module('openshiftConsole')
.controller('SecretController', function ($routeParams, $filter, $scope, DataService, ProjectsService, SecretsService) {
$scope.projectName = $routeParams.project;
$scope.secretName = $routeParams.secret;
$scope.view = {
showSecret: false
};
$scope.alerts = $scope.alerts || {};
$scope.breadcrumbs = [
{
title: "Secrets",
link: "project/" + $routeParams.project + "/browse/secrets"
},
{
title: $scope.secretName
}
];
$scope.addToApplicationVisible = false;
$scope.addToApplication = function() {
if (!$scope.secret.data) {
return;
}
$scope.addToApplicationVisible = true;
};
$scope.closeAddToApplication = function() {
$scope.addToApplicationVisible = false;
};
ProjectsService
.get($routeParams.project)
.then(_.spread(function(project, context) {
$scope.project = project;
$scope.context = context;
DataService.get("secrets", $scope.secretName, context, { errorNotification: false }).then(
function(secret) {
$scope.secret = secret;
$scope.decodedSecretData = SecretsService.decodeSecretData($scope.secret.data);
$scope.loaded = true;
},
function(e) {
$scope.loaded = true;
$scope.error = e;
});
}));
});