forked from openiap/opencore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUsers.html
More file actions
197 lines (184 loc) · 8.87 KB
/
Copy pathUsers.html
File metadata and controls
197 lines (184 loc) · 8.87 KB
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
<style type="text/css">
.nonmultitenant {
/* width: 130px; */
white-space:nowrap
}
.multitenant {
/* width: 245px; */
white-space:nowrap
}
.validated {
/* width: 20px; */
white-space:nowrap
}
.dbusage {
/* width: 80px; */
white-space:nowrap
}
</style>
<div id="title" class="row">
<h1 translate lib="web">users</h1>
</div>
<div class="col-sm-12 text-right">
<em class="fas fa-cog fa-spin" ng-show="ctrl.loading==true"></em>
<input type="checkbox" id="checkbox-1" ng-model="ctrl.skipcustomerfilter" ng-change="ctrl.Search()"
ng-show="menuctrl.WebSocketClientService.multi_tenant">
<label for="checkbox-1" ng-show="menuctrl.WebSocketClientService.multi_tenant"><span translate lib="web">show
all</span></label>
<a href="#/User" class="btn btn-info" translate lib="web">Adduser</a>
</div>
<div ng-show="ctrl.errormessage != ''"" class=" alert alert-danger" role="alert">{{ctrl.errormessage}}</div>
<table id="table1" class="table table-striped" when-scrolled="ctrl.more()" style="width: 100%;">
<thead class="thead-dark">
<tr>
<th ng-click="ctrl.ToggleOrder('name')"><b translate lib="web">name</b></th>
<th ng-click="ctrl.ToggleOrder('username')"><b translate lib="web">username</b></th>
<th ng-click="ctrl.ToggleOrder('_created')"><b translate lib="web">created</b></th>
<th ng-click="ctrl.ToggleOrder('lastseen')"><b translate lib="web">lastseen</b></th>
<th ng-click="ctrl.ToggleOrder('dbusage')" class="dbusage"><b translate lib="web">dbusage</b></th>
<th ng-show="ctrl.WebSocketClientService.validate_user_form != ''" ng-click="ctrl.ToggleOrder('validated')" class="validated">
<em class="fas fa-check"></em>
</th>
<th class="text-right"></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="model in ctrl.models">
<td class="text-truncate"><a style="color: inherit; text-decoration: inherit;" ng-href="#/User/{{model._id}}">{{model.name}}</a></td>
<td class="text-truncate">{{model.username}}</td>
<td>
<timesince ng-model="model._created" />
</td>
<td>
<timesince ng-model="model.lastseen" />
</td>
<td class="dbusage">
<div >
<format-bytes ng-model="model.dbusage" />
</div>
</td>
<td ng-show="ctrl.WebSocketClientService.validate_user_form != ''" class="validated">
<em ng-show="model.validated" class="fas fa-check"></em>
</td>
<td
ng-class="{multitenant: menuctrl.WebSocketClientService.multi_tenant == true, nonmultitenant: menuctrl.WebSocketClientService.multi_tenant == false}"
>
<div
class="text-right"
>
<a href ng-click="ctrl.ShowPlans(model)" class="btn" role="button" ng-show="menuctrl.user.customerid != null && menuctrl.WebSocketClientService.multi_tenant && model.customerid && model.customerid != '' &&
(menuctrl.hasrole('admins') || menuctrl.hasrole('customer admins') || menuctrl.hasrole('resellers'))
">
<em class="fas fa-money-bill-wave"></em></a>
<a ng-href="#/Customer/{{model.customerid}}" class="btn" role="button" ng-show="menuctrl.user.customerid != null && menuctrl.WebSocketClientService.multi_tenant && model.customerid && model.customerid != ''">
<em class="fas fa-industry"></em></a>
<a ng-href ng-click="ctrl.Impersonate(model)" class="btn"
ng-show="model._id != ctrl.WebSocketClientService.user._id"><em class="fas fa-user-secret"></em></a>
<em class="btn fas fa-user-secret disabled" ng-show="model._id == ctrl.WebSocketClientService.user._id"></em>
<a class="btn" ng-href="#/User/{{model._id}}">
<em class="fas fa-edit"></em>
</a>
<a href ng-click="ctrl.DeleteOne(model)" class="btn" ng-disabled="ctrl.loading==true"
ng-class="{'btn-danger': ctrl.shiftdown==true && ctrl.collection == 'users' && (model._type == 'user' || model._type == 'customer')}"><em
class="fas fa-trash"></em></a>
</div>
</td>
</tr>
</tbody>
</table>
<div class="modal" id="resourceModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<a href="#" class="close" role="button" aria-label="Close">
<span aria-hidden="true">×</span>
</a>
<h5 class="modal-title">Services for {{ctrl.user.name}}</h5>
<p>
<div ng-repeat="Resource in ctrl.Resources | orderBy: 'order'">
<div class="row" ng-repeat="Product in Resource.products | orderBy: 'order'"
ng-show="Resource.userassign == 'multiplevariants'">
<div class="col">{{Product.name}}</div>
<div class="col">{{ Product.count }}</div>
<div class="col">
<a href ng-click="ctrl.AddPlan(Resource, Product)" class="btn" role="button"
ng-show="(Product.count == 0 || Product.userassign == 'multiple') && ctrl.loading==false">
<em class="fas fa-money-bill-wave"></em></a>
<a href ng-click="ctrl.RemovePlan(Resource, Product)" class="btn" role="button"
ng-show="Product.count > 0 && ctrl.loading==false">
<em class="fas fa-trash"></em></a>
</div>
</div>
<div class="row" ng-show="Resource.userassign == 'singlevariant'">
<div class="col">{{Resource.name}}</div>
<div class="col">
<select ng-model="Resource.newproduct"
ng-options="item as item.name for item in Resource.products | orderBy: 'order'"
ng-disabled="ctrl.loading==true">
</select>
</div>
<div class="col">
<a href ng-click="ctrl.AddPlan(Resource, Resource.newproduct)" class="btn" role="button"
ng-show="(Resource.newproduct.count == 0 || Resource.newproduct.userassign == 'multiple') && ctrl.loading==false">
<em class="fas fa-money-bill-wave"></em></a>
<em class="fas fa-money-bill-wave disabled btn"
ng-show="(Resource.newproduct.count > 0 && Resource.newproduct.userassign != 'multiple') || Resource.newproduct == null || ctrl.loading==true"></em>
<a href ng-click="ctrl.RemovePlan(Resource, Resource.newproduct)" class="btn" role="button"
ng-show="Resource.newproduct.count > 0 && ctrl.loading==false">
<em class="fas fa-trash"></em></a>
<em class="fas fa-trash disabled btn"
ng-show="(Resource.newproduct.count == 0) || Resource.newproduct == null || ctrl.loading==true"></em>
</div>
</div>
</div>
</p>
<div class="text-right mt-20">
<!-- text-right = text-align: right, mt-20 = margin-top: 2rem (20px) -->
<a href class="btn mr-5" role="button" ng-click="ctrl.ToggleModal()">Close</a>
</div>
</div>
</div>
</div>
<div class="modal modal-full" id="NextInvoiceModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<a href="#" class="close" role="button" aria-label="Close">
<span aria-hidden="true">×</span>
</a>
<h5 class="modal-title" ng-show="!ctrl.proration">Next Invoice for
{{ctrl.WebSocketClientService.customer.name}}</h5>
<h5 class="modal-title" ng-show="ctrl.proration">Accept next Invoice for
{{ctrl.WebSocketClientService.customer.name}}</h5>
<h6>{{ ctrl.period_start }} to {{ ctrl.period_end }}</h6>
<p>
<div class="row" ng-repeat="line in ctrl.nextinvoice.lines.data">
<div class="col">{{line.description}}</div>
<div class="col">{{ line.quantity }}</div>
<div class="col">{{ line.amount / 100 }} {{ line.currency }}</div>
</div>
<hr
ng-show="(ctrl.nextinvoice.tax && ctrl.nextinvoice.tax > 0) || (ctrl.nextinvoice.total_discount_amounts && ctrl.nextinvoice.total_discount_amounts.length > 0)">
<div class="row" ng-show="ctrl.nextinvoice.tax && ctrl.nextinvoice.tax > 0">
<div class="col">Tax</div>
<div class="col"></div>
<div class="col">{{ ctrl.nextinvoice.tax / 100 }} {{ ctrl.nextinvoice.currency }}</div>
</div>
<div class="row" ng-repeat="item in ctrl.nextinvoice.total_discount_amounts">
<div class="col">Discount</div>
<div class="col"></div>
<div class="col">{{ item.amount / 100 }} {{ ctrl.nextinvoice.currency }}</div>
</div>
<hr>
<div class="row">
<div class="col">Total</div>
<div class="col"></div>
<div class="col">{{ ctrl.nextinvoice.amount_due / 100 }} {{ ctrl.nextinvoice.currency }}</div>
</div>
</p>
<div class="text-right mt-20">
<a href ng-show="ctrl.proration" class="btn mr-5 btn-success" role="button"
ng-click="ctrl.AddPlan2()">Accept</a>
<a href class="btn mr-5" role="button" ng-click="ctrl.ToggleNextInvoiceModal()">Close</a>
</div>
</div>
</div>
</div>