Commit 51c837bd authored by ari_darmawan's avatar ari_darmawan

fix bug next page

parent bc482aa5
......@@ -24,11 +24,11 @@
</div>
<div class="col-12 col-sm-12 col-md-12 col-lg-3">
<label class="text-muted"><small>Search</small></label>
<input type="text" class="form-control form-control-sm" (keyup.enter)="requestLogLogin()" [(ngModel)]="listRequest.search_text" placeholder="Type.." maxlength="100">
<input type="text" class="form-control form-control-sm" (keyup.enter)="onSearch()" [(ngModel)]="listRequest.search_text" placeholder="Type.." maxlength="100">
</div>
<div class="col-12 col-sm-12 col-md-4 col-lg-2">
<label class="text-muted"><small></small></label>
<button class="btn btn-sm btn-success arataka-btn-success" style="margin-top: 31px; width: 100px;" (click)="requestLogLogin()">
<button class="btn btn-sm btn-success arataka-btn-success" style="margin-top: 31px; width: 100px;" (click)="onSearch()">
<i class="bi bi-search"></i>
Search
</button>
......
......@@ -134,13 +134,19 @@ export class LoginLogsComponent implements OnInit {
}
}
onSearch() {
this.listRequest.filter_limit = 10;
this.listRequest.filter_page = 1;
this.requestLogLogin();
}
exportFile() {
const params = {
"filter_limit": null,
"filter_page": null,
}
AratakaConfig.LoadingPage.showLoading('Export File.., Please wait..')
this.API.exportFile('user_log/export', this.listRequest)
this.API.exportFile('user_log/export', params)
.subscribe((response: any) => {
const data = `data:application/octet-stream;base64,${response.base_64}`;
const fileName: string = `log-login-${moment(this.listRequest.time_start).format('DD MMM YYYY')}-${moment(this.listRequest.time_end).format('DD MMM YYYY')}-${moment(new Date()).format('DD MMM YYYY LTS')}.xlsx`;
......@@ -162,6 +168,7 @@ export class LoginLogsComponent implements OnInit {
requestLogLogin() {
this.isLoading = true;
this.isEmpaty = false;
this.API.post('user_log/list', this.listRequest)
.subscribe((response: items) => {
if (response.items.length > 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment