pomeriggio 12/02

This commit is contained in:
matteo
2019-02-12 18:56:56 +01:00
parent 4ac7f80d2f
commit 4631fa7ec2
3 changed files with 26 additions and 26 deletions
+1 -1
View File
@@ -79,7 +79,7 @@ static getDerivedStateFromProps(nextProps, prevState) {
</Collapse>
</Col>
</ReactHeight>
<Row style={{ "max-height": `calc(90vh - ${this.state.blackbgHeight}px )` }} className='mt-1 downSection'>
<Row style={{ "max-height": `calc(98vh - ${this.state.blackbgHeight}px - ${this.state.navHeight}px)` }} className='mt-1 downSection'>
<Switch>
<Route exact path='/' component={VideoList} />
<Route path={["/video/:id", "/search/:query"]} component={Suggestion} />
+2 -1
View File
@@ -5,7 +5,8 @@ import ReactDOM from 'react-dom';
import App from './App';
import registerServiceWorker from './registerServiceWorker';
import { HashRouter, BrowserRouter } from 'react-router-dom'; // eslint-disable-line
localStorage.setItem('lastWatched', JSON.stringify([]))
localStorage['lastWatched'] ? function (){}() : localStorage.setItem('lastWatched', JSON.stringify([]))
localStorage['lastId'] ? function (){}() : localStorage.setItem('lastId','0J2QdDbelmY')
ReactDOM.render(<HashRouter><App /></HashRouter>, document.getElementById('root'));
+23 -24
View File
@@ -12,24 +12,34 @@ class popGlobaleAssoluta extends React.Component {
headers: null
};
ISO_8601parse(a) {
return moment(a, moment.ISO_8601).format('ddd, DD/MM/YYYY hh:mm:ss');
}
componentDidMount() {
// listSiti.map(
// sito =>
// axios.get(`http://site${sito}.tw.cs.unibo.it/globpop`, {
// 'params': {
// 'id': this.props.match.params.id
// }
// })
// )
// let listSiti = ['1828', '1829', '1838', '1839', '1846', '1822', '1847', '1831', '1827', '1848', '1824', '1830', '1836', '1850', '1849', '1851', '1861', '1823', '1863', '1834', '1904', '1906', '1901', '1862', '1859'];
let listSiti = ['1828', '1838', '1839', '1846', '1847', '1831', '1827', '1848',, '1849', '1851', '1823', '1863', '1834', '1904', '1901', '1862', '1859'];
axios.all(listSiti.map(sito => {
axios.get(`http://site${sito}.tw.cs.unibo.it/globpop`, {
let listSiti = ['1828', '1838', '1839', '1846', '1847', '1831', '1827', '1849', '1823', '1863', '1834', '1901', '1859'];
let axiosReq = [];
for(let i=0; i<listSiti.length; i++){
console.log(`http://site${listSiti[i]}.tw.cs.unibo.it/globpop`)
axiosReq.push(axios.get(`http://site${listSiti[i]}.tw.cs.unibo.it/globpop`, {
'params': {
'id': this.props.match.params.id
}
})
})).then( res=>{console.log(res.data)}
)
}
}))
}
Promise.all(axiosReq)
.then(axios.spread((...res) => {
console.log(res.map(x=>x.data))
})
)
}
// METODI
getThumbnailsNames(reccomended) {
@@ -65,18 +75,7 @@ class popGlobaleAssoluta extends React.Component {
}
/*shuffleArray(videoarray) {
for (let i = videoarray.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[videoarray[i], videoarray[j]] = [videoarray[j], videoarray[i]]; // eslint-disable-line no-param-reassign
}
// Durstenfeld shuffle.
// https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm
}*/
render() {
const ISO_8601parse = this.ISO_8601parse;
const { error, isLoaded, items, headers } = this.state;
if (error) {
return (