@@ -24,6 +24,7 @@ interface Props {
2424
2525export default ( { database, className, onDelete } : Props ) => {
2626 const [ visible , setVisible ] = useState ( false ) ;
27+ const [ connectionVisible , setConnectionVisible ] = useState ( false ) ;
2728 const { addFlash, clearFlashes } = useStoreActions ( ( actions : Actions < ApplicationStore > ) => actions . flashes ) ;
2829 const server = ServerContext . useStoreState ( state => state . server . data ! ) ;
2930
@@ -102,6 +103,27 @@ export default ({ database, className, onDelete }: Props) => {
102103 )
103104 }
104105 </ Formik >
106+ < Modal visible = { connectionVisible } onDismissed = { ( ) => setConnectionVisible ( false ) } >
107+ < h3 className = { 'mb-6' } > Database connection details</ h3 >
108+ < div >
109+ < label className = { 'input-dark-label' } > Password</ label >
110+ < input type = { 'text' } className = { 'input-dark' } readOnly = { true } value = { database . password } />
111+ </ div >
112+ < div className = { 'mt-6' } >
113+ < label className = { 'input-dark-label' } > JBDC Connection String</ label >
114+ < input
115+ type = { 'text' }
116+ className = { 'input-dark' }
117+ readOnly = { true }
118+ value = { `jdbc:mysql://${ database . username } :${ database . password } @${ database . connectionString } /${ database . name } ` }
119+ />
120+ </ div >
121+ < div className = { 'mt-6 text-right' } >
122+ < button className = { 'btn btn-sm btn-secondary' } onClick = { ( ) => setConnectionVisible ( false ) } >
123+ Close
124+ </ button >
125+ </ div >
126+ </ Modal >
105127 < div className = { classNames ( 'grey-row-box no-hover' , className ) } >
106128 < div className = { 'icon' } >
107129 < FontAwesomeIcon icon = { faDatabase } />
@@ -114,16 +136,17 @@ export default ({ database, className, onDelete }: Props) => {
114136 < p className = { 'text-center text-sm' } > { database . connectionString } </ p >
115137 </ div >
116138 < div className = { 'ml-6' } >
117- < p className = { 'text-center text-xs text-neutral-500 uppercase mb-1 select-none' } > Connections
118- From:</ p >
139+ < p className = { 'text-center text-xs text-neutral-500 uppercase mb-1 select-none' } >
140+ Connections From:
141+ </ p >
119142 < p className = { 'text-center text-sm' } > { database . allowConnectionsFrom } </ p >
120143 </ div >
121144 < div className = { 'ml-6' } >
122145 < p className = { 'text-center text-xs text-neutral-500 uppercase mb-1 select-none' } > Username:</ p >
123146 < p className = { 'text-center text-sm' } > { database . username } </ p >
124147 </ div >
125148 < div className = { 'ml-6' } >
126- < button className = { 'btn btn-sm btn-secondary mr-2' } >
149+ < button className = { 'btn btn-sm btn-secondary mr-2' } onClick = { ( ) => setConnectionVisible ( true ) } >
127150 < FontAwesomeIcon icon = { faEye } fixedWidth = { true } />
128151 </ button >
129152 < button className = { 'btn btn-sm btn-secondary btn-red' } onClick = { ( ) => setVisible ( true ) } >
0 commit comments