diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 78f21897..1aaf8616 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 ca66cea0..2f5de7b0 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 92a5ba31..b125d8d2 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 (
;
+ return (
+
+ );
}
diff --git a/src/components/pages/UploadText.tsx b/src/components/pages/UploadText.tsx
index a672c01f..b895b91a 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))}>
+