diff --git a/cmd/bbgo-desktop/main.go b/cmd/bbgo-desktop/main.go index 16816cc19..db0606da6 100644 --- a/cmd/bbgo-desktop/main.go +++ b/cmd/bbgo-desktop/main.go @@ -35,7 +35,7 @@ func main() { args = append(args, "--class=bbgo") // here allocate a chrome window with a blank page. - ui, err := lorca.New("", "", 800, 640, args...) + ui, err := lorca.New("", "", 1024, 780, args...) if err != nil { log.WithError(err).Error("failed to initialize the window") return diff --git a/frontend/components/SaveConfigAndRestart.js b/frontend/components/SaveConfigAndRestart.js index 166dce0cd..72d6e9161 100644 --- a/frontend/components/SaveConfigAndRestart.js +++ b/frontend/components/SaveConfigAndRestart.js @@ -1,22 +1,9 @@ import React from 'react'; -import { useRouter } from 'next/router'; +import {useRouter} from 'next/router'; import Button from '@material-ui/core/Button'; import Typography from '@material-ui/core/Typography'; -import List from '@material-ui/core/List'; -import Card from '@material-ui/core/Card'; -import CardHeader from '@material-ui/core/CardHeader'; -import CardContent from '@material-ui/core/CardContent'; -import Avatar from '@material-ui/core/Avatar'; -import IconButton from '@material-ui/core/IconButton'; -import MoreVertIcon from '@material-ui/icons/MoreVert'; -import Table from '@material-ui/core/Table'; -import TableBody from '@material-ui/core/TableBody'; -import TableCell from '@material-ui/core/TableCell'; -import TableContainer from '@material-ui/core/TableContainer'; -import TableHead from '@material-ui/core/TableHead'; -import TableRow from '@material-ui/core/TableRow'; import {makeStyles} from '@material-ui/core/styles'; @@ -48,21 +35,16 @@ const useStyles = makeStyles((theme) => ({ export default function SaveConfigAndRestart({onBack, onRestarted}) { const classes = useStyles(); - const { push } = useRouter(); - const [strategies, setStrategies] = React.useState([]); - + const {push} = useRouter(); const [response, setResponse] = React.useState({}); - React.useEffect(() => { - }, []) - const handleRestart = () => { saveConfig((resp) => { setResponse(resp); setupRestart((resp) => { let t - t = setInterval(function() { + t = setInterval(() => { ping(() => { clearInterval(t) push("/"); diff --git a/frontend/components/SideBar.js b/frontend/components/SideBar.js index 9b08e1c76..e345a451b 100644 --- a/frontend/components/SideBar.js +++ b/frontend/components/SideBar.js @@ -11,20 +11,12 @@ import TrendingUpIcon from "@material-ui/icons/TrendingUp"; import React from "react"; import {makeStyles} from "@material-ui/core/styles"; -const drawerWidth = 260; +const drawerWidth = 240; const useStyles = makeStyles((theme) => ({ root: { - // flexGrow: 1, - display: 'flex', - }, - content: { flexGrow: 1, - height: '100vh', - overflow: 'auto', - }, - fixedHeight: { - height: 240, + display: 'flex', }, toolbar: { paddingRight: 24, // keep right padding when drawer closed @@ -38,14 +30,20 @@ const useStyles = makeStyles((theme) => ({ }, appBarSpacer: theme.mixins.toolbar, drawerPaper: { + [theme.breakpoints.up('sm')]: { + width: drawerWidth, + flexShrink: 0, + }, position: 'relative', whiteSpace: 'nowrap', - width: drawerWidth, transition: theme.transitions.create('width', { easing: theme.transitions.easing.sharp, duration: theme.transitions.duration.enteringScreen, }), }, + drawer: { + width: drawerWidth, + }, })); @@ -54,7 +52,11 @@ export default function SideBar() { return
diff --git a/frontend/layouts/DashboardLayout.js b/frontend/layouts/DashboardLayout.js index cba90ac37..3fa1ff58a 100644 --- a/frontend/layouts/DashboardLayout.js +++ b/frontend/layouts/DashboardLayout.js @@ -42,7 +42,7 @@ export default function DashboardLayout({children}) {
- + {children}
diff --git a/frontend/pages/index.tsx b/frontend/pages/index.tsx index 1b9e186f9..ce66e6b32 100644 --- a/frontend/pages/index.tsx +++ b/frontend/pages/index.tsx @@ -1,5 +1,5 @@ -import React, {useState} from 'react'; -import { useRouter } from 'next/router'; +import React from 'react'; +import {useRouter} from 'next/router'; import {makeStyles} from '@material-ui/core/styles'; import Typography from '@material-ui/core/Typography'; @@ -26,6 +26,7 @@ const useStyles = makeStyles((theme) => ({ height: 300, }, totalAssetsSummary: { + margin: theme.spacing(2), padding: theme.spacing(2), }, control: { @@ -34,11 +35,10 @@ const useStyles = makeStyles((theme) => ({ })); - // props are pageProps passed from _app.tsx export default function Home() { const classes = useStyles(); - const { push } = useRouter(); + const router = useRouter(); const [sessions, setSessions] = React.useState([]) @@ -47,12 +47,12 @@ export default function Home() { if (sessions && sessions.length > 0) { setSessions(sessions) } else { - push("/setup"); + router.push("/setup"); } }).catch((err) => { console.error(err); }) - }, []) + }, [router]) if (sessions.length == 0) { return ( @@ -68,29 +68,27 @@ export default function Home() { return ( - - - - Total Assets - + + + Total Assets + - - - - - - - - - - + + + - - + + + + + + + - - + + + ); } diff --git a/pkg/server/setup.go b/pkg/server/setup.go index 166d30da2..08c8b13c1 100644 --- a/pkg/server/setup.go +++ b/pkg/server/setup.go @@ -117,7 +117,7 @@ func (s *Server) setupRestart(c *gin.Context) { logrus.WithError(err).Error("server forced to shutdown") } - logrus.Info("web server shutdown completed") + logrus.Info("server shutdown completed") bin := os.Args[0] args := os.Args[0:]