@@ -83,7 +83,7 @@ <h3><i class="fas fa-list" aria-hidden="true"></i> Resource Information</h3>
83
83
</ div >
84
84
85
85
<!-- Start Storage Report -->
86
- {% if resource.resource_type.name == "Storage" %}
86
+ {% if resource.resource_type.name == "Storage" and user_is_manager %}
87
87
< div class ="card mb-3 ">
88
88
< div class ="card-header ">
89
89
< h3 class ="d-inline "> < i class ="fas fa-info-circle " aria-hidden ="true "> </ i > Storage Report</ h3 >
@@ -95,7 +95,7 @@ <h3 class="d-inline"><i class="fas fa-info-circle" aria-hidden="true"></i> Stora
95
95
{% endif %}
96
96
97
97
<!-- Start Resource Attributes -->
98
- {% if attributes or request.user.is_superuser %}
98
+ {% if user_is_manager %}
99
99
< div class ="card mb-3 ">
100
100
< div class ="card-header ">
101
101
< h3 class ="d-inline "> < i class ="fas fa-info-circle " aria-hidden ="true "> </ i > Resource Attributes</ h3 >
@@ -174,7 +174,7 @@ <h3 class="d-inline"><i class="fas fa-users" aria-hidden="true"></i> Resource Ad
174
174
</ div >
175
175
176
176
<!-- Start Resource Allocations -->
177
- {% if user_is_manager and 'Cluster' in resource.resource_type.name %}
177
+ {% if user_is_manager %}
178
178
< div class ="card mb-3 ">
179
179
< div class ="card-header ">
180
180
< h3 class ="d-inline "> < i class ="fas fa-users " aria-hidden ="true "> </ i > Resource Allocations</ h3 >
@@ -183,11 +183,13 @@ <h3 class="d-inline"><i class="fas fa-users" aria-hidden="true"></i> Resource Al
183
183
{# {% if user_sync_dt %}#}
184
184
{# < span class ="float-right "> Last Sync: {{user_sync_dt}}</ span > #}
185
185
{# {% endif %}#}
186
- < div class ="float-right ">
187
- < a class ="btn btn-danger " href ="{% url 'resource-allocations-edit' resource.pk %} " role ="button ">
188
- < i class ="fas fa-edit " aria-hidden ="true "> </ i > Edit Resource Allocations
189
- </ a >
190
- </ div >
186
+ {% if 'Cluster' in resource.resource_type.name %}
187
+ < div class ="float-right ">
188
+ < a class ="btn btn-danger " href ="{% url 'resource-allocations-edit' resource.pk %} " role ="button ">
189
+ < i class ="fas fa-edit " aria-hidden ="true "> </ i > Edit Resource Allocations
190
+ </ a >
191
+ </ div >
192
+ {% endif %}
191
193
</ div >
192
194
< div class ="card-body ">
193
195
< div class ="table-responsive ">
@@ -198,22 +200,28 @@ <h3 class="d-inline"><i class="fas fa-users" aria-hidden="true"></i> Resource Al
198
200
< tr >
199
201
< th scope ="col "> Project</ th >
200
202
< th scope ="col "> Users</ th >
201
- < th scope ="col "> CPU Hours</ th >
202
- < th scope ="col "> Percent Usage</ th >
203
- < th scope ="col "> RawShare</ th >
204
- < th scope ="col "> EffectvUsage < a class ="info-button " title ="EffectvUsage " data-toggle ="popover " data-trigger ="click "
205
- 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 "
206
- aria-hidden ="true "> </ i > </ a >
207
- </ th >
208
- < th scope ="col "> NormShares < a class ="info-button " title ="NormShares " data-toggle ="popover " data-trigger ="click "
209
- 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>. "
210
- > < i class ="fas fa-info-circle " aria-hidden ="true "> </ i > </ a >
211
- </ th >
212
- < th scope ="col "> FairShare < a class ="info-button " title ="FairShare " data-toggle ="popover " data-trigger ="click "
213
- 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>. "
214
- > < i class ="fas fa-info-circle " aria-hidden ="true "> </ i >
215
- </ a >
216
- </ th >
203
+ {% if 'Cluster' in resource.resource_type.name %}
204
+ < th scope ="col "> CPU Hours</ th >
205
+ < th scope ="col "> Percent Usage</ th >
206
+ < th scope ="col "> RawShare</ th >
207
+ < th scope ="col "> EffectvUsage < a class ="info-button " title ="EffectvUsage " data-toggle ="popover " data-trigger ="click "
208
+ 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 "
209
+ aria-hidden ="true "> </ i > </ a >
210
+ </ th >
211
+ < th scope ="col "> NormShares < a class ="info-button " title ="NormShares " data-toggle ="popover " data-trigger ="click "
212
+ 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>. "
213
+ > < i cl ass ="fas fa-info-circle " aria-hidden ="true "> </ i > </ a >
214
+ </ th >
215
+ < th scope ="col "> FairShare < a class ="info-button " title ="FairShare " data-toggle ="popover " data-trigger ="click "
216
+ 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>. "
217
+ > < i cla ss ="fas fa-info-circle " aria-hidden ="true "> </ i >
218
+ </ a >
219
+ </ th >
220
+ {% elif resource.resource_type.name == 'Storage' %}
221
+ < th scope ="col "> Path</ th >
222
+ < th scope ="col "> Quota ({{ resource.quantity_label }})</ th >
223
+ < th scope ="col "> Used ({{ resource.quantity_label }})</ th >
224
+ {% endif %}
217
225
</ tr >
218
226
</ thead >
219
227
@@ -226,28 +234,44 @@ <h3 class="d-inline"><i class="fas fa-users" aria-hidden="true"></i> Resource Al
226
234
</ a >
227
235
</ td >
228
236
< td > {{ allocation.user_count }}</ td >
229
- < td data-sort ="{{allocation.usage}} " name ="usage ">
230
- {% if allocation.usage is None %}
231
- 0
232
- {% else %}
233
- {{ allocation.usage|floatformat:1 }}
234
- {% endif %}
235
- </ td >
236
- < td data-sort ="{{allocation.usage}} " name ="usage_pct ">
237
- {% if allocation.usage is None or allocation.usage == 0 %}
238
- 0%
239
- {% else %}
240
- {{allocation.usage|div:total_hours|mul:100|floatformat:2 }}%
241
- {% endif %}
242
- </ td >
243
- < td > {{ allocation.rawshares}}</ td >
244
- < td > {{ allocation.effectvusage }}</ td >
245
- < td > {{ allocation.normshares }}</ td >
246
- < td > {{ allocation.fairshare }}</ td >
247
-
237
+ {% if 'Cluster' in resource.resource_type.name %}
238
+ < td data-sort ="{{allocation.usage}} " name ="usage ">
239
+ {% if allocation.usage is None %}
240
+ 0
241
+ {% else %}
242
+ {{ allocation.usage|floatformat:1 }}
243
+ {% endif %}
244
+ </ td >
245
+ < td data-sort ="{{allocation.usage}} " name ="usage_pct ">
246
+ {% if allocation.usage is None or allocation.usage == 0 %}
247
+ 0%
248
+ {% else %}
249
+ {{allocation.usage|div:total_hours|mul:100|floatformat:2 }}%
250
+ {% endif %}
251
+ </ td >
252
+ < td > {{ allocation.rawshares}}</ td >
253
+ < td > {{ allocation.effectvusage }}</ td >
254
+ < td > {{ allocation.normshares }}</ td >
255
+ < td > {{ allocation.fairshare }}</ td >
256
+ {% elif resource.resource_type.name == 'Storage' %}
257
+ < td > {{ allocation.path }}</ td >
258
+ < td > {{ allocation.size|floatformat:2 }}</ td >
259
+ < td > {{ allocation.usage|floatformat:2 }}</ td >
260
+ {% endif %}
248
261
</ tr >
249
262
{% endfor %}
250
263
</ tbody >
264
+ {% if resource.resource_type.name == 'Storage' %}
265
+ < tfoot >
266
+ < tr style ="background-color:#C2C2C2;font-weight:bold ">
267
+ < td > Total Tracked Storage</ td >
268
+ < td > </ td >
269
+ < td > </ td >
270
+ < td > {{ allocation_total.size|floatformat:1}}</ td >
271
+ < td > {{ allocation_total.usage|floatformat:1}}</ td >
272
+ </ tr >
273
+ </ tfoot >
274
+ {% endif %}
251
275
</ table >
252
276
</ div >
253
277
0 commit comments