forked from openshift/origin-web-console
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathosc-persistent-volume-claim.html
230 lines (225 loc) · 10.1 KB
/
osc-persistent-volume-claim.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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<ng-form name="persistentVolumeClaimForm">
<fieldset ng-disabled="claimDisabled">
<div ng-if="persistentVolumeClaimForm.capacity.$error.outOfClaims" class="has-error">
<div class="alert alert-danger">
<span class="pficon pficon-error-circle-o" aria-hidden="true"></span>
<strong>Storage quota limit has been reached. You will not be able to create any new storage.</strong>
<a ng-href="project/{{projectName}}/quota" target="_blank">View Quota </a>
</div>
</div>
<div ng-if="storageClasses.length" class="form-group">
<!--storage class-->
<label>Storage Class</label>
<div>
<ui-select
ng-model="claim.storageClass"
theme="bootstrap"
search-enabled="true"
title="Select a storage class"
class="select-role">
<ui-select-match placeholder="Select a storage class">
<span>
{{$select.selected.metadata.name}}
</span>
</ui-select-match>
<ui-select-choices
repeat="sclass as sclass in storageClasses | toArray | filter : { metadata: { name: $select.search } } ">
<div>
<span ng-bind-html="sclass.metadata.name | highlight : $select.search"></span>
<span ng-if="sclass.parameters.type || sclass.parameters.zone || (sclass | description)" class="text-muted">
<small>–
<span ng-if="sclass.parameters.type">
Type: {{sclass.parameters.type}}
</span>
<span ng-if="sclass.parameters.zone">
<span ng-if="sclass.parameters.type">|</span>
Zone: {{sclass.parameters.zone}}
</span>
<span ng-if="sclass | description">
<span ng-if="sclass.parameters.type || sclass.parameters.zone">|</span>
{{sclass | description}}
</span>
</small>
</span>
</div>
</ui-select-choices>
</ui-select>
</div>
<div id="claim-storage-class-help" class="help-block">
Storage classes are set by the administrator to define types of storage the users can select.
<span ng-if="defaultStorageClass"> If another storage class is not chosen, the default storage class <var>{{defaultStorageClass.metadata.name}}</var> will be used.</span>
<div class="learn-more-block">
<a ng-href="{{'storage_classes' | helpLink}}" target="_blank">Learn More <i class="fa fa-external-link" aria-hidden="true"> </i></a>
</div>
</div>
</div>
<!-- Name -->
<div class="form-group">
<label for="claim-name" class="required">Name</label>
<span ng-class="{ 'has-error': persistentVolumeClaimForm.name.$invalid && persistentVolumeClaimForm.name.$touched && !claimDisabled }">
<input
id="claim-name"
class="form-control"
type="text"
name="name"
ng-model="claim.name"
ng-required="true"
ng-pattern="nameValidation.pattern"
ng-maxlength="nameValidation.maxlength"
placeholder="my-storage-claim"
take-focus
select-on-focus
autocorrect="off"
autocapitalize="none"
spellcheck="false"
aria-describedby="claim-name-help">
</span>
<div>
<span id="claim-name-help" class="help-block">A unique name for the storage claim within the project.</span>
</div>
<div class="has-error" ng-show="persistentVolumeClaimForm.name.$error.required && persistentVolumeClaimForm.name.$touched && !claimDisabled">
<span class="help-block">
Name is required.
</span>
</div>
<div class="has-error" ng-show="persistentVolumeClaimForm.name.$error.pattern && persistentVolumeClaimForm.name.$touched && !claimDisabled">
<span class="help-block">
{{nameValidation.description}}
</span>
</div>
<div class="has-error" ng-show="persistentVolumeClaimForm.name.$error.maxlength && persistentVolumeClaimForm.name.$touched && !claimDisabled">
<span class="help-block">
Can't be longer than {{nameValidation.maxlength}} characters.
</span>
</div>
</div>
<div class="form-group" >
<label class="required">Access Mode</label><br/>
<label class="radio-inline">
<input type="radio" name="accessModes" ng-model="claim.accessModes" value="ReadWriteOnce" aria-describedby="access-modes-help" ng-checked="true" >
Single User (RWO)
</label>
<label class="radio-inline">
<input type="radio" id="accessModes" name="accessModes" ng-model="claim.accessModes" value="ReadWriteMany" aria-describedby="access-modes-help" >
Shared Access (RWX)
</label>
<label class="radio-inline">
<input type="radio" name="accessModes" ng-model="claim.accessModes" value="ReadOnlyMany" aria-describedby="access-modes-help">
Read Only (ROX)
</label>
<div>
<span id="access-modes-help" class="help-block">Permissions to the mounted volume.</span>
</div>
</div>
<!-- capacity -->
<div ng-if="capacityReadOnly" class="form-group mar-bottom-xl">
<label>Size</label>
<div class="static-form-value-large">
{{claim.amount}} {{claim.unit | humanizeUnit : 'storage'}}
<small>(cannot be changed)</small>
</div>
</div>
<div ng-if="!capacityReadOnly" class="form-group">
<fieldset class="form-inline compute-resource">
<label class="required">
Size
<small ng-if="limits.min && limits.max">
{{limits.min | usageWithUnits : 'storage'}} min to {{limits.max | usageWithUnits : 'storage'}} max
</small>
<small ng-if="limits.min && !limits.max">
Min: {{limits.min | usageWithUnits : 'storage'}}
</small>
<small ng-if="limits.max && !limits.min">
Max: {{limits.max | usageWithUnits : 'storage'}}
</small>
</label>
<div class="resource-size" ng-class="{ 'has-error': persistentVolumeClaimForm.capacity.$invalid && persistentVolumeClaimForm.capacity.$touched && !claimDisabled }">
<div class="resource-amount">
<label for="claim-amount" class="sr-only">Amount</label>
<input type="number"
name="capacity"
id="claim-amount"
ng-model="claim.amount"
required
min="0"
pattern="\d+(\.\d+)?"
select-on-focus
class="form-control"
aria-describedby="claim-capacity-help">
</div>
<div class="resource-unit">
<label class="sr-only" >Unit</label>
<ui-select search-enabled="false" ng-model="claim.unit" input-id="claim-capacity-unit">
<ui-select-match>{{$select.selected.label}}</ui-select-match>
<ui-select-choices repeat="option.value as option in units" group-by="groupUnits">
{{option.label}}
</ui-select-choices>
</ui-select>
</div>
</div>
<div id="claim-capacity-help" class="help-block">
Desired storage capacity.
</div>
<div ng-if="persistentVolumeClaimForm.capacity.$touched && !claimDisabled">
<div class="has-error" ng-show="persistentVolumeClaimForm.capacity.$error.required">
<span class="help-block">
Size is required.
</span>
</div>
<div class="has-error" ng-show="persistentVolumeClaimForm.capacity.$error.number">
<span class="help-block">
Must be a number.
</span>
</div>
<div class="has-error" ng-show="persistentVolumeClaimForm.capacity.$error.min">
<span class="help-block">
Must be a positive number.
</span>
</div>
<div ng-if="persistentVolumeClaimForm.capacity.$error.limitRangeMin" class="has-error">
<span class="help-block">
Can't be less than {{limits.min | usageWithUnits : 'storage'}}.
</span>
</div>
<div ng-if="persistentVolumeClaimForm.capacity.$error.limitRangeMax" class="has-error">
<span class="help-block">
Can't be greater than {{limits.max | usageWithUnits : 'storage'}}.
</span>
</div>
<div ng-if="persistentVolumeClaimForm.capacity.$error.willExceedStorage" class="has-error">
<span class="help-block">
Storage quota will be exceeded. <a ng-href="project/{{projectName}}/quota" target="_blank">View Quota </a>
</span>
</div>
</div>
<div class="learn-more-block mar-top-sm">
<a href="" ng-click="showComputeUnitsHelp()">What are GiB?</a>
</div>
</fieldset>
</div>
<!--advanced options-->
<div ng-show="!showAdvancedOptions" class="mar-bottom-xl">
Use
<a href="" ng-click="showAdvancedOptions = true">label selectors</a>
to request storage.
</div>
<div ng-show="showAdvancedOptions" class="form-group">
<fieldset class="compute-resource">
<label>Label Selector</label>
<div class="help-block mar-bottom-lg">
Enter a label and value to use for your storage.
<div class="learn-more-block">
<a ng-href="{{'selector_label' | helpLink}}" target="_blank">Learn More <i class="fa fa-external-link" aria-hidden="true"></i></a>
</div>
</div>
<key-value-editor
entries="claim.selectedLabels"
key-placeholder="label"
value-placeholder="value"
key-validator="[a-zA-Z][a-zA-Z0-9_-]*"
key-validator-error-tooltip="A valid label name is an alphanumeric (a-z and 0-9) string beginning with a letter that may contain underscores and dashes."
add-row-link="Add Label"></key-value-editor>
</fieldset>
</div>
</fieldset>
</ng-form>