MCPcopy
hub / github.com/MikeChongCan/scylla / loadData

Method loadData

frontend/src/components/ProxyList.tsx:89–120  ·  view source on GitHub ↗
(props: any)

Source from the content-addressed store, hash-verified

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;

Callers 2

componentDidMountMethod · 0.95

Calls 3

getBaseURLFunction · 0.90
getMethod · 0.80
parseMethod · 0.45

Tested by

no test coverage detected