начало базовых исправлений

This commit is contained in:
Alexey Kasyanchuk
2017-01-02 04:33:50 +03:00
parent 92a68abafe
commit 4843b6eef6
4 changed files with 34 additions and 9 deletions

View File

@ -15,7 +15,7 @@ const mysqlSettings = {
}; };
// Start server // Start server
server.listen(8099); server.listen(8095);
let listenerMysql = mysql.createConnection(mysqlSettings); let listenerMysql = mysql.createConnection(mysqlSettings);
let socketMysql = mysql.createConnection(mysqlSettings); let socketMysql = mysql.createConnection(mysqlSettings);
@ -198,5 +198,5 @@ listenerMysql.connect(function(err) {
// spider.on('nodes', (nodes)=>console.log('foundNodes')) // spider.on('nodes', (nodes)=>console.log('foundNodes'))
spider.listen(4445) //spider.listen(4445)
}); });

View File

@ -4,7 +4,7 @@ import './router';
import PagesPie from './pages-pie.js'; import PagesPie from './pages-pie.js';
var io = require("socket.io-client"); var io = require("socket.io-client");
window.torrentSocket = io('http://localhost:8099/'); window.torrentSocket = io('http://' + document.location.hostname + ':8095/');
class App extends Component { class App extends Component {
componentDidMount() { componentDidMount() {

View File

@ -3,11 +3,29 @@ import React, { Component } from 'react';
import RecentTorrents from './recent-torrents' import RecentTorrents from './recent-torrents'
import Search from './search' import Search from './search'
const Header = (props) => {
return (
<div className='column center w100p fs0-75'>
<div style={{width: '60%'}}>
Welcome to BT Search! This is file search engine to the torrents of the internet.
Here you can easily find torrent or file that you intrested for. We are not responsible for any content of the site:
content are adding automaticly. Content right holders and users can mark/block bad content.
</div>
</div>
);
}
export {Header}
export default class IndexPage extends Component { export default class IndexPage extends Component {
render() { render() {
return ( return (
<div className="column"> <div className="column">
<RecentTorrents /> <Header />
<div className='column center w100p pad1-25'>
<div>Most recent torrents:</div>
<RecentTorrents />
</div>
<Search /> <Search />
</div> </div>
); );

View File

@ -1,4 +1,15 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import formatBytes from './format-bytes'
const TorrentLine = (props) => {
const torrent = props.torrent;
return (
<div className='clickable row inline fs0-85 pad0-25' onClick={() => window.router('/torrent/' + torrent.hash)}>
<div>{torrent.name}</div>
<div style={{marginLeft: '8px'}}>({formatBytes(torrent.size, 1)})</div>
</div>
)
}
export default class RecentTorrents extends Component { export default class RecentTorrents extends Component {
constructor() { constructor() {
@ -22,11 +33,7 @@ export default class RecentTorrents extends Component {
<div className="list column"> <div className="list column">
{ {
this.torrents.map((torrent, index) =>{ this.torrents.map((torrent, index) =>{
return( return <TorrentLine key={index} torrent={torrent} />;
<div key={index} className='clickable' onClick={() => window.router('/torrent/' + torrent.hash)}>
{torrent.name}
</div>
);
}) })
} }
</div> </div>