[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("error", () => console.log("WHOOSPSIE I GUESS?"));
|
||||
this.rconLive = false;
|
||||
this.rconError = false;
|
||||
}
|
||||
|
||||
onPush(p) {
|
||||
|
@ -22,6 +23,7 @@ export default class RconSocket {
|
|||
|
||||
onRconError(v) {
|
||||
this.rconLive = false;
|
||||
this.rconError = true;
|
||||
console.log("Server sent: ", v);
|
||||
}
|
||||
|
||||
|
|
|
@ -55,10 +55,12 @@ export default function RconView(props) {
|
|||
variant="outlined"
|
||||
value={cmd}
|
||||
onChange={updateCmd}
|
||||
disabled={!(rcon && rcon.rconLive)}
|
||||
disabled={!(rcon && rcon.rconLive && !rcon.rconError)}
|
||||
/>
|
||||
{rcon && rcon.rconLive && <Button onClick={sendCommand}>Send</Button>}
|
||||
{!(rcon && rcon.rconLive) && (
|
||||
{rcon && rcon.rconLive && !rcon.rconError && (
|
||||
<Button onClick={sendCommand}>Send</Button>
|
||||
)}
|
||||
{!(rcon && rcon.rconLive && !rcon.rconError) && (
|
||||
<Button color="secondary">Not Connected</Button>
|
||||
)}
|
||||
</Box>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue