Compare commits

...
12 Commits
Author SHA1 Message Date
Pixeldrain-Server ca5342d7fa Fix typo 2026-11-12 15:58:21 +01:00
Pixeldrain-Server ee06b91b92 Add remote sync feature to run rclone on the server side 2026-11-12 15:50:06 +01:00
Pixeldrain-Server b423446412 Add button titles for accessibility 2026-11-09 20:42:08 +01:00
Pixeldrain-Server 5788f5a8b4 Update to Material Symbols and switch to class names for icons
The switch to class names is for accessibility. Class names are not translated by browser translation plugins and not read by screen readers.
2026-11-09 20:26:23 +01:00
Pixeldrain-Server 672a19f8f6 Remove Svelte upgrade compatibility code 2026-11-09 19:18:18 +01:00
Pixeldrain-Server 1956790dde Add data sync form 2026-11-09 18:48:27 +01:00
Pixeldrain-Server ebb72c7f24 Redesign the home page 2026-11-05 15:53:24 +01:00
Pixeldrain-Server 5b32f3dca7 Update S3 connection information 2026-10-09 16:11:48 +02:00
Pixeldrain-Server 9f8a985c63 Add S3 metrics 2026-10-06 16:19:23 +02:00
Pixeldrain-Server 8a41307700 Only warn about limits when usage-based billing is disabled 2026-10-06 11:51:19 +02:00
Pixeldrain-Server e3e8a1db1a Move metered billing settings to the subscription tab 2026-10-06 01:00:53 +02:00
Pixeldrain-Server a50ac7310f Tweak subscriptions some more 2026-10-06 00:46:54 +02:00
100 changed files with 1815 additions and 1131 deletions

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
module fornaxian.tech/nova_web
go 1.26
go 1.27
replace (
fornaxian.tech/nova_server => ../nova_server
Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.
+107
View File
@@ -0,0 +1,107 @@
/* Generated by svelte/icons.js */
.i_account_balance_wallet{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760H520q-71 0-115.5 44.5T360-600v240q0 71 44.5 115.5T520-200h320q0 33-23.5 56.5T760-120H200Zm320-160q-33 0-56.5-23.5T440-360v-240q0-33 23.5-56.5T520-680h280q33 0 56.5 23.5T880-600v240q0 33-23.5 56.5T800-280H520Zm163-157q17-17 17-43t-17-43q-17-17-43-17t-43 17q-17 17-17 43t17 43q17 17 43 17t43-17Z'/></svg>")}
.i_add{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M440-440H200v-80h240v-240h80v240h240v80H520v240h-80v-240Z'/></svg>")}
.i_admin_panel_settings{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M680-80q-83 0-141.5-58.5T480-280q0-83 58.5-141.5T680-480q83 0 141.5 58.5T880-280q0 83-58.5 141.5T680-80Zm-200 0q-139-35-229.5-159.5T160-516v-244l320-120 320 120v227q-26-13-58.5-20t-61.5-7q-116 0-198 82t-82 198q0 62 23.5 112T483-81q-1 0-1.5.5t-1.5.5Zm242.5-217.5Q740-315 740-340t-17.5-42.5Q705-400 680-400t-42.5 17.5Q620-365 620-340t17.5 42.5Q655-280 680-280t42.5-17.5ZM680-160q31 0 57-14.5t42-38.5q-22-13-47-20t-52-7q-27 0-52 7t-47 20q16 24 42 38.5t57 14.5Z'/></svg>")}
.i_app_registration{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M183.5-183.5Q160-207 160-240t23.5-56.5Q207-320 240-320t56.5 23.5Q320-273 320-240t-23.5 56.5Q273-160 240-160t-56.5-23.5Zm0-240Q160-447 160-480t23.5-56.5Q207-560 240-560t56.5 23.5Q320-513 320-480t-23.5 56.5Q273-400 240-400t-56.5-23.5Zm0-240Q160-687 160-720t23.5-56.5Q207-800 240-800t56.5 23.5Q320-753 320-720t-23.5 56.5Q273-640 240-640t-56.5-23.5Zm240 0Q400-687 400-720t23.5-56.5Q447-800 480-800t56.5 23.5Q560-753 560-720t-23.5 56.5Q513-640 480-640t-56.5-23.5Zm240 0Q640-687 640-720t23.5-56.5Q687-800 720-800t56.5 23.5Q800-753 800-720t-23.5 56.5Q753-640 720-640t-56.5-23.5Zm-240 240Q400-447 400-480t23.5-56.5Q447-560 480-560t56.5 23.5Q560-513 560-480t-23.5 56.5Q513-400 480-400t-56.5-23.5ZM520-160v-123l221-220q9-9 20-13t22-4q12 0 23 4.5t20 13.5l37 37q8 9 12.5 20t4.5 22q0 11-4 22.5T863-380L643-160H520Zm263-224 37-39-37-37-38 38 38 38Z'/></svg>")}
.i_apps{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M183.5-183.5Q160-207 160-240t23.5-56.5Q207-320 240-320t56.5 23.5Q320-273 320-240t-23.5 56.5Q273-160 240-160t-56.5-23.5Zm240 0Q400-207 400-240t23.5-56.5Q447-320 480-320t56.5 23.5Q560-273 560-240t-23.5 56.5Q513-160 480-160t-56.5-23.5Zm240 0Q640-207 640-240t23.5-56.5Q687-320 720-320t56.5 23.5Q800-273 800-240t-23.5 56.5Q753-160 720-160t-56.5-23.5Zm-480-240Q160-447 160-480t23.5-56.5Q207-560 240-560t56.5 23.5Q320-513 320-480t-23.5 56.5Q273-400 240-400t-56.5-23.5Zm240 0Q400-447 400-480t23.5-56.5Q447-560 480-560t56.5 23.5Q560-513 560-480t-23.5 56.5Q513-400 480-400t-56.5-23.5Zm240 0Q640-447 640-480t23.5-56.5Q687-560 720-560t56.5 23.5Q800-513 800-480t-23.5 56.5Q753-400 720-400t-56.5-23.5Zm-480-240Q160-687 160-720t23.5-56.5Q207-800 240-800t56.5 23.5Q320-753 320-720t-23.5 56.5Q273-640 240-640t-56.5-23.5Zm240 0Q400-687 400-720t23.5-56.5Q447-800 480-800t56.5 23.5Q560-753 560-720t-23.5 56.5Q513-640 480-640t-56.5-23.5Zm240 0Q640-687 640-720t23.5-56.5Q687-800 720-800t56.5 23.5Q800-753 800-720t-23.5 56.5Q753-640 720-640t-56.5-23.5Z'/></svg>")}
.i_area_chart{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M840-320 464-614 305-395 120-540v-140l160 120 200-280 200 160h160v360ZM120-160v-280l200 160 160-220 360 281v59H120Z'/></svg>")}
.i_arrow_back{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='m313-440 224 224-57 56-320-320 320-320 57 56-224 224h487v80H313Z'/></svg>")}
.i_arrow_drop_down{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M480-360 280-560h400L480-360Z'/></svg>")}
.i_arrow_forward{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M647-440H160v-80h487L423-744l57-56 320 320-320 320-57-56 224-224Z'/></svg>")}
.i_arrow_right{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M400-280v-400l200 200-200 200Z'/></svg>")}
.i_block{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M324-111.5Q251-143 197-197t-85.5-127Q80-397 80-480t31.5-156Q143-709 197-763t127-85.5Q397-880 480-880t156 31.5Q709-817 763-763t85.5 127Q880-563 880-480t-31.5 156Q817-251 763-197t-127 85.5Q563-80 480-80t-156-31.5ZM677-227q16-12 30-26t26-30L283-733q-16 12-30 26t-26 30l450 450Z'/></svg>")}
.i_bolt{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='m320-80 40-280H160l360-520h80l-40 320h240L400-80h-80Z'/></svg>")}
.i_bookmark_add{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M200-120v-640q0-33 23.5-56.5T280-840h280q-20 30-30 57.5T520-720q0 72 45.5 127T680-524q23 3 40 3t40-3v404L480-240 200-120Zm480-480v-80h-80v-80h80v-80h80v80h80v80h-80v80h-80Z'/></svg>")}
.i_bookmark_remove{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M840-680H600v-80h240v80ZM200-120v-640q0-33 23.5-56.5T280-840h280q-20 30-30 57.5T520-720q0 72 45.5 127T680-524q23 3 40 3t40-3v404L480-240 200-120Z'/></svg>")}
.i_cancel{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='m336-280 144-144 144 144 56-56-144-144 144-144-56-56-144 144-144-144-56 56 144 144-144 144 56 56ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Z'/></svg>")}
.i_check{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z'/></svg>")}
.i_chevron_left{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z'/></svg>")}
.i_chevron_right{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z'/></svg>")}
.i_close{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z'/></svg>")}
.i_cloud_upload{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M440-160H260q-91 0-155.5-63T40-377q0-78 47-139t123-78q25-92 100-149t170-57q117 0 198.5 81.5T760-520q69 8 114.5 59.5T920-340q0 75-52.5 127.5T740-160H520v-286l64 62 56-56-160-160-160 160 56 56 64-62v286Z'/></svg>")}
.i_collections{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M360-400h400L622-580l-92 120-62-80-108 140Zm-40 160q-33 0-56.5-23.5T240-320v-480q0-33 23.5-56.5T320-880h480q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H320ZM160-80q-33 0-56.5-23.5T80-160v-560h80v560h560v80H160Z'/></svg>")}
.i_content_copy{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Z'/></svg>")}
.i_create{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M120-120v-170l528-527q12-11 26.5-17t30.5-6q16 0 31 6t26 18l55 56q12 11 17.5 26t5.5 30q0 16-5.5 30.5T817-647L290-120H120Zm584-528 56-56-56-56-56 56 56 56Z'/></svg>")}
.i_create_new_folder{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M560-320h80v-80h80v-80h-80v-80h-80v80h-80v80h80v80ZM160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h240l80 80h320q33 0 56.5 23.5T880-640v400q0 33-23.5 56.5T800-160H160Z'/></svg>")}
.i_dashboard{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M520-600v-240h320v240H520ZM120-440v-400h320v400H120Zm400 320v-400h320v400H520Zm-400 0v-240h320v240H120Z'/></svg>")}
.i_data_usage{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M480-80q-83 0-156-31.5t-127-86Q143-252 111.5-325T80-480q0-157 104-270t256-128v120q-103 14-171.5 92.5T200-480q0 116 82 198t198 82q66 0 123.5-28t96.5-76l104 60q-54 75-139 119.5T480-80Zm366-238-104-60q9-24 13.5-49.5T760-480q0-107-68.5-185.5T520-758v-120q152 15 256 128t104 270q0 44-8 85t-26 77Z'/></svg>")}
.i_delete{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M280-120q-33 0-56.5-23.5T200-200v-520h-40v-80h200v-40h240v40h200v80h-40v520q0 33-23.5 56.5T680-120H280Zm80-160h80v-360h-80v360Zm160 0h80v-360h-80v360Z'/></svg>")}
.i_delete_forever{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='m376-300 104-104 104 104 56-56-104-104 104-104-56-56-104 104-104-104-56 56 104 104-104 104 56 56Zm-96 180q-33 0-56.5-23.5T200-200v-520h-40v-80h200v-40h240v40h200v80h-40v520q0 33-23.5 56.5T680-120H280Z'/></svg>")}
.i_description{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M320-240h320v-80H320v80Zm0-160h320v-80H320v80ZM240-80q-33 0-56.5-23.5T160-160v-640q0-33 23.5-56.5T240-880h320l240 240v480q0 33-23.5 56.5T720-80H240Zm280-520h200L520-800v200Z'/></svg>")}
.i_done{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z'/></svg>")}
.i_download{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M480-320 280-520l56-58 104 104v-326h80v326l104-104 56 58-200 200ZM240-160q-33 0-56.5-23.5T160-240v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-160H240Z'/></svg>")}
.i_drag_indicator{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M360-160q-33 0-56.5-23.5T280-240q0-33 23.5-56.5T360-320q33 0 56.5 23.5T440-240q0 33-23.5 56.5T360-160Zm240 0q-33 0-56.5-23.5T520-240q0-33 23.5-56.5T600-320q33 0 56.5 23.5T680-240q0 33-23.5 56.5T600-160ZM360-400q-33 0-56.5-23.5T280-480q0-33 23.5-56.5T360-560q33 0 56.5 23.5T440-480q0 33-23.5 56.5T360-400Zm240 0q-33 0-56.5-23.5T520-480q0-33 23.5-56.5T600-560q33 0 56.5 23.5T680-480q0 33-23.5 56.5T600-400ZM360-640q-33 0-56.5-23.5T280-720q0-33 23.5-56.5T360-800q33 0 56.5 23.5T440-720q0 33-23.5 56.5T360-640Zm240 0q-33 0-56.5-23.5T520-720q0-33 23.5-56.5T600-800q33 0 56.5 23.5T680-720q0 33-23.5 56.5T600-640Z'/></svg>")}
.i_drive_file_move{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h240l80 80h320q33 0 56.5 23.5T880-640v400q0 33-23.5 56.5T800-160H160Zm328-240-65 65 56 56 161-161-161-161-56 56 65 65H320v80h168Z'/></svg>")}
.i_east{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='m600-200-57-56 184-184H80v-80h647L544-704l56-56 280 280-280 280Z'/></svg>")}
.i_edit{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M120-120v-170l528-527q12-11 26.5-17t30.5-6q16 0 31 6t26 18l55 56q12 11 17.5 26t5.5 30q0 16-5.5 30.5T817-647L290-120H120Zm584-528 56-56-56-56-56 56 56 56Z'/></svg>")}
.i_email{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h640q33 0 56.5 23.5T880-720v480q0 33-23.5 56.5T800-160H160Zm320-280 320-200v-80L480-520 160-720v80l320 200Z'/></svg>")}
.i_expand_less{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='m296-345-56-56 240-240 240 240-56 56-184-184-184 184Z'/></svg>")}
.i_expand_more{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z'/></svg>")}
.i_flag{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M200-120v-680h360l16 80h224v400H520l-16-80H280v280h-80Z'/></svg>")}
.i_folder{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h240l80 80h320q33 0 56.5 23.5T880-640v400q0 33-23.5 56.5T800-160H160Z'/></svg>")}
.i_folder_open{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h240l80 80h320q33 0 56.5 23.5T880-640H160v400l96-320h684L837-217q-8 26-29.5 41.5T760-160H160Z'/></svg>")}
.i_forward_10{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M360-320v-180h-60v-60h120v240h-60Zm140 0q-17 0-28.5-11.5T460-360v-160q0-17 11.5-28.5T500-560h80q17 0 28.5 11.5T620-520v160q0 17-11.5 28.5T580-320h-80Zm20-60h40v-120h-40v120ZM339.5-108.5q-65.5-28.5-114-77t-77-114Q120-365 120-440t28.5-140.5q28.5-65.5 77-114t114-77Q405-800 480-800h6l-62-62 56-58 160 160-160 160-56-58 62-62h-6q-117 0-198.5 81.5T200-440q0 117 81.5 198.5T480-160q117 0 198.5-81.5T760-440h80q0 75-28.5 140.5t-77 114q-48.5 48.5-114 77T480-80q-75 0-140.5-28.5Z'/></svg>")}
.i_fullscreen{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M120-120v-200h80v120h120v80H120Zm520 0v-80h120v-120h80v200H640ZM120-640v-200h200v80H200v120h-80Zm640 0v-120H640v-80h200v200h-80Z'/></svg>")}
.i_help{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M513.5-254.5Q528-269 528-290t-14.5-35.5Q499-340 478-340t-35.5 14.5Q428-311 428-290t14.5 35.5Q457-240 478-240t35.5-14.5ZM442-394h74q0-33 7.5-52t42.5-52q26-26 41-49.5t15-56.5q0-56-41-86t-97-30q-57 0-92.5 30T342-618l66 26q5-18 22.5-39t53.5-21q32 0 48 17.5t16 38.5q0 20-12 37.5T506-526q-44 39-54 59t-10 73Zm38 314q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Z'/></svg>")}
.i_home{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M160-120v-480l320-240 320 240v480H560v-280H400v280H160Z'/></svg>")}
.i_how_to_reg{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M622-144 484-282l56-56 82 82 202-202 56 56-258 258ZM287-527q-47-47-47-113t47-113q47-47 113-47t113 47q47 47 47 113t-47 113q-47 47-113 47t-113-47Zm227 99L368-282l122 122H80v-112q0-33 17-62t47-44q51-26 115-44t141-18q30 0 58.5 3t55.5 9Z'/></svg>")}
.i_hub{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M155-75q-35-35-35-85t35-85q35-35 85-35 14 0 26 3t23 8l57-71q-28-31-39-70t-5-78l-81-27q-17 25-43 40t-58 15q-50 0-85-35T0-580q0-50 35-85t85-35q50 0 85 35t35 85v8l81 28q20-36 53.5-61t75.5-32v-87q-39-11-64.5-42.5T360-840q0-50 35-85t85-35q50 0 85 35t35 85q0 42-26 73.5T510-724v87q42 7 75.5 32t53.5 61l81-28v-8q0-50 35-85t85-35q50 0 85 35t35 85q0 50-35 85t-85 35q-32 0-58.5-15T739-515l-81 27q6 39-5 77.5T614-340l57 70q11-5 23-7.5t26-2.5q50 0 85 35t35 85q0 50-35 85t-85 35q-50 0-85-35t-35-85q0-20 6.5-38.5T624-232l-57-71q-41 23-87.5 23T392-303l-56 71q11 15 17.5 33.5T360-160q0 50-35 85t-85 35q-50 0-85-35Z'/></svg>")}
.i_image{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm40-160h480L570-480 450-320l-90-120-120 160Z'/></svg>")}
.i_info{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M440-280h80v-240h-80v240Zm68.5-331.5Q520-623 520-640t-11.5-28.5Q497-680 480-680t-28.5 11.5Q440-657 440-640t11.5 28.5Q463-600 480-600t28.5-11.5ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Z'/></svg>")}
.i_key{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M365-395q35-35 35-85t-35-85q-35-35-85-35t-85 35q-35 35-35 85t35 85q35 35 85 35t85-35Zm-85 155q-100 0-170-70T40-480q0-100 70-170t170-70q81 0 141.5 46T506-560h335l79 79-140 160-100-79-80 80-80-80h-14q-25 72-87 116t-139 44Z'/></svg>")}
.i_list{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M280-600v-80h560v80H280Zm0 160v-80h560v80H280Zm0 160v-80h560v80H280ZM160-600q-17 0-28.5-11.5T120-640q0-17 11.5-28.5T160-680q17 0 28.5 11.5T200-640q0 17-11.5 28.5T160-600Zm0 160q-17 0-28.5-11.5T120-480q0-17 11.5-28.5T160-520q17 0 28.5 11.5T200-480q0 17-11.5 28.5T160-440Zm0 160q-17 0-28.5-11.5T120-320q0-17 11.5-28.5T160-360q17 0 28.5 11.5T200-320q0 17-11.5 28.5T160-280Z'/></svg>")}
.i_lock_open{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M240-640h360v-80q0-50-35-85t-85-35q-50 0-85 35t-35 85h-80q0-83 58.5-141.5T480-920q83 0 141.5 58.5T680-720v80h40q33 0 56.5 23.5T800-560v400q0 33-23.5 56.5T720-80H240q-33 0-56.5-23.5T160-160v-400q0-33 23.5-56.5T240-640Zm296.5 336.5Q560-327 560-360t-23.5-56.5Q513-440 480-440t-56.5 23.5Q400-393 400-360t23.5 56.5Q447-280 480-280t56.5-23.5Z'/></svg>")}
.i_login{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M480-120v-80h280v-560H480v-80h280q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H480Zm-80-160-55-58 102-102H120v-80h327L345-622l55-58 200 200-200 200Z'/></svg>")}
.i_logout{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h280v80H200v560h280v80H200Zm440-160-55-58 102-102H360v-80h327L585-622l55-58 200 200-200 200Z'/></svg>")}
.i_menu{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M120-240v-80h720v80H120Zm0-200v-80h720v80H120Zm0-200v-80h720v80H120Z'/></svg>")}
.i_more_time{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M299.5-148Q234-176 185-225t-77-114.5Q80-405 80-480t28-140.5Q136-686 185-735t114.5-77Q365-840 440-840q21 0 40.5 2.5T520-830v82q-20-6-39.5-9t-40.5-3q-118 0-199 81t-81 199q0 118 81 199t199 81q118 0 199-81t81-199q0-11-1-20t-3-20h82q2 11 2 20v20q0 75-28 140.5T695-225q-49 49-114.5 77T440-120q-75 0-140.5-28ZM552-312 400-464v-216h80v184l128 128-56 56Zm168-288v-120H600v-80h120v-120h80v120h120v80H800v120h-80Z'/></svg>")}
.i_north{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M440-80v-647L256-544l-56-56 280-280 280 280-56 57-184-184v647h-80Z'/></svg>")}
.i_open_in_new{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h280v80H200v560h560v-280h80v280q0 33-23.5 56.5T760-120H200Zm188-212-56-56 372-372H560v-80h280v280h-80v-144L388-332Z'/></svg>")}
.i_paid{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M444-200h70v-50q50-9 86-39t36-89q0-42-24-77t-96-61q-60-20-83-35t-23-41q0-26 18.5-41t53.5-15q32 0 50 15.5t26 38.5l64-26q-11-35-40.5-61T516-710v-50h-70v50q-50 11-78 44t-28 74q0 47 27.5 76t86.5 50q63 23 87.5 41t24.5 47q0 33-23.5 48.5T486-314q-33 0-58.5-20.5T390-396l-66 26q14 48 43.5 77.5T444-252v52Zm36 120q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Z'/></svg>")}
.i_palette{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M480-80q-82 0-155-31.5t-127.5-86Q143-252 111.5-325T80-480q0-83 32.5-156t88-127Q256-817 330-848.5T488-880q80 0 151 27.5t124.5 76q53.5 48.5 85 115T880-518q0 115-70 176.5T640-280h-74q-9 0-12.5 5t-3.5 11q0 12 15 34.5t15 51.5q0 50-27.5 74T480-80ZM303-457q17-17 17-43t-17-43q-17-17-43-17t-43 17q-17 17-17 43t17 43q17 17 43 17t43-17Zm120-160q17-17 17-43t-17-43q-17-17-43-17t-43 17q-17 17-17 43t17 43q17 17 43 17t43-17Zm200 0q17-17 17-43t-17-43q-17-17-43-17t-43 17q-17 17-17 43t17 43q17 17 43 17t43-17Zm120 160q17-17 17-43t-17-43q-17-17-43-17t-43 17q-17 17-17 43t17 43q17 17 43 17t43-17Z'/></svg>")}
.i_pause{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M560-200v-560h160v560H560Zm-320 0v-560h160v560H240Z'/></svg>")}
.i_payments{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M120-160q-33 0-56.5-23.5T40-240v-440h80v440h680v80H120Zm160-160q-33 0-56.5-23.5T200-400v-320q0-33 23.5-56.5T280-800h560q33 0 56.5 23.5T920-720v320q0 33-23.5 56.5T840-320H280Zm80-80q0-33-23.5-56.5T280-480v80h80Zm400 0h80v-80q-33 0-56.5 23.5T760-400Zm-200-40q50 0 85-35t35-85q0-50-35-85t-85-35q-50 0-85 35t-35 85q0 50 35 85t85 35ZM280-640q33 0 56.5-23.5T360-720h-80v80Zm560 0v-80h-80q0 33 23.5 56.5T840-640Z'/></svg>")}
.i_person{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M367-527q-47-47-47-113t47-113q47-47 113-47t113 47q47 47 47 113t-47 113q-47 47-113 47t-113-47ZM160-160v-112q0-34 17.5-62.5T224-378q62-31 126-46.5T480-440q66 0 130 15.5T736-378q29 15 46.5 43.5T800-272v112H160Z'/></svg>")}
.i_person_remove{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M640-520v-80h240v80H640Zm-393-7q-47-47-47-113t47-113q47-47 113-47t113 47q47 47 47 113t-47 113q-47 47-113 47t-113-47ZM40-160v-112q0-34 17.5-62.5T104-378q62-31 126-46.5T360-440q66 0 130 15.5T616-378q29 15 46.5 43.5T680-272v112H40Z'/></svg>")}
.i_photo_library{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M360-400h400L622-580l-92 120-62-80-108 140Zm-40 160q-33 0-56.5-23.5T240-320v-480q0-33 23.5-56.5T320-880h480q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H320ZM160-80q-33 0-56.5-23.5T80-160v-560h80v560h560v80H160Z'/></svg>")}
.i_play_arrow{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M320-200v-560l440 280-440 280Z'/></svg>")}
.i_priority_high{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M480-120q-33 0-56.5-23.5T400-200q0-33 23.5-56.5T480-280q33 0 56.5 23.5T560-200q0 33-23.5 56.5T480-120Zm-80-240v-480h160v480H400Z'/></svg>")}
.i_public{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M324-111.5Q251-143 197-197t-85.5-127Q80-397 80-480t31.5-156Q143-709 197-763t127-85.5Q397-880 480-880t156 31.5Q709-817 763-763t85.5 127Q880-563 880-480t-31.5 156Q817-251 763-197t-127 85.5Q563-80 480-80t-156-31.5ZM440-162v-78q-33 0-56.5-23.5T360-320v-40L168-552q-3 18-5.5 36t-2.5 36q0 121 79.5 212T440-162Zm276-102q41-45 62.5-100.5T800-480q0-98-54.5-179T600-776v16q0 33-23.5 56.5T520-680h-80v80q0 17-11.5 28.5T400-560h-80v80h240q17 0 28.5 11.5T600-440v120h40q26 0 47 15.5t29 40.5Z'/></svg>")}
.i_receipt{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M120-80v-800l60 60 60-60 60 60 60-60 60 60 60-60 60 60 60-60 60 60 60-60 60 60 60-60v800l-60-60-60 60-60-60-60 60-60-60-60 60-60-60-60 60-60-60-60 60-60-60-60 60Zm120-200h480v-80H240v80Zm0-160h480v-80H240v80Zm0-160h480v-80H240v80Z'/></svg>")}
.i_refresh{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M480-160q-134 0-227-93t-93-227q0-134 93-227t227-93q69 0 132 28.5T720-690v-110h80v280H520v-80h168q-32-56-87.5-88T480-720q-100 0-170 70t-70 170q0 100 70 170t170 70q77 0 139-44t87-116h84q-28 106-114 173t-196 67Z'/></svg>")}
.i_replay_10{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M339.5-108.5q-65.5-28.5-114-77t-77-114Q120-365 120-440h80q0 117 81.5 198.5T480-160q117 0 198.5-81.5T760-440q0-117-81.5-198.5T480-720h-6l62 62-56 58-160-160 160-160 56 58-62 62h6q75 0 140.5 28.5t114 77q48.5 48.5 77 114T840-440q0 75-28.5 140.5t-77 114q-48.5 48.5-114 77T480-80q-75 0-140.5-28.5ZM360-320v-180h-60v-60h120v240h-60Zm140 0q-17 0-28.5-11.5T460-360v-160q0-17 11.5-28.5T500-560h80q17 0 28.5 11.5T620-520v160q0 17-11.5 28.5T580-320h-80Zm20-60h40v-120h-40v120Z'/></svg>")}
.i_restart_alt{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M440-122q-121-15-200.5-105.5T160-440q0-66 26-126.5T260-672l57 57q-38 34-57.5 79T240-440q0 88 56 155.5T440-202v80Zm80 0v-80q87-16 143.5-83T720-440q0-100-70-170t-170-70h-3l44 44-56 56-140-140 140-140 56 56-44 44h3q134 0 227 93t93 227q0 121-79.5 211.5T520-122Z'/></svg>")}
.i_restore_from_trash{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M440-320h80v-166l64 62 56-56-160-160-160 160 56 56 64-62v166ZM280-120q-33 0-56.5-23.5T200-200v-520h-40v-80h200v-40h240v40h200v80h-40v520q0 33-23.5 56.5T680-120H280Z'/></svg>")}
.i_save{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M840-680v480q0 33-23.5 56.5T760-120H200q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h480l160 160ZM565-275q35-35 35-85t-35-85q-35-35-85-35t-85 35q-35 35-35 85t35 85q35 35 85 35t85-35ZM240-560h360v-160H240v160Z'/></svg>")}
.i_search{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z'/></svg>")}
.i_select_all{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M280-280v-400h400v400H280Zm80-80h240v-240H360v240ZM200-200v80q-33 0-56.5-23.5T120-200h80Zm-80-80v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm80-160h-80q0-33 23.5-56.5T200-840v80Zm80 640v-80h80v80h-80Zm0-640v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-640v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-640v-80h80v80h-80Zm160 640v-80h80q0 33-23.5 56.5T760-120Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80q33 0 56.5 23.5T840-760h-80Z'/></svg>")}
.i_send{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M120-160v-240l320-80-320-80v-240l760 320-760 320Z'/></svg>")}
.i_settings{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='m370-80-16-128q-13-5-24.5-12T307-235l-119 50L78-375l103-78q-1-7-1-13.5v-27q0-6.5 1-13.5L78-585l110-190 119 50q11-8 23-15t24-12l16-128h220l16 128q13 5 24.5 12t22.5 15l119-50 110 190-103 78q1 7 1 13.5v27q0 6.5-2 13.5l103 78-110 190-118-50q-11 8-23 15t-24 12L590-80H370Zm112-260q58 0 99-41t41-99q0-58-41-99t-99-41q-59 0-99.5 41T342-480q0 58 40.5 99t99.5 41Z'/></svg>")}
.i_share{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M680-80q-50 0-85-35t-35-85q0-6 3-28L282-392q-16 15-37 23.5t-45 8.5q-50 0-85-35t-35-85q0-50 35-85t85-35q24 0 45 8.5t37 23.5l281-164q-2-7-2.5-13.5T560-760q0-50 35-85t85-35q50 0 85 35t35 85q0 50-35 85t-85 35q-24 0-45-8.5T598-672L317-508q2 7 2.5 13.5t.5 14.5q0 8-.5 14.5T317-452l281 164q16-15 37-23.5t45-8.5q50 0 85 35t35 85q0 50-35 85t-85 35Z'/></svg>")}
.i_shopping_cart{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M223.5-103.5Q200-127 200-160t23.5-56.5Q247-240 280-240t56.5 23.5Q360-193 360-160t-23.5 56.5Q313-80 280-80t-56.5-23.5Zm400 0Q600-127 600-160t23.5-56.5Q647-240 680-240t56.5 23.5Q760-193 760-160t-23.5 56.5Q713-80 680-80t-56.5-23.5ZM208-800h590q23 0 35 20.5t1 41.5L692-482q-11 20-29.5 31T622-440H324l-44 80h480v80H280q-45 0-68-39.5t-2-78.5l54-98-144-304H40v-80h130l38 80Z'/></svg>")}
.i_shuffle{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M560-160v-80h104L537-367l57-57 126 126v-102h80v240H560Zm-344 0-56-56 504-504H560v-80h240v240h-80v-104L216-160Zm151-377L160-744l56-56 207 207-56 56Z'/></svg>")}
.i_skip_next{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M660-240v-480h80v480h-80Zm-440 0v-480l360 240-360 240Z'/></svg>")}
.i_skip_previous{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M220-240v-480h80v480h-80Zm520 0L380-480l360-240v480Z'/></svg>")}
.i_speed{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M418-340q25 25 63 23.5t55-27.5l224-336-336 224q-26 18-28.5 54.5T418-340ZM204-160q-22 0-40.5-9.5T134-198q-26-47-40-97.5T80-400q0-83 31.5-156T197-683q54-54 127-85.5T480-800q82 0 154 31t126 84.5q54 53.5 86 125T879-406q1 55-12.5 107.5T825-198q-11 19-29.5 28.5T755-160H204Z'/></svg>")}
.i_star{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='m233-120 65-281L80-590l288-25 112-265 112 265 288 25-218 189 65 281-247-149-247 149Z'/></svg>")}
.i_stop{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M240-240v-480h480v480H240Z'/></svg>")}
.i_storage{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M120-160v-160h720v160H120Zm80-40h80v-80h-80v80Zm-80-440v-160h720v160H120Zm80-40h80v-80h-80v80Zm-80 280v-160h720v160H120Zm80-40h80v-80h-80v80Z'/></svg>")}
.i_swap_horiz{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M280-160 80-360l200-200 56 57-103 103h287v80H233l103 103-56 57Zm400-240-56-57 103-103H440v-80h287L624-743l56-57 200 200-200 200Z'/></svg>")}
.i_sync_alt{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M280-120 80-320l200-200 57 56-104 104h607v80H233l104 104-57 56Zm400-320-57-56 104-104H120v-80h607L623-784l57-56 200 200-200 200Z'/></svg>")}
.i_text_snippet{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h400l240 240v400q0 33-23.5 56.5T760-120H200Zm80-160h400v-80H280v80Zm0-160h400v-80H280v80Zm0-160h280v-80H280v80Z'/></svg>")}
.i_touch_app{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M419-80q-28 0-52.5-12T325-126L107-403l19-20q20-21 48-25t52 11l74 45v-328q0-17 11.5-28.5T340-760q17 0 29 11.5t12 28.5v200h299q50 0 85 35t35 85v160q0 66-47 113T640-80H419ZM167-620q-13-22-20-47.5t-7-52.5q0-83 58.5-141.5T340-920q83 0 141.5 58.5T540-720q0 27-7 52.5T513-620l-69-40q8-14 12-28.5t4-31.5q0-50-35-85t-85-35q-50 0-85 35t-35 85q0 17 4 31.5t12 28.5l-69 40Z'/></svg>")}
.i_undo{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M280-200v-80h284q63 0 109.5-40T720-420q0-60-46.5-100T564-560H312l104 104-56 56-200-200 200-200 56 56-104 104h252q97 0 166.5 63T800-420q0 94-69.5 157T564-200H280Z'/></svg>")}
.i_unfold_less{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='m356-160-56-56 180-180 180 180-56 56-124-124-124 124Zm124-404L300-744l56-56 124 124 124-124 56 56-180 180Z'/></svg>")}
.i_unfold_more{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M480-120 300-300l58-58 122 122 122-122 58 58-180 180ZM358-598l-58-58 180-180 180 180-58 58-122-122-122 122Z'/></svg>")}
.i_upload{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M440-320v-326L336-542l-56-58 200-200 200 200-56 58-104-104v326h-80ZM240-160q-33 0-56.5-23.5T160-240v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-160H240Z'/></svg>")}
.i_verified_user{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='m438-338 226-226-57-57-169 169-84-84-57 57 141 141Zm42 258q-139-35-229.5-159.5T160-516v-244l320-120 320 120v244q0 152-90.5 276.5T480-80Z'/></svg>")}
.i_view_compact{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M880-170v-620 620ZM80-610v-180h170v180H80Zm210 0v-180h170v180H290Zm210 0v-180h170v180H500Zm210 0v-180h170v180H710Zm0 220v-180h170v180H710Zm-210 0v-180h170v180H500Zm-210 0v-180h170v180H290Zm-210 0v-180h170v180H80Zm630 220v-180h170v180H710Zm-210 0v-180h170v180H500Zm-210 0v-180h170v180H290Zm-210 0v-180h170v180H80Z'/></svg>")}
.i_visibility{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M607.5-372.5Q660-425 660-500t-52.5-127.5Q555-680 480-680t-127.5 52.5Q300-575 300-500t52.5 127.5Q405-320 480-320t127.5-52.5Zm-204-51Q372-455 372-500t31.5-76.5Q435-608 480-608t76.5 31.5Q588-545 588-500t-31.5 76.5Q525-392 480-392t-76.5-31.5ZM214-281.5Q94-363 40-500q54-137 174-218.5T480-800q146 0 266 81.5T920-500q-54 137-174 218.5T480-200q-146 0-266-81.5Z'/></svg>")}
.i_visibility_off{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M792-56 624-222q-35 11-70.5 16.5T480-200q-151 0-269-83.5T40-500q21-53 53-98.5t73-81.5L56-792l56-56 736 736-56 56ZM480-320q11 0 20.5-1t20.5-4L305-541q-3 11-4 20.5t-1 20.5q0 75 52.5 127.5T480-320Zm292 18L645-428q7-17 11-34.5t4-37.5q0-75-52.5-127.5T480-680q-20 0-37.5 4T408-664L306-766q41-17 84-25.5t90-8.5q151 0 269 83.5T920-500q-23 59-60.5 109.5T772-302ZM587-486 467-606q28-5 51.5 4.5T559-574q17 18 24.5 41.5T587-486Z'/></svg>")}
.i_volume_off{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M792-56 671-177q-25 16-53 27.5T560-131v-82q14-5 27.5-10t25.5-12L480-368v208L280-360H120v-240h128L56-792l56-56 736 736-56 56Zm-8-232-58-58q17-31 25.5-65t8.5-70q0-94-55-168T560-749v-82q124 28 202 125.5T840-481q0 53-14.5 102T784-288ZM650-422l-90-90v-130q47 22 73.5 66t26.5 96q0 15-2.5 29.5T650-422ZM480-592 376-696l104-104v208Z'/></svg>")}
.i_volume_up{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M560-131v-82q90-26 145-100t55-168q0-94-55-168T560-749v-82q124 28 202 125.5T840-481q0 127-78 224.5T560-131ZM120-360v-240h160l200-200v640L280-360H120Zm440 40v-322q47 22 73.5 66t26.5 96q0 51-26.5 94.5T560-320Z'/></svg>")}
.i_vpn_key{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M280-240q-100 0-170-70T40-480q0-100 70-170t170-70q81 0 141.5 45.5T506-560h414v160h-80v160H680v-160H506q-24 69-84.5 114.5T280-240Zm0-160q33 0 56.5-23.5T360-480q0-33-23.5-56.5T280-560q-33 0-56.5 23.5T200-480q0 33 23.5 56.5T280-400Z'/></svg>")}
.i_warning{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='m40-120 440-760 440 760H40Zm468.5-131.5Q520-263 520-280t-11.5-28.5Q497-320 480-320t-28.5 11.5Q440-297 440-280t11.5 28.5Q463-240 480-240t28.5-11.5ZM440-360h80v-200h-80v200Z'/></svg>")}
.i_west{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M360-200 80-480l280-280 56 56-183 184h647v80H233l184 184-57 56Z'/></svg>")}
.i_zoom_in{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Zm-40-60v-80h-80v-80h80v-80h80v80h80v80h-80v80h-80Z'/></svg>")}
.i_zoom_out{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400ZM280-540v-80h200v80H280Z'/></svg>")}
+12 -21
View File
@@ -94,31 +94,22 @@ body {
accent-color: var(--accent_color);
}
@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
font-display: block;
src: local('Material Icons'),
local('MaterialIcons-Regular'),
url(/res/misc/MaterialIcons.woff2) format('woff2');
}
/* Material Symbols, used like <i class="icon i_delete"></i>. The i_ classes
are generated into icons.css by svelte/icons.js. The glyph is a mask on a
pseudo element so backgrounds and padding on the icon itself still work */
.icon {
font-family: 'Material Icons';
font-weight: normal;
font-style: normal;
font-size: 1.5em;
display: inline-block;
line-height: 1em;
text-transform: none;
letter-spacing: normal;
word-wrap: normal;
white-space: nowrap;
direction: ltr;
text-rendering: optimizeLegibility;
vertical-align: middle;
font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.icon::before {
content: "";
display: block;
width: 1em;
height: 1em;
background-color: currentColor;
-webkit-mask: var(--icon) center / contain no-repeat;
mask: var(--icon) center / contain no-repeat;
}
.icon_unicode {
+1 -1
View File
@@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="/res/style/layout.css?v{{.CacheID}}"/>
<link rel="preload" href="/res/misc/MaterialIcons.woff2" as="font" type="font/woff2" crossorigin/>
<link rel="stylesheet" href="/res/style/icons.css?v{{.CacheID}}"/>
<link rel="icon" href="/favicon.ico" sizes="32x32"/>
<link rel="icon" href="/res/img/nova.svg" type="image/svg+xml"/>
+44
View File
@@ -0,0 +1,44 @@
// Writes the Material Symbols used in the source to icons.css. Icons are found
// by their i_<name> classes and by the icon props of Button, ToggleButton and
// TabMenu: icon="name", icon: "name" and icon={a ? "name" : "other"}. Icons
// which are already in icons.css are not downloaded again
import { globSync, readFileSync, writeFileSync } from "node:fs"
const css_file = "../res/static/style/icons.css"
const names = new Set()
for (const file of globSync(["src/**/*.svelte", "../res/template/**/*.html"])) {
const src = readFileSync(file, "utf8")
for (const [, name] of src.matchAll(/\bi_([a-z0-9_]+)/g)) {
names.add(name)
}
for (const [, prop] of src.matchAll(/\bicon(?:_on|_off)?(?:=|:\s*)("[^"]*"|\{[^}]*\})/g)) {
for (const [, name] of prop.matchAll(/"([a-z0-9_]+)"/g)) {
names.add(name)
}
}
}
const cached = new Map(
readFileSync(css_file, "utf8").matchAll(/^\.i_([a-z0-9_]+)\{.*$/gm).map(m => [m[1], m[0]])
)
const rules = await Promise.all([...names].sort().map(async name => {
if (cached.has(name)) {
return cached.get(name)
}
const url = `https://fonts.gstatic.com/s/i/short-term/release/materialsymbolsoutlined/${name}/fill1/24px.svg`
const resp = await fetch(url)
if (!resp.ok) {
throw new Error(`Icon ${name} not found: ${resp.status} ${url}`)
}
const svg = await resp.text()
const path = svg.match(/^<svg [^>]*viewBox="0 -960 960 960"[^>]*><path d="([^"]+)"\/><\/svg>$/)
if (path === null) {
throw new Error(`Icon ${name} has an unexpected format: ${svg}`)
}
return `.i_${name}{--icon:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'><path d='${path[1]}'/></svg>")}`
}))
writeFileSync(css_file, "/* Generated by svelte/icons.js */\n" + rules.join("\n") + "\n")
+2 -2
View File
@@ -3,8 +3,8 @@
"version": "1.0.0",
"type": "module",
"scripts": {
"build": "NODE_ENV=production vite build",
"dev": "NODE_ENV=development vite build --watch"
"build": "node icons.js && NODE_ENV=production vite build",
"dev": "node icons.js && NODE_ENV=development vite build --watch"
},
"devDependencies": {
"@rollup/plugin-node-resolve": "^15.3.1",
+15 -10
View File
@@ -1,12 +1,17 @@
<script lang="ts">
import { formatDate, formatNumber } from "util/Formatting";
import Expandable from "util/Expandable.svelte";
import { createEventDispatcher } from "svelte";
let dispatch = createEventDispatcher()
let {
report,
ip_report_count
ip_report_count,
on_resolve_report,
on_resolve_by_ip,
}: {
report: any
ip_report_count: {[key: string]: number}
on_resolve_report: (action: string, report_type: string) => void
on_resolve_by_ip: (ip: string, action: string) => void
} = $props();
let preview = $state(false)
@@ -14,7 +19,7 @@ let can_grant = $derived(report.status !== "granted")
let can_reject = $derived(report.status !== "rejected")
let set_status = async (action: string, report_type: string) => {
dispatch("resolve_report", {action: action, report_type: report_type})
on_resolve_report(action, report_type)
}
</script>
@@ -47,19 +52,19 @@ let set_status = async (action: string, report_type: string) => {
<div class="toolbar">
<div class="action_list">
<a class="button" target="_blank" href={"/u/"+report.file.id} rel="noreferrer">
<i class="icon">open_in_new</i> Open file
<i class="icon i_open_in_new"></i> Open file
</a>
<button class:button_highlight={preview} onclick={() => {preview = !preview}}>
<i class="icon">visibility</i> Preview
<i class="icon i_visibility"></i> Preview
</button>
{#if can_grant}
<button class="button_highlight" onclick={() => {set_status("grant", report.type)}}>
<i class="icon">done</i> Block ({report.type})
<i class="icon i_done"></i> Block ({report.type})
</button>
{/if}
{#if can_reject}
<button class="button_red" onclick={() => {set_status("reject", "")}}>
<i class="icon">delete</i> Ignore
<i class="icon i_delete"></i> Ignore
</button>
{/if}
</div>
@@ -105,12 +110,12 @@ let set_status = async (action: string, report_type: string) => {
<td>{ip_report_count[user_report.ip_address]}</td>
<td>
{#if can_grant}
<button onclick={() => dispatch("resolve_by_ip", {ip: user_report.ip_address, action: "grant"})}>
<button onclick={() => on_resolve_by_ip(user_report.ip_address, "grant")}>
Accept all
</button>
{/if}
{#if can_reject}
<button onclick={() => dispatch("resolve_by_ip", {ip: user_report.ip_address, action: "reject"})}>
<button onclick={() => on_resolve_by_ip(user_report.ip_address, "reject")}>
Ignore all
</button>
{/if}
+5 -5
View File
@@ -168,15 +168,15 @@ onMount(() => {
<div class="tab_bar">
<button onclick={() => {tab = "pending"; get_reports()}} class:button_highlight={tab === "pending"}>
<i class="icon">flag</i>
<i class="icon i_flag"></i>
Pending
</button>
<button onclick={() => {tab = "granted"; get_reports()}} class:button_highlight={tab === "granted"}>
<i class="icon">flag</i>
<i class="icon i_flag"></i>
Granted
</button>
<button onclick={() => {tab = "rejected"; get_reports()}} class:button_highlight={tab === "rejected"}>
<i class="icon">flag</i>
<i class="icon i_flag"></i>
Rejected
</button>
</div>
@@ -185,8 +185,8 @@ onMount(() => {
<AbuseReport
report={report}
ip_report_count={ip_report_count}
on:resolve_report={e => resolve_report(report.id, e.detail.action, e.detail.report_type)}
on:resolve_by_ip={e => resolve_by_ip(e.detail.ip, e.detail.action)}
on_resolve_report={(action, report_type) => resolve_report(report.id, action, report_type)}
on_resolve_by_ip={resolve_by_ip}
/>
{/each}
</section>
+1 -1
View File
@@ -31,7 +31,7 @@ let block_form = {
default_value: "Anonymous",
},
],
submit_label: `<i class="icon">send</i> Submit`,
submit_label: `<i class="icon i_send"></i> Submit`,
on_submit: async fields => {
const form = new FormData()
form.append("text", fields.text)
+16 -17
View File
@@ -116,7 +116,6 @@ const delete_reporter = async (reporter: Reporter) => {
const index = reporters.indexOf(reporter)
if (index > -1) {
reporters.splice(index, 1)
reporters = reporters
}
try {
@@ -140,11 +139,11 @@ onMount(get_reporters);
<section>
<div class="toolbar" style="text-align: left;">
<div class="toolbar_spacer"></div>
<button onclick={() => get_reporters()}>
<i class="icon">refresh</i>
<button onclick={() => get_reporters()} title="Refresh">
<i class="icon i_refresh"></i>
</button>
<button bind:this={edit_button} class:button_highlight={creating} onclick={() => {creating = !creating}}>
<i class="icon">create</i> Add abuse reporter
<i class="icon i_create"></i> Add abuse reporter
</button>
</div>
{#if creating}
@@ -164,7 +163,7 @@ onMount(get_reporters);
<label for="reporter_status_2">Rejected</label>
</div>
<button class="button_highlight" type="submit">
<i class="icon">save</i> Save
<i class="icon i_save"></i> Save
</button>
</div>
</form>
@@ -175,29 +174,29 @@ onMount(get_reporters);
<h2>Pending reporters ({reporters_pending.length})</h2>
<EmailReportersTable
reporters={reporters_pending}
on:edit={e => edit_reporter(e.detail)}
on:approve={e => approve_reporter(e.detail)}
on:spam={e => spam_reporter(e.detail)}
on:delete={e => delete_reporter(e.detail)}>
on_edit={edit_reporter}
on_approve={approve_reporter}
on_spam={spam_reporter}
on_delete={delete_reporter}>
</EmailReportersTable>
<h2>Trusted reporters ({reporters_trusted.length})</h2>
<EmailReportersTable
reporters={reporters_trusted}
on:edit={e => edit_reporter(e.detail)}
on:approve={e => approve_reporter(e.detail)}
on:spam={e => spam_reporter(e.detail)}
on:delete={e => delete_reporter(e.detail)}>
on_edit={edit_reporter}
on_approve={approve_reporter}
on_spam={spam_reporter}
on_delete={delete_reporter}>
</EmailReportersTable>
<h2>Rejected reporters ({reporters_rejected.length})</h2>
<EmailReportersTable
reporters={reporters_rejected}
on:edit={e => edit_reporter(e.detail)}
on:approve={e => approve_reporter(e.detail)}
on:spam={e => spam_reporter(e.detail)}
on:delete={e => delete_reporter(e.detail)}>
on_edit={edit_reporter}
on_approve={approve_reporter}
on_spam={spam_reporter}
on_delete={delete_reporter}>
</EmailReportersTable>
<br/>
@@ -1,45 +1,43 @@
<script lang="ts">
import { run, preventDefault } from 'svelte/legacy';
import { createEventDispatcher } from "svelte";
import { formatDate } from "util/Formatting";
import Modal from "util/Modal.svelte"
import SortButton from "layout/SortButton.svelte";
import { flip } from "svelte/animate";
const dispatch = createEventDispatcher()
let { reporters = $bindable([]) } = $props();
const update_table = (reporters) => sort("")
let { reporters = [], on_edit, on_approve, on_spam, on_delete }: {
reporters?: any[];
on_edit: (reporter: any) => void;
on_approve: (reporter: any) => void;
on_spam: (reporter: any) => void;
on_delete: (reporter: any) => void;
} = $props();
let sort_field = $state("last_used")
let asc = $state(false)
const sort = (field) => {
if (field !== "" && field === sort_field) asc = !asc
if (field === "") field = sort_field
const sort = (field: string) => {
if (field === sort_field) asc = !asc
sort_field = field
console.log("sorting by", field, "asc", asc)
reporters.sort((a, b) => {
if (typeof (a[field]) === "number") {
// Sort ints from high to low
if (asc) {
return a[field] - b[field]
} else {
return b[field] - a[field]
}
} else {
// Sort strings alphabetically
if (asc) {
return a[field].localeCompare(b[field])
} else {
return b[field].localeCompare(a[field])
}
}
})
reporters = reporters
}
let sorted = $derived([...reporters].sort((a, b) => {
if (typeof (a[sort_field]) === "number") {
// Sort ints from high to low
if (asc) {
return a[sort_field] - b[sort_field]
} else {
return b[sort_field] - a[sort_field]
}
} else {
// Sort strings alphabetically
if (asc) {
return a[sort_field].localeCompare(b[sort_field])
} else {
return b[sort_field].localeCompare(a[sort_field])
}
}
}))
let modal: Modal = $state()
let preview_subject = $state("")
let preview_html = $state("")
@@ -50,9 +48,6 @@ const toggle_preview = (rep) => {
preview_html = rep.last_message_html
modal.show()
}
run(() => {
update_table(reporters)
});
</script>
<div class="table_scroll">
@@ -69,7 +64,7 @@ run(() => {
</tr>
</thead>
<tbody>
{#each reporters as rep (rep.from_address)}
{#each sorted as rep (rep.from_address)}
<tr animate:flip={{duration: 500}}>
<td>{rep.from_address}</td>
<td>{rep.name}</td>
@@ -78,24 +73,24 @@ run(() => {
<td>{formatDate(rep.last_used, true, true, false)}</td>
<td>{formatDate(rep.created, false, false, false)}</td>
<td>
<button onclick={preventDefault(() => toggle_preview(rep))} class="button round">
<i class="icon">email</i>
<button onclick={e => {e.preventDefault(); toggle_preview(rep)}} class="button round" title="Show last message">
<i class="icon i_email"></i>
</button>
<button onclick={preventDefault(() => {dispatch("edit", rep)})} class="button round">
<i class="icon">edit</i>
<button onclick={e => {e.preventDefault(); on_edit(rep)}} class="button round" title="Edit">
<i class="icon i_edit"></i>
</button>
{#if rep.status !== "trusted"}
<button onclick={preventDefault(() => {dispatch("approve", rep)})} class="button button_highlight round">
<i class="icon">check</i>
<button onclick={e => {e.preventDefault(); on_approve(rep)}} class="button button_highlight round" title="Trust">
<i class="icon i_check"></i>
</button>
{/if}
{#if rep.status !== "rejected"}
<button onclick={preventDefault(() => {dispatch("spam", rep)})} class="button button_red round">
<i class="icon">block</i>
<button onclick={e => {e.preventDefault(); on_spam(rep)}} class="button button_red round" title="Reject">
<i class="icon i_block"></i>
</button>
{/if}
<button onclick={preventDefault(() => {dispatch("delete", rep)})} class="button button_red round">
<i class="icon">delete</i>
<button onclick={e => {e.preventDefault(); on_delete(rep)}} class="button button_red round" title="Delete">
<i class="icon i_delete"></i>
</button>
</td>
</tr>
+1 -1
View File
@@ -49,7 +49,7 @@ const date = (d: string) => (!d || d.startsWith("0001-")) ? "never" : formatDate
<label for="hash_input">File hash (hex sha256)</label>
<input id="hash_input" bind:value={hash} onclick={e => e.currentTarget.select()}/>
<button type="submit" disabled={loading}>
<i class="icon">search</i> Look up
<i class="icon i_search"></i> Look up
</button>
</form>
+2 -2
View File
@@ -285,11 +285,11 @@ onMount(() => {
<h3>Cache nodes</h3>
</section>
<PeerTable peers={status.peers.reduce((acc, val) => {if (val.role === "cache") {acc.push(val)}; return acc}, [])}/>
<PeerTable peers={status.peers.filter(peer => peer.services?.includes("cache"))}/>
<section>
<h3>Storage nodes</h3>
</section>
<PeerTable peers={status.peers.reduce((acc, val) => {if (val.role === "storage") {acc.push(val)}; return acc}, [])}/>
<PeerTable peers={status.peers.filter(peer => peer.services?.includes("storage"))}/>
<section>
<h3>Query statistics</h3>
@@ -55,6 +55,8 @@ const groups: {
data_type: "duration",
},
{metric: "filesystem_index_walk_child", data_type: "number"},
{metric: "s3_request", data_type: "number"},
{metric: "s3_error_500", data_type: "number"},
]
}, {
title: "Task scheduler", expanded: false,
+2 -2
View File
@@ -161,13 +161,13 @@ let invoices_filtered: Invoice[] = $state([])
<h3>{year + "-" + ("00"+(month)).slice(-2)}</h3>
<div class="toolbar">
<button onclick={last_month}>
<i class="icon">chevron_left</i>
<i class="icon i_chevron_left"></i>
Previous month
</button>
<div class="toolbar_spacer"></div>
<button onclick={next_month}>
Next month
<i class="icon">chevron_right</i>
<i class="icon i_chevron_right"></i>
</button>
</div>
@@ -8,7 +8,7 @@ import { loading_finish, loading_start } from "lib/Loading";
let { settlement = {} } = $props();
let payments = $state([])
let per_country = $state({})
let per_country: {[country: string]: any} = $state({})
let totals = $state({
count: 0,
vat: 0,
@@ -79,7 +79,7 @@ const get_payments = async () => {
{}
)
console.log(per_country)
console.log($state.snapshot(per_country))
} catch (err) {
alert(err);
} finally {
+2 -2
View File
@@ -115,8 +115,8 @@ const decommission = (id: string) => {
<td>{formatDataVolume(peer.min_free_space, 3)}</td>
{#if !all_reachable}
<td>
<button class="button flat delete" onclick={() => decommission(peer.id)}>
<i class="icon small">delete</i>
<button class="button flat delete" onclick={() => decommission(peer.id)} title="Decommission">
<i class="icon small i_delete"></i>
</button>
</td>
{/if}
+1 -1
View File
@@ -67,7 +67,7 @@ let pages = [
}, {
path: "/admin/paypal_taxes",
title: "Paypal Taxes",
icon: "paypal",
icon: "payments",
component: PayPalTaxes,
}, {
path: "/admin/invoices",
+2 -2
View File
@@ -26,7 +26,7 @@ let credit_form = {
default_value: 0,
},
],
submit_label: `<i class="icon">send</i> Submit`,
submit_label: `<i class="icon i_send"></i> Submit`,
on_submit: async fields => {
const form = new FormData()
form.append("id", fields.user_id)
@@ -71,7 +71,7 @@ let impersonate_form = {
default_value: "",
},
],
submit_label: `<i class="icon">send</i> Submit`,
submit_label: `<i class="icon i_send"></i> Submit`,
on_submit: async fields => {
const form = new FormData()
form.append("id", fields.user_id)
@@ -1,5 +1,4 @@
<script>
import { stopPropagation } from 'svelte/legacy';
import { onMount } from "svelte";
import { formatDate } from "util/Formatting";
import Expandable from "util/Expandable.svelte";
@@ -116,9 +115,9 @@ onMount(get_bans);
<div class="toolbar_spacer"></div>
<button class:button_highlight={expanded} onclick={() => {expanded = !expanded}}>
{#if expanded}
<i class="icon">unfold_less</i> Collapse all
<i class="icon i_unfold_less"></i> Collapse all
{:else}
<i class="icon">unfold_more</i> Expand all
<i class="icon i_unfold_more"></i> Expand all
{/if}
</button>
</div>
@@ -142,8 +141,8 @@ onMount(get_bans);
Date<br/>
{formatDate(row.offences[0].ban_time, false, false, false)}
</div>
<button onclick={stopPropagation(() => {delete_ban(row.user_id)})} class="button button_red" style="align-self: center;">
<i class="icon">delete</i>
<button onclick={e => {e.stopPropagation(); delete_ban(row.user_id)}} class="button button_red" style="align-self: center;" title="Delete ban">
<i class="icon i_delete"></i>
</button>
</div>
{/snippet}
@@ -152,7 +151,7 @@ onMount(get_bans);
<Button click={() => impersonate(row.user_id)} icon="login" label="Impersonate user"/>
<div class="toolbar_spacer"></div>
<div class="toolbar_label">
<i class="icon">block</i> Block all files
<i class="icon i_block"></i> Block all files
<select bind:value={row.select_abuse_type}>
<option>copyright</option>
<option>child_abuse</option>
+3 -3
View File
@@ -33,16 +33,16 @@ onMount(() => {
oncontextmenu={e => file_menu.open(node, e.target, e)}
>
{#if node.abuse_type !== undefined}
<i class="icon small">block</i>
<i class="icon small i_block"></i>
{:else if node.is_shared()}
<i class="icon small">share</i>
<i class="icon small i_share"></i>
{/if}
<div class="node_name" class:base={$nav.base_index === i} class:small={$nav.path.length > 10}>
{node.name}
</div>
</a>
{#if $nav.base_index !== i}
<i class="icon">chevron_right</i>
<i class="icon i_chevron_right"></i>
{/if}
{/each}
+7 -5
View File
@@ -6,6 +6,7 @@ import { fs_path_url, fs_share_hotlink_url, fs_share_url, fs_timeseries, type FS
import { color_by_name } from "util/Util";
import CopyButton from "layout/CopyButton.svelte";
import type { FSNavigator } from "./FSNavigator";
import { untrack } from "svelte";
let {
nav,
@@ -19,9 +20,12 @@ export const toggle = () => visible = !visible
$effect(() => {
// Only update the chart if the details modal is open. Else the chart is
// rendered for nothing
if (visible) {
update_chart($nav.base, chart_timespan, chart_interval)
// rendered for nothing. The chart is not there until it's downloaded,
// reading it here makes this run again when it's ready. The timespan is not
// a dependency, update_chart sets it and that would fetch the data twice
if (visible && chart) {
const base = $nav.base
untrack(() => update_chart(base, chart_timespan, chart_interval))
}
})
@@ -42,8 +46,6 @@ let total_downloads = $state(0)
let total_egress = $state(0)
let update_chart = async (base: FSNode, timespan: number, interval: number) => {
// The chart is not there until it's downloaded. The $effect above reads it
// through this function, so it calls this function again when it's ready
if (!visible || base.type !== "file" || !chart) {
return
}
+4
View File
@@ -16,6 +16,10 @@ export class FSNavigator {
// Initialized will be set to true when the first file or directory is loaded
initialized = false
shuffle = false
toggle_shuffle = () => {
this.shuffle = !this.shuffle
this.notify_subscribers()
}
// Whether navigation events should update the browser history
history_enabled = true
+3 -3
View File
@@ -115,11 +115,11 @@ const toggle_expand_keyboard = (e: KeyboardEvent) => {
</script>
<div class="container" onclick={toggle_expand} onkeypress={toggle_expand_keyboard} role="presentation">
<button class="button_expand hidden_vertical" onclick={toggle_expand}>
<button class="button_expand hidden_vertical" onclick={toggle_expand} title={expanded ? "Collapse" : "Expand"}>
{#if expanded}
<i class="icon">expand_more</i>
<i class="icon i_expand_more"></i>
{:else}
<i class="icon">expand_less</i>
<i class="icon i_expand_less"></i>
{/if}
</button>
+1 -1
View File
@@ -79,7 +79,7 @@ const keydown = (e: KeyboardEvent) => {
nav.download()
break;
case "r":
nav.shuffle = !nav.shuffle
nav.toggle_shuffle()
break;
case "a":
case "ArrowLeft":
+2 -2
View File
@@ -213,7 +213,7 @@ const window_keydown = (e: KeyboardEvent) => {
{/if}
<div class="center">
<form class="search_form" onsubmit={submit_search}>
<i class="icon">search</i>
<i class="icon i_search"></i>
<input
bind:this={search_bar}
class="term"
@@ -250,7 +250,7 @@ const window_keydown = (e: KeyboardEvent) => {
<div class="node">
<div class="node_name" style="text-align: center;">
<button onclick={() => {search(last_limit + 100)}}>
<i class="icon">expand_more</i>
<i class="icon i_expand_more"></i>
More results
</button>
</div>
+13 -13
View File
@@ -41,37 +41,37 @@ export const copy_link = () => {
<div class="grid" class:hide={!toolbar_expanded}>
<div class="button_row">
<button onclick={() => {nav.open_sibling(-1)}}>
<i class="icon">skip_previous</i>
<button onclick={() => {nav.open_sibling(-1)}} title="Previous file">
<i class="icon i_skip_previous"></i>
</button>
<button onclick={() => {nav.shuffle = !nav.shuffle}} class:button_highlight={nav.shuffle}>
<i class="icon">shuffle</i>
<button onclick={nav.toggle_shuffle} class:button_highlight={$nav.shuffle} title="Shuffle">
<i class="icon i_shuffle"></i>
</button>
<button onclick={() => {nav.open_sibling(1)}}>
<i class="icon">skip_next</i>
<button onclick={() => {nav.open_sibling(1)}} title="Next file">
<i class="icon i_skip_next"></i>
</button>
</div>
<button onclick={() => nav.download()}>
<i class="icon">save</i>
<i class="icon i_save"></i>
<span>Download</span>
</button>
{#if is_bookmark($bookmarks_store, $nav.base.id)}
<button onclick={() => bookmark_del($nav.base.id)}>
<i class="icon">bookmark_remove</i>
<i class="icon i_bookmark_remove"></i>
<span>Bookmark</span>
</button>
{:else}
<button onclick={() => bookmark_add($nav.base)}>
<i class="icon">bookmark_add</i>
<i class="icon i_bookmark_add"></i>
<span>Bookmark</span>
</button>
{/if}
{#if path_is_shared($nav.path)}
<button onclick={copy_link} class:button_highlight={link_copied}>
<i class="icon">content_copy</i>
<i class="icon i_content_copy"></i>
{#if link_copied}
<span>Link copied!</span>
{:else}
@@ -83,19 +83,19 @@ export const copy_link = () => {
<!-- Share button is enabled when: The browser has a sharing API, or the user can edit the file (to enable sharing)-->
{#if navigator.share !== undefined || $nav.permissions.write === true}
<button onclick={(e) => share_dialog.open(e, nav.path)}>
<i class="icon">share</i>
<i class="icon i_share"></i>
<span>Share</span>
</button>
{/if}
<button onclick={() => details_visible = !details_visible} class:button_highlight={details_visible}>
<i class="icon">help</i>
<i class="icon i_help"></i>
<span>Deta<u>i</u>ls</span>
</button>
{#if $nav.base.id !== "me" && $nav.permissions.write === true}
<button onclick={() => edit_window.edit(nav.base, true, "file")} class:button_highlight={edit_visible}>
<i class="icon">edit</i>
<i class="icon i_edit"></i>
<span><u>E</u>dit</span>
</button>
{/if}
@@ -22,7 +22,6 @@ const add_user = (e: SubmitEvent) => {
}
const del_user = (id: string) => {
delete options.user_permissions[id]
options.user_permissions = options.user_permissions
}
let new_password = $state("")
@@ -49,7 +48,6 @@ const generate_password = () => {
let revealed: {[password: string]: boolean} = $state({})
const del_password = (pass: string) => {
delete options.password_permissions[pass]
options.password_permissions = options.password_permissions
}
</script>
@@ -95,7 +93,7 @@ const del_password = (pass: string) => {
{#if options.user_permissions !== undefined}
{#each Object.keys(options.user_permissions) as id (id)}
<div class="row">
<Button click={() => del_user(id)} icon="delete"/>
<Button click={() => del_user(id)} icon="delete" title="Remove"/>
<div class="grow id">
{id}
</div>
@@ -135,9 +133,9 @@ const del_password = (pass: string) => {
{#if options.password_permissions !== undefined}
{#each Object.keys(options.password_permissions) as password (password)}
<div class="row">
<Button click={() => del_password(password)} icon="delete"/>
<Button click={() => del_password(password)} icon="delete" title="Remove"/>
<input type="text" bind:value={options.password_permissions[password].label} placeholder="Label" class="grow" maxlength="100" size="1">
<ToggleButton bind:on={revealed[password]} icon_on="visibility" icon_off="visibility_off"/>
<ToggleButton bind:on={revealed[password]} icon_on="visibility" icon_off="visibility_off" title="Reveal password"/>
<div class="grow id">
{revealed[password] ? password : "••••••••••••••••"}
</div>
@@ -151,7 +151,7 @@ let accent_info = $state(false)
</p>
<div>Header image ID</div>
<button onclick={() => pick_image("brand_header_image")}>
<i class="icon">folder_open</i>
<i class="icon i_folder_open"></i>
Pick
</button>
<input type="text" bind:value={options.brand_header_image}/>
@@ -159,7 +159,7 @@ let accent_info = $state(false)
<input class="span2" type="text" bind:value={options.brand_header_link}/>
<div>Background image ID</div>
<button onclick={() => pick_image("brand_background_image")}>
<i class="icon">folder_open</i>
<i class="icon i_folder_open"></i>
Pick
</button>
<input type="text" bind:value={options.brand_background_image}/>
@@ -182,9 +182,9 @@ let accent_info = $state(false)
<hr/>
<div class="example_button_row">
<button type="button"><i class="icon">touch_app</i>Normal</button>
<button type="button" class="button_highlight"><i class="icon">priority_high</i>Important</button>
<button type="button" class="button_red"><i class="icon">warning</i>Dangerous</button>
<button type="button"><i class="icon i_touch_app"></i>Normal</button>
<button type="button" class="button_highlight"><i class="icon i_priority_high"></i>Important</button>
<button type="button" class="button_red"><i class="icon i_warning"></i>Dangerous</button>
</div>
<div class="example_button_row">
@@ -35,7 +35,7 @@ export const edit = (f: FSNode, oae = false, open_tab = "") => {
tab = open_tab
}
console.log("Editing file", file)
console.log("Editing file", $state.snapshot(file))
// We save the name in a separate field because we need both the original
// name and the new name for the rename operation
@@ -111,15 +111,15 @@ const save = async (e: SubmitEvent) => {
<Modal bind:visible={visible} title="Edit {file.name}" width="800px" form="edit_form" style="color: var(--body_text_color); {custom_css}">
<div class="tab_bar">
<button class:button_highlight={tab === "file"} onclick={() => tab = "file"}>
<i class="icon">edit</i>
<i class="icon i_edit"></i>
Properties
</button>
<button class:button_highlight={tab === "share"} onclick={() => tab = "share"}>
<i class="icon">share</i>
<i class="icon i_share"></i>
Sharing
</button>
<button class:button_highlight={tab === "branding"} onclick={() => tab = "branding"}>
<i class="icon">palette</i>
<i class="icon i_palette"></i>
Branding
</button>
</div>
@@ -45,6 +45,16 @@ const toggle_example = () => {
let share_link = $derived(window.location.protocol+"//"+window.location.host+"/d/"+file.id)
const s3_endpoint = window.location.protocol+"//s3."+window.location.host
// S3 clients know the directory by its UUID, which is what the ID is when it's
// decoded from base58. Clients like Proxmox Backup Server only accept lowercase
// bucket names
const base58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
let s3_bucket = $derived(
[...file.id].reduce((n, c) => n * 58n + BigInt(base58.indexOf(c)), 0n)
.toString(16).padStart(32, "0")
.replace(/^(.{8})(.{4})(.{4})(.{4})/, "$1-$2-$3-$4-")
)
</script>
{#if $user.subscription.file_sharing === false}
@@ -79,15 +89,27 @@ const s3_endpoint = window.location.protocol+"//s3."+window.location.host
<legend>S3 access</legend>
<p>
This directory can be used as a bucket by backup tools and other
software which supports Amazon S3. The directory ID is the access key,
and the passwords above are the secret keys. Each password's permissions
decide what it can do.
software which supports Amazon S3. The name of the bucket is also the
access key, and the passwords above are the secret keys. Each password's
permissions decide what it can do.
</p>
<table>
<tbody>
<tr><td>Endpoint</td><td>{s3_endpoint}</td><td><CopyButton text={s3_endpoint}>Copy</CopyButton></td></tr>
<tr><td>Bucket and access key</td><td>{file.id}</td><td><CopyButton text={file.id}>Copy</CopyButton></td></tr>
<tr><td>Region</td><td>us-east-1 (any region works)</td><td></td></tr>
<tr>
<td>Endpoint</td>
<td>{s3_endpoint}</td>
<td><CopyButton text={s3_endpoint}>Copy</CopyButton></td>
</tr>
<tr>
<td>Bucket ID / Access key</td>
<td>{s3_bucket}</td>
<td><CopyButton text={s3_bucket}>Copy</CopyButton></td>
</tr>
<tr>
<td>Region</td>
<td>us-east-1 (any region works)</td>
<td></td>
</tr>
</tbody>
</table>
</fieldset>
@@ -110,7 +132,7 @@ const s3_endpoint = window.location.protocol+"//s3."+window.location.host
<br/>
<CopyButton text={embed_html} disabled={!is_shared}>Copy HTML</CopyButton>
<button onclick={toggle_example} class:button_highlight={example} disabled={!is_shared}>
<i class="icon">visibility</i> Show example
<i class="icon i_visibility"></i> Show example
</button>
</div>
<hr/>
@@ -36,15 +36,16 @@ let {
</div>
{#if child.is_shared()}
<i class="icon" title="This file / directory is shared. Click to open public link">share</i>
<i class="icon i_share" title="This file / directory is shared. Click to open public link"></i>
{/if}
{#if !hide_edit}
<button
class="action_button flat"
onclick={e => file_event(FileAction.Menu, index, e)}
title="Menu"
>
<i class="icon">menu</i>
<i class="icon i_menu"></i>
</button>
{/if}
</a>
@@ -183,13 +183,13 @@ onMount(() => {
{#snippet nav_buttons()}
<button onclick={navigate_back} use:drag_click title="Back">
<i class="icon">arrow_back</i>
<i class="icon i_arrow_back"></i>
</button>
<button onclick={() => nav.navigate_up()} use:drag_click disabled={$nav.path.length <= 1} title="Up">
<i class="icon">north</i>
<i class="icon i_north"></i>
</button>
<button onclick={() => nav.reload()} use:drag_click title="Refresh directory listing">
<i class="icon">refresh</i>
<i class="icon i_refresh"></i>
</button>
{/snippet}
@@ -198,7 +198,7 @@ onMount(() => {
<div class="toolbar">
<div class="toolbar_left">
<button onclick={() => open_search()} title="Press / to search">
<i class="icon">search</i>
<i class="icon i_search"></i>
</button>
{@render nav_buttons()}
{#if $nav.children.some(c => c.name === ".Trash" && c.type === "dir")}
@@ -206,31 +206,31 @@ onMount(() => {
onclick={() => nav.navigate($nav.children.find(c => c.name === ".Trash").path, true)}
title="Open trash bin"
>
<i class="icon">delete</i>
<i class="icon i_delete"></i>
</button>
{/if}
</div>
<div class="toolbar_middle">
<button onclick={() => toggle_view()} title="Switch between gallery, list and compact view">
<i class="icon" class:button_highlight={directory_view === "list"}>list</i>
<i class="icon" class:button_highlight={directory_view === "gallery"}>collections</i>
<i class="icon" class:button_highlight={directory_view === "compact"}>view_compact</i>
<i class="icon i_list" class:button_highlight={directory_view === "list"}></i>
<i class="icon i_collections" class:button_highlight={directory_view === "gallery"}></i>
<i class="icon i_view_compact" class:button_highlight={directory_view === "compact"}></i>
</button>
<button class="button_large_icons" onclick={() => toggle_large_icons()} title="Switch between large and small icons">
{#if large_icons}
<i class="icon">zoom_out</i>
<i class="icon i_zoom_out"></i>
{:else}
<i class="icon">zoom_in</i>
<i class="icon i_zoom_in"></i>
{/if}
</button>
<button onclick={() => {show_hidden = !show_hidden}} title="Toggle hidden files">
{#if show_hidden}
<i class="icon">visibility_off</i>
<i class="icon i_visibility_off"></i>
{:else}
<i class="icon">visibility</i>
<i class="icon i_visibility"></i>
{/if}
</button>
</div>
@@ -238,13 +238,13 @@ onMount(() => {
<div class="toolbar_right">
{#if $nav.permissions.write}
<button onclick={() => pick_files()} title="Upload files to this directory">
<i class="icon">cloud_upload</i>
<i class="icon i_cloud_upload"></i>
</button>
<Button click={() => {creating_dir = !creating_dir}} highlight={creating_dir} icon="create_new_folder" title="Make folder"/>
<button onclick={() => nav.set_selecting(true)} title="Select and delete files">
<i class="icon">select_all</i>
<i class="icon i_select_all"></i>
</button>
{/if}
</div>
@@ -253,7 +253,7 @@ onMount(() => {
{:else}
<div class="toolbar toolbar_edit">
<div>
<Button click={() => nav.set_selecting(false)} icon="close"/>
<Button click={() => nav.set_selecting(false)} icon="close" title="Clear selection"/>
{@render nav_buttons()}
</div>
<div class="toolbar_spacer">
@@ -272,7 +272,7 @@ onMount(() => {
{:else}
<Button click={() => {moving = true}} icon="drive_file_move" label="Move"/>
<button onclick={delete_selected} class="button_red">
<i class="icon">delete</i>
<i class="icon i_delete"></i>
Delete
</button>
{/if}
@@ -7,12 +7,14 @@ import Modal from "util/Modal.svelte";
import { FSNavigator, path_link } from "filesystem/FSNavigator";
import { fs_encode_path, type FSNode } from "lib/FilesystemAPI.svelte";
import { FileAction, type FileActionHandler } from "./FileManagerLib";
import CreateDirectory from "./CreateDirectory.svelte";
let nav = $state(new FSNavigator(false))
let modal: Modal = $state()
let directory_view = $state("")
let large_icons = $state(false)
let show_hidden = $state(false)
let creating_dir = $state(false)
let {
callback,
@@ -26,6 +28,7 @@ let {
} = $props();
export const open = (path: string) => {
creating_dir = false
modal.show()
nav.set_selecting(false)
nav.navigate(path, false)
@@ -95,14 +98,14 @@ onMount(() => {
<Modal bind:this={modal} width="900px">
{#snippet header()}
<div class="header" >
<button class="button round" onclick={modal.hide}>
<i class="icon">close</i>
<button class="button round" onclick={modal.hide} title="Close">
<i class="icon i_close"></i>
</button>
<button onclick={() => nav.navigate_up()} disabled={$nav.path.length <= 1} title="Up">
<i class="icon">north</i>
<i class="icon i_north"></i>
</button>
<button onclick={() => nav.reload()} title="Refresh directory listing">
<i class="icon">refresh</i>
<i class="icon i_refresh"></i>
</button>
<div class="title">
@@ -113,22 +116,27 @@ onMount(() => {
{/if}
</div>
{#if $nav.permissions.write}
<button onclick={() => creating_dir = !creating_dir} class:button_highlight={creating_dir} title="Make folder">
<i class="icon i_create_new_folder"></i>
</button>
{/if}
<button onclick={() => {show_hidden = !show_hidden}} title="Toggle hidden files">
{#if show_hidden}
<i class="icon">visibility_off</i>
<i class="icon i_visibility_off"></i>
{:else}
<i class="icon">visibility</i>
<i class="icon i_visibility"></i>
{/if}
</button>
<button onclick={() => toggle_view()} title="Switch between gallery, list and compact view">
<i class="icon" class:button_highlight={directory_view === "list"}>list</i>
<i class="icon" class:button_highlight={directory_view === "gallery"}>collections</i>
<i class="icon" class:button_highlight={directory_view === "compact"}>view_compact</i>
<i class="icon i_list" class:button_highlight={directory_view === "list"}></i>
<i class="icon i_collections" class:button_highlight={directory_view === "gallery"}></i>
<i class="icon i_view_compact" class:button_highlight={directory_view === "compact"}></i>
</button>
<button class="button button_highlight round" onclick={done}>
<i class="icon">done</i> Pick
<i class="icon i_done"></i> Pick
</button>
</div>
{/snippet}
@@ -140,20 +148,24 @@ onMount(() => {
use:path_link={{nav: nav, node: node}}
>
{#if node.abuse_type !== undefined}
<i class="icon small">block</i>
<i class="icon small i_block"></i>
{:else if node.is_shared()}
<i class="icon small">share</i>
<i class="icon small i_share"></i>
{/if}
<div class="node_name" class:base={$nav.base_index === i}>
{node.name}
</div>
</a>
{#if $nav.base_index !== i}
<i class="icon">chevron_right</i>
<i class="icon i_chevron_right"></i>
{/if}
{/each}
{#if creating_dir}
<CreateDirectory nav={nav}/>
{/if}
{#if directory_view === "list"}
<ListView
nav={nav}
@@ -100,7 +100,7 @@ onMount(load_settings)
</td>
{/each}
<td class="node_icons icons_wrap">
<Button flat icon="settings" click={e => dialog.open(e)} />
<Button flat icon="settings" click={e => dialog.open(e)} title="Columns"/>
</td>
</tr>
</thead>
@@ -162,24 +162,25 @@ onMount(load_settings)
<td class="node_icons">
<div class="icons_wrap">
{#if child.abuse_type !== undefined}
<i class="icon" title="This file / directory has received an abuse report. It cannot be shared">block</i>
<i class="icon i_block" title="This file / directory has received an abuse report. It cannot be shared"></i>
{:else if child.is_shared()}
<a
href="/d/{child.id}"
onclick={e => file_event(FileAction.Share, index, e)}
class="button action_button"
title="This file / directory is shared. Click to open public link"
>
<i class="icon" title="This file / directory is shared. Click to open public link">share</i>
<i class="icon i_share"></i>
</a>
{/if}
{#if child.properties !== undefined && child.properties.branding_enabled === "true" && !hide_branding}
<button class="action_button" onclick={e => file_event(FileAction.Branding, index, e)}>
<i class="icon">palette</i>
<button class="action_button" onclick={e => file_event(FileAction.Branding, index, e)} title="Edit branding">
<i class="icon i_palette"></i>
</button>
{/if}
{#if !hide_edit}
<button class="action_button" onclick={e => file_event(FileAction.Menu, index, e)}>
<i class="icon">menu</i>
<button class="action_button" onclick={e => file_event(FileAction.Menu, index, e)} title="Menu">
<i class="icon i_menu"></i>
</button>
{/if}
</div>
@@ -199,7 +200,7 @@ onMount(load_settings)
</div>
{/each}
<button type="submit">
<i class="icon">save</i>
<i class="icon i_save"></i>
Save
</button>
</form>
@@ -109,11 +109,11 @@ onMount(() => {
{#snippet toolbar()}
{#if $trash.selecting}
<div class="toolbar toolbar_edit">
<Button icon="close" click={() => trash.set_selecting(false)}/>
<Button icon="close" click={() => trash.set_selecting(false)} title="Stop selecting"/>
<div class="toolbar_spacer">Selecting files</div>
<Button click={restore} icon="restore_from_trash" label="Restore"/>
<button onclick={delete_selected} class="button_red">
<i class="icon">delete_forever</i>
<i class="icon i_delete_forever"></i>
Delete
</button>
</div>
@@ -121,23 +121,23 @@ onMount(() => {
<div class="toolbar">
<div>
<button onclick={() => history.back()} title="Back">
<i class="icon">arrow_back</i>
<i class="icon i_arrow_back"></i>
</button>
<button onclick={() => nav.navigate_up()} title="Up">
<i class="icon">north</i>
<i class="icon i_north"></i>
</button>
<button onclick={load} title="Refresh trash bin">
<i class="icon">refresh</i>
<i class="icon i_refresh"></i>
</button>
</div>
<div>Trash bin ({formatDataVolume(size, 3)})</div>
<div>
{#if $trash.children.length !== 0}
<button onclick={() => trash.set_selecting(true)} title="Select files to restore or delete">
<i class="icon">select_all</i>
<i class="icon i_select_all"></i>
</button>
<button onclick={empty_trash} class="button_red">
<i class="icon">delete_forever</i>
<i class="icon i_delete_forever"></i>
Delete all
</button>
{/if}
+8 -8
View File
@@ -128,17 +128,17 @@ onMount(() => {
<track kind="captions"/>
</audio>
<div style="text-align: center;">
<button onclick={() => change_track(-1)}><i class="icon">skip_previous</i></button>
<button onclick={() => seek(-10)}><i class="icon">replay_10</i></button>
<button onclick={toggle_playback}>
<button onclick={() => change_track(-1)} title="Previous track"><i class="icon i_skip_previous"></i></button>
<button onclick={() => seek(-10)} title="Back 10 seconds"><i class="icon i_replay_10"></i></button>
<button onclick={toggle_playback} title={playing ? "Pause" : "Play"}>
{#if playing}
<i class="icon">pause</i>
<i class="icon i_pause"></i>
{:else}
<i class="icon">play_arrow</i>
<i class="icon i_play_arrow"></i>
{/if}
</button>
<button onclick={() => seek(10)}><i class="icon">forward_10</i></button>
<button onclick={() => change_track(1)}><i class="icon">skip_next</i></button>
<button onclick={() => seek(10)} title="Forward 10 seconds"><i class="icon i_forward_10"></i></button>
<button onclick={() => change_track(1)} title="Next track"><i class="icon i_skip_next"></i></button>
</div>
<h2>Tracklist</h2>
@@ -146,7 +146,7 @@ onMount(() => {
{#if !sibling.is_hidden()}
<a href={"/d"+fs_encode_path(sibling.path)} class="node" class:button_highlight={sibling.path === $nav.base.path}>
{#if sibling.path === $nav.base.path}
<i class="play_arrow icon">play_arrow</i>
<i class="play_arrow icon i_play_arrow"></i>
{:else}
<img src={fs_node_icon(sibling, 64, 64)} class="node_icon" alt="icon"/>
{/if}
@@ -1,14 +1,11 @@
<script lang="ts">
import type { FSNode } from 'lib/FilesystemAPI.svelte';
import { run } from 'svelte/legacy';
let { path = [] }: {path: FSNode[]} = $props();
let image_uri: string = $state()
let image_link: string = $state()
const update_links = (path: FSNode[]) => {
image_uri = null
image_link = null
let { image_uri, image_link } = $derived.by(() => {
let image_uri: string = null
let image_link: string = null
for (let node of path) {
if (node.properties && node.properties.branding_enabled === "true") {
if (node.properties.brand_header_image) {
@@ -19,10 +16,8 @@ const update_links = (path: FSNode[]) => {
}
}
}
}
run(() => {
update_links(path)
});
return { image_uri, image_link }
})
</script>
{#if image_uri}
+2 -2
View File
@@ -37,11 +37,11 @@ let {
</table>
<hr/>
<button class="button_highlight" onclick={() => node.download()}>
<i class="icon">download</i>
<i class="icon i_download"></i>
<span>Download</span>
</button>
<button onclick={() => open_details()}>
<i class="icon">help</i>
<i class="icon i_help"></i>
<span>Details</span>
</button>
</IconBlock>
+1 -1
View File
@@ -96,7 +96,7 @@ let magnet = $state("")
</p>
{/if}
<button onclick={() => node.download()} class="button">
<i class="icon">download</i>
<i class="icon i_download"></i>
<span>Download torrent file</span>
</button>
</IconBlock>
+16 -16
View File
@@ -118,35 +118,35 @@ const video_keydown = (e: KeyboardEvent) => {
<div class="controls">
<div class="spacer"></div>
<button onclick={() => open_sibling(-1)}>
<i class="icon">skip_previous</i>
<button onclick={() => open_sibling(-1)} title="Previous file">
<i class="icon i_skip_previous"></i>
</button>
<button onclick={() => seek(-10)}>
<i class="icon">replay_10</i>
<button onclick={() => seek(-10)} title="Back 10 seconds">
<i class="icon i_replay_10"></i>
</button>
<button onclick={toggle_playback} class="button_highlight">
<button onclick={toggle_playback} class="button_highlight" title={playing ? "Pause" : "Play"}>
{#if playing}
<i class="icon">pause</i>
<i class="icon i_pause"></i>
{:else}
<i class="icon">play_arrow</i>
<i class="icon i_play_arrow"></i>
{/if}
</button>
<button onclick={() => seek(10)}>
<i class="icon">forward_10</i>
<button onclick={() => seek(10)} title="Forward 10 seconds">
<i class="icon i_forward_10"></i>
</button>
<button onclick={() => open_sibling(1)}>
<i class="icon">skip_next</i>
<button onclick={() => open_sibling(1)} title="Next file">
<i class="icon i_skip_next"></i>
</button>
<div style="width: 16px; height: 8px;"></div>
<button onclick={toggle_mute} class:button_red={player && player.muted}>
<button onclick={toggle_mute} class:button_red={player && player.muted} title="Mute">
{#if player && player.muted}
<i class="icon">volume_off</i>
<i class="icon i_volume_off"></i>
{:else}
<i class="icon">volume_up</i>
<i class="icon i_volume_up"></i>
{/if}
</button>
<button onclick={toggle_fullscreen}>
<i class="icon">fullscreen</i>
<button onclick={toggle_fullscreen} title="Fullscreen">
<i class="icon i_fullscreen"></i>
</button>
<div class="spacer"></div>
</div>
+11 -8
View File
@@ -48,19 +48,22 @@ export const update = async () => {
return
}
zip = await resp.json() as ZipEntry
const z = await resp.json() as ZipEntry
// Check if the zip has the property which allows separate files to be
// downloaded. If so then we set the download URL for each file
if (zip.properties !== undefined) {
if (zip.properties.includes("read_individual_files")) {
// downloaded. If so then we set the download URL for each file. This
// happens before the zip becomes state, else every file in the archive
// would get a state proxy instead of only the ones which are rendered
if (z.properties !== undefined) {
if (z.properties.includes("read_individual_files")) {
// Set the download URL for each file in the zip
recursive_set_url(fs_path_url(node.path)+"?zip_file=", zip)
recursive_set_url(fs_path_url(node.path)+"?zip_file=", z)
}
truncated = zip.properties.includes("truncated")
truncated = z.properties.includes("truncated")
}
uncomp_size = recursive_size(zip)
uncomp_size = recursive_size(z)
zip = z
comp_ratio = (uncomp_size / node.file_size)
status = "finished"
} catch (err) {
@@ -125,7 +128,7 @@ const recursive_size = (file: ZipEntry) => {
</table>
<hr/>
<button class="button_highlight" onclick={() => node.download()}>
<i class="icon">download</i>
<i class="icon i_download"></i>
<span>Download</span>
</button>
</IconBlock>
+7 -12
View File
@@ -13,6 +13,7 @@ let { item = {} as ZipEntry }: {
{#if child.children}
<details bind:open={child.details_open}>
<summary>
<i class="icon {child.details_open ? 'i_folder_open' : 'i_folder'}"></i>
<div class="filename">
{name}
(
@@ -37,6 +38,7 @@ let { item = {} as ZipEntry }: {
{#each Object.entries(item.children) as [name, child]}
{#if !child.children}
<li>
<i class="icon i_description"></i>
<div class="filename">
{name}
(
@@ -59,19 +61,13 @@ details {
}
details > summary {
list-style-type: none;
}
details > summary, li {
display: flex;
align-items: center;
}
details > summary::before {
font-family: 'Material Icons';
content: 'folder';
}
details[open] > summary::before {
font-family: 'Material Icons';
content: 'folder_open';
}
li::before {
font-family: 'Material Icons';
content: 'description';
.icon {
font-size: 1em;
}
ul {
list-style-type: none;
@@ -80,7 +76,6 @@ ul {
border-left: 2px solid var(--separator);
}
.filename {
display: inline;
margin-left: 0.5em;
}
</style>
-353
View File
@@ -1,353 +0,0 @@
<script>
import Tooltip from "layout/Tooltip.svelte";
import Euro from "util/Euro.svelte";
import OtherPlans from "layout/checkout/SubscriptionPlans.svelte";
import { user } from "lib/UserStore";
</script>
<section>
<p>
Nova features two different payment modes. We offer a monthly
subscription which is managed by Patreon, and a Prepaid subscription
which supports a dozen different payment providers. With Prepaid you pay
in advance to charge your credit, then usage will be subtracted from
your account credit. For low usage Prepaid is usually better as the
monthly fee is much lower.
</p>
</section>
<div class="horizontal_scroll">
<div class="grid">
<div></div>
<div class="top_row free_feat">
<span class="bold">Free</span>
</div>
<div class="top_row pro_feat">
<span class="bold">Pro</span>
</div>
<div class="top_row prepaid_feat">
<span class="bold">Prepaid</span>
</div>
<div class="left_col">
Recurring price
</div>
<div class="feature_cell free_feat">
<span class="bold">None</span>
</div>
<div class="feature_cell pro_feat">
<Tooltip>
{#snippet label()}
<span>
<span class="bold">€4 / month</span> or
<span class="bold">€40 / year</span>
</span>
{/snippet}
The Pro subscription is managed by Patreon. Patreon's own fees
and sales tax will be added to this price. After paying you need
to link your Nova account to Patreon to activate the plan.
</Tooltip>
</div>
<div class="feature_cell prepaid_feat">
<Tooltip>
{#snippet label()}
<span class="bold">€1 / month minimum</span>
{/snippet}
<p>
The minimum fee is only charged when usage is less than €1.
This calculation is per day, the €1 amount is divided by the
number of days in the month and if your usage is lower than
that, you will be charged the minimum fee.
</p>
</Tooltip>
</div>
<div class="left_col">
<a href="/about#toc_3">Transfer limit</a>
</div>
<div class="feature_cell free_feat">
<Tooltip>
{#snippet label()}
<span class="bold">6 GB per day</span>
{/snippet}
<p>
Free users are limited to downloading 6 GB per day, this
limit is linked to your IP address, even if you are logged
in to an account.
</p>
<p>
When the download limit is exceeded the download speed is
reduced to 1 MiB/s. You can have at most three concurrent
downloads running.
</p>
</Tooltip>
</div>
<div class="feature_cell pro_feat">
<Tooltip>
{#snippet label()}
<span class="bold">4 TB per 30 days</span>
{/snippet}
<p>
The transfer limit is used for downloading, sharing and
hotlinking files.
</p>
<p>
Paid plans do not have a concurrent connection limit.
</p>
</Tooltip>
</div>
<div class="feature_cell prepaid_feat">
<Tooltip>
{#snippet label()}
<span class="bold">€1 per TB transferred</span>
{/snippet}
<p>
Prepaid does not have a transfer limit, instead you are
charged for what you use at a rate of €1 per terabyte
downloaded. This applies to downloading your own files,
other people's files and others downloading your files (if
you have hotlinking enabled in your account settings).
</p>
<p>
Paid plans do not have a concurrent connection limit.
</p>
</Tooltip>
</div>
<div class="left_col">
<a href="/about#toc_6">Hotlinking</a>
</div>
<div class="feature_cell free_feat">
<span class="bold">Hotlinking not supported</span><br/>
Hotlinked files get blocked
</div>
<div class="feature_cell span2 right pro_feat">
<span class="bold">Hotlinking supported</span><br/>
Hotlinking uses your transfer limit
</div>
<div class="left_col">
Storage
</div>
<div class="feature_cell span2 left pro_feat">
<span class="bold">No limit</span><br/>
Files expire when they are not downloaded
</div>
<div class="feature_cell prepaid_feat">
<span class="bold">€4 / TB / month</span><br/>
No limit, you pay for what you use
</div>
<div class="left_col">
<a href="/about#toc_1">File expiry</a>
</div>
<div class="feature_cell free_feat">
<Tooltip>
{#snippet label()}
<span class="bold">120 days (4 months)</span>
{/snippet}
<p>
Files expire when they have not been downloaded in the last
120 days. A download is counted when more than 10% of the
whole file was downloaded in a single request.
</p>
</Tooltip>
</div>
<div class="feature_cell pro_feat">
<Tooltip>
{#snippet label()}
<span class="bold">240 days (8 months)</span>
{/snippet}
<p>
The Pro plan has 240 day file expiry. The same rules apply
as the free plan. Higher Patreon subscription plans are
available where files do not expire at all.
</p>
</Tooltip>
</div>
<div class="feature_cell prepaid_feat">
<Tooltip>
{#snippet label()}
<span class="bold">Files do not expire</span>
{/snippet}
<p>
Files don't expire while your Prepaid plan is active. If
your credit runs out you have one week to top up your
balance. If you fail to do so your files will revert to the
regular file expiry rules.
</p>
</Tooltip>
</div>
<div class="left_col">
Download page customization
</div>
<div class="feature_cell free_feat">
<span class="bold">None</span>
</div>
<div class="feature_cell pro_feat">
None
</div>
<div class="feature_cell prepaid_feat">
Theme, background, header and footer image can be customized
</div>
<div class="left_col">
Max file size
</div>
<div class="feature_cell free_feat">
<span class="bold">20 GB</span> per file
</div>
<div class="feature_cell span2 right pro_feat">
<span class="bold">100 GB</span> per file
</div>
<div class="left_col">
Payment processors
</div>
<div class="feature_cell free_feat">
<span class="bold">None</span>
</div>
<div class="feature_cell pro_feat">
<span class="bold">PayPal</span>, <span class="bold">Credit/debit</span>
</div>
<div class="feature_cell prepaid_feat">
<span class="bold">PayPal</span>,
<span class="bold">Bitcoin</span>,
<span class="bold">Litecoin</span>,
<span class="bold">Monero</span>
</div>
<div></div>
<div class="bottom_row free_feat">
Free
</div>
<div class="bottom_row pro_feat">
{#if $user !== null && $user.subscription.id === "patreon_1"}
You have this plan<br/>
Thank you for supporting Nova!
{:else}
<a href="https://www.patreon.com/join/nova/checkout?rid=5736701&cadence=1" class="button button_highlight round">
€ 4 per month
</a>
or
<a href="https://www.patreon.com/join/nova/checkout?rid=5736701&cadence=12" class="button button_highlight round">
€ 40 per year!
</a>
<br/>
(Excluding tax)
<br/>
Subscription managed by Patreon
{/if}
</div>
<div class="bottom_row prepaid_feat">
{#if $user === null}
<!-- User is not logged in -->
Account required<br/>
<a href="/login?redirect=/user/subscription/manage" class="button button_highlight round">
<i class="icon">login</i>
Log in
</a>
or
<a href="/register?redirect=/user/subscription/manage" class="button button_highlight round">
<i class="icon">how_to_reg</i>
Register
</a>
<br/>
Payments processed by Mollie<br/>
No recurring payments
{:else}
<!-- User is logged in -->
{#if $user.subscription.type === ""}
<a href="/user/subscription/manage#deposit" class="button button_highlight round">
Deposit credit
</a>
to activate Prepaid
{:else if $user.subscription.type === "patreon"}
Patreon subscription active. Prepaid cannot be activated
{:else if $user.subscription.type === "prepaid"}
Prepaid subscription is active<br/>
Current balance <Euro amount={$user.balance_micro_eur}/>
<br/>
<a href="/user/subscription/manage#deposit" class="button button_highlight round">
Top up my credit
</a>
{/if}
{/if}
</div>
</div>
</div>
<section>
<h2>Other plans available on Patreon</h2>
<OtherPlans/>
</section>
<style>
.bold {
font-weight: bold;
}
.horizontal_scroll {
overflow-x: scroll;
overflow-y: hidden;
width: 100%;
padding: 10px;
}
.grid {
display: grid;
grid-auto-flow: row;
grid-template-columns: 9em 1fr 1fr 1fr;
min-width: 50em;
max-width: 70em;
gap: 5px;
margin: auto;
}
.grid > div {
justify-content: center;
align-items: center;
align-content: center;
text-align: center;
padding: 0.25em;
min-height: 3em;
}
.left_col {
border-top-left-radius: 6px;
border-bottom-left-radius: 6px;
border: 1px solid var(--separator);
}
.top_row {
border-top-left-radius: 6px;
border-top-right-radius: 6px;
}
.bottom_row {
border-bottom-left-radius: 6px;
border-bottom-right-radius: 6px;
border: 1px solid var(--separator);
font-weight: bold;
}
.feature_cell {
background-color: var(--card_color);
border: 1px solid var(--background_color);
}
.pro_feat {
border: 1px solid var(--accent_color);
}
.free_feat {
border: 1px solid #ebcb8b;
}
.prepaid_feat {
border: 1px solid #ec2cfa;
}
.span2 {
grid-column: span 2;
}
.span2.left {
border-image: linear-gradient(to right, #ebcb8b 0%, var(--accent_color) 100%) 1;
}
.span2.right {
border-image: linear-gradient(to right, var(--accent_color) 0%, #ec2cfa 100%) 1;
}
</style>
-30
View File
@@ -1,30 +0,0 @@
<script lang="ts">
import Checkout from "layout/checkout/Checkout.svelte";
import { user } from "lib/UserStore";
import LoginRegister from "login/LoginRegister.svelte";
import Euro from "util/Euro.svelte";
</script>
{#if $user !== null}
<div class="page_content">
<section>
{#if $user.subscription.id !== ""}
<p>
You already have the {$user.subscription.name} plan active.
Your account balance is <Euro
amount={$user.balance_micro_eur}/>. Subscriptions are
charged from this balance every day, use the form below to
top it up or to switch to another plan.
</p>
{:else}
<p>
Pick a subscription plan to upgrade your account. Your
account balance is <Euro amount={$user.balance_micro_eur}/>.
</p>
{/if}
<Checkout/>
</section>
</div>
{:else}
<LoginRegister/>
{/if}
+145 -47
View File
@@ -1,55 +1,86 @@
<script>
import Footer from "layout/Footer.svelte";
import GetStarted from "./GetStarted.svelte";
import Pricing from "./Pricing.svelte";
<script lang="ts">
import SubscriptionPlans from "layout/checkout/SubscriptionPlans.svelte";
import NovaLogo from "util/NovaLogo.svelte";
import { user } from "lib/UserStore";
import LoginRegister from "login/LoginRegister.svelte";
import Showcase from "./Showcase.svelte";
import Euro from "util/Euro.svelte";
</script>
<header class="logo_header">
<NovaLogo full style="display: block; height: 100px; max-width: 100%; margin: 50px auto;"/>
<header class="hero">
<NovaLogo full style="display: block; height: 100px; max-width: 100%; margin: 50px auto 0 auto;"/>
</header>
<div class="page_content">
<section>
<div class="highlight_yellow">
This is a development server. All files and accounts may be lost when
the final product launches.
</div>
</section>
<section>
<section>
<p style="text-align: center;">
Nova.storage is a platform for cost-effective cloud storage and content
delivery. We store and serve your files at an extremely competitive
rate.
</p>
</section>
<div class="highlights">
<div class="bubble">
<h3><i class="icon i_public"></i> Fully European</h3>
<p>
Nova.storage is a platform for cost-effective cloud storage and
content delivery. We will store and serve your files at an extremely
competitive rate.
Nova is developed and operated entirely within Europe. With its
headquarters in the Netherlands and hosting in Germany.
</p>
<h2>Features</h2>
<ul>
<li>
Cloud storage with <a href="/filesystem#toc_7">rclone</a> and
FTPS support
</li>
<li>
Customizable download pages (custom branding colours, header and
background images)
</li>
<li>
Fault tolerance for up to four storage server failures
</li>
<li>
Caching servers highly optimized for long-distance data transfer
</li>
</ul>
<h3>What you don't get</h3>
<ul>
<li>
Data backups - Please keep a local copy of everything you store
in case of emergency
</li>
<li>
Commercial support - I'm busy, please don't bother me
</li>
</ul>
</section>
</div>
<div class="bubble">
<h3><i class="icon i_storage"></i> Proven storage engine</h3>
<p>
Pixelstore, the storage engine behind Nova, has been running in
production for more than ten years. It is fine-tuned for
reliability and performance.
</p>
</div>
<div class="bubble">
<h3><i class="icon i_verified_user"></i> Fault-tolerant</h3>
<p>
The storage, database and caching layers all have redundancy built
in. Your files stay available through up to four storage server
failures.
</p>
</div>
<div class="bubble">
<h3>
<i class="icon i_speed"></i>
Highly optimised
</h3>
<p>
Our servers are tuned for high performance transfers over long
distances, so downloads stay fast no matter where you are in the
world.
</p>
</div>
<div class="bubble">
<h3><i class="icon i_hub"></i> Easy integration</h3>
<p>
Connect with the
<a href="https://docs.nova.storage/api/filesystem/">filesystem API</a>,
<a href="https://docs.nova.storage/filesystem/#s3">S3</a>,
<a href="https://docs.nova.storage/filesystem/#ftps">FTPS</a> or
<a href="https://docs.nova.storage/filesystem/#rclone">rclone</a>.
Backup tools, NAS devices and file managers work out of the box.
</p>
</div>
<div class="bubble">
<h3>
<i class="icon i_edit"></i>
Customizable</h3>
<p>
You can make Nova look however you want. Apply your brand colours,
add a custom wallpaper, link back to your own site, you name it.
</p>
</div>
</div>
<header>
@@ -57,19 +88,86 @@ import NovaLogo from "util/NovaLogo.svelte";
</header>
<SubscriptionPlans/>
<section>
<p>
Every plan includes a fixed amount of storage and egress. If you need
more, you can turn on
<a href="/user/subscription/metered_billing">usage based billing</a>.
Usage above your plan is then charged from your account balance at these
rates:
</p>
<div class="rates">
<div class="bubble">
<div class="rate"><Euro amount={4e6}/> / TB / month</div>
Storage above your plan
</div>
<div class="bubble">
<div class="rate"><Euro amount={1e6}/> / TB</div>
Egress above your plan
</div>
</div>
</section>
<header>
<h1>Feature showcase</h1>
</header>
<Showcase/>
{#if $user === null}
<header>
<h1>Get started</h1>
</header>
<LoginRegister/>
{/if}
<style>
header {
padding-top: 20px;
padding-bottom: 20px;
.hero {
padding: 0 8px 20px 8px;
}
.logo_header {
text-align: initial;
padding-top: 0;
padding-bottom: 0;
.highlights {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(min(18em, 100%), 1fr));
gap: 8px;
width: 100%;
max-width: 1000px;
margin: 12px auto;
padding: 0 4px;
}
.highlights > div {
margin: 0;
padding: 0 1em;
}
.highlights h3 {
display: flex;
align-items: center;
gap: 0.4em;
font-size: 1.3em;
border-bottom: none;
}
.highlights .icon {
color: var(--accent_color);
background: var(--accent_shade);
border-radius: 8px;
padding: 0.2em;
}
.rates {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 8px;
}
.rates > div {
flex: 0 1 16em;
margin: 0;
padding: 0.5em;
text-align: center;
}
.rate {
font-size: 1.5em;
line-height: 1.5;
}
header > h1 {
margin-top: 30px;
margin-bottom: 30px;
}
</style>
-182
View File
@@ -1,182 +0,0 @@
<script>
import Euro from "util/Euro.svelte";
import ProgressBar from "util/ProgressBar.svelte";
let nova_storage = $state(0)
let nova_egress = $state(0)
let nova_total = $state(0)
let backblaze_storage = $state(0)
let backblaze_egress = $state(0)
let backblaze_api = $state(0)
let backblaze_total = $state(0)
let wasabi_storage = $state(0)
let wasabi_total = $state(0)
let price_max = $state(0)
let storage = $state(10) // TB
let egress = $state(10) // TB
let avg_file_size = $state(1000) // kB
$effect(() => {
// Nova has a minimum file size of 10kB. Calculate the number of files from
// storage and avg file size, then calculate storage usage based on that.
nova_storage = Math.max(storage * 4, ((storage*10)/avg_file_size)*4)
nova_egress = egress * 1
nova_total = nova_storage + nova_egress
// Egress at Backblaze is free up to three times the amount of storage, then
// it's $10/TB
backblaze_storage = storage * 6
backblaze_egress = Math.max(egress - (storage * 3), 0) * 10
backblaze_api = ((egress * 1e12) / (avg_file_size * 1e3)) * 0.0000004
backblaze_total = backblaze_storage + backblaze_egress + backblaze_api
// Wasabi does not have egress fees
wasabi_storage = storage * 6.99
wasabi_total = (egress > storage) ? 0 : wasabi_storage
price_max = Math.max(nova_total, backblaze_total, wasabi_total)
});
</script>
<h2>Price calculator</h2>
<div class="inputs">
<div>
<div class="usage_label">Storage</div>
<div class="usage_input">
<input type="number" bind:value={storage}/>
<div>TB / month</div>
</div>
</div>
<div>
<div class="usage_label">Egress</div>
<div class="usage_input">
<input type="number" bind:value={egress}/>
<div>TB / month</div>
</div>
</div>
<div>
<div class="usage_label">Average file size</div>
<div class="usage_input">
<input type="number" bind:value={avg_file_size}/>
<div>kB</div>
</div>
</div>
</div>
<div class="bars">
<div>
<div>
Nova.storage - <Euro amount={nova_total*1e6}/> / month<br/>
<Euro amount={nova_storage*1e6}/> storage,
<Euro amount={nova_egress*1e6}/> egress
<ProgressBar used={nova_total} total={price_max}/>
</div>
{#if avg_file_size < 10}
<div>
Nova counts a minimum file size of 10 kB. Files smaller than that
are rounded up to 10 kB.
</div>
{/if}
</div>
<div>
<div>
Backblaze B2 - <Euro symbol="$" amount={backblaze_total*1e6}/> / month<br/>
<Euro symbol="$" amount={backblaze_storage*1e6}/> storage,
<Euro symbol="$" amount={backblaze_egress*1e6}/> egress,
<Euro symbol="$" amount={backblaze_api*1e6}/> API calls
<ProgressBar used={backblaze_total} total={price_max}/>
</div>
</div>
<div>
<div>
Wasabi - <Euro symbol="$" amount={wasabi_total*1e6}/> / month<br/>
<Euro symbol="$" amount={wasabi_storage*1e6}/> storage
<ProgressBar used={wasabi_total} total={price_max}/>
</div>
{#if egress > storage}
<div>
Wasabi does not allow users to download more than their amount
of stored data per month. For this reason Wasabi is excluded
from price calculations when egress is higher than storage.
</div>
{/if}
</div>
</div>
<p>
Note that while Nova.storage might not seem to be the cheapest option in some
cases, most cloud providers have extra hidden costs for API calls and
region-specific prices. This makes it very hard to accurately compare the
pricing of these platforms. Nova.storage includes no hidden costs, I only
charge for storage and egress.
</p>
<p>
Large cloud providers like Amazon, Microsoft and Google are excluded from
this calculation because their pricing is too complex accurately compare
them. Just assume that Nova wil be cheaper.
</p>
<style>
.inputs {
display: flex;
flex-direction: row;
justify-content: center;
gap: 10px;
margin-bottom: 10px;
}
@media(max-width: 700px) {
.inputs {
flex-direction: column;
}
}
.inputs > div {
flex: 1 1 100%;
display: flex;
flex-direction: column;
border-radius: 6px;
overflow: hidden;
border: 2px solid var(--card_color);
}
.usage_label {
flex: 1 1 auto;
text-align: center;
font-size: 1.3em;
padding: 4px;
}
.usage_input {
flex: 1 1 auto;
background: var(--card_color);
display: flex;
flex-direction: row;
align-items: center;
}
.usage_input > input {
flex: 1 1 auto;
background: var(--card_color);
}
.usage_input > div {
flex: 0 0 auto;
background: var(--card_color);
}
.bars {
display: flex;
flex-direction: column;
justify-content: center;
gap: 10px;
}
.bars > div {
flex: 1 1 auto;
display: flex;
flex-direction: column;
border-radius: 6px;
overflow: hidden;
border: 2px solid var(--card_color);
}
.bars > div > div {
padding: 4px;
}
.bars > div > div:first-child {
background: var(--card_color);
}
</style>
+119
View File
@@ -0,0 +1,119 @@
<script lang="ts">
const slides = [
{
image: "download_page",
title: "Download pages",
text: `Share files and directories with a link. Visitors get a fast
download page in your own colours, with your header and background.`,
}, {
image: "access_control",
title: "Access control",
text: `Decide who can read, write and delete, per link, per user and per
password. Passwords double as S3 credentials.`,
}, {
image: "branding",
title: "Branding",
text: `Start from one of the theme presets or pick your own colours,
header image and background image.`,
}, {
image: "image_viewer",
title: "File previews",
text: `Images, videos, audio, PDFs and text files open right in the
browser, and archives can be browsed before downloading.`,
}, {
image: "statistics",
title: "Statistics",
text: `Follow the downloads and data transfer of every file, from the
last day up to five years back.`,
}, {
image: "remote_sync",
title: "Remote sync",
text: `Import from or export to S3, Backblaze B2, Azure, SFTP, FTP,
WebDAV or pixeldrain. Syncs run on our servers, so you can close the
page while they run.`,
},
]
let slider: HTMLDivElement
let current = $state(0)
const show = (i: number) => slider.scrollTo({
left: ((i + slides.length) % slides.length) * slider.clientWidth,
behavior: "smooth",
})
</script>
<div class="page_content showcase">
<div
class="slider"
bind:this={slider}
onscroll={() => current = Math.round(slider.scrollLeft / slider.clientWidth)}
>
{#each slides as slide (slide.image)}
<figure>
<img
src="/res/img/home/{slide.image}.webp"
alt={slide.title}
width="2000"
height="1250"
loading="lazy"
/>
<figcaption>{slide.text}</figcaption>
</figure>
{/each}
</div>
<div class="slider_nav">
<button onclick={() => show(current-1)} title="Previous">
<i class="icon i_chevron_left"></i>
</button>
{#each slides as slide, i (slide.image)}
<button class:button_highlight={i === current} onclick={() => show(i)}>
{slide.title}
</button>
{/each}
<button onclick={() => show(current+1)} title="Next">
<i class="icon i_chevron_right"></i>
</button>
</div>
</div>
<style>
/* Lines up with the cards on the home page, which have 4px of padding on each
side */
.showcase {
width: calc(100% - 8px);
max-width: 992px;
margin: 0 auto 12px auto;
padding: 8px;
}
.slider {
display: flex;
overflow-x: auto;
scroll-snap-type: x mandatory;
overscroll-behavior-x: contain;
scrollbar-width: none;
}
.slider::-webkit-scrollbar {
display: none;
}
.slider > figure {
flex: 0 0 100%;
margin: 0;
scroll-snap-align: center;
}
.slider img {
display: block;
width: 100%;
height: auto;
border-radius: 6px;
border: 1px solid var(--separator);
}
.slider figcaption {
padding: 0.5em;
text-align: center;
}
.slider_nav {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
</style>
+1 -1
View File
@@ -1,4 +1,4 @@
<i class="icon star" title="These options require a Persistence (€8) subscription or Prepaid plan to use">star</i>
<i class="icon star i_star" title="These options require a Persistence (€8) subscription or Prepaid plan to use"></i>
<style>
.star {
+1 -1
View File
@@ -1,4 +1,4 @@
<i class="icon star" title="These options require a Pro (€4) subscription or Prepaid plan to use">star</i>
<i class="icon star i_star" title="These options require a Pro (€4) subscription or Prepaid plan to use"></i>
<style>
.star {
+2 -2
View File
@@ -65,7 +65,7 @@ let click_int = (e: MouseEvent) => {
disabled={disabled ? true:null}
>
{#if icon !== ""}
<i class="icon" class:small={icon_small}>{icon}</i>
<i class="icon i_{icon}" class:small={icon_small}></i>
{/if}
{#if label !== ""}
<span>{label}</span>
@@ -85,7 +85,7 @@ let click_int = (e: MouseEvent) => {
style={style}
>
{#if icon !== ""}
<i class="icon" class:small={icon_small}>{icon}</i>
<i class="icon i_{icon}" class:small={icon_small}></i>
{/if}
{#if label !== ""}
<span>{label}</span>
+1 -1
View File
@@ -54,7 +54,7 @@ export const copy = (e: MouseEvent) => {
title="Copy text to clipboard"
disabled={disabled}
>
<i class="icon">content_copy</i>
<i class="icon i_content_copy"></i>
<span>
{#if success}
Copied!
+2 -1
View File
@@ -10,8 +10,9 @@ let {
class:button_highlight={toggle}
style="margin: 0;"
onclick={() => toggle = !toggle}
title="Help"
>
<i class="icon">help</i>
<i class="icon i_help"></i>
</button>
<style>
+6 -10
View File
@@ -23,30 +23,27 @@ import { formatDataVolume, formatDataVolumeBits, formatThousands } from "util/Fo
let {
index_field = "",
rows = $bindable([]),
rows = [],
columns = [],
sort_field = $bindable(index_field),
sort_field = index_field,
totals = false
}: {
index_field?: string;
rows?: any;
rows?: any[];
columns?: SortColumn[];
sort_field?: any;
sort_field?: string;
totals?: boolean;
} = $props();
let asc = $state(true)
const sort = (field: string) => {
if (field !== "" && field === sort_field) {
if (field === sort_field) {
asc = !asc
}
if (field === "") {
field = sort_field
}
sort_field = field
console.log("sorting by", field, "asc", asc)
rows.sort((a, b) => {
rows = [...rows].sort((a, b) => {
if (typeof (a[field]) === "number") {
// Sort ints from high to low
if (asc) {
@@ -63,7 +60,6 @@ const sort = (field: string) => {
}
}
})
rows = rows
}
</script>
+5 -2
View File
@@ -9,6 +9,7 @@ let {
highlight = false,
flat = false,
action,
title,
children,
}: {
on?: boolean;
@@ -20,6 +21,7 @@ let {
highlight?: boolean;
flat?: boolean;
action?: (e: MouseEvent) => void;
title?: string;
children?: import('svelte').Snippet;
} = $props();
@@ -34,6 +36,7 @@ const click = (e: MouseEvent) => {
<button
onclick={click}
type="button"
title={title}
class="button"
class:button_highlight={highlight}
class:group_first
@@ -42,9 +45,9 @@ const click = (e: MouseEvent) => {
class:flat
>
{#if on}
<i class="icon on">{icon_on}</i>
<i class="icon on i_{icon_on}"></i>
{:else}
<i class="icon off">{icon_off}</i>
<i class="icon off i_{icon_off}"></i>
{/if}
{@render children?.()}
</button>
+1 -1
View File
@@ -13,7 +13,7 @@ const open = () => dialog.open(button.getBoundingClientRect())
</script>
<button bind:this={button} onclick={open} class="button round">
<i class="icon">info</i>{@render label?.()}
<i class="icon i_info"></i>{@render label?.()}
</button>
<Dialog bind:this={dialog}>
+4 -4
View File
@@ -171,7 +171,7 @@ const submit = async (e: SubmitEvent) => {
{#if covered}
<button type="submit" class="button_highlight" style="flex-direction: column;">
<i class="icon">shopping_cart</i>
<i class="icon i_shopping_cart"></i>
Activate plan {status.subscription.name}
({status.months} month{status.months === 1 ? "" : "s"})
</button>
@@ -203,7 +203,7 @@ const submit = async (e: SubmitEvent) => {
</div>
<button type="submit" class="button_highlight">
<i class="icon">paid</i> Checkout
<i class="icon i_paid"></i> Checkout
</button>
</div>
@@ -259,10 +259,10 @@ const submit = async (e: SubmitEvent) => {
</td>
<td>
{#if p.months === status.months}
<i class="icon">check</i> Selected
<i class="icon i_check"></i> Selected
{:else}
<button onclick={() => switch_period(p)}>
<i class="icon">swap_horiz</i> Select
<i class="icon i_swap_horiz"></i> Select
</button>
{/if}
</td>
@@ -1,5 +1,4 @@
<script lang="ts">
import { preventDefault } from 'svelte/legacy';
import { countries } from "country-data-list";
import { get_misc_vat_rate, put_user } from "lib/NovaAPI";
import { payment_providers, type CheckoutState } from "./CheckoutLib";
@@ -59,7 +58,7 @@ const format_country = (c: typeof countries.all[0]) => {
Please pick your country of residence
</div>
<div>
<form onsubmit={preventDefault(set_country)} class="country_form">
<form onsubmit={set_country} class="country_form">
<div class="country_search">
<datalist id="country_picker">
{#each countries.all.filter(c => c.status === "assigned") as c}
@@ -73,7 +72,7 @@ const format_country = (c: typeof countries.all[0]) => {
placeholder="Search for country"
style="flex: 1 1 auto;">
<button type="submit" class="button_highlight" style="flex: 0 0 auto;">
<i class="icon">send</i>
<i class="icon i_send"></i>
Continue
</button>
</div>
+1 -1
View File
@@ -30,7 +30,7 @@ const submit = async (e: SubmitEvent) => {
<button type="submit" class="button_highlight" style="align-self: end;">
Continue
<i class="icon">chevron_right</i>
<i class="icon i_chevron_right"></i>
</button>
</form>
<hr/>
+2 -2
View File
@@ -67,11 +67,11 @@ const cancel = async () => {
<SuccessMessage bind:this={cancel_message}/>
<div class="options">
<button onclick={extend}>
<i class="icon">more_time</i>
<i class="icon i_more_time"></i>
Extend current plan (credit deposit)
</button>
<button onclick={cancel}>
<i class="icon">cancel</i>
<i class="icon i_cancel"></i>
Cancel current plan and return to Free
</button>
</div>
+1 -1
View File
@@ -45,7 +45,7 @@ export type Peer = {
ip: string
port: number
hostname: string
role: string
services: string[] | null
reachable: boolean
unreachable_count: number
latency: number
+14
View File
@@ -208,6 +208,20 @@ export const subscription_periods: SubscriptionPeriod[] = [
// same value the server divides the monthly fee by
export const days_per_month = 365.25 / 12
// The price of the subscription period the user is in. This is also how far
// the balance can go below zero before usage above the plan is refused
export const period_price = (u: User) => {
const period = subscription_periods.find(p => p.months === u.subscription_months)
return period === undefined ? 0 :
u.subscription.monthly_fee * period.months * period.discount
}
// Whether usage above a limit of the plan is billed instead of refused. price
// is what the plan charges for that usage. The server does the same check in
// billsExtra
export const bills_extra = (u: User, price: number) =>
u.usage_based_billing && price > 0 && u.balance_micro_eur >= -period_price(u)
export const get_misc_subscriptions = async () => {
return await check_response(
await fetch(get_endpoint() + "/misc/subscriptions")
+4 -4
View File
@@ -103,7 +103,7 @@ onMount(async () => {
<li>
{dir.path}
<button onclick={() => dirs.splice(index, 1)} title="Remove">
<i class="icon">close</i>
<i class="icon i_close"></i>
</button>
</li>
{/each}
@@ -111,7 +111,7 @@ onMount(async () => {
{/if}
<p>
<button onclick={() => picker.open("/me")}>
<i class="icon">folder</i>
<i class="icon i_folder"></i>
{dirs.length === 0 ? "Pick directories" : "Add a directory"}
</button>
</p>
@@ -122,12 +122,12 @@ onMount(async () => {
app on the <a href="/user/api_keys">API keys page</a>.
</p>
<button class="button_highlight" onclick={approve}>
<i class="icon">check</i> Approve
<i class="icon i_check"></i> Approve
</button>
<!-- For a request which was not approved the address has an error
in it, which tells the app that the user said no -->
<a class="button" href={request.redirect_uri} rel="external">
<i class="icon">close</i> Deny
<i class="icon i_close"></i> Deny
</a>
{/if}
</section>
+7 -5
View File
@@ -1,9 +1,11 @@
<script lang="ts">
import { createEventDispatcher, onMount } from "svelte";
import { onMount } from "svelte";
import Form, { type FormConfig } from "util/Form.svelte"
import { check_response, get_endpoint } from "lib/NovaAPI";
let dispatch = createEventDispatcher()
let { on_login }: {
on_login?: (login: {key: string}) => void;
} = $props();
const form_login: FormConfig = {
fields: [
@@ -21,7 +23,7 @@ const form_login: FormConfig = {
login.`
},
],
submit_label: `<i class="icon">send</i> Login`,
submit_label: `<i class="icon i_send"></i> Login`,
on_submit: async (fields) => {
username = fields.username
password = fields.password
@@ -37,7 +39,7 @@ const form_otp: FormConfig = {
description: `Please enter the one-time password from your authenticator app`
},
],
submit_label: `<i class="icon">send</i> Login`,
submit_label: `<i class="icon i_send"></i> Login`,
on_submit: async (fields) => {
totp = fields.totp
return await login()
@@ -100,7 +102,7 @@ const login = async (e?: SubmitEvent) => {
}
}
dispatch("login", {key: resp.auth_key})
on_login?.({key: resp.auth_key})
if (typeof login_redirect === "string" && login_redirect.startsWith("/")) {
console.debug("redirecting user to requested path", login_redirect)
+11 -4
View File
@@ -10,21 +10,21 @@ let page = $state("login")
</script>
<div class="tab_bar">
<button onclick={() => page = "login"} class:button_highlight={page === "login"}>
<i class="icon small">login</i>
<i class="icon small i_login"></i>
<span>Login</span>
</button>
<button onclick={() => page = "register"} class:button_highlight={page === "register"}>
<i class="icon small">how_to_reg</i>
<i class="icon small i_how_to_reg"></i>
<span>Register</span>
</button>
</div>
<div class="page_content">
{#if page === "login"}
<Login on:login={finish_login}/>
<Login on_login={finish_login}/>
{:else if page === "register"}
<Register on:login={finish_login}/>
<Register/>
{/if}
</div>
@@ -35,4 +35,11 @@ let page = $state("login")
font-size: 1.3em;
justify-content: center;
}
.page_content {
margin-top: 0; /* Attach the buttons to the body */
width: calc(100% - 8px);
max-width: 992px;
margin: 0 auto 12px auto;
padding: 8px;
}
</style>
+1 -1
View File
@@ -27,7 +27,7 @@ let form: FormConfig = {
"prevent you from logging into your new account"
},
],
submit_label: `<i class="icon">send</i> Register`,
submit_label: `<i class="icon i_send"></i> Register`,
on_submit: async fields => {
if (fields.password !== fields.password2) {
return {
+18 -18
View File
@@ -10,10 +10,10 @@ import NovaLogo from "util/NovaLogo.svelte";
// Each part of the API has a read and a write permission
const components: [string, string, keyof UserSession, keyof UserSession][] = [
["Files", "folder", "filesystem_read", "filesystem_write"],
["Account", "person", "account_read", "account_write"],
["API keys", "vpn_key", "session_read", "session_write"],
["Billing", "receipt", "billing_read", "billing_write"],
["Files", "i_folder", "filesystem_read", "filesystem_write"],
["Account", "i_person", "account_read", "account_write"],
["API keys", "i_vpn_key", "session_read", "session_write"],
["Billing", "i_receipt", "billing_read", "billing_write"],
]
let keys: UserSession[] = $state([])
@@ -178,7 +178,7 @@ onMount(load_keys)
<div class="toolbar">
<div class="toolbar_spacer"></div>
<button onclick={create_key}>
<i class="icon">add</i> Create new API key
<i class="icon i_add"></i> Create new API key
</button>
</div>
@@ -189,13 +189,13 @@ onMount(load_keys)
{#if key.app_name === "website login"}
<NovaLogo style="height: 1.5em;"/> Nova website
{:else if key.app_name === "website keys page"}
<i class="icon">vpn_key</i> Created on this page
<i class="icon i_vpn_key"></i> Created on this page
{:else if key.app_name === "sharex"}
<img src="/res/img/sharex.png" alt=""/> ShareX
{:else if key.app_name === "jdownloader"}
<img src="/res/img/jdownloader.png" alt=""/> JDownloader
{:else}
<i class="icon">apps</i> {key.app_name || "Unnamed key"}
<i class="icon i_apps"></i> {key.app_name || "Unnamed key"}
{/if}
</span>
{#if key.current}
@@ -206,11 +206,11 @@ onMount(load_keys)
this page and the rest of the website stop working -->
{#if !key.current && editing !== key.auth_key}
<button onclick={() => edit_key(key)}>
<i class="icon">edit</i> Edit
<i class="icon i_edit"></i> Edit
</button>
{/if}
<button class="button_red" onclick={() => delete_key(key)}>
<i class="icon">delete</i> Delete
<i class="icon i_delete"></i> Delete
</button>
</div>
@@ -222,7 +222,7 @@ onMount(load_keys)
class:button_highlight={shown[key.auth_key]}
onclick={() => shown[key.auth_key] = !shown[key.auth_key]}
>
<i class="icon">{shown[key.auth_key] ? "visibility_off" : "visibility"}</i>
<i class="icon {shown[key.auth_key] ? 'i_visibility_off' : 'i_visibility'}"></i>
{shown[key.auth_key] ? "Hide" : "Show"}
</button>
<CopyButton text={key.auth_key}>Copy</CopyButton>
@@ -232,7 +232,7 @@ onMount(load_keys)
<div class="edit">
{#each components as [name, icon, read, write]}
<div class="row">
<span class="name"><i class="icon small">{icon}</i> {name}</span>
<span class="name"><i class="icon small {icon}"></i> {name}</span>
<label>
<input type="checkbox" bind:checked={edit_perms[read]}/> read
</label>
@@ -253,25 +253,25 @@ onMount(load_keys)
<span>Files access is limited to</span>
{#each edit_dirs as id, index (id)}
<span>
<i class="icon small">folder</i>{dir_names[id] ?? id}
<i class="icon small i_folder"></i>{dir_names[id] ?? id}
<button onclick={() => edit_dirs.splice(index, 1)} title="Remove">
<i class="icon small">close</i>
<i class="icon small i_close"></i>
</button>
</span>
{/each}
{/if}
<button onclick={() => picker.open("/me")}>
<i class="icon">folder</i>
<i class="icon i_folder"></i>
{edit_dirs.length === 0 ? "Limit to a directory" : "Add a directory"}
</button>
</div>
<div class="row">
<button class="button_highlight" onclick={save_key}>
<i class="icon">save</i> Save
<i class="icon i_save"></i> Save
</button>
<button onclick={() => editing = ""}>
<i class="icon">close</i> Cancel
<i class="icon i_close"></i> Cancel
</button>
</div>
</div>
@@ -279,7 +279,7 @@ onMount(load_keys)
<div class="row permissions">
{#each components as [name, icon, read, write]}
<span class:none={!key[read] && !key[write]}>
<i class="icon small">{icon}</i>
<i class="icon small {icon}"></i>
{name}:
{#if key[read] && key[write]}
read / write
@@ -297,7 +297,7 @@ onMount(load_keys)
<div class="row">
<span>Files access is limited to</span>
{#each key.filesystem_dirs as id}
<a href="/d/{id}"><i class="icon small">folder</i>{dir_names[id] ?? id}</a>
<a href="/d/{id}"><i class="icon small i_folder"></i>{dir_names[id] ?? id}</a>
{/each}
</div>
{/if}
+3 -3
View File
@@ -74,7 +74,7 @@ let account_settings: FormConfig = $derived({
separator: true,
},
],
submit_label: `<i class="icon">save</i> Save`,
submit_label: `<i class="icon i_save"></i> Save`,
on_submit: async fields => {
if (fields.password_new1 != fields.password_new2) {
return {
@@ -122,7 +122,7 @@ let affiliate_settings: FormConfig = $derived({
extra.`,
},
],
submit_label: `<i class="icon">save</i> Save`,
submit_label: `<i class="icon i_save"></i> Save`,
on_submit: async fields => {
const form = new FormData()
form.append("affiliate_user_name", fields.affiliate_user_name)
@@ -167,7 +167,7 @@ let delete_account: FormConfig = {
},
],
submit_red: true,
submit_label: `<i class="icon">delete</i> Delete`,
submit_label: `<i class="icon i_delete"></i> Delete`,
on_submit: async fields => {
const resp = await fetch(
get_endpoint()+"/user",
+4 -4
View File
@@ -67,13 +67,13 @@ onMount(() => {
<h3>{month_str}</h3>
<div class="toolbar">
<button onclick={last_month}>
<i class="icon">chevron_left</i>
<i class="icon i_chevron_left"></i>
Previous month
</button>
<div class="toolbar_spacer"></div>
<button onclick={next_month}>
Next month
<i class="icon">chevron_right</i>
<i class="icon i_chevron_right"></i>
</button>
</div>
@@ -119,13 +119,13 @@ onMount(() => {
{#if data.length > 100}
<div class="toolbar">
<button onclick={last_month}>
<i class="icon">chevron_left</i>
<i class="icon i_chevron_left"></i>
Previous month
</button>
<div class="toolbar_spacer"></div>
<button onclick={next_month}>
Next month
<i class="icon">chevron_right</i>
<i class="icon i_chevron_right"></i>
</button>
</div>
{/if}
+4 -4
View File
@@ -52,7 +52,7 @@ let app_name = $derived(() => {
<!-- Show a back button if an app is selected -->
{#if app_name}
<a href="/user/connect_app" class="button">
<i class="icon">arrow_back</i>
<i class="icon i_arrow_back"></i>
Back to apps
</a>
{/if}
@@ -92,7 +92,7 @@ let app_name = $derived(() => {
{#if !api_key}
<div class="center">
<button class="button_highlight" onclick={create_key}>
<i class="icon">add</i>
<i class="icon i_add"></i>
Generate key
</button>
</div>
@@ -102,7 +102,7 @@ let app_name = $derived(() => {
<div class="copy_container">
<CopyButton text={api_key}>Copy key to clipboard</CopyButton>
<button onclick={toggle_show_key} class="copy_button" class:button_highlight={show_key !== ""}>
<i class="icon">visibility</i>
<i class="icon i_visibility"></i>
{#if show_key === ""}
Show key
{:else}
@@ -146,7 +146,7 @@ let app_name = $derived(() => {
<div class="center">
<a href="/misc/sharex/nova.storage.sxcu" class="button button_highlight">
<i class="icon small">save</i>
<i class="icon small i_save"></i>
Download ShareX Uploader
</a>
</div>
+19 -7
View File
@@ -2,6 +2,7 @@
import ProgressBar from "util/ProgressBar.svelte";
import { formatDataVolume, formatEuros } from "util/Formatting"
import { user } from "lib/UserStore";
import { bills_extra } from "lib/NovaAPI";
let { total = 0, used = 0 }: {
total?: number;
@@ -10,8 +11,11 @@ let { total = 0, used = 0 }: {
let frac = $derived(used / total)
let bill_shock = $derived($user !== null && $user.monthly_transfer_cap === total)
let billable = $derived($user !== null && $user.subscription.price_per_tb_bandwidth > 0)
let billed = $derived(billable && $user.usage_based_billing)
let price = $derived($user === null ? 0 : $user.subscription.price_per_tb_bandwidth)
let billed = $derived($user !== null && bills_extra($user, price))
// Usage based billing is on, but the balance is too far below zero for it
let overdrawn = $derived($user !== null && $user.usage_based_billing && price > 0 && !billed)
let included = $derived($user === null ? 0 : $user.subscription.monthly_transfer_cap)
</script>
@@ -47,17 +51,25 @@ let included = $derived($user === null ? 0 : $user.subscription.monthly_transfer
</p>
{#if bill_shock}
<p>
This is your bill shock limit. <a href="/user/sharing">Increase
This is your bill shock limit. <a href="/user/subscription/metered_billing">Increase
or disable the limit</a> to continue sharing files.
</p>
{:else if overdrawn}
<p>
Your balance is too far below zero to bill more data transfer.
Top up your credit to continue sharing files.
</p>
<a class="button button_highlight" href="/user/subscription/manage">
<i class="icon i_paid"></i> Top up credit
</a>
{:else}
<p>
Upgrade your plan or enable
<a href="/user/sharing">usage based billing</a> to continue
<a href="/user/subscription/metered_billing">usage based billing</a> to continue
sharing files.
</p>
<a class="button button_highlight" href="/user/subscription/manage">
<i class="icon">bolt</i> Upgrade options
<i class="icon i_bolt"></i> Upgrade options
</a>
{/if}
</div>
@@ -70,11 +82,11 @@ let included = $derived($user === null ? 0 : $user.subscription.monthly_transfer
{#if bill_shock}
<p>
This is your bill shock limit, you can change it in the
<a href="/user/sharing">sharing settings</a>.
<a href="/user/subscription/metered_billing">subscription settings</a>.
</p>
{:else}
<a class="button button_highlight" href="/user/subscription/manage">
<i class="icon">bolt</i> Upgrade options
<i class="icon i_bolt"></i> Upgrade options
</a>
{/if}
</div>
+12
View File
@@ -11,6 +11,8 @@ import { onMount } from "svelte";
import { get_user, type User } from "lib/NovaAPI";
import SharingSettings from "./SharingSettings.svelte";
import SubscriptionManage from "./SubscriptionManage.svelte";
import SubscriptionUsage from "./SubscriptionUsage.svelte";
import RemoteSync from "./remote_sync/RemoteSync.svelte";
let pages: Tab[] = [
{
@@ -39,6 +41,11 @@ let pages: Tab[] = [
title: "Transactions",
icon: "receipt",
component: Transactions,
}, {
path: "/user/subscription/metered_billing",
title: "Metered billing",
icon: "data_usage",
component: SubscriptionUsage,
},
],
}, {
@@ -46,6 +53,11 @@ let pages: Tab[] = [
title: "Sharing settings",
icon: "share",
component: SharingSettings,
}, {
path: "/user/remote_sync",
title: "Remote sync",
icon: "sync_alt",
component: RemoteSync,
}, {
path: "/user/connect_app",
title: "Apps",
+5 -99
View File
@@ -1,14 +1,10 @@
<script lang="ts">
import { onMount } from "svelte";
import { formatDataVolume, formatEuros } from "util/Formatting";
import ProgressBar from "util/ProgressBar.svelte";
import { loading_run } from "lib/Loading";
import { get_endpoint, put_user } from 'lib/NovaAPI';
import { put_user } from 'lib/NovaAPI';
import SuccessMessage from 'util/SuccessMessage.svelte';
import { user } from "lib/UserStore";
let success_message: SuccessMessage = $state()
let transfer_cap = $state($user === null ? 0 : $user.monthly_transfer_cap / 1e12)
const update_user = async (e: SubmitEvent) => {
if (e !== null) {
@@ -16,10 +12,7 @@ const update_user = async (e: SubmitEvent) => {
}
loading_run(async () => {
try {
await put_user({
transfer_cap: transfer_cap*1e12,
embed_domains: embed_domains.join(" "),
})
await put_user({embed_domains: embed_domains.join(" ")})
success_message.set(true, "Sharing settings updated")
} catch (err) {
@@ -28,40 +21,6 @@ const update_user = async (e: SubmitEvent) => {
})
}
const set_usage_based_billing = (e: Event) => {
const input = e.target as HTMLInputElement
loading_run(async () => {
try {
await put_user({usage_based_billing: input.checked})
success_message.set(true, "Usage based billing updated")
} catch (err) {
input.checked = !input.checked
success_message.set(false, "Failed to update user: "+err)
}
})
}
let transfer_used = $state(0)
let load_transfer_used = () => {
let today = new Date()
let start = new Date()
start.setDate(start.getDate() - 30)
fetch(
get_endpoint() + "/user/time_series/egress" +
"?start=" + start.toISOString() +
"&end=" + today.toISOString() +
"&interval=60"
).then(resp => {
if (!resp.ok) { return Promise.reject("Error: " + resp.status); }
return resp.json();
}).then(resp => {
transfer_used = resp.amounts.reduce((acc, cur) => { return acc + cur }, 0)
}).catch(e => {
console.error("Error requesting time series: " + e);
})
}
// Embedding settings
let embed_domains: string[] = $state($user === null ? [] : $user.embed_domains.split(" "))
let new_domain: string = $state("")
@@ -79,58 +38,11 @@ const del_domain = (index: number) => {
embed_domains = embed_domains
update_user(null)
}
onMount(async () => {
load_transfer_used()
})
</script>
<section>
<SuccessMessage bind:this={success_message}/>
{#if $user !== null && $user.subscription.type === "subscription"}
<h2>Usage based billing</h2>
<p>
When your storage or data transfer goes over the limits of your
plan, uploads and downloads are blocked. With usage based billing
they keep working and the usage above the limits is billed at
{formatEuros($user.subscription.price_per_tb_storage, 2)} per TB per
month for storage and
{formatEuros($user.subscription.price_per_tb_bandwidth, 2)} per TB
for data transfer.
</p>
<label>
<input type="checkbox" checked={$user.usage_based_billing} onchange={set_usage_based_billing}/>
Enable usage based billing
</label>
{/if}
<h2>Bill shock limit</h2>
<p>
Billshock limit in terabytes per month (1 TB = 1000 GB). Set to 0 to
disable.
</p>
<form onsubmit={update_user} class="billshock_container">
<input type="number" bind:value={transfer_cap} step="0.1" min="0" style="width: 5em;"/>
<div style="margin: 0.5em;">TB</div>
<button type="submit">
<i class="icon">save</i> Save
</button>
</form>
<p>
Bandwidth used in the last 30 days: {formatDataVolume(transfer_used, 3)},
new limit: {formatDataVolume(transfer_cap*1e12, 3)}
</p>
<ProgressBar used={transfer_used} total={transfer_cap*1e12} warn></ProgressBar>
<p>
The billshock limit limits how much bandwidth your account can use in a
30 day window. When this limit is reached hotlinking will be disabled
and you will no longer be charged for bandwidth usage. This is mostly
useful for the Prepaid subscription, but it works for Patreon plans too.
Set to 0 to disable the limit.
</p>
<h2>Embedding controls</h2>
<p>
Here you can control which websites are allowed to embed your files in
@@ -144,7 +56,7 @@ onMount(async () => {
<div class="form_row">
<span>Add domain name</span>
<input class="grow" bind:value={new_domain} type="text"/>
<button class="shrink" type="submit"><i class="icon">add</i> Add</button>
<button class="shrink" type="submit"><i class="icon i_add"></i> Add</button>
</div>
</form>
<hr/>
@@ -155,8 +67,8 @@ onMount(async () => {
{/if}
{#each embed_domains as domain, index}
<div class="form_row">
<button class="shrink" type="button" onclick={() => del_domain(index)}>
<i class="icon">delete</i>
<button class="shrink" type="button" onclick={() => del_domain(index)} title="Remove">
<i class="icon i_delete"></i>
</button>
<div>{domain}</div>
</div>
@@ -165,12 +77,6 @@ onMount(async () => {
</section>
<style>
.billshock_container {
display: flex;
flex-direction: row;
align-items: center;
}
.highlight_border {
text-align: initial;
}
+20 -5
View File
@@ -2,6 +2,7 @@
import { formatDataVolume, formatEuros } from "util/Formatting"
import ProgressBar from "util/ProgressBar.svelte";
import { user } from "lib/UserStore";
import { bills_extra } from "lib/NovaAPI";
let { total = 0, used = 0 }: {
total?: number;
@@ -9,8 +10,11 @@ let { total = 0, used = 0 }: {
} = $props();
let frac = $derived(total <= 0 ? 0 : used / total)
let billable = $derived($user !== null && $user.subscription.price_per_tb_storage > 0)
let billed = $derived(billable && $user.usage_based_billing)
let price = $derived($user === null ? 0 : $user.subscription.price_per_tb_storage)
let billed = $derived($user !== null && bills_extra($user, price))
// Usage based billing is on, but the balance is too far below zero for it
let overdrawn = $derived($user !== null && $user.usage_based_billing && price > 0 && !billed)
</script>
<ProgressBar total={total} used={used} warn></ProgressBar>
@@ -35,17 +39,28 @@ let billed = $derived(billable && $user.usage_based_billing)
month.
</p>
{/if}
{:else if frac > 1 && overdrawn}
<div class="highlight_yellow">
<p>
You are storing more than your plan includes, and your balance is
too far below zero to bill more storage. You can't upload new files
until you top up your credit. Your existing files stay available.
</p>
<a class="button button_highlight" href="/user/subscription/manage">
<i class="icon i_paid"></i> Top up credit
</a>
</div>
{:else if frac > 1}
<div class="highlight_yellow">
<p>
You are storing more than your plan allows, so you can't upload new
files. Your existing files stay available. Delete some files or
upgrade your plan to continue uploading, or enable
<a href="/user/sharing">usage based billing</a> to pay for the
<a href="/user/subscription/metered_billing">usage based billing</a> to pay for the
storage above the limit.
</p>
<a class="button button_highlight" href="/user/subscription/manage">
<i class="icon">bolt</i> Upgrade options
<i class="icon i_bolt"></i> Upgrade options
</a>
</div>
{:else if frac > 0.8}
@@ -55,7 +70,7 @@ let billed = $derived(billable && $user.usage_based_billing)
it runs out you won't be able to upload new files anymore.
</p>
<a class="button button_highlight" href="/user/subscription/manage">
<i class="icon">bolt</i> Upgrade options
<i class="icon i_bolt"></i> Upgrade options
</a>
</div>
{/if}
@@ -129,11 +129,11 @@ onMount(async () => {
<td>
{#if row.status === "open"}
<a href="/api/user/invoice/{row.id}/pay" class="button button_highlight">
<i class="icon">paid</i> Pay
<i class="icon i_paid"></i> Pay
</a>
{/if}
<a href="/api/user/invoice/{row.id}/pdf" target="_blank" class="button">
<i class="icon">description</i> PDF
<i class="icon i_description"></i> PDF
</a>
</td>
</tr>
@@ -0,0 +1,101 @@
<script lang="ts">
import { formatDataVolume, formatEuros } from "util/Formatting";
import ProgressBar from "util/ProgressBar.svelte";
import { loading_run } from "lib/Loading";
import { period_price, put_user } from "lib/NovaAPI";
import SuccessMessage from "util/SuccessMessage.svelte";
import { user } from "lib/UserStore";
import ToggleButton from "layout/ToggleButton.svelte";
let success_message: SuccessMessage = $state()
// The toggle button has already flipped the value in the user store when this
// runs. put_user reloads the store from the server, so only a failed request
// has to flip it back
const set_usage_based_billing = () => {
loading_run(async () => {
try {
await put_user({usage_based_billing: $user.usage_based_billing})
success_message.set(true, "Usage based billing updated")
} catch (err) {
$user.usage_based_billing = !$user.usage_based_billing
success_message.set(false, "Failed to update user: "+(err?.message ?? err))
}
})
}
let transfer_cap = $state($user === null ? 0 : $user.monthly_transfer_cap / 1e12)
let transfer_used = $derived($user === null ? 0 : $user.monthly_transfer_used)
const set_transfer_cap = (e: SubmitEvent) => {
e.preventDefault()
loading_run(async () => {
try {
await put_user({transfer_cap: transfer_cap*1e12})
success_message.set(true, "Bill shock limit updated")
} catch (err) {
success_message.set(false, "Failed to update user: "+(err?.message ?? err))
}
})
}
</script>
<section>
<SuccessMessage bind:this={success_message}/>
{#if $user !== null && $user.subscription.type === "subscription"}
<h2>Usage based billing</h2>
<p>
When your storage or data transfer goes over the limits of your
plan, uploads and downloads are blocked. With usage based billing
they keep working and the usage above the limits is billed at
{formatEuros($user.subscription.price_per_tb_storage, 2)} per TB per
month for storage and
{formatEuros($user.subscription.price_per_tb_bandwidth, 2)} per TB
for data transfer.
</p>
<p>
This usage is charged from your account credit afterwards. When
your balance is more than {formatEuros(period_price($user), 2)} below zero
(the price of your subscription period) the limits of your plan
apply again, until you top up your credit.
</p>
<ToggleButton bind:on={$user.usage_based_billing} action={set_usage_based_billing}>
Usage based billing
</ToggleButton>
{/if}
<h2>Bill shock limit</h2>
<p>
Billshock limit in terabytes per month (1 TB = 1000 GB). Set to 0 to
disable.
</p>
<form onsubmit={set_transfer_cap} class="billshock_container">
<input type="number" bind:value={transfer_cap} step="0.1" min="0" style="width: 5em;"/>
<div style="margin: 0.5em;">TB</div>
<button type="submit">
<i class="icon i_save"></i> Save
</button>
</form>
<p>
Bandwidth used in the last 30 days: {formatDataVolume(transfer_used, 3)},
new limit: {formatDataVolume(transfer_cap*1e12, 3)}
</p>
<ProgressBar used={transfer_used} total={transfer_cap*1e12} warn></ProgressBar>
<p>
The billshock limit limits how much bandwidth your account can use in a
30 day window. When this limit is reached your files can't be downloaded
until your usage drops below it, and you will no longer be charged for
bandwidth usage. This is mostly useful with usage based billing, but it
works without it too. Set to 0 to disable the limit.
</p>
</section>
<style>
.billshock_container {
display: flex;
flex-direction: row;
align-items: center;
}
</style>
+9 -7
View File
@@ -99,11 +99,13 @@ onMount(() => {
<h2>Transaction log</h2>
<p>
Here is a log of all transactions on your account balance. Usage is
calculated per day. The storage charge is divided by the average number
of days in a month (30.4375).
calculated per day. Storage and bandwidth are only charged for what you
use above the amounts included in your plan, and that is the usage which
is listed here. The storage charge is divided by the average number of
days in a month (30.4375).
</p>
<p>
Example: If you have 2 TB stored on your Nova account at €4 per TB
Example: If you store 2 TB more than your plan includes at €4 per TB
then the daily charge will be:<br/>
2 TB * € 4 = € 8<br/>
@@ -114,13 +116,13 @@ onMount(() => {
<h3>{month_str}</h3>
<div class="toolbar">
<button onclick={last_month}>
<i class="icon">chevron_left</i>
<i class="icon i_chevron_left"></i>
Previous month
</button>
<div class="toolbar_spacer"></div>
<button onclick={next_month}>
Next month
<i class="icon">chevron_right</i>
<i class="icon i_chevron_right"></i>
</button>
</div>
<ul>
@@ -129,11 +131,11 @@ onMount(() => {
</li>
<li>
Storage charge: <Euro amount={transactions.total_storage_charge} precision="4"/>
(used {formatDataVolume(transactions.total_storage_used, 3)})
({formatDataVolume(transactions.total_storage_used, 3)} above your plan)
</li>
<li>
Bandwidth charge: <Euro amount={transactions.total_bandwidth_charge} precision="4"/>
(used {formatDataVolume(transactions.total_bandwidth_used, 3)})
({formatDataVolume(transactions.total_bandwidth_used, 3)} above your plan)
</li>
<li>
Total charge: <Euro amount={transactions.total_deducted} precision="4"/>
@@ -18,7 +18,7 @@ import { user } from "lib/UserStore";
</li>
{/if}
<li>
<i class="icon">settings</i>
<i class="icon i_settings"></i>
<a href="/user/settings">Account settings</a>
</li>
</ul>
@@ -28,11 +28,11 @@ import { user } from "lib/UserStore";
<div class="button_row">
<a href="/d/me" class="button">
<i class="icon">folder</i>
<i class="icon i_folder"></i>
Filesystem
</a>
<button onclick={()=> logout_user("/")}>
<i class="icon">logout</i>
<i class="icon i_logout"></i>
Log out
</button>
</div>
@@ -59,11 +59,11 @@ onMount(() => {
</script>
<div class="toolbar">
<Button click={last_month} icon="chevron_left"/>
<Button click={last_month} icon="chevron_left" title="Previous month"/>
<div class="toolbar_spacer">
{month_str}
</div>
<Button click={next_month} icon="chevron_right"/>
<Button click={next_month} icon="chevron_right" title="Next month"/>
</div>
{#if data.length === 0}
@@ -108,11 +108,11 @@ onMount(() => {
</script>
<div class="toolbar">
<Button click={last_month} icon="chevron_left"/>
<Button click={last_month} icon="chevron_left" title="Previous month"/>
<div class="toolbar_spacer">
{month_str}
</div>
<Button click={next_month} icon="chevron_right"/>
<Button click={next_month} icon="chevron_right" title="Next month"/>
</div>
<table>
@@ -137,14 +137,14 @@ onMount(() => {
<td>Storage charge</td>
<td>
<Euro amount={transactions.total_storage_charge} precision="4"/>
(used {formatDataVolume(transactions.total_storage_used, 3)})
({formatDataVolume(transactions.total_storage_used, 3)} above your plan)
</td>
</tr>
<tr>
<td>Bandwidth charge</td>
<td>
<Euro amount={transactions.total_bandwidth_charge} precision="4"/>
(used {formatDataVolume(transactions.total_bandwidth_used, 3)})
({formatDataVolume(transactions.total_bandwidth_used, 3)} above your plan)
</td>
</tr>
<tr>
@@ -1,14 +1,40 @@
<script lang="ts">
import { days_per_month, subscription_periods } from "lib/NovaAPI";
import { user } from "lib/UserStore";
import Euro from "util/Euro.svelte";
import { formatDataVolume } from "util/Formatting";
import { formatDataVolume, formatDate, formatEuros } from "util/Formatting";
// What the account costs per day at its current usage, the same sum the server
// charges every night. Data transfer above the plan is left out, it can't be
// predicted
let daily_cost = $derived.by(() => {
if ($user === null || $user.subscription.type !== "subscription") {
return 0
}
const sub = $user.subscription
const discount = subscription_periods.find(
p => p.months === $user.subscription_months,
)?.discount ?? 1
const extra_storage = $user.usage_based_billing ?
Math.max(0, $user.storage_space_used - sub.storage_limit) *
sub.price_per_tb_storage / 1e12 : 0
return (sub.monthly_fee * discount + extra_storage) / days_per_month
})
let credit_until = $derived.by(() => {
const date = new Date()
date.setDate(date.getDate() + Math.floor($user.balance_micro_eur / daily_cost))
return formatDate(date, false, false, false)
})
</script>
{#if $user !== null}
<ul>
<li>
Supporter level: {$user.subscription.name}<br/>
<i class="icon">shopping_cart</i>
<i class="icon i_shopping_cart"></i>
<a href="/user/subscription">Manage subscriptions</a>
</li>
@@ -16,10 +42,22 @@ import { formatDataVolume } from "util/Formatting";
<li>
Current account balance: <Euro amount={$user.balance_micro_eur}></Euro><br/>
<i class="icon">account_balance_wallet</i>
{#if daily_cost > 0}
Your plan costs {formatEuros(daily_cost, 4)} per day at your
current usage.
{#if $user.balance_micro_eur > 0}
Your credit lasts until about {credit_until}.
{/if}
{#if $user.usage_based_billing}
Data transfer above your plan is not included.
{/if}
<br/>
{/if}
<i class="icon i_account_balance_wallet"></i>
<a href="/user/subscription/manage">Deposit credit</a><br/>
<i class="icon">receipt</i>
<i class="icon i_receipt"></i>
<a href="/user/subscription/transactions">Transaction log</a>
{#if $user.balance_micro_eur > 0 && $user.subscription.id === ""}
@@ -1,5 +1,5 @@
<script lang="ts">
import { get_endpoint, get_user, type User } from "lib/NovaAPI";
import { bills_extra, get_endpoint, get_user, type User } from "lib/NovaAPI";
import { onMount } from "svelte";
import HotlinkProgressBar from "user_home/HotlinkProgressBar.svelte";
import StorageProgressBar from "user_home/StorageProgressBar.svelte";
@@ -37,7 +37,7 @@ onMount(async () => {
// The lowest limit which blocks downloads. With usage based billing the
// plan's limit is billed instead, only the bill shock limit blocks
let caps = [user.monthly_transfer_cap]
if (!user.usage_based_billing || user.subscription.price_per_tb_bandwidth <= 0) {
if (!bills_extra(user, user.subscription.price_per_tb_bandwidth)) {
caps.push(user.subscription.monthly_transfer_cap)
}
caps = caps.filter(cap => cap > 0)
@@ -59,6 +59,6 @@ onMount(async () => {
<br/><br/>
Egress used (30 days):
(<a href="/user/sharing">set custom limit</a>)
(<a href="/user/subscription/metered_billing">set custom limit</a>)
<HotlinkProgressBar used={transfer_used} total={transfer_cap}></HotlinkProgressBar>
{/if}
@@ -144,17 +144,17 @@ onMount(() => {
{/if}
{#if i > 0}
<Button click={() => swap_card(i, i-1)} icon="chevron_left" flat/>
<Button click={() => swap_card(i, i-1)} icon="chevron_left" flat title="Move left"/>
{/if}
{#if i < cards.length-1}
<Button click={() => swap_card(i, i+1)} icon="chevron_right" flat/>
<Button click={() => swap_card(i, i+1)} icon="chevron_right" flat title="Move right"/>
{/if}
<Button click={() => shrink(i)} icon="zoom_out" flat/>
<Button click={() => shrink(i)} icon="zoom_out" flat title="Shrink"/>
<span>
{card.size === undefined ? 1 : card.size}
</span>
<Button click={() => expand(i)} icon="zoom_in" flat/>
<Button click={() => expand(i)} icon="zoom_in" flat title="Enlarge"/>
</div>
{#if !card.hidden && card.size > 0}
@@ -0,0 +1,263 @@
<script lang="ts">
import { onMount } from "svelte";
import { loading_run } from "lib/Loading";
import { check_response, dict_to_form, get_endpoint } from "lib/NovaAPI";
import ProgressBar from "util/ProgressBar.svelte";
import { formatDataVolume, formatDate, formatDuration } from "util/Formatting";
import { user } from "lib/UserStore";
import RemoteSyncForm from "./RemoteSyncForm.svelte";
import { edit_remote_sync, form, secret_fields, service_of, type RemoteSync } from "./RemoteSyncLib.svelte";
let syncs: RemoteSync[] = $state([])
// Polls every second while a sync runs, the server saves the
// progress that often
let mounted = true
let timeout: ReturnType<typeof setTimeout>
const load = async () => {
clearTimeout(timeout)
try {
syncs = await check_response(await fetch(get_endpoint() + "/user/remote_sync"))
} catch (err) {
console.error("Failed to load remote syncs:", err)
}
if (mounted && syncs.some(t => t.status === "running")) {
timeout = setTimeout(load, 1000)
}
}
onMount(() => {
load()
return () => {
mounted = false
clearTimeout(timeout)
}
})
const edit = (t: RemoteSync) => {
edit_remote_sync(t)
document.getElementById("remote_sync_form")?.scrollIntoView({ behavior: "smooth" })
}
const restart = async (t: RemoteSync, body = {}) => {
try {
await loading_run(async () => check_response(
await fetch(get_endpoint() + "/user/remote_sync/" + t.id + "/restart", {
method: "POST",
body: dict_to_form(body),
})
))
} catch (err) {
alert("Failed to restart the remote sync: " + (err.message ?? err))
return
}
asking = ""
load()
}
// A sync without remembered credentials asks for them again. What the form
// still has for that service is filled in
let asking = $state("")
let secrets: { [name: string]: string } = $state({})
let remember_again = $state(false)
const ask = (t: RemoteSync) => {
const service = service_of(t)
secrets = Object.fromEntries(secret_fields(service).map(f =>
[f.name, (form.options[service][f.name] as string) ?? ""]
))
remember_again = false
asking = t.id
}
const remove = async (t: RemoteSync) => {
try {
await loading_run(async () => check_response(
await fetch(get_endpoint() + "/user/remote_sync/" + t.id, { method: "DELETE" })
))
} catch (err) {
alert("Failed to remove the remote sync: " + (err.message ?? err))
return
}
load()
}
</script>
<section>
<h2>Remote sync</h2>
<p>
Copy files between Nova and another storage service. The sync runs
on our servers, so you can close this page while it runs. A sync
which stopped can be started again, files which are already there are
skipped.
</p>
{#if $user !== null && $user.subscription.id === ""}
<p>
Remote sync is available on paid plans.
<a class="button button_highlight" href="/user/subscription/manage">
<i class="icon i_shopping_cart"></i> Upgrade
</a>
</p>
{:else}
<RemoteSyncForm onsaved={load}/>
{/if}
{#each syncs as t (t.id)}
{@const name = t.directory_path || t.directory}
{@const service = service_of(t)}
<div class="remote_sync" class:running={t.status === "running"} class:editing={form.editing === t.id}>
<div class="row">
<span class="title">
<i class="icon {t.direction === 'import' ? 'i_download' : 'i_upload'}"></i>
<span class="badge">{t.sync ? "Sync" : "Copy"}</span>
{t.direction === "import" ? t.remote + " → " + name : name + " → " + t.remote}
</span>
<div class="toolbar_spacer"></div>
{#if t.status === "running"}
<button onclick={() => remove(t)}>
<i class="icon i_cancel"></i> Abort
</button>
{:else}
{#if service !== ""}
<button onclick={() => edit(t)}>
<i class="icon i_edit"></i> Edit
</button>
{/if}
<button onclick={() => t.remember || service === "" ? restart(t) : ask(t)}>
<i class="icon i_restart_alt"></i> Restart
</button>
<button class="button_red" onclick={() => remove(t)}>
<i class="icon i_delete"></i> Remove
</button>
{/if}
</div>
{#if t.stats}
<ProgressBar total={t.stats.totalBytes} used={t.stats.bytes} speed={1000} animation="linear"/>
<div class="details">
<div>
<span>Data copied</span>
{formatDataVolume(t.stats.bytes, 3)} of {formatDataVolume(t.stats.totalBytes, 3)}
</div>
<div>
<span>Files copied</span>
{t.stats.transfers} of {t.stats.totalTransfers}
</div>
<div>
<span>Files checked</span>
{t.stats.checks} of {t.stats.totalChecks}
</div>
<div>
<span>Transfer rate</span>
{formatDataVolume(t.stats.speed, 3)}/s
</div>
<div>
<span>Time left</span>
<!-- Below a minute the second unit would be milliseconds -->
{t.status === "running" && t.stats.eta !== null
? formatDuration(t.stats.eta * 1000, t.stats.eta < 60 ? 1 : 2) : "-"}
</div>
</div>
{/if}
{#if t.error}
<div class="highlight_red">{t.error}</div>
{/if}
{#if asking === t.id}
<form class="form" onsubmit={e => { e.preventDefault(); restart(t, { ...secrets, remember: remember_again }) }}>
<!-- Keeps Firefox from filling in the account's login, see RemoteSyncForm -->
<input type="text" autocomplete="username" value={"RemoteSync " + t.remote} style="display: none;"/>
{#each secret_fields(service) as f (f.name)}
<label for={"restart_" + f.name}>{f.label}</label>
{#if f.type === "textarea"}
<textarea id={"restart_" + f.name} bind:value={secrets[f.name]}></textarea>
{:else if f.type === "password"}
<input id={"restart_" + f.name} type="password" autocomplete="off" bind:value={secrets[f.name]}/>
{:else}
<input id={"restart_" + f.name} type="text" autocomplete="off" bind:value={secrets[f.name]}/>
{/if}
{/each}
<label>
<input type="checkbox" bind:checked={remember_again}/>
Remember the credentials
</label>
<div class="row">
<button type="button" onclick={() => asking = ""}>Cancel</button>
<button class="button_highlight" type="submit">
<i class="icon i_restart_alt"></i> Restart
</button>
</div>
</form>
{/if}
<div class="details">
<div>
<span>Status</span>
{t.status}
</div>
<div>
<span>Started</span>
{t.started ? formatDate(t.started, true, true, false) : "-"}
</div>
<div>
<span>Credentials</span>
{t.remember ? "Remembered" : "Not saved"}
</div>
</div>
</div>
{/each}
</section>
<style>
/* The cards of the API keys page */
.remote_sync {
margin: 0.8em 0;
padding: 0.4em 0.6em;
border-radius: 8px;
border-left: 3px solid var(--separator);
background: var(--card_color);
}
.remote_sync.running,
.remote_sync.editing {
border-left-color: var(--accent_color);
}
.row {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 0.2em 0.5em;
margin: 0.3em 0;
}
.toolbar_spacer {
flex: 1 1 auto;
}
.title {
display: inline-flex;
align-items: center;
gap: 0.3em;
font-size: 1.1em;
overflow-wrap: anywhere;
}
.badge {
padding: 0 0.6em;
border-radius: 1em;
color: var(--link_color);
background: var(--accent_shade);
}
/* Each detail is a label with its value below it */
.details {
display: flex;
flex-wrap: wrap;
gap: 0.2em 1.5em;
font-size: 0.9em;
}
.details > div {
display: flex;
flex-direction: column;
}
.details span {
opacity: 0.6;
}
</style>
@@ -0,0 +1,228 @@
<script lang="ts">
import { loading_run } from "lib/Loading";
import { check_response, dict_to_form, get_endpoint } from "lib/NovaAPI";
import FilePicker from "filesystem/filemanager/FilePicker.svelte";
import { backends, form, s3_presets, type Field } from "./RemoteSyncLib.svelte";
// Called after a sync was started or saved
let { onsaved }: { onsaved: () => void } = $props()
let picker: FilePicker = $state()
// The value of a preset option is its index and region
const use_preset = (value: string) => {
const [i, region] = value.split(" ")
for (const [name, v] of Object.entries(s3_presets[+i].options)) {
form.options.s3[name] = v.replace("{region}", region)
}
}
const placeholder = (f: Field) =>
f.secret && form.editing && form.saved_secrets ? "Saved, leave empty to keep it" : f.default ?? ""
const submit = async (e: SubmitEvent) => {
e.preventDefault()
const b = backends[form.backend]
const fields = {}
for (const f of b.fields) {
const value = form.options[form.backend][f.name] || f.default
if (value) {
fields[f.name] = value
}
}
try {
await loading_run(async () => check_response(
await fetch(get_endpoint() + "/user/remote_sync" + (form.editing ? "/" + form.editing : ""), {
method: form.editing ? "PUT" : "POST",
body: dict_to_form({
direction: form.direction, sync: form.sync, remember: form.remember, directory: form.dir.id,
type: b.type ?? form.backend, path: form.paths[form.backend], ...fields,
}),
})
))
} catch (err) {
alert("Failed to " + (form.editing ? "save" : "start") + " the remote sync: " + (err.message ?? err))
return
}
form.editing = ""
form.step = 1
onsaved()
}
</script>
{#snippet field(f: Field)}
{#if f.type === "checkbox"}
<label><input type="checkbox" bind:checked={form.options[form.backend][f.name]}/> {f.label}</label>
{:else}
<label for={"remote_sync_" + f.name}>{f.label}</label>
{#if f.type === "textarea"}
<textarea id={"remote_sync_" + f.name} bind:value={form.options[form.backend][f.name]}></textarea>
{:else if f.type === "password"}
<input
id={"remote_sync_" + f.name}
type="password"
autocomplete="off"
placeholder={placeholder(f)}
bind:value={form.options[form.backend][f.name]}
/>
{:else}
<input id={"remote_sync_" + f.name} type="text" autocomplete="off" placeholder={placeholder(f)} bind:value={form.options[form.backend][f.name]}/>
{/if}
{#if f.help}
<small>{@html f.help}</small>
{/if}
{/if}
<hr/>
{/snippet}
{#snippet path()}
<label for="remote_sync_path">{backends[form.backend].path}</label>
<input id="remote_sync_path" type="text" bind:value={form.paths[form.backend]} required={backends[form.backend].path_required}/>
{/snippet}
<div id="remote_sync_form" class="highlight_border">
<div class="navbar">
<b>{form.editing ? "Edit remote sync" : "New remote sync"}</b>
{#if form.step === 2}
<button onclick={() => form.step = 1}>
{form.direction === "import" ? "Import into" : "Export from"} {form.dir.path}
</button>
<button onclick={() => form.step = 1}>{form.sync ? "Sync" : "Copy"}</button>
<button onclick={() => form.step = 1}>Service: {backends[form.backend].name}</button>
{/if}
{#if form.editing}
<button onclick={() => { form.editing = ""; form.step = 1 }}>
<i class="icon i_close"></i> Stop editing
</button>
{/if}
</div>
<hr/>
{#if form.step === 1}
<form class="form" onsubmit={e => { e.preventDefault(); form.step = 2 }}>
<label class="radio_label">
<input type="radio" bind:group={form.direction} value="import"/>
Import into Nova
</label>
<label class="radio_label">
<input type="radio" bind:group={form.direction} value="export"/>
Export from Nova
</label>
<hr/>
<label class="radio_label">
<input type="radio" bind:group={form.sync} value={true}/>
Sync: Delete files at the destination which do not exist at
the source
</label>
<label class="radio_label">
<input type="radio" bind:group={form.sync} value={false}/>
Copy: Only copy files from the source to the destination
without removing anything
</label>
<hr/>
<label for="remote_sync_dir">Local directory</label>
<button id="remote_sync_dir" type="button" onclick={() => picker.open("/me")}>
<i class="icon i_folder"></i>
{form.dir ? form.dir.path : "Choose a directory"}
</button>
<label for="remote_sync_backend">Remote service</label>
<select id="remote_sync_backend" bind:value={form.backend}>
{#each Object.entries(backends) as [type, b]}
<option value={type}>{b.name}</option>
{/each}
</select>
<button class="button_highlight" type="submit" disabled={!form.dir}>
Next <i class="icon i_arrow_forward"></i>
</button>
</form>
{:else}
<form class="form" onsubmit={submit}>
<!-- Firefox fills the account's login into a form with a password
field, unless the form has a username field of its own -->
<input type="text" autocomplete="username" value={"RemoteSync " + backends[form.backend].name} style="display: none;"/>
{#if form.backend === "s3"}
<label for="remote_sync_preset">Preset</label>
<select id="remote_sync_preset" onchange={e => use_preset(e.currentTarget.value)}>
<option value="" disabled selected>Choose a service to fill in the fields below</option>
{#each s3_presets as p, i}
{#if p.regions}
<optgroup label={p.name}>
{#each Object.entries(p.regions) as [region, city]}
<option value={i + " " + region}>{p.name} {city} ({region})</option>
{/each}
</optgroup>
{:else}
<option value={i + " "}>{p.name}</option>
{/if}
{/each}
</select>
<hr/>
{/if}
{#each backends[form.backend].fields.filter(f => !f.advanced) as f (form.backend + f.name)}
{@render field(f)}
{/each}
{#if !backends[form.backend].path_advanced}
{@render path()}
{/if}
{#if backends[form.backend].path_advanced || backends[form.backend].fields.some(f => f.advanced)}
<label><input type="checkbox" bind:checked={form.advanced}/> Advanced options</label>
{#if form.advanced}
{#each backends[form.backend].fields.filter(f => f.advanced) as f (form.backend + f.name)}
{@render field(f)}
{/each}
{#if backends[form.backend].path_advanced}
{@render path()}
{/if}
{/if}
{/if}
<label>
<input type="checkbox" bind:checked={form.remember}/>
Remember the credentials, so a restart doesn't ask for them again
</label>
<button class="button_highlight" type="submit">
{#if form.editing}
<i class="icon i_save"></i> Save
{:else}
<i class="icon i_sync_alt"></i> Start sync
{/if}
</button>
</form>
{/if}
</div>
<FilePicker bind:this={picker} callback={nodes => form.dir = { id: nodes[0].id, path: nodes[0].path }} directories/>
<style>
/* Edit scrolls here, clear of the page's sticky header */
#remote_sync_form {
scroll-margin-top: 3.5em;
}
/* The choices of the first step, like the checkout widget */
.navbar {
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
gap: 0.25em;
}
.radio_picker {
display: flex;
flex-direction: column;
}
.radio_label {
display: flex;
flex-direction: row;
gap: 0.5em;
margin: 0.2em 0;
}
</style>
@@ -0,0 +1,245 @@
import { get_endpoint } from "lib/NovaAPI";
export const nova_api = new URL(get_endpoint(), window.location.href).href
// The fields are rclone's option names, the server only passes these on.
// Advanced fields are behind a toggle, their default is sent when left empty.
// Secret fields are credentials, which the server never sends back. help is
// HTML
export type Field = {
name: string
label: string
type?: "password" | "checkbox" | "textarea"
secret?: boolean
advanced?: boolean
default?: string
help?: string
}
// type is the rclone backend, when it differs from the key. A path which is
// advanced is behind the toggle, a required one is a bucket
export const backends: {
[key: string]: {
name: string, type?: string, path: string, path_advanced?: boolean, path_required?: boolean, fields: Field[],
}
} = {
s3: {
name: "S3", path: "Bucket and path", path_required: true, fields: [
{ name: "provider", label: "Provider (AWS, Cloudflare, Wasabi, Other...)" },
{ name: "endpoint", label: "Endpoint, empty for AWS" },
{ name: "region", label: "Region" },
{ name: "access_key_id", label: "Access key ID" },
{ name: "secret_access_key", label: "Secret access key", type: "password", secret: true },
]
},
b2: {
name: "Backblaze B2", path: "Bucket and path", path_required: true, fields: [
{ name: "account", label: "Application key ID" },
{ name: "key", label: "Application key", type: "password", secret: true },
]
},
azureblob: {
name: "Azure Blob Storage", path: "Container and path", path_required: true, fields: [
{ name: "account", label: "Storage account name" },
{ name: "key", label: "Storage account key", type: "password", secret: true },
]
},
sftp: {
name: "SFTP", path: "Path", fields: [
{ name: "host", label: "Host" },
{ name: "port", label: "Port, empty for 22" },
{ name: "user", label: "User" },
{ name: "pass", label: "Password", type: "password", secret: true },
{ name: "key_pem", label: "Private key (PEM), instead of a password", type: "textarea", secret: true },
]
},
ftp: {
name: "FTP", path: "Path", fields: [
{ name: "host", label: "Host" },
{ name: "port", label: "Port, empty for 21" },
{ name: "user", label: "User" },
{ name: "pass", label: "Password", type: "password", secret: true },
{ name: "tls", label: "Implicit TLS", type: "checkbox" },
{ name: "explicit_tls", label: "Explicit TLS", type: "checkbox" },
]
},
webdav: {
name: "WebDAV", path: "Path", fields: [
{ name: "url", label: "URL" },
{ name: "vendor", label: "Vendor (nextcloud, owncloud, other...)" },
{ name: "user", label: "User" },
{ name: "pass", label: "Password", type: "password", secret: true },
]
},
// Nova has the API of pixeldrain, rclone's pixeldrain backend does both. The
// API keys are text fields: Firefox fills the account password into any
// password field on this site
nova: {
name: "Nova",
type: "pixeldrain",
path: "Path inside the directory",
path_advanced: true,
fields: [
{
name: "root_folder_id",
label: "Directory ID",
default: "me",
help: "Open the directory in the other account, its Node ID is in the Details window. " +
"Leave it empty for the home directory of the key.",
}, {
// rclone checks the key with GET /user
name: "api_key",
label: "API key of remote account",
secret: true,
help: "Create one on the <a href=\"/user/api_keys\">API keys page</a> while you are logged in to " +
"that account. It needs the Account read permission.",
}, {
name: "api_url",
label: "API endpoint",
advanced: true,
default: nova_api
},
]
},
pixeldrain: {
name: "Pixeldrain", path: "Path", fields: [
{
name: "api_key", label: "API key", secret: true,
help: "Create one on the <a href=\"https://pixeldrain.com/user/api_keys\" target=\"_blank\">" +
"API keys page</a> of pixeldrain.",
},
{ name: "api_url", label: "API endpoint", advanced: true, default: "https://pixeldrain.com/api" },
{
name: "root_folder_id", label: "Directory ID, for a key which only works in one directory, or a shared directory",
advanced: true, default: "me",
},
]
},
}
// Common S3 services, from rclone's list of providers. A preset fills in its
// options, with {region} replaced by the chosen region. The region option is
// only set where rclone asks for it, and AWS finds the region of the bucket
// itself
export const s3_presets: {
name: string, options: { [name: string]: string }, regions?: { [region: string]: string },
}[] = [
{ name: "Amazon S3", options: { provider: "AWS", endpoint: "", region: "" } },
{
name: "Cloudflare R2",
options: { provider: "Cloudflare", endpoint: "https://ACCOUNT_ID.r2.cloudflarestorage.com", region: "auto" },
},
{ name: "Google Cloud Storage", options: { provider: "GCS", endpoint: "https://storage.googleapis.com", region: "" } },
{ name: "Storj", options: { provider: "Storj", endpoint: "https://gateway.storjshare.io", region: "" } },
{
name: "Wasabi", options: { provider: "Wasabi", endpoint: "https://s3.{region}.wasabisys.com", region: "" },
regions: {
"us-east-1": "N. Virginia", "us-east-2": "N. Virginia", "us-central-1": "Texas", "us-west-1": "Oregon",
"ca-central-1": "Toronto", "eu-central-1": "Amsterdam", "eu-central-2": "Frankfurt", "eu-west-1": "London",
"eu-west-2": "Paris", "eu-south-1": "Milan", "ap-northeast-1": "Tokyo", "ap-northeast-2": "Osaka",
"ap-southeast-1": "Singapore", "ap-southeast-2": "Sydney",
},
},
{
name: "Hetzner", options: { provider: "Hetzner", endpoint: "https://{region}.your-objectstorage.com", region: "{region}" },
regions: { fsn1: "Falkenstein", nbg1: "Nuremberg", hel1: "Helsinki" },
},
{
name: "Scaleway", options: { provider: "Scaleway", endpoint: "https://s3.{region}.scw.cloud", region: "{region}" },
regions: { "nl-ams": "Amsterdam", "fr-par": "Paris", "pl-waw": "Warsaw" },
},
{
name: "OVHcloud", options: { provider: "OVHcloud", endpoint: "https://s3.{region}.io.cloud.ovh.net", region: "{region}" },
regions: {
gra: "Gravelines", rbx: "Roubaix", sbg: "Strasbourg", "eu-west-par": "Paris", de: "Frankfurt", uk: "London",
waw: "Warsaw", bhs: "Beauharnois", "ca-east-tor": "Toronto", sgp: "Singapore", "ap-southeast-syd": "Sydney",
"ap-south-mum": "Mumbai",
},
},
{
name: "DigitalOcean Spaces",
options: { provider: "DigitalOcean", endpoint: "https://{region}.digitaloceanspaces.com", region: "" },
regions: {
nyc3: "New York", sfo2: "San Francisco", sfo3: "San Francisco", tor1: "Toronto", ams3: "Amsterdam",
fra1: "Frankfurt", lon1: "London", blr1: "Bangalore", sgp1: "Singapore", syd1: "Sydney",
},
},
]
export const secret_fields = (service: string) => backends[service].fields.filter(f => f.secret)
export type RemoteSync = {
id: string
direction: string
sync: boolean
directory: string
// From the home directory, when the sync started
directory_path: string
remote: string
// What a restart uses. The options never have the credentials
type: string
path: string
options: { [name: string]: string }
remember: boolean
status: string
error: string
started: string
// rclone's core/stats object
stats: {
bytes: number
totalBytes: number
speed: number
eta: number | null
transfers: number
totalTransfers: number
checks: number
totalChecks: number
} | null
}
// The service of a sync, Nova and pixeldrain both use rclone's pixeldrain
// backend. Empty for a type which isn't in backends
export const service_of = (t: RemoteSync) => {
const service = t.type === "pixeldrain" && t.options.api_url === nova_api ? "nova" : t.type
return backends[service] === undefined ? "" : service
}
// The form outlives the page, so an attempt which failed can be tried again
// without typing everything again. It's only kept in memory, so a reload clears
// the passwords in it
export const form = $state({
step: 1,
// The sync which is edited, empty for a new one
editing: "",
// The edited sync has its credentials saved on the server
saved_secrets: false,
direction: "import",
dir: null as { id: string, path: string } | null,
backend: "s3",
// The options of one service mean nothing to another
options: Object.fromEntries(Object.keys(backends).map(k => [k, {}])) as
{ [backend: string]: { [name: string]: string | boolean } },
advanced: false,
paths: Object.fromEntries(Object.keys(backends).map(k => [k, ""])) as { [backend: string]: string },
sync: false,
remember: false,
})
// edit_remote_sync loads a sync into the form. Its credentials stay empty, the
// server never sends them, and leaving them empty keeps the saved ones
export const edit_remote_sync = (t: RemoteSync) => {
const service = service_of(t)
form.step = 1
form.editing = t.id
form.saved_secrets = t.remember
form.direction = t.direction
form.sync = t.sync
form.dir = { id: t.directory, path: t.directory_path }
form.backend = service
form.options[service] = { ...t.options }
form.paths[service] = t.path
form.remember = t.remember
form.advanced = (backends[service].path_advanced && t.path !== "") || backends[service].fields.some(f =>
f.advanced && t.options[f.name] !== undefined && t.options[f.name] !== f.default
)
}
+3 -5
View File
@@ -1,6 +1,4 @@
<script lang="ts">
import { stopPropagation } from 'svelte/legacy';
export const toggle = () => {
expanded = !expanded
}
@@ -62,11 +60,11 @@ let {
{@render header?.()}
</div>
<button class="bucket_expand" onclick={stopPropagation(toggle)}>
<button class="bucket_expand" onclick={e => {e.stopPropagation(); toggle()}} title={expanded ? "Collapse" : "Expand"}>
{#if expanded}
<i class="icon">expand_less</i>
<i class="icon i_expand_less"></i>
{:else}
<i class="icon">expand_more</i>
<i class="icon i_expand_more"></i>
{/if}
</button>
</div>
+2 -2
View File
@@ -87,12 +87,12 @@ const keydown = (e: KeyboardEvent) => {
<div class="header">
{#if header}{@render header()}{:else}
{#if form !== ""}
<Button round click={hide} icon="close"/>
<Button round click={hide} icon="close" title="Close"/>
<span class="title">{title}</span>
<Button round highlight type="submit" form={form} click={hide} icon="save" label="Save"/>
{:else}
<span class="title">{title}</span>
<Button round click={hide} icon="close" />
<Button round click={hide} icon="close" title="Close"/>
{/if}
{/if}
</div>
+3 -3
View File
@@ -67,7 +67,7 @@ onMount(() => {
{#snippet breadcrumbs()}
{current_page.title}
{#if current_subpage !== null}
<i class="icon">chevron_right</i>
<i class="icon i_chevron_right"></i>
{current_subpage.title}
{/if}
{/snippet}
@@ -81,7 +81,7 @@ onMount(() => {
href="{page.path}"
class:button_highlight={current_page && page.path === current_page.path}
>
<i class="icon">{page.icon}</i>
<i class="icon i_{page.icon}"></i>
<span>{page.title}</span>
</a>
{/if}
@@ -100,7 +100,7 @@ onMount(() => {
href="{page.path}"
class:button_highlight={current_subpage && page.path === current_subpage.path}
>
<i class="icon">{page.icon}</i>
<i class="icon i_{page.icon}"></i>
<span>{page.title}</span>
</a>
{/if}
+22 -16
View File
@@ -186,7 +186,7 @@ const set_offset = (off: number) => {
<nav class="nav bubble" bind:this={nav}>
{#if document.documentElement.clientWidth < min_screen_size_menu_open}
<button class="button" onclick={toggle_menu}>
<i class="icon">menu</i>
<i class="icon i_menu"></i>
Menu
</button>
{/if}
@@ -225,7 +225,10 @@ const set_offset = (off: number) => {
{formatDataVolume($user.subscription.storage_limit, 3)}
</div>
<div style="grid-column: span 2">
<ProgressBar used={$user.storage_space_used} total={$user.subscription.storage_limit} warn/>
<ProgressBar
used={$user.storage_space_used}
total={$user.subscription.storage_limit}
warn={!$user.usage_based_billing}/>
</div>
<div>Transfer</div>
<div>
@@ -233,37 +236,40 @@ const set_offset = (off: number) => {
{formatDataVolume($user.subscription.monthly_transfer_cap, 3)}
</div>
<div style="grid-column: span 2">
<ProgressBar used={$user.monthly_transfer_used} total={$user.subscription.monthly_transfer_cap} warn/>
<ProgressBar
used={$user.monthly_transfer_used}
total={$user.subscription.monthly_transfer_cap}
warn={!$user.usage_based_billing}/>
</div>
</div>
{/snippet}
</MenuEntry>
<a class="button" href="/user" use:highlight_current_page>
<i class="icon">person</i>
<i class="icon i_person"></i>
<span>Account</span>
</a>
<a class="button" href="/d/me" use:highlight_current_page>
<i class="icon">folder</i>
<i class="icon i_folder"></i>
<span>Filesystem</span>
</a>
<a class="button" href="/d/me/.Trash" use:highlight_current_page>
<i class="icon">delete</i>
<i class="icon i_delete"></i>
<span>Trash</span>
</a>
{#if $user.is_admin}
<a class="button" href="/admin" use:highlight_current_page>
<i class="icon">admin_panel_settings</i>
<i class="icon i_admin_panel_settings"></i>
<span>Admin Panel</span>
</a>
{/if}
{:else}
<a class="button" href="/login" use:highlight_current_page>
<i class="icon">login</i>
<i class="icon i_login"></i>
<span>Login</span>
</a>
<a class="button" href="/register" use:highlight_current_page>
<i class="icon">how_to_reg</i>
<i class="icon i_how_to_reg"></i>
<span>Register</span>
</a>
{/if}
@@ -275,14 +281,14 @@ const set_offset = (off: number) => {
</span>
{/snippet}
{#snippet body()}
<a class="button" href="/speedtest" use:highlight_current_page>
<i class="icon">speed</i>
<span>Speedtest</span>
</a>
<a class="button" href="https://docs.nova.storage" use:highlight_current_page>
<i class="icon">text_snippet</i>
<i class="icon i_text_snippet"></i>
<span>Documentation</span>
</a>
<a class="button" href="/speedtest" use:highlight_current_page>
<i class="icon i_speed"></i>
<span>Speedtest</span>
</a>
{/snippet}
</MenuEntry>
@@ -295,8 +301,8 @@ const set_offset = (off: number) => {
<div class="page">
<div class="header bubble">
<div class="breadcrumbs">
<button class="menu_button" onclick={toggle_menu}>
<i class="icon">menu</i>
<button class="menu_button" onclick={toggle_menu} title="Menu">
<i class="icon i_menu"></i>
</button>
{#if $breadcrumbs_store !== null}
+7 -6
View File
@@ -78,11 +78,11 @@ const drop = (e: DragEvent, drop_idx: number) => {
<MenuEntry id="bookmarks">
{#snippet title()}
<div class="title">Bookmarks</div>
<button onclick={toggle_edit} class:button_highlight={editing} class="button flat">
<button onclick={toggle_edit} class:button_highlight={editing} class="button flat" title={editing ? "Save" : "Edit"}>
{#if editing}
<i class="icon">save</i>
<i class="icon i_save"></i>
{:else}
<i class="icon">edit</i>
<i class="icon i_edit"></i>
{/if}
</button>
{/snippet}
@@ -107,12 +107,13 @@ const drop = (e: DragEvent, drop_idx: number) => {
style="cursor: grab;"
onmousedown={enable_drag}
onmouseup={disable_drag}
title="Drag to reorder"
>
<i class="icon">drag_indicator</i>
<i class="icon i_drag_indicator"></i>
</button>
<input type="text" bind:value={bookmark.label}/>
<button onclick={() => delete_bookmark(bookmark.id)}>
<i class="icon">delete</i>
<button onclick={() => delete_bookmark(bookmark.id)} title="Remove">
<i class="icon i_delete"></i>
</button>
{:else}
<a class="button" href="/d{fs_encode_path(bookmark.path)}" use:highlight_current_page>
+9 -1
View File
@@ -46,7 +46,15 @@ const toggle = (e: MouseEvent) => {
</script>
<div class="title" class:no_border>
<ToggleButton bind:on={expanded} action={toggle} icon_on="arrow_drop_down" icon_off="arrow_right" highlight={false} flat/>
<ToggleButton
bind:on={expanded}
action={toggle}
icon_on="arrow_drop_down"
icon_off="arrow_right"
highlight={false}
flat
title={expanded ? "Collapse" : "Expand"}
/>
{#if !collapsed}
{@render title()}
+3 -3
View File
@@ -32,7 +32,7 @@ onMount(() => {
{#snippet title()}
<div class="title">Parent directories</div>
<button title="Navigate up" onclick={() => global_navigator.navigate_up()} class="button flat">
<i class="icon">north</i>
<i class="icon i_north"></i>
</button>
{/snippet}
@@ -54,10 +54,10 @@ onMount(() => {
{#snippet title()}
<div class="title">Siblings</div>
<button title="Open previous sibling" onclick={() => global_navigator.open_sibling(-1)} class="button flat">
<i class="icon">west</i>
<i class="icon i_west"></i>
</button>
<button title="Open next sibling" onclick={() => global_navigator.open_sibling(1)} class="button flat">
<i class="icon">east</i>
<i class="icon i_east"></i>
</button>
{/snippet}