diff --git a/Dockerignore b/Dockerignore index 72776a961..1a2648e3d 100644 --- a/Dockerignore +++ b/Dockerignore @@ -1,3 +1,5 @@ -prisma/migrations +prisma node_modules -.next \ No newline at end of file +.next +uploads +.git diff --git a/package.json b/package.json index 47c1456b7..cd8fa60d0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zip3", - "version": "3.2.1", + "version": "3.2.2", "scripts": { "prepare": "husky install", "dev": "NODE_ENV=development node server", @@ -17,10 +17,9 @@ "@emotion/styled": "^11.3.0", "@iarna/toml": "2.2.5", "@material-ui/core": "^5.0.0-alpha.37", - "@material-ui/data-grid": "^4.0.0-alpha.32", "@material-ui/icons": "^5.0.0-alpha.37", "@material-ui/styles": "^5.0.0-alpha.35", - "@prisma/client": "^2.30.3", + "@prisma/client": "^3.0.2", "@reduxjs/toolkit": "^1.6.0", "argon2": "^0.28.2", "colorette": "^1.2.2", @@ -30,7 +29,7 @@ "formik": "^2.2.9", "multer": "^1.4.2", "next": "11.1.1", - "prisma": "^2.30.3", + "prisma": "^3.0.2", "react": "17.0.2", "react-dom": "17.0.2", "react-dropzone": "^11.3.2", diff --git a/server/index.js b/server/index.js index 4861a15a0..ad4e088ea 100644 --- a/server/index.js +++ b/server/index.js @@ -123,6 +123,7 @@ function shouldUseYarn() { }); srv.on('listening', () => { Logger.get('server').info(`listening on ${config.core.host}:${config.core.port}`); + if (process.platform === 'linux' && dev) execSync(`xdg-open ${config.core.secure ? 'https' : 'http'}://${config.core.host === '0.0.0.0' ? 'localhost' : config.core.host}:${config.core.port}`); }); srv.listen(config.core.port, config.core.host ?? '0.0.0.0'); diff --git a/src/components/Image.tsx b/src/components/Image.tsx index 3f3d9a3c9..acbedd0aa 100644 --- a/src/components/Image.tsx +++ b/src/components/Image.tsx @@ -4,64 +4,80 @@ import { Card, CardMedia, CardActionArea, - Popover, Button, - ButtonGroup + Dialog, + DialogTitle, + DialogActions, + DialogContent } from '@material-ui/core'; +import AudioIcon from '@material-ui/icons/Audiotrack'; import copy from 'copy-to-clipboard'; -import useFetch from '../lib/hooks/useFetch'; +import useFetch from 'hooks/useFetch'; export default function Image({ image, updateImages }) { - const [anchorEl, setAnchorEl] = useState(null); + const [open, setOpen] = useState(false); + const [t,] = useState(image.mimetype.split('/')[0]); const handleDelete = async () => { - const res = await useFetch('/api/user/images', 'DELETE', { id: image.id }); + const res = await useFetch('/api/user/files', 'DELETE', { id: image.id }); if (!res.error) updateImages(true); - setAnchorEl(null); + setOpen(false); }; const handleCopy = () => { copy(`${window.location.protocol}//${window.location.host}${image.url}`); - setAnchorEl(null); + setOpen(false); }; const handleFavorite = async () => { - const data = await useFetch('/api/user/images', 'PATCH', { id: image.id, favorite: !image.favorite }); + const data = await useFetch('/api/user/files', 'PATCH', { id: image.id, favorite: !image.favorite }); if (!data.error) updateImages(true); }; + const Type = (props) => { + return { + 'video':