Archived
pomeriggio 12/02
This commit is contained in:
+1
-1
@@ -79,7 +79,7 @@ static getDerivedStateFromProps(nextProps, prevState) {
|
|||||||
</Collapse>
|
</Collapse>
|
||||||
</Col>
|
</Col>
|
||||||
</ReactHeight>
|
</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>
|
<Switch>
|
||||||
<Route exact path='/' component={VideoList} />
|
<Route exact path='/' component={VideoList} />
|
||||||
<Route path={["/video/:id", "/search/:query"]} component={Suggestion} />
|
<Route path={["/video/:id", "/search/:query"]} component={Suggestion} />
|
||||||
|
|||||||
+2
-1
@@ -5,7 +5,8 @@ import ReactDOM from 'react-dom';
|
|||||||
import App from './App';
|
import App from './App';
|
||||||
import registerServiceWorker from './registerServiceWorker';
|
import registerServiceWorker from './registerServiceWorker';
|
||||||
import { HashRouter, BrowserRouter } from 'react-router-dom'; // eslint-disable-line
|
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')
|
localStorage['lastId'] ? function (){}() : localStorage.setItem('lastId','0J2QdDbelmY')
|
||||||
|
|
||||||
ReactDOM.render(<HashRouter><App /></HashRouter>, document.getElementById('root'));
|
ReactDOM.render(<HashRouter><App /></HashRouter>, document.getElementById('root'));
|
||||||
|
|||||||
@@ -12,24 +12,34 @@ class popGlobaleAssoluta extends React.Component {
|
|||||||
headers: null
|
headers: null
|
||||||
};
|
};
|
||||||
|
|
||||||
ISO_8601parse(a) {
|
|
||||||
return moment(a, moment.ISO_8601).format('ddd, DD/MM/YYYY hh:mm:ss');
|
|
||||||
}
|
|
||||||
|
|
||||||
componentDidMount() {
|
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', '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'];
|
let listSiti = ['1828', '1838', '1839', '1846', '1847', '1831', '1827', '1849', '1823', '1863', '1834', '1901', '1859'];
|
||||||
axios.all(listSiti.map(sito => {
|
let axiosReq = [];
|
||||||
axios.get(`http://site${sito}.tw.cs.unibo.it/globpop`, {
|
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': {
|
'params': {
|
||||||
'id': this.props.match.params.id
|
'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
|
// METODI
|
||||||
getThumbnailsNames(reccomended) {
|
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() {
|
render() {
|
||||||
const ISO_8601parse = this.ISO_8601parse;
|
|
||||||
const { error, isLoaded, items, headers } = this.state;
|
const { error, isLoaded, items, headers } = this.state;
|
||||||
if (error) {
|
if (error) {
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user