Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
ChengjieLi28 committed Dec 5, 2023
1 parent 9ce4996 commit 4f2dce4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
35 changes: 20 additions & 15 deletions xinference/web/ui/src/components/errorMessageSnackBar.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,35 @@
import Snackbar from "@mui/material/Snackbar";
import React, {useContext} from "react";
import {ApiContext} from "./apiContext";
import MuiAlert from '@mui/material/Alert';
import MuiAlert from '@mui/material/Alert'
import Snackbar from '@mui/material/Snackbar'
import React, { useContext } from 'react'

import { ApiContext } from './apiContext'

const Alert = React.forwardRef(function Alert(props, ref) {
return <MuiAlert elevation={6} ref={ref} variant="filled" {...props} />;
});
return <MuiAlert elevation={6} ref={ref} variant="filled" {...props} />
})

const ErrorMessageSnackBar = () => {
const {errorMsg, setErrorMsg} = useContext(ApiContext);
const { errorMsg, setErrorMsg } = useContext(ApiContext)

const handleClose = (event, reason) => {
if (reason === 'clickaway') {
return;
return
}
setErrorMsg("");
};
setErrorMsg('')
}

return (
<Snackbar open={errorMsg !== ""} autoHideDuration={10000}
anchorOrigin={{vertical: 'top', horizontal: 'center'}} onClose={handleClose}>
<Alert severity="error" onClose={handleClose} sx={{width: '100%'}}>
<Snackbar
open={errorMsg !== ''}
autoHideDuration={10000}
anchorOrigin={{ vertical: 'top', horizontal: 'center' }}
onClose={handleClose}
>
<Alert severity="error" onClose={handleClose} sx={{ width: '100%' }}>
{errorMsg}
</Alert>
</Snackbar>
);
)
}

export default ErrorMessageSnackBar;
export default ErrorMessageSnackBar
1 change: 1 addition & 0 deletions xinference/web/ui/src/scenes/launch_model/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import ErrorMessageSnackBar from '../../components/errorMessageSnackBar'
import Title from '../../components/Title'
import LaunchEmbedding from './launchEmbedding'
import LaunchLLM from './launchLLM'
import LaunchRerank from './launchRerank'

const LaunchModel = () => {
const [value, setValue] = React.useState('1')
Expand Down

0 comments on commit 4f2dce4

Please sign in to comment.