mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
added Login page for testing with BE endpoint
This commit is contained in:
parent
3b257fe3cb
commit
583a0293ce
7 changed files with 44 additions and 1 deletions
|
|
@ -354,7 +354,7 @@ func (h *Handler) collectStats(next http.Handler) http.Handler {
|
|||
|
||||
// latticeRoutes lists the frontend routes that do not directly correspond to
|
||||
// backend routes, and require special handling.
|
||||
var latticeRoutes = []string{"/tables", "/query", "/querybuilder"} // TODO somehow pull this from some metadata in the lattice directory
|
||||
var latticeRoutes = []string{"/tables", "/query", "/querybuilder", "/login"} // TODO somehow pull this from some metadata in the lattice directory
|
||||
|
||||
// newRouter creates a new mux http router.
|
||||
func newRouter(handler *Handler) http.Handler {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import { MoleculaTablesContainer } from 'App/MoleculaTables';
|
|||
import { QueryContainer } from 'App/Query';
|
||||
import { QueryBuilderContainer } from 'App/QueryBuilder';
|
||||
import css from './App.module.scss';
|
||||
import Login from 'App/Login/Login';
|
||||
|
||||
const App = () => {
|
||||
const [theme, setTheme] = useState<string>(
|
||||
|
|
@ -46,6 +47,7 @@ const App = () => {
|
|||
<Route path="/tables/:id?" component={MoleculaTablesContainer} />
|
||||
<Route exact path="/query" component={QueryContainer} />
|
||||
<Route exact path="/querybuilder" component={QueryBuilderContainer} />
|
||||
<Route exact path="/login" component={Login} />
|
||||
<Route component={NotFound} />
|
||||
</Switch>
|
||||
</div>
|
||||
|
|
|
|||
19
lattice/src/App/Login/Login.tsx
Normal file
19
lattice/src/App/Login/Login.tsx
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import LoginButton from './LoginButton';
|
||||
import { pilosa } from 'services/eventServices';
|
||||
|
||||
function login() {
|
||||
pilosa.get.login().then((res) => {
|
||||
console.log(`login result:`, res);
|
||||
});
|
||||
}
|
||||
|
||||
function Login() {
|
||||
return (
|
||||
<>
|
||||
<h6>Login</h6>
|
||||
<LoginButton onClick={login} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default Login;
|
||||
11
lattice/src/App/Login/LoginButton.tsx
Normal file
11
lattice/src/App/Login/LoginButton.tsx
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import React from 'react';
|
||||
|
||||
interface Props {
|
||||
onClick: () => void;
|
||||
}
|
||||
|
||||
const LoginButton: React.FC<Props> = ({ onClick }) => {
|
||||
return <button onClick={onClick}>Login</button>;
|
||||
};
|
||||
|
||||
export default LoginButton;
|
||||
1
lattice/src/App/Login/index.ts
Normal file
1
lattice/src/App/Login/index.ts
Normal file
|
|
@ -0,0 +1 @@
|
|||
export * from './Login';
|
||||
|
|
@ -14,6 +14,9 @@ export const pilosa = {
|
|||
status() {
|
||||
return api.get('/status');
|
||||
},
|
||||
login() {
|
||||
return api.get('/login');
|
||||
},
|
||||
info() {
|
||||
return api.get('/info');
|
||||
},
|
||||
|
|
|
|||
|
|
@ -51,6 +51,13 @@ export const Nav = () => {
|
|||
</Typography>
|
||||
</ListItem>
|
||||
</NavLink>
|
||||
<NavLink to="/login" activeClassName={css.activeNavLink}>
|
||||
<ListItem className={css.navLink} button>
|
||||
<Typography variant="subtitle2" color={textColor}>
|
||||
Login
|
||||
</Typography>
|
||||
</ListItem>
|
||||
</NavLink>
|
||||
</List>
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue