2025-01-24 16:13:14 -04:00
|
|
|
/*
|
|
|
|
|
This component contains a drop-down form that lets the user select from
|
|
|
|
|
a range of Global Back End servers.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
// Global npm libraries
|
|
|
|
|
import React from 'react'
|
|
|
|
|
import { Container, Row, Col, Button } from 'react-bootstrap'
|
2025-02-01 13:04:34 -04:00
|
|
|
import { useNavigate } from 'react-router-dom'
|
2025-01-24 16:13:14 -04:00
|
|
|
|
|
|
|
|
const ServerSelect = (props) => {
|
2025-02-15 20:55:43 -04:00
|
|
|
const { linkTo, appData } = props
|
2025-02-01 13:04:34 -04:00
|
|
|
|
|
|
|
|
// Use the navigate function to navigate to the servers view
|
|
|
|
|
const navigate = useNavigate()
|
2025-01-24 16:13:14 -04:00
|
|
|
|
|
|
|
|
// This is a click handler for the server select button. It brings up the
|
|
|
|
|
// server selection View.
|
|
|
|
|
const handleServerSelect = () => {
|
|
|
|
|
console.log('This function should navigate to the server selection view.')
|
2025-02-01 13:04:34 -04:00
|
|
|
navigate(linkTo)
|
2025-01-24 16:13:14 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Container>
|
2025-02-01 13:04:34 -04:00
|
|
|
<>
|
|
|
|
|
<hr />
|
|
|
|
|
<Row>
|
|
|
|
|
<Col style={{ textAlign: 'center', padding: '25px' }}>
|
|
|
|
|
<br />
|
|
|
|
|
<h5>
|
|
|
|
|
Having trouble loading? Try selecting a different back-end server.
|
|
|
|
|
</h5>
|
2025-02-15 20:55:43 -04:00
|
|
|
<p style={{ fontStyle: 'italic' }}>Current Server : {appData.serverUrl}</p>
|
2025-02-01 13:04:34 -04:00
|
|
|
<Button variant='warning' onClick={handleServerSelect}>
|
|
|
|
|
Select a different back end server
|
|
|
|
|
</Button>
|
|
|
|
|
<br />
|
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
|
|
</Row>
|
|
|
|
|
</>
|
2025-01-24 16:13:14 -04:00
|
|
|
</Container>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default ServerSelect
|