From 68d346e69d89e4f33f2f684515e78b25bf99c8e6 Mon Sep 17 00:00:00 2001 From: diced Date: Thu, 27 Oct 2022 21:26:54 -0700 Subject: [PATCH] fix: stuff --- .github/workflows/build.yml | 9 +++++++-- README.md | 2 ++ src/components/icons/DiscordIcon.tsx | 1 + src/components/icons/FlameshotIcon.tsx | 1 + src/components/icons/ShareXIcon.tsx | 4 +++- src/components/pages/UploadText.tsx | 7 ++++++- src/components/pages/Urls/index.tsx | 13 ++++++++++++- 7 files changed, 32 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 78f2189..1aaf861 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,8 +19,13 @@ jobs: id: cache-restore uses: actions/cache@v2 with: - path: node_modules - key: ${{ runner.os }}-node${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }} + path: | + node_modules + ${{ github.workspace }}/.next/cache + key: ${{ runner.os }}-node${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} + restore-keys: | + ${{ runner.os }}-node${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }}- + - name: Install dependencies if: steps.cache-restore.outputs.cache-hit != 'true' diff --git a/README.md b/README.md index ca66cea..2f5de7b 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,8 @@ A ShareX/file upload server that is easy to use, packed with features, and with - Fully customizable Discord webhook notifications - OAuth2 registration (Discord and GitHub) - User invites +- File Chunking (for large files) +- File deletion once it reaches a certain amount of views - Easy setup instructions on [docs](https://zipl.vercel.app/) (One command install `docker-compose up -d`) # Usage diff --git a/src/components/icons/DiscordIcon.tsx b/src/components/icons/DiscordIcon.tsx index 92a5ba3..b125d8d 100644 --- a/src/components/icons/DiscordIcon.tsx +++ b/src/components/icons/DiscordIcon.tsx @@ -5,6 +5,7 @@ import Image from 'next/image'; export default function DiscordIcon({ ...props }) { return ( discord; + return ( + sharex + ); } diff --git a/src/components/pages/UploadText.tsx b/src/components/pages/UploadText.tsx index a672c01..b895b91 100644 --- a/src/components/pages/UploadText.tsx +++ b/src/components/pages/UploadText.tsx @@ -1,4 +1,4 @@ -import { Button, Group, PasswordInput, Select, Tabs, Title, Tooltip } from '@mantine/core'; +import { Button, Group, NumberInput, PasswordInput, Select, Tabs, Title, Tooltip } from '@mantine/core'; import { Prism } from '@mantine/prism'; import { Language } from 'prism-react-renderer'; import { showNotification, updateNotification } from '@mantine/notifications'; @@ -17,6 +17,7 @@ export default function Upload() { const [lang, setLang] = useState('txt'); const [password, setPassword] = useState(''); const [expires, setExpires] = useState('never'); + const [maxViews, setMaxViews] = useState(undefined); const handleUpload = async () => { const file = new File([value], 'text.' + lang); @@ -97,6 +98,7 @@ export default function Upload() { expires !== 'never' && req.setRequestHeader('Expires-At', 'date=' + expires_at.toISOString()); password !== '' && req.setRequestHeader('Password', password); + maxViews && maxViews !== 0 && req.setRequestHeader('Max-Views', String(maxViews)); req.send(body); }; @@ -139,6 +141,9 @@ export default function Upload() { icon={} searchable /> + + setMaxViews(x)} /> + onSubmit(v))}> +