/
shares_table.jst
89 lines (87 loc) · 4.22 KB
/
shares_table.jst
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
<div class="alert alert-warning">
<p>
Share size enforcement is temporarily disabled due to incomplete support in
BTRFS. Until this status changes, the effective size of a Share is equal to the
size of the Pool it belongs to.
</p>
</div>
{{#if collectionNotEmpty}}
<table id="shares-table" class="table table-bordered table-striped share-table data-table" width="100%" summary="List of shares">
<thead>
<tr>
<th>Name</th>
<th>Size</th>
<th>Usage <i class="fa fa-info-circle" title="Share content - uses Quotas" /></th>
<th>Btrfs Usage <i class="fa fa-info-circle" title="Share content inc snapshots - uses Quotas" /></th>
<th>Active mount options / Status</th>
<th>Pool (Active mount options / Status) Quotas</th>
<th>Compression <i class="fa fa-info-circle" title="Inherits pool setting if not specified on share" /></th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{{#each shares}}
<tr>
<td><a href="#shares/{{this.id}}"><i class="glyphicon glyphicon-folder-open"></i> {{this.name}}</a></td>
<td>{{humanize_size this.size}}</td>
<td>{{humanize_size this.rusage}}</td>
<td>{{humanize_size this.pqgroup_rusage}} {{checkUsage this.size this.pqgroup_rusage}}</td>
<td>
{{#if this.is_mounted}}
{{this.mount_status}}
{{else}}
<strong><span style="color:red">{{this.mount_status}}</span></strong>
{{/if}}
</td>
<td><a href="#pools/{{this.pool.id}}">{{this.pool.name}}</a>
{{#if this.pool.is_mounted}}
({{this.pool.mount_status}})
{{else}}
(<strong><span style="color:red">{{this.pool.mount_status}}</span></strong>)
{{/if}}
{{# if this.pool.quotas_enabled}}
Enabled
{{else}}
<strong><span style="color:red">Disabled</span></strong>
{{/if}}
</td>
<td>
{{displayCompressionAlgo this.compression_algo this.id}}
</td>
<td>{{#if (isSystemShare this.id this.pool.role)}}
N/A
{{else}}
<a id="delete_share_{{this.name}}" data-id="{{this.id}}" data-name="{{this.name}}" data-action="delete"
data-pool="{{this.pool.name}}" data-size="{{humanize_size this.size}}" data-usage="{{humanize_size this.eusage}}" rel="tooltip" title="Delete share"><i class="glyphicon glyphicon-trash"></i></a>
{{/if}}
</td>
</tr>
{{/each}}
</tbody>
</table>
<a href="#add_share" id="add_share" class="btn btn-primary"><i class="glyphicon glyphicon-edit "></i> Create Share</a>
{{ else }}
<h4>No shares have been created</h4>
<a href="#add_share" id="add_share" class="btn btn-primary"><i class="glyphicon glyphicon-edit "></i> Create Share</a>
{{/if}}
{{! Todo: maintain a common file and function for all modals? }}
<div id="delete-share-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header modal-header-danger">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 class="modal-title">Delete <span class="pass-share-name"></span> ?</h3>
</div>
<div class="modal-body">
<div class="messages"></div>
<p>Deleting <strong><em><span class="pass-share-name"></span></em></strong> will destroy all of its data (<strong><span id="pass-share-usage"></span></strong>). Are you sure?</p>
<label><input type="checkbox" id="force-delete" name="force-delete"> Force Delete <i class="fa fa-info-circle fa-lg"
title="Forces the deletion of undetected Snapshots and then deletes the Share. Useful to forcefully delete the Rock-on root share, for example." rel="tooltip"></i></label>
</div>
<div class="modal-footer">
<button class="btn btn-default" data-dismiss="modal" aria-hidden="true">No</button>
<button id="js-confirm-share-delete" class="btn btn-primary">Yes</button>
</div><!--end modal-fooetr-->
</div><!--end modal-content-->
</div><!--end modal-dialog-->
</div>