@@ -79,7 +79,7 @@ <h3><i class="fas fa-list" aria-hidden="true"></i> Resource Information</h3>
79
79
</ div >
80
80
81
81
<!-- Start Storage Report -->
82
- {% if resource.resource_type.name == "Storage" %}
82
+ {% if resource.resource_type.name == "Storage" and user_is_manager %}
83
83
< div class ="card mb-3 ">
84
84
< div class ="card-header ">
85
85
< h3 class ="d-inline "> < i class ="fas fa-info-circle " aria-hidden ="true "> </ i > Storage Report</ h3 >
@@ -91,7 +91,7 @@ <h3 class="d-inline"><i class="fas fa-info-circle" aria-hidden="true"></i> Stora
91
91
{% endif %}
92
92
93
93
<!-- Start Resource Attributes -->
94
- {% if attributes or request.user.is_superuser %}
94
+ {% if user_is_manager %}
95
95
< div class ="card mb-3 ">
96
96
< div class ="card-header ">
97
97
< h3 class ="d-inline "> < i class ="fas fa-info-circle " aria-hidden ="true "> </ i > Resource Attributes</ h3 >
@@ -170,7 +170,7 @@ <h3 class="d-inline"><i class="fas fa-users" aria-hidden="true"></i> Resource Ad
170
170
</ div >
171
171
172
172
<!-- Start Resource Allocations -->
173
- {% if user_is_manager and 'Cluster' in resource.resource_type.name %}
173
+ {% if user_is_manager %}
174
174
< div class ="card mb-3 ">
175
175
< div class ="card-header ">
176
176
< h3 class ="d-inline "> < i class ="fas fa-users " aria-hidden ="true "> </ i > Resource Allocations</ h3 >
@@ -179,11 +179,13 @@ <h3 class="d-inline"><i class="fas fa-users" aria-hidden="true"></i> Resource Al
179
179
{# {% if user_sync_dt %}#}
180
180
{# < span class ="float-right "> Last Sync: {{user_sync_dt}}</ span > #}
181
181
{# {% endif %}#}
182
- < div class ="float-right ">
183
- < a class ="btn btn-danger " href ="{% url 'resource-allocations-edit' resource.pk %} " role ="button ">
184
- < i class ="fas fa-edit " aria-hidden ="true "> </ i > Edit Resource Allocations
185
- </ a >
186
- </ div >
182
+ {% if 'Cluster' in resource.resource_type.name %}
183
+ < div class ="float-right ">
184
+ < a class ="btn btn-danger " href ="{% url 'resource-allocations-edit' resource.pk %} " role ="button ">
185
+ < i class ="fas fa-edit " aria-hidden ="true "> </ i > Edit Resource Allocations
186
+ </ a >
187
+ </ div >
188
+ {% endif %}
187
189
</ div >
188
190
< div class ="card-body ">
189
191
< div class ="table-responsive ">
@@ -194,22 +196,28 @@ <h3 class="d-inline"><i class="fas fa-users" aria-hidden="true"></i> Resource Al
194
196
< tr >
195
197
< th scope ="col "> Project</ th >
196
198
< th scope ="col "> Users</ th >
197
- < th scope ="col "> CPU Hours</ th >
198
- < th scope ="col "> Percent Usage</ th >
199
- < th scope ="col "> RawShare</ th >
200
- < th scope ="col "> EffectvUsage < a class ="info-button " title ="EffectvUsage " data-toggle ="popover " data-trigger ="click "
201
- data-content ="The fraction of the cluster the account has been granted. For more information, go <a href='https://docs.rc.fas.harvard.edu/kb/fairshare/#articleTOC_4' title='fairshare calculation'>here</a>. "> < i class ="fas fa-info-circle "
202
- aria-hidden ="true "> </ i > </ a >
203
- </ th >
204
- < th scope ="col "> NormShares < a class ="info-button " title ="NormShares " data-toggle ="popover " data-trigger ="click "
205
- data-content ="Calculated fairshare per user. For more information on this number, go <a href='https://docs.rc.fas.harvard.edu/kb/fairshare/#articleTOC_4' title='fairshare calculation'>here</a>. "
206
- > < i class ="fas fa-info-circle " aria-hidden ="true "> </ i > </ a >
207
- </ th >
208
- < th scope ="col "> FairShare < a class ="info-button " title ="FairShare " data-toggle ="popover " data-trigger ="click "
209
- data-content ="User fairshare, calculated by the equation 2^(-EffectvUsage/NormShares). For more information on fairshare calculation, go <a href='https://docs.rc.fas.harvard.edu/kb/fairshare/#articleTOC_4' title='fairshare calculation'>here</a>. "
210
- > < i class ="fas fa-info-circle " aria-hidden ="true "> </ i >
211
- </ a >
212
- </ th >
199
+ {% if 'Cluster' in resource.resource_type.name %}
200
+ < th scope ="col "> CPU Hours</ th >
201
+ < th scope ="col "> Percent Usage</ th >
202
+ < th scope ="col "> RawShare</ th >
203
+ < th scope ="col "> EffectvUsage < a class ="info-button " title ="EffectvUsage " data-toggle ="popover " data-trigger ="click "
204
+ data-content ="The fraction of the cluster the account has been granted. For more information, go <a href='https://docs.rc.fas.harvard.edu/kb/fairshare/#articleTOC_4' title='fairshare calculation'>here</a>. "> < i class ="fas fa-info-circle "
205
+ aria-hidden ="true "> </ i > </ a >
206
+ </ th >
207
+ < th scope ="col "> NormShares < a class ="info-button " title ="NormShares " data-toggle ="popover " data-trigger ="click "
208
+ data-content ="Calculated fairshare per user. For more information on this number, go <a href='https://docs.rc.fas.harvard.edu/kb/fairshare/#articleTOC_4' title='fairshare calculation'>here</a>. "
209
+ > < i cl ass ="fas fa-info-circle " aria-hidden ="true "> </ i > </ a >
210
+ </ th >
211
+ < th scope ="col "> FairShare < a class ="info-button " title ="FairShare " data-toggle ="popover " data-trigger ="click "
212
+ data-content ="User fairshare, calculated by the equation 2^(-EffectvUsage/NormShares). For more information on fairshare calculation, go <a href='https://docs.rc.fas.harvard.edu/kb/fairshare/#articleTOC_4' title='fairshare calculation'>here</a>. "
213
+ > < i cla ss ="fas fa-info-circle " aria-hidden ="true "> </ i >
214
+ </ a >
215
+ </ th >
216
+ {% elif resource.resource_type.name == 'Storage' %}
217
+ < th scope ="col "> Path</ th >
218
+ < th scope ="col "> Quota ({{ resource.quantity_label }})</ th >
219
+ < th scope ="col "> Used ({{ resource.quantity_label }})</ th >
220
+ {% endif %}
213
221
</ tr >
214
222
</ thead >
215
223
@@ -222,28 +230,44 @@ <h3 class="d-inline"><i class="fas fa-users" aria-hidden="true"></i> Resource Al
222
230
</ a >
223
231
</ td >
224
232
< td > {{ allocation.user_count }}</ td >
225
- < td data-sort ="{{allocation.usage}} " name ="usage ">
226
- {% if allocation.usage is None %}
227
- 0
228
- {% else %}
229
- {{ allocation.usage|floatformat:1 }}
230
- {% endif %}
231
- </ td >
232
- < td data-sort ="{{allocation.usage}} " name ="usage_pct ">
233
- {% if allocation.usage is None or allocation.usage == 0 %}
234
- 0%
235
- {% else %}
236
- {{allocation.usage|div:total_hours|mul:100|floatformat:2 }}%
237
- {% endif %}
238
- </ td >
239
- < td > {{ allocation.rawshares}}</ td >
240
- < td > {{ allocation.effectvusage }}</ td >
241
- < td > {{ allocation.normshares }}</ td >
242
- < td > {{ allocation.fairshare }}</ td >
243
-
233
+ {% if 'Cluster' in resource.resource_type.name %}
234
+ < td data-sort ="{{allocation.usage}} " name ="usage ">
235
+ {% if allocation.usage is None %}
236
+ 0
237
+ {% else %}
238
+ {{ allocation.usage|floatformat:1 }}
239
+ {% endif %}
240
+ </ td >
241
+ < td data-sort ="{{allocation.usage}} " name ="usage_pct ">
242
+ {% if allocation.usage is None or allocation.usage == 0 %}
243
+ 0%
244
+ {% else %}
245
+ {{allocation.usage|div:total_hours|mul:100|floatformat:2 }}%
246
+ {% endif %}
247
+ </ td >
248
+ < td > {{ allocation.rawshares}}</ td >
249
+ < td > {{ allocation.effectvusage }}</ td >
250
+ < td > {{ allocation.normshares }}</ td >
251
+ < td > {{ allocation.fairshare }}</ td >
252
+ {% elif resource.resource_type.name == 'Storage' %}
253
+ < td > {{ allocation.path }}</ td >
254
+ < td > {{ allocation.size|floatformat:2 }}</ td >
255
+ < td > {{ allocation.usage|floatformat:2 }}</ td >
256
+ {% endif %}
244
257
</ tr >
245
258
{% endfor %}
246
259
</ tbody >
260
+ {% if resource.resource_type.name == 'Storage' %}
261
+ < tfoot >
262
+ < tr style ="background-color:#C2C2C2;font-weight:bold ">
263
+ < td > Total Tracked Storage</ td >
264
+ < td > </ td >
265
+ < td > </ td >
266
+ < td > {{ allocation_total.size|floatformat:1}}</ td >
267
+ < td > {{ allocation_total.usage|floatformat:1}}</ td >
268
+ </ tr >
269
+ </ tfoot >
270
+ {% endif %}
247
271
</ table >
248
272
</ div >
249
273
0 commit comments