diff --git a/res/include/md/api_file.md b/res/include/md/api_file.md index 8464900..82597d6 100644 --- a/res/include/md/api_file.md +++ b/res/include/md/api_file.md @@ -1,6 +1,6 @@ ## File Methods -
+
POST/file
@@ -75,7 +75,7 @@ HTTP 413: Payload Too Large
-
+
PUT/file/{name}
diff --git a/res/include/md/api_file_post.md b/res/include/md/api_file_post.md index f683840..9752167 100644 --- a/res/include/md/api_file_post.md +++ b/res/include/md/api_file_post.md @@ -1,6 +1,6 @@ ## File Methods -
+
POST/file
diff --git a/res/static/style/layout.css b/res/static/style/layout.css index 99593fe..87bc07e 100644 --- a/res/static/style/layout.css +++ b/res/static/style/layout.css @@ -401,47 +401,47 @@ pre { /* API documentation markup */ -details { +.api_doc_details { border-top: 1px solid; border-bottom: 1px solid; margin: 15px 0 15px 0; } -details>summary { +.api_doc_details>summary { padding: 2px; font-family: monospace; } -details>summary>.method { +.api_doc_details>summary>.method { display: inline-block; width: 80px; } -details>div { +.api_doc_details>div { padding: 8px; } -details.request_get { +.api_doc_details.request_get { border-color: #3636ff; background-color: rgba(32, 32, 255, 0.2); } -details.request_post { +.api_doc_details.request_post { border-color: #00d000; background-color: rgba(0, 255, 0, 0.05); } -details.request_delete { +.api_doc_details.request_delete { border-color: #B00000; background-color: rgba(255, 0, 0, 0.05); } -details.request_put { +.api_doc_details.request_put { border-color: #B06000; background-color: rgba(255, 128, 0, 0.05); } -details.request_patch { +.api_doc_details.request_patch { border-color: #6000B0; background-color: rgba(128, 0, 255, 0.1); } diff --git a/svelte/src/file_viewer/FileUtilities.svelte b/svelte/src/file_viewer/FileUtilities.svelte index a2150c1..574c960 100644 --- a/svelte/src/file_viewer/FileUtilities.svelte +++ b/svelte/src/file_viewer/FileUtilities.svelte @@ -37,6 +37,8 @@ export const file_set_href = file => { export const file_type = file => { if (file.mime_type === "application/bittorrent" || file.mime_type === "application/x-bittorrent") { return "torrent" + } else if (file.mime_type === "application/zip") { + return "zip" } else if (file.mime_type.startsWith("image")) { return "image" } else if ( diff --git a/svelte/src/file_viewer/viewers/FilePreview.svelte b/svelte/src/file_viewer/viewers/FilePreview.svelte index fd90235..8e19cf6 100644 --- a/svelte/src/file_viewer/viewers/FilePreview.svelte +++ b/svelte/src/file_viewer/viewers/FilePreview.svelte @@ -13,6 +13,7 @@ import RateLimit from "./RateLimit.svelte"; import Torrent from "./Torrent.svelte"; import SpeedLimit from "./SpeedLimit.svelte"; import { download_limits } from "../DownloadLimitStore"; +import Zip from "./Zip.svelte"; let viewer let viewer_type = "loading" @@ -68,7 +69,9 @@ export const set_file = async file => { {:else if viewer_type === "text"} {:else if viewer_type === "torrent"} - + +{:else if viewer_type === "zip"} + {:else if viewer_type === "file"} {/if} diff --git a/svelte/src/file_viewer/viewers/Zip.svelte b/svelte/src/file_viewer/viewers/Zip.svelte new file mode 100644 index 0000000..027e9c8 --- /dev/null +++ b/svelte/src/file_viewer/viewers/Zip.svelte @@ -0,0 +1,100 @@ + + +

{file.name}

+ +File icon + + Compressed size: {formatDataVolume(file.size, 3)}
+ Uncompressed size: {formatDataVolume(uncomp_size, 3)}
+ Uploaded on: {formatDate(file.date_upload, true, true, true)} +
+ +
+

+ +{#if status === "parse_failed"} + +

+ Zip archive could not be parsed. It may be corrupted. +

+
+{/if} + +{#if status === "finished"} + +

Files in this zip archive

+ +
+{/if} + + diff --git a/svelte/src/file_viewer/viewers/ZipItem.svelte b/svelte/src/file_viewer/viewers/ZipItem.svelte new file mode 100644 index 0000000..b2fbfa9 --- /dev/null +++ b/svelte/src/file_viewer/viewers/ZipItem.svelte @@ -0,0 +1,44 @@ + + + +{#each Object.entries(item.children) as [name, child]} + {#if child.children} +
+ + {name} ({formatDataVolume(child.size, 3)}) + + +
+ {/if} +{/each} + + +
    + {#each Object.entries(item.children) as [name, child]} + {#if !child.children} +
  • + {name} ({formatDataVolume(child.size, 3)})
    +
  • + {/if} + {/each} +
+ + diff --git a/svelte/src/home_page/FeatureTable.svelte b/svelte/src/home_page/FeatureTable.svelte index cd039db..6ee2bab 100644 --- a/svelte/src/home_page/FeatureTable.svelte +++ b/svelte/src/home_page/FeatureTable.svelte @@ -53,7 +53,7 @@ onMount(() => { Data transfer limit
- 20 GB data transfer per week + Download limit of 20 GB per week (168 hours). When this threshold is reached your download speed will be reduced
@@ -153,7 +153,7 @@ onMount(() => {

Unlike most other sharing sites pixeldrain uses a postponing system for expiring files. When a file is freshly uploaded it gets 60 days by - default (120 days if you have the pro plan). After these 60 days we will + default (240 days if you have the pro plan). After these 60 days we will check when the file was last viewed. Files which are regularly viewed could still bring new users to the platform, it would be rude to show these people a File Not Found page. So if the file was viewed in the diff --git a/svelte/src/home_page/OtherPlans.svelte b/svelte/src/home_page/OtherPlans.svelte index 5f5ac99..1db6d23 100644 --- a/svelte/src/home_page/OtherPlans.svelte +++ b/svelte/src/home_page/OtherPlans.svelte @@ -13,7 +13,7 @@ {/if}

-
20 GB max file size
+
50 GB max file size
Files never expire
4 TB transfer limit
4 TB storage space
@@ -39,7 +39,7 @@ {/if}
-
20 GB max file size
+
50 GB max file size
Files never expire
8 TB transfer limit
8 TB storage space
@@ -60,7 +60,7 @@ {/if}
-
20 GB max file size
+
50 GB max file size
Files never expire
16 TB transfer limit
16 TB storage space
@@ -81,7 +81,7 @@ {/if}
-
20 GB max file size
+
50 GB max file size
Files never expire
32 TB transfer limit
32 TB storage space