(props: any)
| 87 | } |
| 88 | |
| 89 | async loadData(props: any) { |
| 90 | const parsed = queryString.parse(props.location.search); |
| 91 | |
| 92 | const page = parsed['page'] || 1; |
| 93 | const https = parsed['https'] || null; |
| 94 | const anonymous = parsed['anonymous'] || null; |
| 95 | |
| 96 | const params: any = {}; |
| 97 | |
| 98 | if (page) { |
| 99 | params['page'] = page; |
| 100 | } |
| 101 | |
| 102 | if (https) { |
| 103 | params['https'] = https; |
| 104 | } |
| 105 | |
| 106 | if (anonymous) { |
| 107 | params['anonymous'] = anonymous; |
| 108 | } |
| 109 | |
| 110 | const response = await axios.get(`${getBaseURL()}/api/v1/proxies?${queryString.stringify(params)}`); |
| 111 | const res: ResponseJSON = response.data; |
| 112 | const proxies: Proxy[] = res.proxies; |
| 113 | this.setState({ |
| 114 | proxies: proxies, |
| 115 | count: res.count, |
| 116 | per_page: res.per_page, |
| 117 | page: res.page, |
| 118 | total_page: res.total_page, |
| 119 | }); |
| 120 | } |
| 121 | |
| 122 | renderPagination(): JSX.Element { |
| 123 | const {total_page, page} = this.state; |
no test coverage detected