Add last_n_active field in UI #instance/filter-users
This commit is contained in:
parent
a50f14472f
commit
f89fde5c66
|
@ -87,6 +87,16 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="input" title="Limit database query when searching and ordering users by latest active ones">
|
||||||
|
<label>Last N active users:</label>
|
||||||
|
<br class="sep"/>
|
||||||
|
<div class="flex">
|
||||||
|
<div>
|
||||||
|
<label for="last_n_active">LIMIT value:</label>
|
||||||
|
<input type="number" name="last_n_active" value="NaN"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<br>
|
<br>
|
||||||
<div class="input flex">
|
<div class="input flex">
|
||||||
<button class="btn center"
|
<button class="btn center"
|
||||||
|
|
|
@ -213,6 +213,12 @@ window.view.instance = {
|
||||||
if (newerThan > 0)
|
if (newerThan > 0)
|
||||||
data.newer_than_days = newerThan;
|
data.newer_than_days = newerThan;
|
||||||
}
|
}
|
||||||
|
var lastNActive = E.element('#filters-current input[name=last_n_active]').value;
|
||||||
|
if (lastNActive !== '') {
|
||||||
|
lastNActive = Number.parseInt(lastNActive);
|
||||||
|
if (lastNActive > 0)
|
||||||
|
data.last_n_active = lastNActive;
|
||||||
|
}
|
||||||
return data;
|
return data;
|
||||||
},
|
},
|
||||||
set_current_filter: function(data) {
|
set_current_filter: function(data) {
|
||||||
|
@ -255,6 +261,8 @@ window.view.instance = {
|
||||||
E.element('#filters-current input[name=older_than_days]').value = Number.parseInt(d.older_than_days);
|
E.element('#filters-current input[name=older_than_days]').value = Number.parseInt(d.older_than_days);
|
||||||
if (d.newer_than_days !== undefined)
|
if (d.newer_than_days !== undefined)
|
||||||
E.element('#filters-current input[name=newer_than_days]').value = Number.parseInt(d.newer_than_days);
|
E.element('#filters-current input[name=newer_than_days]').value = Number.parseInt(d.newer_than_days);
|
||||||
|
if (d.last_n_active !== undefined)
|
||||||
|
E.element('#filters-current input[name=last_n_active]').value = Number.parseInt(d.last_n_active);
|
||||||
};
|
};
|
||||||
if (typeof data === 'object')
|
if (typeof data === 'object')
|
||||||
_process(data);
|
_process(data);
|
||||||
|
|
Loading…
Reference in New Issue