summary refs log tree commit diff
diff options
context:
space:
mode:
authorJorik Schellekens <joriks@matrix.org>2019-09-05 10:55:31 +0100
committerJorik Schellekens <joriks@matrix.org>2019-09-05 10:55:31 +0100
commit0bc1f9c2d1b2e8ca8e185dc8dee5830f5def0d42 (patch)
tree7e0b207eb27470f1fe72bf82af30cb16f4edfc9c
parentJust say the config has been set up. (diff)
downloadsynapse-0bc1f9c2d1b2e8ca8e185dc8dee5830f5def0d42.tar.xz
Database defaults
-rw-r--r--synapse_topology/webui/src/js/components/Database.jsx11
1 files changed, 7 insertions, 4 deletions
diff --git a/synapse_topology/webui/src/js/components/Database.jsx b/synapse_topology/webui/src/js/components/Database.jsx
index dc12be9cf1..4b0ff5327e 100644
--- a/synapse_topology/webui/src/js/components/Database.jsx
+++ b/synapse_topology/webui/src/js/components/Database.jsx
@@ -23,7 +23,8 @@ export default ({
     const defaultDatabase = DATABASE_TYPES.POSTGRES;
     const [database, setDatabase] = useState(defaultDatabase)
 
-    const [databaseHost, setHost] = useState();
+    const hostDefault = "localhost"
+    const [databaseHost, setHost] = useState(hostDefault);
     const [postgresDatabase, setPostgresDatabase] = useState();
     const [databaseUsername, setUser] = useState();
     const [databasePassword, setPassword] = useState();
@@ -40,13 +41,14 @@ export default ({
                 <p>Postgres is recommended.</p>
 
                 <Tabs defaultActiveKey={defaultDatabase} onSelect={k => setDatabase(k)}>
-                    <Tab eventKey={DATABASE_TYPES.POSTGRES} title={DATABASE_TYPES.POSTGRES}>
+                    <Tab eventKey={DATABASE_TYPES.POSTGRES} title={"Postgres"}>
+                        This will connect to the given Postgres database via {DATABASE_TYPES.POSTGRES}
                         <p>
                             Host
                         </p>
                         <input
                             type="text"
-                            onChange={e => setHost(e.target.value)}
+                            onChange={e => setHost(e.target.value ? e.target.value : hostDefault)}
                             autoFocus
                             placeholder="localhost"
                         />
@@ -79,6 +81,7 @@ export default ({
                         />
                         <button
                             className='inputButton'
+                            disabled={databaseHost ? undefined : true}
                             onClick={() => {
                                 toggle();
                                 onClick({
@@ -89,7 +92,7 @@ export default ({
                                     databasePassword,
                                 })
                             }}
-                        >Use {DATABASE_TYPES.POSTGRES}</button>
+                        >Use Postgres</button>
                     </Tab>
                     <Tab eventKey={DATABASE_TYPES.SQLITE3} title={DATABASE_TYPES.SQLITE3}>
                         <button