[FEATURE] Fix RCON Connectoin Display
This commit is contained in:
parent
3c6f31f6d7
commit
e65e085011
2 changed files with 7 additions and 3 deletions
|
@ -8,6 +8,7 @@ export default class RconSocket {
|
||||||
this.sk.on("rcon-error", this.onRconError.bind(this));
|
this.sk.on("rcon-error", this.onRconError.bind(this));
|
||||||
this.sk.on("error", () => console.log("WHOOSPSIE I GUESS?"));
|
this.sk.on("error", () => console.log("WHOOSPSIE I GUESS?"));
|
||||||
this.rconLive = false;
|
this.rconLive = false;
|
||||||
|
this.rconError = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
onPush(p) {
|
onPush(p) {
|
||||||
|
@ -22,6 +23,7 @@ export default class RconSocket {
|
||||||
|
|
||||||
onRconError(v) {
|
onRconError(v) {
|
||||||
this.rconLive = false;
|
this.rconLive = false;
|
||||||
|
this.rconError = true;
|
||||||
console.log("Server sent: ", v);
|
console.log("Server sent: ", v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,10 +55,12 @@ export default function RconView(props) {
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
value={cmd}
|
value={cmd}
|
||||||
onChange={updateCmd}
|
onChange={updateCmd}
|
||||||
disabled={!(rcon && rcon.rconLive)}
|
disabled={!(rcon && rcon.rconLive && !rcon.rconError)}
|
||||||
/>
|
/>
|
||||||
{rcon && rcon.rconLive && <Button onClick={sendCommand}>Send</Button>}
|
{rcon && rcon.rconLive && !rcon.rconError && (
|
||||||
{!(rcon && rcon.rconLive) && (
|
<Button onClick={sendCommand}>Send</Button>
|
||||||
|
)}
|
||||||
|
{!(rcon && rcon.rconLive && !rcon.rconError) && (
|
||||||
<Button color="secondary">Not Connected</Button>
|
<Button color="secondary">Not Connected</Button>
|
||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue