Commit 51c837bd authored by ari_darmawan's avatar ari_darmawan

fix bug next page

parent bc482aa5
...@@ -24,11 +24,11 @@ ...@@ -24,11 +24,11 @@
</div> </div>
<div class="col-12 col-sm-12 col-md-12 col-lg-3"> <div class="col-12 col-sm-12 col-md-12 col-lg-3">
<label class="text-muted"><small>Search</small></label> <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>
<div class="col-12 col-sm-12 col-md-4 col-lg-2"> <div class="col-12 col-sm-12 col-md-4 col-lg-2">
<label class="text-muted"><small></small></label> <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> <i class="bi bi-search"></i>
Search Search
</button> </button>
......
...@@ -134,13 +134,19 @@ export class LoginLogsComponent implements OnInit { ...@@ -134,13 +134,19 @@ export class LoginLogsComponent implements OnInit {
} }
} }
onSearch() {
this.listRequest.filter_limit = 10;
this.listRequest.filter_page = 1;
this.requestLogLogin();
}
exportFile() { exportFile() {
const params = { const params = {
"filter_limit": null, "filter_limit": null,
"filter_page": null, "filter_page": null,
} }
AratakaConfig.LoadingPage.showLoading('Export File.., Please wait..') 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) => { .subscribe((response: any) => {
const data = `data:application/octet-stream;base64,${response.base_64}`; 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`; 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 { ...@@ -162,6 +168,7 @@ export class LoginLogsComponent implements OnInit {
requestLogLogin() { requestLogLogin() {
this.isLoading = true; this.isLoading = true;
this.isEmpaty = false;
this.API.post('user_log/list', this.listRequest) this.API.post('user_log/list', this.listRequest)
.subscribe((response: items) => { .subscribe((response: items) => {
if (response.items.length > 0) { 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