From 486c68accc5cfbfbeb92a08d7d18d75b496f3354 Mon Sep 17 00:00:00 2001 From: "karl.hudgell" Date: Wed, 17 Feb 2021 20:06:36 +0000 Subject: [PATCH] working react router --- SQL (1)/BBLB_DNS_userAccounts.sql | 0 client/public/index.html | 31 ++------- client/src/App.js | 97 ++++++---------------------- client/src/app2.js | 60 ----------------- client/src/components/About.jsx | 30 +++++++++ client/src/components/Footer.jsx | 17 +++++ client/src/components/Home.jsx | 30 +++++++++ client/src/components/Navigation.jsx | 51 +++++++++++++++ client/src/components/ServerList.jsx | 57 ++++++++++++++++ client/src/components/index.js | 5 ++ client/src/old.js | 81 +++++++++++++++++++++++ lib/checker.js | 2 +- lib/streamArray.json | 2 +- 13 files changed, 296 insertions(+), 167 deletions(-) delete mode 100644 SQL (1)/BBLB_DNS_userAccounts.sql delete mode 100644 client/src/app2.js create mode 100644 client/src/components/About.jsx create mode 100644 client/src/components/Footer.jsx create mode 100644 client/src/components/Home.jsx create mode 100644 client/src/components/Navigation.jsx create mode 100644 client/src/components/ServerList.jsx create mode 100644 client/src/components/index.js create mode 100644 client/src/old.js diff --git a/SQL (1)/BBLB_DNS_userAccounts.sql b/SQL (1)/BBLB_DNS_userAccounts.sql deleted file mode 100644 index e69de29..0000000 diff --git a/client/public/index.html b/client/public/index.html index aa069f2..5a7d7c1 100644 --- a/client/public/index.html +++ b/client/public/index.html @@ -9,35 +9,14 @@ name="description" content="Web site created using create-react-app" /> - - - - + React App
- - + \ No newline at end of file diff --git a/client/src/App.js b/client/src/App.js index 4fd2c4c..4908cb3 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -1,81 +1,20 @@ -import React, { Component } from 'react'; -import axios from 'axios'; -import './App.css'; -class App extends Component { - constructor() { - super(); - this.state = { - fname: '', - lname: '', - streams: [] - }; - } - - - componentDidMount() { - fetch('/getStreams') - .then(res => res.json()) - .then(streams => this.setState({ streams })); - } - - - onChange = (e) => { - /* - Because we named the inputs to match their - corresponding values in state, it's - super easy to update the state - */ - this.setState({ [e.target.name]: e.target.value }); - } - - onSubmit = (e) => { - e.preventDefault(); - // get our form data out of state - const { fname, lname } = this.state; - console.log({ fname, lname }) - } - - render() { - const { fname, lname } = this.state; - return ( -
-
-
-

User Login

-

-

-

UserName - -

-

Password - -

-
- -
-

-
-
-
-
-

Stream Details

- {this.state.streams.map(stream => -
{stream.StreamName} - {stream.StreamURL}
- )} -
-
-
- ); - } +import React from "react"; +import { BrowserRouter as Router, Route, Switch } from "react-router-dom"; +import { Navigation, Footer, Home, About, ServerList } from "./components"; +function App() { + return ( +
+ + + + } /> + } /> + } /> + +
+ +
+ ); } + export default App; \ No newline at end of file diff --git a/client/src/app2.js b/client/src/app2.js deleted file mode 100644 index b2b761b..0000000 --- a/client/src/app2.js +++ /dev/null @@ -1,60 +0,0 @@ -import React, { Component } from 'react'; -import axios from 'axios'; - -class UserForm extends Component { - constructor() { - super(); - this.state = { - fname: '', - lname: '', - email: '', - }; - } - - onChange = (e) => { - /* - Because we named the inputs to match their - corresponding values in state, it's - super easy to update the state - */ - this.setState({ [e.target.name]: e.target.value }); - } - - onSubmit = (e) => { - e.preventDefault(); - // get our form data out of state - const { fname, lname, email } = this.state; - - axios.post('/', { fname, lname, email }) - .then((result) => { - //access the results here.... - }); - } - - render() { - const { fname, lname, email } = this.state; - return ( -
- - - - -
- ); - } -} \ No newline at end of file diff --git a/client/src/components/About.jsx b/client/src/components/About.jsx new file mode 100644 index 0000000..367c0d9 --- /dev/null +++ b/client/src/components/About.jsx @@ -0,0 +1,30 @@ +import React from "react"; + +function About() { + return ( +
+
+
+
+ +
+
+

About

+

+ Lorem Ipsum is simply dummy text of the printing and typesetting + industry. Lorem Ipsum has been the industry's standard dummy text + ever since the 1500s, when an unknown printer took a galley of + type and scrambled it to make a type specimen book. +

+
+
+
+
+ ); +} + +export default About; \ No newline at end of file diff --git a/client/src/components/Footer.jsx b/client/src/components/Footer.jsx new file mode 100644 index 0000000..82d7f69 --- /dev/null +++ b/client/src/components/Footer.jsx @@ -0,0 +1,17 @@ +import React from "react"; + +function Footer() { + return ( +
+
+
+

+ Copyright © 2021 +

+
+
+
+ ); +} + +export default Footer; \ No newline at end of file diff --git a/client/src/components/Home.jsx b/client/src/components/Home.jsx new file mode 100644 index 0000000..c5c26ad --- /dev/null +++ b/client/src/components/Home.jsx @@ -0,0 +1,30 @@ +import React from "react"; + +function Home() { + return ( +
+
+
+
+ +
+
+

Home

+

+ Lorem Ipsum is simply dummy text of the printing and typesetting + industry. Lorem Ipsum has been the industry's standard dummy text + ever since the 1500s, when an unknown printer took a galley of + type and scrambled it to make a type specimen book. +

+
+
+
+
+ ); +} + +export default Home; \ No newline at end of file diff --git a/client/src/components/Navigation.jsx b/client/src/components/Navigation.jsx new file mode 100644 index 0000000..7ccdded --- /dev/null +++ b/client/src/components/Navigation.jsx @@ -0,0 +1,51 @@ +import React from "react"; +import { Link, withRouter } from "react-router-dom"; + +function Navigation(props) { + return ( +
+ +
+ ); +} + +export default withRouter(Navigation); diff --git a/client/src/components/ServerList.jsx b/client/src/components/ServerList.jsx new file mode 100644 index 0000000..c6ef8c0 --- /dev/null +++ b/client/src/components/ServerList.jsx @@ -0,0 +1,57 @@ +import React, { Component } from "react"; +import axios from "axios"; + +class ServerList extends Component { + constructor() { + super(); + this.state = { + fname: "", + lname: "", + streams: [], + }; + } + + componentDidMount() { + fetch("/getStreams") + .then((res) => res.json()) + .then((streams) => this.setState({ streams })); + } + + onChange = (e) => { + /* + Because we named the inputs to match their + corresponding values in state, it's + super easy to update the state + */ + this.setState({ [e.target.name]: e.target.value }); + }; + + onSubmit = (e) => { + e.preventDefault(); + // get our form data out of state + const { fname, lname } = this.state; + console.log({ fname, lname }); + }; + + render() { + return ( +
+
+
+
+

Stream Details

+
+
+ {this.state.streams.map((stream) => ( +
+ {stream.StreamName} - {stream.StreamURL} +
+ ))} +
+
+
+
+ ); + } +} +export default ServerList; diff --git a/client/src/components/index.js b/client/src/components/index.js new file mode 100644 index 0000000..cbcb530 --- /dev/null +++ b/client/src/components/index.js @@ -0,0 +1,5 @@ +export { default as Navigation } from "./Navigation"; +export { default as Footer } from "./Footer"; +export { default as Home } from "./Home"; +export { default as About } from "./About"; +export { default as ServerList } from "./ServerList"; \ No newline at end of file diff --git a/client/src/old.js b/client/src/old.js new file mode 100644 index 0000000..4fd2c4c --- /dev/null +++ b/client/src/old.js @@ -0,0 +1,81 @@ +import React, { Component } from 'react'; +import axios from 'axios'; +import './App.css'; +class App extends Component { + constructor() { + super(); + this.state = { + fname: '', + lname: '', + streams: [] + }; + } + + + componentDidMount() { + fetch('/getStreams') + .then(res => res.json()) + .then(streams => this.setState({ streams })); + } + + + onChange = (e) => { + /* + Because we named the inputs to match their + corresponding values in state, it's + super easy to update the state + */ + this.setState({ [e.target.name]: e.target.value }); + } + + onSubmit = (e) => { + e.preventDefault(); + // get our form data out of state + const { fname, lname } = this.state; + console.log({ fname, lname }) + } + + render() { + const { fname, lname } = this.state; + return ( +
+
+
+

User Login

+

+

+

UserName + +

+

Password + +

+
+ +
+

+
+
+
+
+

Stream Details

+ {this.state.streams.map(stream => +
{stream.StreamName} - {stream.StreamURL}
+ )} +
+
+
+ ); + } +} +export default App; \ No newline at end of file diff --git a/lib/checker.js b/lib/checker.js index 82d2a61..970c49e 100644 --- a/lib/checker.js +++ b/lib/checker.js @@ -57,7 +57,7 @@ async function main() { console.log('Finished') } -main() +// main() module.exports = { singleCheck, diff --git a/lib/streamArray.json b/lib/streamArray.json index 6ef176f..f74a7fc 100644 --- a/lib/streamArray.json +++ b/lib/streamArray.json @@ -1 +1 @@ -[{"StreamName":"Insanity","StreamURL":"https://trippy.pro:443"},{"StreamName":"PremPlus","StreamURL":"https://itty.in:443"},{"StreamName":"GunSlinger","StreamURL":"http://gunslingertv.org:8080"},{"StreamName":"VIP","StreamURL":"http://oven-cleaner.com:8080/"},{"StreamName":"Technoid","StreamURL":"http://capoisagod2021.org:8080"},{"StreamName":"Old Premium","StreamURL":"https://caporeds.online:443","username":"Dazg3012","expiaryDate":"12/30/2021"},{"StreamName":"??","StreamURL":"http://screamstreams.info:8080"},{"StreamName":"Gold","StreamURL":"http://catenamode.cf:8090"},{"StreamName":"??","StreamURL":"http://sulu.xyz:2086"},{"StreamName":"??","StreamURL":"http://bigbox.me.uk:2086"},{"StreamName":"??","StreamURL":"http://beautifilm.xyz:8080"},{"StreamName":"??","StreamURL":"https://hulks.xyz:443"},{"StreamName":"??","StreamURL":"http://mytv.digital:8080/"},{"StreamName":"??","StreamURL":"http://theonlinemedia.network:2052"},{"StreamName":"Gold","StreamURL":"http://server1.jforbes.club:8090"},{"StreamName":"??","StreamURL":"http://ths.viewdns.net:8080"},{"StreamName":"??","StreamURL":"http://vpsuk.store:8080"},{"StreamName":"??","StreamURL":"http://ac.mustardsubs.tk:8880"},{"StreamName":"??","StreamURL":"http://faithhosting.xyz:25461"},{"StreamName":"??","StreamURL":"http://ip365.cx:80"},{"StreamName":"??","StreamURL":"https://trippy.pro:443"},{"StreamName":"??","StreamURL":"http://g132.caporeds.online:8080/"},{"StreamName":"??","StreamURL":"http://theonlinemedia.network:2052"},{"StreamName":"??","StreamURL":"http://beautifilm.xyz:8080"},{"StreamName":"??","StreamURL":"http://pimptv.dnsabr.com:8080"},{"StreamName":"??","StreamURL":"http://tavaratv.xyz:2095"},{"StreamName":"??","StreamURL":"http://cms-tan.media:8880"},{"StreamName":"??","StreamURL":"http://streamknighttv.xyz:8080"},{"StreamName":"??","StreamURL":"http://covidsucks.xyz:8080"},{"StreamName":"Gambler","StreamURL":"http://fckbrexit.link:8080"},{"StreamName":"??","StreamURL":"http://tv.realot.xyz:35001"},{"StreamName":"??","StreamURL":"http://www.tvxclnt.com:8080"},{"StreamName":"??","StreamURL":"http://iptv.satplex.co.uk:8080"}] \ No newline at end of file +[{"StreamName":"Insanity","StreamURL":"https://trippy.pro:443"},{"StreamName":"PremPlus","StreamURL":"https://itty.in:443"},{"StreamName":"GunSlinger","StreamURL":"http://gunslingertv.org:8080"},{"StreamName":"VIP","StreamURL":"http://oven-cleaner.com:8080/"},{"StreamName":"Technoid","StreamURL":"http://capoisagod2021.org:8080"},{"StreamName":"Old Premium","StreamURL":"https://caporeds.online:443","username":"Dazg3012","expiaryDate":"12/30/2021"},{"StreamName":"??","StreamURL":"http://screamstreams.info:8080"},{"StreamName":"Gold","StreamURL":"http://catenamode.cf:8090"},{"StreamName":"??","StreamURL":"http://sulu.xyz:2086"},{"StreamName":"??","StreamURL":"http://bigbox.me.uk:2086"},{"StreamName":"??","StreamURL":"http://beautifilm.xyz:8080"},{"StreamName":"??","StreamURL":"https://hulks.xyz:443"},{"StreamName":"??","StreamURL":"http://mytv.digital:8080/"},{"StreamName":"??","StreamURL":"http://theonlinemedia.network:2052"},{"StreamName":"Gold","StreamURL":"http://server1.jforbes.club:8090"},{"StreamName":"??","StreamURL":"http://ths.viewdns.net:8080"},{"StreamName":"??","StreamURL":"http://vpsuk.store:8080"},{"StreamName":"??","StreamURL":"http://ac.mustardsubs.tk:8880"},{"StreamName":"??","StreamURL":"http://faithhosting.xyz:25461"},{"StreamName":"??","StreamURL":"http://ip365.cx:80"},{"StreamName":"??","StreamURL":"http://g132.caporeds.online:8080/"},{"StreamName":"??","StreamURL":"http://theonlinemedia.network:2052"},{"StreamName":"??","StreamURL":"http://beautifilm.xyz:8080"},{"StreamName":"??","StreamURL":"http://pimptv.dnsabr.com:8080"},{"StreamName":"??","StreamURL":"http://tavaratv.xyz:2095"},{"StreamName":"??","StreamURL":"http://cms-tan.media:8880"},{"StreamName":"??","StreamURL":"http://streamknighttv.xyz:8080"},{"StreamName":"??","StreamURL":"http://covidsucks.xyz:8080"},{"StreamName":"??","StreamURL":"http://fckbrexit.link:8080"},{"StreamName":"Gambler","StreamURL":"http://tv.realot.xyz:35001"},{"StreamName":"??","StreamURL":"http://www.tvxclnt.com:8080"},{"StreamName":"??","StreamURL":"http://iptv.satplex.co.uk:8080"},{"StreamName":"??","StreamURL":"http://37723998.to:2052"}] \ No newline at end of file