forked from openshift/origin-web-console
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadd-secret-to-application.html
92 lines (92 loc) · 3.99 KB
/
add-secret-to-application.html
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<div>
<div class="dialog-title">
<h3>Add to Application</h3>
</div>
<div class="dialog-body">
<form name="addToApplicationForm" novalidate>
<fieldset ng-disabled="disableInputs">
<legend>Add this secret to application:</legend>
<div class="form-group">
<div class="application-select">
<ui-select id="application" ng-model="ctrl.application" required="true" ng-disabled="ctrl.disableInputs">
<ui-select-match placeholder="{{ctrl.applications.length ? 'Select an application' : 'There are no applications in this project'}}">
<span>
{{$select.selected.metadata.name}}
<small class="text-muted">– {{$select.selected.kind | humanizeKind : true}}</small>
</span>
</ui-select-match>
<ui-select-choices
repeat="application in (ctrl.applications) | filter : { metadata: { name: $select.search } } track by (application | uid)"
group-by="ctrl.groupByKind">
<span ng-bind-html="application.metadata.name | highlight : $select.search"></span>
</ui-select-choices>
</ui-select>
</div>
</div>
<legend>Add secret as:</legend>
<div class="form-group">
<div class="radio">
<label class="add-choice" for="envFrom">
<input id="envFrom" type="radio" ng-model="ctrl.addType" value="env" ng-disabled="ctrl.disableInputs">
Environment variables
</label>
<div>
<label class="add-choice" for="mountVolume">
<input type="radio" ng-model="ctrl.addType" value="volume" ng-disabled="ctrl.disableInputs">
Volume
</label>
</div>
<div class="volume-options">
<div ng-class="{'has-error': (addToApplicationForm.mountVolume.$error.pattern && addToApplicationForm.mountVolume.$touched)}">
<input class="form-control"
name="mountVolume"
id="mountVolume"
placeholder="Enter a mount path"
type="text"
required
ng-pattern="/^\/.*$/"
osc-unique="ctrl.existingMountPaths"
aria-describedby="mount-path-help"
ng-disabled="ctrl.addType !== 'volume' || ctrl.disableInputs"
ng-model="ctrl.mountVolume"
autocorrect="off"
autocapitalize="off"
spellcheck="false">
</div>
<div class="help-block bind-description">
Mount Path for the volume. A file will be created in this director for each key from the secret. The file contents will be the value of the key.
</div>
<div class="has-error" ng-show="addToApplicationForm.mountVolume.$error.oscUnique">
<span class="help-block">
The mount path is already used. Please choose another mount path.
</span>
</div>
</div>
</div>
</div>
<div class="button-group pull-right">
<button
class="btn btn-default"
ng-class="{'dialog-btn': isDialog}"
ng-click="ctrl.onCancel()">
Cancel
</button>
<button type="submit"
class="btn btn-primary"
ng-class="{'dialog-btn': isDialog}"
ng-click="ctrl.addToApplication()"
ng-disabled="ctrl.addType === 'volume' && addToApplicationForm.$invalid || !ctrl.application"
value="">
Save
</button>
</div>
</fieldset>
</form>
<div class="updating" ng-if="ctrl.updating">
<div class="spinner spinner-lg" aria-hidden="true"></div>
<h3>
<span class="sr-only">Updating</span>
</h3>
</div>
</div>
</div>