forked from openiap/opencore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDuplicates.html
More file actions
179 lines (162 loc) · 6.03 KB
/
Copy pathDuplicates.html
File metadata and controls
179 lines (162 loc) · 6.03 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
<div class="row">
<h1 translate lib="web">duplicates tracking</h1>
</div>
<div class=" col-md-6 text-right">
</div>
<div ng-show="ctrl.errormessage != ''"" class=" alert alert-danger" role="alert">{{ctrl.errormessage}}</div>
<div class="form-group form-horizontal">
<div class="col-sm">
<label class="sr-only">Uniqeness</label>
<div class="input-group unframed-addons">
<input ng-model="ctrl.uniqeness" ng-change="ctrl.loadData()" class="form-control input-md"
ng-model-options="{debounce: 400}" placeholder="group by fields seperated by comma" />
<p class="col-md-1 lead"></p>
<div class="text-right">
<i class="fas fa-cog fa-spin" ng-show="ctrl.loading==true"></i>
<button class="btn btn-info" ng-disabled="ctrl.loading==true" ng-click="ctrl.MassDeleteOnlyOne()"><em
class="fas fa-trash"></em> one</button>
<button class="btn btn-info" ng-disabled="ctrl.loading==true" ng-click="ctrl.MassDeleteAllButOne()"><em
class="fas fa-trash"></em> all but one</button>
<button class="btn btn-info" ng-disabled="ctrl.loading==true" ng-click="ctrl.MassDeleteAll()"><em
class="fas fa-trash"></em> all</button>
</div>
</div>
</div>
</div>
<div class="form-group form-horizontal">
<div class="input-group unframed-addons col-sm-9" ng-show="ctrl.keys.length < 8">
<div ng-repeat="model in ctrl.keys" class="border">
<input type="checkbox" ng-model="ctrl.uniqeness.split(',').indexOf(model) > -1"
ng-click="ctrl.ToggleUniqeness(model)" ng-model-options="{debounce: 400}" />
{{model}}
</div>
</div>
</div>
<div class="form-group form-horizontal" ng-show="ctrl.keys.length >= 8">
<div class="input-group unframed-addons col-sm-9 ">
<div id="list1" class="dropdown-check-list" tabindex="100">
<span class="anchor">Select fields</span>
<ul class="items">
<li ng-repeat="model in ctrl.keys"><input type="checkbox"
ng-model="ctrl.uniqeness.split(',').indexOf(model) > -1" ng-click="ctrl.ToggleUniqeness(model)" />{{model}}
</li>
</ul>
</div>
</div>
</div>
</div>
<table id=" table1" class="table table-striped table-hover table-sm" when-scrolled="ctrl.more()" style="width: 100%;">
<caption></caption>
<thead class="thead-dark">
<tr>
<th scope="col" ng-click="ctrl.ToggleOrder('_id')"><strong>_id</strong></th>
<th scope="col" ng-click="ctrl.ToggleOrder('name')"><strong>name</strong></th>
<th scope="col" class="w-50" ng-click="ctrl.ToggleOrder('count')"><strong>count</strong></th>
<th scope="col" class="w-300"></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="model in ctrl.models">
<td><a ng-click="ctrl.ShowData(model)">{{model._id}}</a></td>
<td><a ng-click="ctrl.ShowData(model)">{{model.items[0].name}}</a></td>
<td>{{model.count}}</td>
<td>
<a href ng-click="ctrl.DeleteOnlyOne(model)" ng-disabled="ctrl.loading==true" class="btn"><em
class="fas fa-trash"></em> one</a>
<a href ng-click="ctrl.DeleteAllButOne(model)" ng-disabled="ctrl.loading==true" class="btn"><em
class="fas fa-trash"></em> all but one</a>
<a href ng-click="ctrl.DeleteAll(model)" ng-disabled="ctrl.loading==true" ng-disabled="ctrl.loading==true"
class="btn"><em class="fas fa-trash"></em> all</a>
</td>
</tr>
</tbody>
</table>
<div class="modal" tabindex="-1" role="dialog" id="exampleModal">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">First 20 duplicates</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<table id=" table1" class="table table-striped table-hover table-sm" when-scrolled="ctrl.more()"
style="width: 100%;">
<caption></caption>
<thead class="thead-dark">
<th scope="col"><strong>id</strong></th>
<th scope="col"><strong>name</strong></th>
<th scope="col"></th>
</thead>
<tbody>
<tr ng-repeat="model in ctrl.model.items | limitTo: 20">
<td class="btn-cell">
<a ng-href="#/Entity/{{ctrl.collection}}/{{model._id}}" ng-click="ctrl.CloseModal()"
class="table-btn"><em class="fas fa-edit"></em>{{ model._id }}</a>
</td>
<td class="btn-cell">
{{ model.name }}
</td>
<td class="btn-cell">
<a href ng-click="ctrl.ModalDeleteOne(model)" ng-disabled="ctrl.loading==true" class="table-btn"><em
class="fas fa-trash"></em></a>
</td>
</tr>
</tbody>
</table>
<div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<style>
.dropdown-check-list {
display: inline-block;
}
.dropdown-check-list .anchor {
position: relative;
cursor: pointer;
display: inline-block;
padding: 5px 50px 5px 10px;
border: 1px solid #ccc;
}
.dropdown-check-list .anchor:after {
position: absolute;
content: "";
border-left: 2px solid black;
border-top: 2px solid black;
padding: 5px;
right: 10px;
top: 20%;
-moz-transform: rotate(-135deg);
-ms-transform: rotate(-135deg);
-o-transform: rotate(-135deg);
-webkit-transform: rotate(-135deg);
transform: rotate(-135deg);
}
.dropdown-check-list .anchor:active:after {
right: 8px;
top: 21%;
}
.dropdown-check-list ul.items {
padding: 2px;
display: none;
margin: 0;
border: 1px solid #ccc;
border-top: none;
}
.dropdown-check-list ul.items li {
list-style: none;
}
.dropdown-check-list.visible .anchor {
color: #0094ff;
}
.dropdown-check-list.visible .items {
display: block;
}
</style>