Tidy up connection screen, use presenter hostname to look for server.

This commit is contained in:
Matthew Stratford 2021-04-25 01:12:13 +01:00
parent fbe915e9eb
commit 1a479905f6
6 changed files with 24 additions and 32 deletions

View file

@ -17,6 +17,9 @@ $number-of-channels: 3;
.logo { .logo {
height: 50px; height: 50px;
} }
.logo-big {
height: 30vh;
}
} }
.inner { .inner {
text-align: center; text-align: center;

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

View file

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View file

@ -5,14 +5,14 @@ import { useSelector, useDispatch } from "react-redux";
import { RootState } from "../rootReducer"; import { RootState } from "../rootReducer";
import Showplanner from "../showplanner"; import Showplanner from "../showplanner";
import BAPSicleLogo from "../assets/images/bapsicle.png"; import serverLogo from "../assets/images/serverlogo.png";
import appLogo from "../assets/images/bapsicle.png"; import appLogo from "../assets/images/presenterlogo.png";
export function ConnectionDialogue({ error }: { error: String | null }) { export function ConnectionDialogue({ error }: { error: String | null }) {
return ( return (
<div className="loading-dialogue"> <div className="loading-dialogue">
<div className="logo-container"> <div className="logo-container">
<img className="logo mb-5" src={appLogo} alt="BAPS Logo" /> <img className="logo-big mb-2" src={appLogo} alt="BAPS Logo" />
</div> </div>
<span className="inner"> <span className="inner">
@ -21,37 +21,25 @@ export function ConnectionDialogue({ error }: { error: String | null }) {
<strong>Broadcast &amp; Presenting Suite</strong> <strong>Broadcast &amp; Presenting Suite</strong>
</p> </p>
<hr /> <hr />
{error !== null && ( <span className="my-2">
<> {error == null && <strong>Connecting...</strong>}
<span> {error != null && (
<strong>Failed!</strong> <code>{error}</code> <>
</span> <strong>Disconnected!</strong> <code>{error}</code>
<form> </>
<div> )}
<label htmlFor="hostname">Hostname: </label> </span>
<input <form className="my-3">
name="hostname" <input className="btn btn-primary" type="submit" value="Reconnect" />
type="text" </form>
placeholder="localhost"
></input>
</div>
<div>
<label htmlFor="port">Port: </label>
<input name="port" type="text" placeholder="13501"></input>
</div>
<div>
<input type="submit" value="Connect" />
</div>
</form>
<hr />
</>
)}
{error == null && <p>Connecting...</p>}
</span> </span>
<hr /> <hr />
<div className="logo-container"> <div className="logo-container">
Powered by Powered by
<img className="logo mb-5" src={BAPSicleLogo} alt="BAPSicle Logo" /> <br />
<a href={"http://" + window.location.hostname + ":13500"}>
<img className="logo mb-5" src={serverLogo} alt="BAPSicle" />
</a>
</div> </div>
</div> </div>
); );

View file

@ -70,12 +70,12 @@ export const getCurrentServer = (): AppThunk => async (dispatch, getState) => {
export const getServer = (): AppThunk => async (dispatch) => { export const getServer = (): AppThunk => async (dispatch) => {
// TODO Server Details Configurable // TODO Server Details Configurable
let bapsServer: bapsServer = { let bapsServer: bapsServer = {
hostname: "webstudio-dev.ury.org.uk", hostname: window.location.hostname,
port: 13501, port: 13501,
name: "Connecting...", name: "Connecting...",
}; };
dispatch(sessionState.actions.setCurrentServer({ server: bapsServer })); dispatch(sessionState.actions.setCurrentServer({ server: bapsServer }));
dispatch(connectBAPSicle("ws://webstudio-dev.ury.org.uk:13501")); dispatch(connectBAPSicle("ws://" + window.location.hostname + ":13501"));
/* /*
dispatch(sessionState.actions.getUserStarting()); dispatch(sessionState.actions.getUserStarting());
try { try {

View file

@ -161,6 +161,7 @@ export const connectBAPSicle = (path: string): AppThunk => async (
dispatch(SessionState.setServerState("CONNECTING")); dispatch(SessionState.setServerState("CONNECTING"));
BAPSicleWS.onopen = () => dispatch(SessionState.setServerState("CONNECTED")); BAPSicleWS.onopen = () => dispatch(SessionState.setServerState("CONNECTED"));
BAPSicleWS.onclose = () => dispatch(SessionState.setServerState("FAILED")); BAPSicleWS.onclose = () => dispatch(SessionState.setServerState("FAILED"));
BAPSicleWS.onerror = () => dispatch(SessionState.setServerState("FAILED"));
}; };
export const disconnectBAPSicle = () => { export const disconnectBAPSicle = () => {