Skip to content

Commit

Permalink
Merge pull request #2 from remotv/master
Browse files Browse the repository at this point in the history
update fork
  • Loading branch information
bwookieeeee authored May 28, 2020
2 parents c8ce2d2 + b892a97 commit 821d21c
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 19 deletions.
32 changes: 18 additions & 14 deletions src/components/layout/frontPage/frontPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ export default class FrontPage extends Component {
totalUsers: "...",
totalServers: "...",
activeDevices: "...",
registeredDevices: "..."
registeredDevices: "...",
};

async componentDidMount() {
await axios.get(getStats).then(res => {
await axios.get(getStats).then((res) => {
// console.log(res);
this.setState({
activeUsers: res.data.activeUsers,
totalUsers: res.data.totalUsers,
totalServers: res.data.totalServers,
activeDevices: res.data.activeDevices,
registeredDevices: res.data.registeredDevices
registeredDevices: res.data.registeredDevices,
});
});
}
Expand All @@ -42,12 +42,12 @@ export default class FrontPage extends Component {
totalUsers,
totalServers,
activeDevices,
registeredDevices
registeredDevices,
} = this.state;
return (
<div className="front-page-container">
<div className="front-page-text">
<DisplayAlert show={false} />
<DisplayAlert show={true} />
<br />
<span>
Control & share robots online remotely in real time with remo.tv{" "}
Expand Down Expand Up @@ -152,15 +152,19 @@ const Medium = () => {
const DisplayAlert = ({ show }) => {
return show === true ? (
<div className="alert">
<span className="bolder">Important Notice 11/20/2019 </span>
<span className="bolder">Important Notice 05/27/2020 </span>
<div>
In order to make Remo more secure, we've updated our site's encryption
methods. As a result, any robot using an API key generated before today
will not work.
In order to make remo more secure, we are requiring all robot video
streams to be authenticated. The robot's API key must be included in the
authorization header.
<div>
<br />
You can simply copy and paste the updated key already provided for
each robot under, "manage robots" to your robot's local settings.
If you are using the RemoTV python controller from the main repo, all
you need to do is pull the latest update, and you should be good to
go. This update is mandatory if you want your robot to continue to
work with Remo. If you have questions or comments, the discord link
below is the best place to get in touch, otherwise you can email
jill@remo.tv.
</div>
</div>
</div>
Expand All @@ -174,7 +178,7 @@ const SingleLink = ({ link, text }) => {
<div className="inline-link">
<a
href={link}
onClick={e => {
onClick={(e) => {
e.preventDefault();
window.open(link, "_blank");
}}
Expand All @@ -191,7 +195,7 @@ const InlineLink = ({ link, text }) => {
{text}
<a
href={link}
onClick={e => {
onClick={(e) => {
e.preventDefault();
window.open(link, "_blank");
}}
Expand All @@ -207,7 +211,7 @@ const FPLinkCard = ({ link, image, text }) => {
<React.Fragment>
<a
href={link}
onClick={e => {
onClick={(e) => {
e.preventDefault();
window.open(link, "_blank");
}}
Expand Down
17 changes: 14 additions & 3 deletions src/components/layout/nav/navBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,25 @@ export default class NavBar extends Component {
constructor(props) {
super(props);
this.state = {
redirect: false
redirect: false,
};
}

componentDidMount() {
this.handleQuery();
socket.on("LOGOUT", this.handleLogoutEvent);
}

componentWillUnmount() {
socket.off("LOGOUT", this.handleLogoutEvent);
}

handleLogoutEvent = (user) => {
console.log("Logout, ", user);
localStorage.removeItem("token");
this.setState({ redirect: true });
};

handleQuery = () => {
const { locationSearch } = this.props;
const values = queryString.parse(locationSearch);
Expand Down Expand Up @@ -73,10 +84,10 @@ export default class NavBar extends Component {
handleModal = () => {
return [
{
body: <UserProfile {...this.props} />
body: <UserProfile {...this.props} />,
},
{ header: "" },
{ footer: "" }
{ footer: "" },
];
};

Expand Down
6 changes: 4 additions & 2 deletions src/components/routing/servers/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ export default class ServersPage extends Component {
this.setState({ socketConnected: true });
this.emitAuthentication();
}

Promise.all([this.getServers(), this.getFollowedServers()]);
}

Expand Down Expand Up @@ -241,7 +240,10 @@ export default class ServersPage extends Component {
};

setUser = (user) => {
this.setState({ user });
if (!user) {
localStorage.removeItem("token");
this.setState({ getLogin: true });
} else this.setState({ user });
};

socketConnected = () => {
Expand Down

0 comments on commit 821d21c

Please sign in to comment.