forked from openshift/origin-web-console
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathedit-environment-from.html
187 lines (175 loc) · 8.35 KB
/
edit-environment-from.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<ng-form name="$ctrl.editEnvironmentFromForm" novalidate>
<div
ng-if="$ctrl.showHeader"
class="environment-from-entry environment-from-editor-entry-header">
<div class="environment-from-editor-header config-map-header">
Config Map/Secret
</div>
<div
class="environment-from-editor-header prefix-header"
ng-if="!$ctrl.isEnvFromReadonly() && $ctrl.hasOptions()">
Prefix
<small class="pficon pficon-help tooltip-default-icon"
aria-hidden="true"
data-toggle="tooltip"
data-original-title="Optional prefix added to each environment variable name. A valid prefix is an alphanumeric (a-z and 0-9) string beginning with a letter that may contain underscores."></small>
</div>
</div>
<div ng-model="$ctrl.entries" class="environment-from-editor" as-sortable="$ctrl.dragControlListeners">
<div
class="environment-from-entry"
ng-class-odd="'odd'"
ng-class-even="'even'"
ng-repeat="entry in $ctrl.envFromEntries"
as-sortable-item>
<div class="environment-from-input">
<div class="environment-from-editor-entry-header">
<div class="environment-from-editor-header config-map-header config-map-header-mobile">
Config Map/Secret
</div>
</div>
<div ng-if="$ctrl.isEnvFromReadonly(entry) || !$ctrl.hasOptions()" class="faux-input-group">
<div ng-if="!entry.configMapRef.name && !entry.secretRef.name">
No config maps or secrets have been added as Environment From.
</div>
<div ng-if="entry.configMapRef.name || entry.secretRef.name" class="faux-form-control readonly">
Use all keys and values from
<span ng-if="entry.configMapRef.name">config map {{entry.configMapRef.name}}.</span>
<span ng-if="entry.secretRef.name">secret {{entry.secretRef.name}}.</span>
<span ng-if="entry.prefix">Names will be prefixed with "{{entry.prefix}}"</span>
</div>
</div>
<div ng-if="!$ctrl.isEnvFromReadonly(entry) && $ctrl.hasOptions()">
<div class="ui-select">
<ui-select ng-model="entry.selectedEnvFrom"
ng-required="entry.selectedEnvFrom"
on-select="$ctrl.envFromObjectSelected($index, entry, $select.selected)"
ng-class="{'{{$ctrl.setFocusClass}}' : $last}">
<ui-select-match placeholder="Select a resource">
<span>
{{$select.selected.metadata.name}}
<small class="text-muted">– {{$select.selected.kind | humanizeKind : true}}</small>
</span>
</ui-select-match>
<ui-select-choices
repeat="source in $ctrl.envFromSelectorOptions | filter : { metadata: { name: $select.search } } track by (source | uid)"
group-by="$ctrl.groupByKind">
<span ng-bind-html="source.metadata.name | highlight : $select.search"></span>
</ui-select-choices>
</ui-select>
</div>
</div>
</div>
<div class="environment-from-input prefix">
<div
class="environment-from-editor-header prefix-header prefix-header-mobile"
ng-if="!$ctrl.isEnvFromReadonly() && $ctrl.hasOptions()">
Prefix
<small class="pficon pficon-help tooltip-default-icon"
aria-hidden="true"
data-toggle="tooltip"
data-original-title="Optional prefix added to each environment variable name. A valid prefix is an alphanumeric (a-z and 0-9) string beginning with a letter that may contain underscores."></small>
</div>
<div class="environment-from-input"
ng-if="!$ctrl.isEnvFromReadonly(entry) && $ctrl.hasOptions()"
ng-class="{ 'has-error': ($ctrl.editEnvironmentFromForm['envfrom-prefix-'+$index].$invalid && $ctrl.editEnvironmentFromForm['envfrom-prefix-'+$index].$touched) }">
<label for="envfrom-prefix-{{$index}}" class="sr-only">Prefix</label>
<input type="text"
class="form-control"
placeholder="Add prefix"
id="envfrom-prefix-{{$index}}"
name="envfrom-prefix-{{$index}}"
ng-model="entry.prefix"
ng-pattern="/^[a-zA-Z0-9_]+$/">
<span ng-show="$ctrl.editEnvironmentFromForm['envfrom-prefix-'+$index].$touched">
<span class="help-block key-validation-error"
ng-show="$ctrl.editEnvironmentFromForm['envfrom-prefix-'+$index].$error.pattern">
<span class="validation-text">Please enter a valid prefix.</span>
</span>
</span>
</div>
<div ng-if="!$ctrl.isEnvFromReadonly(entry) && $ctrl.hasEntries()" class="environment-from-editor-button">
<span
ng-if="!$ctrl.cannotSort && $ctrl.entries.length > 1"
class="fa fa-bars sort-row"
role="button"
aria-label="Move row"
aria-grabbed="false"
as-sortable-item-handle></span>
<a
ng-if="!$ctrl.cannotDeleteAny"
href=""
class="pficon pficon-close delete-row as-sortable-item-delete"
role="button"
aria-label="Delete row"
ng-click="$ctrl.deleteEntry($index, 1)"></a>
</div>
<div class="environment-from-view-details">
<a
ng-if="entry.selectedEnvFrom"
href=""
ng-click="$ctrl.viewOverlayPanel(entry.selectedEnvFrom)">View Details</a>
</div>
</div>
</div>
<div class="environment-from-entry" ng-if="!$ctrl.isEnvFromReadonly() && $ctrl.hasOptions()">
<a
href=""
class="add-row-link"
role="button"
ng-click="$ctrl.onAddRow()">Add ALL Values from Config Map or Secret</a>
</div>
</div>
<overlay-panel class="add-config-to-application" show-panel="$ctrl.overlayPanelVisible" show-close="true" handle-close="$ctrl.closeOverlayPanel">
<div class="dialog-title">
<h3>{{$ctrl.overlayPaneEntryDetails.kind | humanizeKind : true}} Details</h3>
</div>
<div class="modal-body">
<h4>{{$ctrl.overlayPaneEntryDetails.metadata.name}}
<small ng-if="$ctrl.overlayPaneEntryDetails.kind === 'Secret'" class="mar-left-sm">
<a href=""
role="button"
ng-click="$ctrl.showSecret = !$ctrl.showSecret">{{$ctrl.showSecret ? "Hide" : "Reveal"}} Secret</a>
</small>
</h4>
<div ng-if="!($ctrl.overlayPaneEntryDetails.data | size)" class="empty-state-message text-center">
The {{$ctrl.overlayPaneEntryDetails.kind | humanizeKind}} has no properties.
</div>
<div ng-if="$ctrl.overlayPaneEntryDetails.data | size" class="table-responsive scroll-shadows-horizontal">
<table class="table table-bordered table-bordered-columns config-map-table key-value-table">
<tbody>
<tr ng-repeat="(prop, value) in $ctrl.decodedData">
<td class="key">{{prop}}</td>
<td class="value">
<truncate-long-text
ng-if="$ctrl.overlayPaneEntryDetails.kind === 'ConfigMap'"
content="value"
limit="50"
newline-limit="2"
expandable="true">
</truncate-long-text>
<span ng-if="!$ctrl.showSecret && $ctrl.overlayPaneEntryDetails.kind === 'Secret'">*****</span>
<div ng-if="$ctrl.showSecret && $ctrl.overlayPaneEntryDetails.kind === 'Secret'">
<truncate-long-text
content="value"
limit="50"
newline-limit="2"
expandable="true">
</truncate-long-text>
<div ng-if="decodedData.$$nonprintable[prop]" class="help-block">
This secret value contains non-printable characters and is displayed as a Base64-encoded string.
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="modal-footer">
<button ng-click="$ctrl.closeOverlayPanel()"
type="button"
class="btn btn-primary pull-right">Close</button>
</div>
</overlay-panel>
</ng-form>