Last change
on this file since 47f4eaf was 47f4eaf, checked in by Marko <Marko@…>, 23 months ago |
Final features implemented
|
-
Property mode
set to
100644
|
File size:
2.0 KB
|
Line | |
---|
1 | import axios from 'axios'
|
---|
2 | import React, { Component } from 'react'
|
---|
3 | import HeaderComponent from '../HeaderComponent/HeaderComponent'
|
---|
4 | import ScrapperInfoComponent from './ScrapperInfoComponent'
|
---|
5 | import "./ScrappersComponent.css"
|
---|
6 |
|
---|
7 | export class ScrappersComponent extends Component {
|
---|
8 | constructor(props) {
|
---|
9 | super(props)
|
---|
10 |
|
---|
11 | this.state = {
|
---|
12 | scrapperinfos: []
|
---|
13 | }
|
---|
14 |
|
---|
15 | }
|
---|
16 |
|
---|
17 | componentDidMount(){
|
---|
18 | var config = {
|
---|
19 | method: 'get',
|
---|
20 | url: '/scrapperinfo',
|
---|
21 | headers: {
|
---|
22 | 'Authorization': 'Bearer '+localStorage.getItem('token')
|
---|
23 | }
|
---|
24 | };
|
---|
25 |
|
---|
26 | axios(config)
|
---|
27 | .then(response => {
|
---|
28 | this.setState({
|
---|
29 | scrapperinfos: response.data
|
---|
30 | })
|
---|
31 | })
|
---|
32 | .catch(error => {
|
---|
33 | console.log(error);
|
---|
34 | });
|
---|
35 | }
|
---|
36 |
|
---|
37 | render() {
|
---|
38 | return (
|
---|
39 | <div className='scrappers-section-main'>
|
---|
40 | <HeaderComponent/>
|
---|
41 | <div className='scrappers-section-header'>
|
---|
42 | <h1 className='scrappers-section-header-text'>
|
---|
43 | Преземање на содржина
|
---|
44 | </h1>
|
---|
45 | </div>
|
---|
46 |
|
---|
47 | <div className='scrappers-info-section'>
|
---|
48 | <table cellPadding={20} className='scrappers-section-table'>
|
---|
49 | <thead className='scrappers-section-table-head'>
|
---|
50 | <tr>
|
---|
51 | <th>Продавница</th>
|
---|
52 | <th>Статус</th>
|
---|
53 | <th>Датум</th>
|
---|
54 | </tr>
|
---|
55 | </thead>
|
---|
56 | <tbody>
|
---|
57 | {
|
---|
58 | this.state.scrapperinfos.map((info,idx) => <ScrapperInfoComponent key={idx} id={info.id} store={info.store}
|
---|
59 | status={info.status} recievedAt={info.recievedAt}/>)
|
---|
60 | }
|
---|
61 | </tbody>
|
---|
62 | </table>
|
---|
63 | </div>
|
---|
64 | </div>
|
---|
65 | )
|
---|
66 | }
|
---|
67 | }
|
---|
68 |
|
---|
69 | export default ScrappersComponent
|
---|
Note:
See
TracBrowser
for help on using the repository browser.