Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ca5342d7fa | ||
|
|
ee06b91b92 | ||
|
|
b423446412 | ||
|
|
5788f5a8b4 | ||
|
|
672a19f8f6 | ||
|
|
1956790dde | ||
|
|
ebb72c7f24 | ||
|
|
5b32f3dca7 | ||
|
|
9f8a985c63 | ||
|
|
8a41307700 | ||
|
|
e3e8a1db1a | ||
|
|
a50ac7310f | ||
|
|
1f7238841a | ||
|
|
f3738cbc4d | ||
|
|
6f0f58d2d9 | ||
|
|
93d5583940 | ||
|
|
a513e731c4 | ||
|
|
d5772c24e5 | ||
|
|
09fa193e9a | ||
|
|
f5b9f543c6 | ||
|
|
9a7ed0a347 | ||
|
|
41c0481380 | ||
|
|
abe6ea9ff4 | ||
|
|
e37702d1aa | ||
|
|
58db683fc8 |
No files matched your search
@@ -1,11 +1,13 @@
|
||||
module fornaxian.tech/nova_web
|
||||
|
||||
go 1.26
|
||||
go 1.27
|
||||
|
||||
replace (
|
||||
fornaxian.tech/nova_server => ../nova_server
|
||||
fornaxian.tech/pixeldrain_api_client => ../pixeldrain_api_client
|
||||
fornaxian.tech/util => ../util
|
||||
// nova_server's fork. Its replaces don't apply here, and we import its api
|
||||
github.com/scylladb/gocqlx/v3 => ../gocqlx
|
||||
)
|
||||
|
||||
require (
|
||||
@@ -14,17 +16,85 @@ require (
|
||||
fornaxian.tech/pixeldrain_api_client v0.0.0-20260701091325-dc9629676a79
|
||||
fornaxian.tech/util v0.0.0-20260123171803-02d15be63d16
|
||||
github.com/julienschmidt/httprouter v1.3.0
|
||||
github.com/russross/blackfriday/v2 v2.1.0
|
||||
)
|
||||
|
||||
require (
|
||||
codeberg.org/go-pdf/fpdf v0.12.0 // indirect
|
||||
github.com/Fornaxian/unifilter v0.0.0-20200428082710-29e3cf43485c // indirect
|
||||
github.com/akamensky/base58 v0.0.0-20210829145138-ce8bf8802e8f // indirect
|
||||
github.com/andybalholm/brotli v1.2.2 // indirect
|
||||
github.com/aymerick/douceur v0.2.0 // indirect
|
||||
github.com/biter777/countries v1.7.5 // indirect
|
||||
github.com/bodgit/plumbing v1.3.0 // indirect
|
||||
github.com/bodgit/sevenzip v1.6.5 // indirect
|
||||
github.com/bodgit/windows v1.0.1 // indirect
|
||||
github.com/boombuler/barcode v1.1.0 // indirect
|
||||
github.com/cention-sany/utf7 v0.0.0-20170124080048-26cad61bd60a // indirect
|
||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||
github.com/clipperhouse/displaywidth v0.11.0 // indirect
|
||||
github.com/clipperhouse/uax29/v2 v2.7.0 // indirect
|
||||
github.com/disintegration/imaging v1.6.2 // indirect
|
||||
github.com/emersion/go-imap/v2 v2.0.0-beta.8 // indirect
|
||||
github.com/emersion/go-message v0.18.2 // indirect
|
||||
github.com/emersion/go-sasl v0.0.0-20241020182733-b788ff22d5a6 // indirect
|
||||
github.com/fatih/color v1.19.0 // indirect
|
||||
github.com/fatih/pool v3.0.0+incompatible // indirect
|
||||
github.com/fclairamb/ftpserverlib v0.32.1 // indirect
|
||||
github.com/fxamacker/cbor/v2 v2.9.2 // indirect
|
||||
github.com/gabriel-vasile/mimetype v1.4.15 // indirect
|
||||
github.com/go-chi/httprate v0.16.0 // indirect
|
||||
github.com/goccy/go-json v0.10.6 // indirect
|
||||
github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f // indirect
|
||||
github.com/gorilla/css v1.0.1 // indirect
|
||||
github.com/gorilla/websocket v1.5.3 // indirect
|
||||
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
|
||||
github.com/inbucket/html2text v1.0.0 // indirect
|
||||
github.com/j-muller/go-torrent-parser v0.0.0-20211014072822-db02b4099054 // indirect
|
||||
github.com/jhillyerd/enmime/v2 v2.4.1 // indirect
|
||||
github.com/klauspost/compress v1.19.1 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.4.0 // indirect
|
||||
github.com/klauspost/reedsolomon v1.14.1 // indirect
|
||||
github.com/kr/fs v0.1.0 // indirect
|
||||
github.com/libp2p/go-reuseport v0.4.0 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.27 // indirect
|
||||
github.com/microcosm-cc/bluemonday v1.0.27 // indirect
|
||||
github.com/minio/sha256-simd v1.0.1 // indirect
|
||||
github.com/olekukonko/cat v0.0.0-20250911104152-50322a0618f6 // indirect
|
||||
github.com/olekukonko/errors v1.3.0 // indirect
|
||||
github.com/olekukonko/ll v0.1.8 // indirect
|
||||
github.com/olekukonko/tablewriter v1.1.4 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/pkg/sftp v1.13.11 // indirect
|
||||
github.com/pquerna/otp v1.5.0 // indirect
|
||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||
github.com/scylladb/go-reflectx v1.0.1 // indirect
|
||||
github.com/scylladb/gocqlx/v3 v3.0.4 // indirect
|
||||
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e // indirect
|
||||
github.com/spf13/afero v1.15.0 // indirect
|
||||
github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf // indirect
|
||||
github.com/stangelandcl/ppmd v0.1.1 // indirect
|
||||
github.com/ulikunitz/xz v0.5.16 // indirect
|
||||
github.com/x448/float16 v0.8.4 // indirect
|
||||
github.com/zeebo/bencode v1.0.0 // indirect
|
||||
github.com/zeebo/xxh3 v1.1.0 // indirect
|
||||
go4.org v0.0.0-20260112195520-a5071408f32f // indirect
|
||||
golang.org/x/exp v0.0.0-20260727155853-b88d891fe743 // indirect
|
||||
golang.org/x/image v0.44.0 // indirect
|
||||
golang.org/x/net v0.57.0 // indirect
|
||||
golang.org/x/sync v0.22.0 // indirect
|
||||
golang.org/x/sys v0.47.0 // indirect
|
||||
golang.org/x/text v0.40.0 // indirect
|
||||
lukechampine.com/frand v1.5.1 // indirect
|
||||
)
|
||||
|
||||
require (
|
||||
fornaxian.tech/nova_server v0.0.0-00010101000000-000000000000
|
||||
github.com/BurntSushi/toml v1.6.0 // indirect
|
||||
github.com/apache/cassandra-gocql-driver/v2 v2.1.2 // indirect
|
||||
github.com/golang/snappy v1.0.0 // indirect
|
||||
github.com/mattn/go-colorable v0.1.15 // indirect
|
||||
github.com/mattn/go-isatty v0.0.24 // indirect
|
||||
github.com/pierrec/lz4/v4 v4.1.27 // indirect
|
||||
github.com/stretchr/testify v1.11.1 // indirect
|
||||
go.uber.org/multierr v1.11.0 // indirect
|
||||
golang.org/x/crypto v0.54.0 // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
|
||||
@@ -1,40 +1,223 @@
|
||||
codeberg.org/go-pdf/fpdf v0.12.0 h1:g8E/1VqGqB2lZUUaqQrrTnA0IEJLPTTX1DZ0qS/ZmhU=
|
||||
codeberg.org/go-pdf/fpdf v0.12.0/go.mod h1:WJNJ2bvCj81rZBdhOf7lKOGoSl+OKMXcIcXqDcP8r5Y=
|
||||
fornaxian.tech/config v0.0.0-20211108212237-6133aed90586 h1:/4a0Iq3cYeyTWcPHsN9pVAGJH3UTq1GapK253lHfXnE=
|
||||
fornaxian.tech/config v0.0.0-20211108212237-6133aed90586/go.mod h1:ULIXF4J1DbBw4EsIPRNQDf6J3hl4P/jlihjy6UCm9FM=
|
||||
fornaxian.tech/log v0.0.0-20211102185326-552e9b1f8640 h1:UPDxJwLRCfh/cv80UMSanzmZ0jIcfS1mcd0Y06HYuLw=
|
||||
fornaxian.tech/log v0.0.0-20211102185326-552e9b1f8640/go.mod h1:sN82qMToeHhP2u3ehvrcE8y1IudRZJAZO9yG5OBYblo=
|
||||
github.com/BurntSushi/toml v1.6.0 h1:dRaEfpa2VI55EwlIW72hMRHdWouJeRF7TPYhI+AUQjk=
|
||||
github.com/BurntSushi/toml v1.6.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
|
||||
github.com/Fornaxian/unifilter v0.0.0-20200428082710-29e3cf43485c h1:ule8gPLT5sJCcIqUpa0MJqOSNHJ/WRpOM0bsFktNHXU=
|
||||
github.com/Fornaxian/unifilter v0.0.0-20200428082710-29e3cf43485c/go.mod h1:ofV5syadd2nI4gOc/rP1yPnXkARgm+E1D/U38mbUj44=
|
||||
github.com/akamensky/base58 v0.0.0-20210829145138-ce8bf8802e8f h1:z8MkSJCUyTmW5YQlxsMLBlwA7GmjxC7L4ooicxqnhz8=
|
||||
github.com/akamensky/base58 v0.0.0-20210829145138-ce8bf8802e8f/go.mod h1:UdUwYgAXBiL+kLfcqxoQJYkHA/vl937/PbFhZM34aZs=
|
||||
github.com/andybalholm/brotli v1.2.2 h1:HzTuoo2ErYQqf5qvcJInB8uvqSVxRttzkFexPWtnceM=
|
||||
github.com/andybalholm/brotli v1.2.2/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUSvPlQ1pLaKY=
|
||||
github.com/apache/cassandra-gocql-driver/v2 v2.1.2 h1:lu/p0Db2av18enHJvWJQoChLssI0P+AR06STq4VdvCc=
|
||||
github.com/apache/cassandra-gocql-driver/v2 v2.1.2/go.mod h1:QH/asJjB3mHvY6Dot6ZKMMpTcOrWJ8i9GhsvG1g0PK4=
|
||||
github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk=
|
||||
github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4=
|
||||
github.com/biter777/countries v1.7.5 h1:MJ+n3+rSxWQdqVJU8eBy9RqcdH6ePPn4PJHocVWUa+Q=
|
||||
github.com/biter777/countries v1.7.5/go.mod h1:1HSpZ526mYqKJcpT5Ti1kcGQ0L0SrXWIaptUWjFfv2E=
|
||||
github.com/bodgit/plumbing v1.3.0 h1:pf9Itz1JOQgn7vEOE7v7nlEfBykYqvUYioC61TwWCFU=
|
||||
github.com/bodgit/plumbing v1.3.0/go.mod h1:JOTb4XiRu5xfnmdnDJo6GmSbSbtSyufrsyZFByMtKEs=
|
||||
github.com/bodgit/sevenzip v1.6.5 h1:7H7BxgmeX0j6UX42lH+KXQ92WgMQJ49DoocFdfHbCng=
|
||||
github.com/bodgit/sevenzip v1.6.5/go.mod h1:GhuB6Lq1xCpP1sps+horjZ8lgiKPJcy2zUX3prla9wc=
|
||||
github.com/bodgit/windows v1.0.1 h1:tF7K6KOluPYygXa3Z2594zxlkbKPAOvqr97etrGNIz4=
|
||||
github.com/bodgit/windows v1.0.1/go.mod h1:a6JLwrB4KrTR5hBpp8FI9/9W9jJfeQ2h4XDXU74ZCdM=
|
||||
github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
|
||||
github.com/boombuler/barcode v1.1.0 h1:ChaYjBR63fr4LFyGn8E8nt7dBSt3MiU3zMOZqFvVkHo=
|
||||
github.com/boombuler/barcode v1.1.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
|
||||
github.com/cention-sany/utf7 v0.0.0-20170124080048-26cad61bd60a h1:MISbI8sU/PSK/ztvmWKFcI7UGb5/HQT7B+i3a2myKgI=
|
||||
github.com/cention-sany/utf7 v0.0.0-20170124080048-26cad61bd60a/go.mod h1:2GxOXOlEPAMFPfp014mK1SWq8G8BN8o7/dfYqJrVGn8=
|
||||
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
|
||||
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/clipperhouse/displaywidth v0.11.0 h1:lBc6kY44VFw+TDx4I8opi/EtL9m20WSEFgwIwO+UVM8=
|
||||
github.com/clipperhouse/displaywidth v0.11.0/go.mod h1:bkrFNkf81G8HyVqmKGxsPufD3JhNl3dSqnGhOoSD/o0=
|
||||
github.com/clipperhouse/uax29/v2 v2.7.0 h1:+gs4oBZ2gPfVrKPthwbMzWZDaAFPGYK72F0NJv2v7Vk=
|
||||
github.com/clipperhouse/uax29/v2 v2.7.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJSwu5BF98AuoVM=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/disintegration/imaging v1.6.2 h1:w1LecBlG2Lnp8B3jk5zSuNqd7b4DXhcjwek1ei82L+c=
|
||||
github.com/disintegration/imaging v1.6.2/go.mod h1:44/5580QXChDfwIclfc/PCwrr44amcmDAg8hxG0Ewe4=
|
||||
github.com/emersion/go-imap/v2 v2.0.0-beta.8 h1:5IXZK1E33DyeP526320J3RS7eFlCYGFgtbrfapqDPug=
|
||||
github.com/emersion/go-imap/v2 v2.0.0-beta.8/go.mod h1:dhoFe2Q0PwLrMD7oZw8ODuaD0vLYPe5uj2wcOMnvh48=
|
||||
github.com/emersion/go-message v0.18.2 h1:rl55SQdjd9oJcIoQNhubD2Acs1E6IzlZISRTK7x/Lpg=
|
||||
github.com/emersion/go-message v0.18.2/go.mod h1:XpJyL70LwRvq2a8rVbHXikPgKj8+aI0kGdHlg16ibYA=
|
||||
github.com/emersion/go-sasl v0.0.0-20241020182733-b788ff22d5a6 h1:oP4q0fw+fOSWn3DfFi4EXdT+B+gTtzx8GC9xsc26Znk=
|
||||
github.com/emersion/go-sasl v0.0.0-20241020182733-b788ff22d5a6/go.mod h1:iL2twTeMvZnrg54ZoPDNfJaJaqy0xIQFuBdrLsmspwQ=
|
||||
github.com/fatih/color v1.19.0 h1:Zp3PiM21/9Ld6FzSKyL5c/BULoe/ONr9KlbYVOfG8+w=
|
||||
github.com/fatih/color v1.19.0/go.mod h1:zNk67I0ZUT1bEGsSGyCZYZNrHuTkJJB+r6Q9VuMi0LE=
|
||||
github.com/fatih/pool v3.0.0+incompatible h1:3xXzI/t5o6aEU/R+xe7ed44CTw41lV3oB0gB5pNXS5U=
|
||||
github.com/fatih/pool v3.0.0+incompatible/go.mod h1:v+kkrv3f2oJ1P9NHaKArMYdTVtNCwfR0DlXwnhA2L4k=
|
||||
github.com/fclairamb/ftpserverlib v0.32.1 h1:JoBxoiu2sifjVbIAfkCQn7Oi3mFbX/PHRO+4PGOROj4=
|
||||
github.com/fclairamb/ftpserverlib v0.32.1/go.mod h1:RJZgAyW8uSb/BtDwD2Wf2wUGUxLaQdmB6VXU7XGp8Oc=
|
||||
github.com/fxamacker/cbor/v2 v2.9.2 h1:X4Ksno9+x3cz0TZv69ec1hxP/+tymuR8PXQJyDwfh78=
|
||||
github.com/fxamacker/cbor/v2 v2.9.2/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ=
|
||||
github.com/gabriel-vasile/mimetype v1.4.15 h1:05iP/CYtZ/w455R/KZM6rZ5ieAdh99UPtd+d3YzLmaI=
|
||||
github.com/gabriel-vasile/mimetype v1.4.15/go.mod h1:azpTcoLcDZRNgFou5j+APrqQx9HqVPWa6ijYQIIVswQ=
|
||||
github.com/go-chi/httprate v0.16.0 h1:8V5DH9j6pSK6UQoBsTpvMyFxycqaKEIToyPKzHJjUa8=
|
||||
github.com/go-chi/httprate v0.16.0/go.mod h1:A8lo+qRhk+s9LiuP5saS7XCGDXRXMcrueq0NfIuCa/I=
|
||||
github.com/go-test/deep v1.1.1 h1:0r/53hagsehfO4bzD2Pgr/+RgHqhmf+k1Bpse2cTu1U=
|
||||
github.com/go-test/deep v1.1.1/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE=
|
||||
github.com/goccy/go-json v0.10.6 h1:p8HrPJzOakx/mn/bQtjgNjdTcN+/S6FcG2CTtQOrHVU=
|
||||
github.com/goccy/go-json v0.10.6/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
|
||||
github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f h1:3BSP1Tbs2djlpprl7wCLuiqMaUh5SJkkzI2gDs+FgLs=
|
||||
github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f/go.mod h1:Pcatq5tYkCW2Q6yrR2VRHlbHpZ/R4/7qyL1TCF7vl14=
|
||||
github.com/golang/snappy v1.0.0 h1:Oy607GVXHs7RtbggtPBnr2RmDArIsAefDwvrdWvRhGs=
|
||||
github.com/golang/snappy v1.0.0/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/gorilla/css v1.0.1 h1:ntNaBIghp6JmvWnxbZKANoLyuXTPZ4cAMlo6RyhlbO8=
|
||||
github.com/gorilla/css v1.0.1/go.mod h1:BvnYkspnSzMmwRK+b8/xgNPLiIuNZr6vbZBTPQ2A3b0=
|
||||
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
|
||||
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
|
||||
github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
|
||||
github.com/inbucket/html2text v1.0.0 h1:N5kza++4uBBDJ2Z3KUnTRyPNoBcW+YfOgNiNmNB+sgs=
|
||||
github.com/inbucket/html2text v1.0.0/go.mod h1:5TrhXQKGU+LXurODaSm55Y9eXoPBRnYiOz4x2XfUoJU=
|
||||
github.com/j-muller/go-torrent-parser v0.0.0-20211014072822-db02b4099054 h1:74rPb7GmzJVJkSQ1Tpd7Y8iCnNveIjnpgyos4Yu4Gzs=
|
||||
github.com/j-muller/go-torrent-parser v0.0.0-20211014072822-db02b4099054/go.mod h1:mMeMpHRplLTgo3ttLVB8R43jtdEKcDpLVw2CvcwTv28=
|
||||
github.com/jhillyerd/enmime/v2 v2.4.1 h1:VkBX8GJJ/wbQofWsKP3egRqgXcwmxlY94YUmXTj08kE=
|
||||
github.com/jhillyerd/enmime/v2 v2.4.1/go.mod h1:TLpvqImPiumRecsJK5TYseRw2bPg3g0EtWc+SfU7cMs=
|
||||
github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U=
|
||||
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
|
||||
github.com/klauspost/compress v1.19.1 h1:VsB4HPswih7mmZ8WleSFQ75c/Ui1M4trX5oAsJnhSlk=
|
||||
github.com/klauspost/compress v1.19.1/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ=
|
||||
github.com/klauspost/cpuid/v2 v2.4.0 h1:S6Hrbc7+ywsr0r+RLapfGBHfyefhCTwEh3A0tV913Dw=
|
||||
github.com/klauspost/cpuid/v2 v2.4.0/go.mod h1:19jmZ9mjzoF//ddRSUsv0zfBTJWh3QJh9FNxZTMrGxU=
|
||||
github.com/klauspost/reedsolomon v1.14.1 h1:swE9kzyWXD/wVG+l5Pe8bWnQ0giIY7D1GjCBKk3kG2U=
|
||||
github.com/klauspost/reedsolomon v1.14.1/go.mod h1:yjqqjgMTQkBUHSG97/rm4zipffCNbCiZcB3kTqr++sQ=
|
||||
github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8=
|
||||
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
|
||||
github.com/libp2p/go-reuseport v0.4.0 h1:nR5KU7hD0WxXCJbmw7r2rhRYruNRl2koHw8fQscQm2s=
|
||||
github.com/libp2p/go-reuseport v0.4.0/go.mod h1:ZtI03j/wO5hZVDFo2jKywN6bYKWLOy8Se6DrI2E1cLU=
|
||||
github.com/mattn/go-colorable v0.1.15 h1:+u9SLTRGnXv73cEsnsmoZBom+dMU88B2M0aDcWy0/jY=
|
||||
github.com/mattn/go-colorable v0.1.15/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
|
||||
github.com/mattn/go-isatty v0.0.24 h1:tGZZoVgT/KiqK1c8ocVLeDS8BSWMRd47J3Lbz7vsReI=
|
||||
github.com/mattn/go-isatty v0.0.24/go.mod h1:nMCL3Zebbrt45jsMDgnfIwz6ydEQApk5oEI3HqDio6A=
|
||||
github.com/mattn/go-runewidth v0.0.27 h1:Feg/Oou5zI/wnpgDF6omIU0OokC9GxLC/WRknhVlIR0=
|
||||
github.com/mattn/go-runewidth v0.0.27/go.mod h1:3qAiGCV4Koz/yuveO58qUefmUTRm8r0IGEXZ9jeHp/8=
|
||||
github.com/microcosm-cc/bluemonday v1.0.27 h1:MpEUotklkwCSLeH+Qdx1VJgNqLlpY2KXwXFM08ygZfk=
|
||||
github.com/microcosm-cc/bluemonday v1.0.27/go.mod h1:jFi9vgW+H7c3V0lb6nR74Ib/DIB5OBs92Dimizgw2cA=
|
||||
github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM=
|
||||
github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8=
|
||||
github.com/olekukonko/cat v0.0.0-20250911104152-50322a0618f6 h1:zrbMGy9YXpIeTnGj4EljqMiZsIcE09mmF8XsD5AYOJc=
|
||||
github.com/olekukonko/cat v0.0.0-20250911104152-50322a0618f6/go.mod h1:rEKTHC9roVVicUIfZK7DYrdIoM0EOr8mK1Hj5s3JjH0=
|
||||
github.com/olekukonko/errors v1.3.0 h1:teJvgLGUEqMzBUms+Dj3/3szNqCG/Jdw9iDbum8fR6U=
|
||||
github.com/olekukonko/errors v1.3.0/go.mod h1:ppzxA5jBKcO1vIpCXQ9ZqgDh8iwODz6OXIGKU8r5m4Y=
|
||||
github.com/olekukonko/ll v0.1.8 h1:ysHCJRGHYKzmBSdz9w5AySztx7lG8SQY+naTGYUbsz8=
|
||||
github.com/olekukonko/ll v0.1.8/go.mod h1:RPRC6UcscfFZgjo1nulkfMH5IM0QAYim0LfnMvUuozw=
|
||||
github.com/olekukonko/tablewriter v1.1.4 h1:ORUMI3dXbMnRlRggJX3+q7OzQFDdvgbN9nVWj1drm6I=
|
||||
github.com/olekukonko/tablewriter v1.1.4/go.mod h1:+kedxuyTtgoZLwif3P1Em4hARJs+mVnzKxmsCL/C5RY=
|
||||
github.com/pierrec/lz4/v4 v4.1.27 h1:+PhzhWDrjRj89TH2sw43nE3+4+W8lSxIuQadEHZyjUk=
|
||||
github.com/pierrec/lz4/v4 v4.1.27/go.mod h1:EoQMVJgeeEOMsCqCzqFm2O0cJvljX2nGZjcRIPL34O4=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/sftp v1.13.11 h1:0N92SLTB8JqASJB14ZLHHzFnBV8mG9zw4K7jghEFWuE=
|
||||
github.com/pkg/sftp v1.13.11/go.mod h1:uNkH9roSXglNJqM+glJJi+TQXQUm0fXFWqCFmT8hsN0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/pquerna/otp v1.5.0 h1:NMMR+WrmaqXU4EzdGJEE1aUUI0AMRzsp96fFFWNPwxs=
|
||||
github.com/pquerna/otp v1.5.0/go.mod h1:dkJfzwRKNiegxyNb54X/3fLwhCynbMspSyWKnvi1AEg=
|
||||
github.com/rs/zerolog v1.34.0 h1:k43nTLIwcTVQAncfCw4KZ2VY6ukYoZaBPNOE8txlOeY=
|
||||
github.com/rs/zerolog v1.34.0/go.mod h1:bJsvje4Z08ROH4Nhs5iH600c3IkWhwp44iRc54W6wYQ=
|
||||
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
|
||||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||
github.com/scylladb/go-reflectx v1.0.1 h1:b917wZM7189pZdlND9PbIJ6NQxfDPfBvUaQ7cjj1iZQ=
|
||||
github.com/scylladb/go-reflectx v1.0.1/go.mod h1:rWnOfDIRWBGN0miMLIcoPt/Dhi2doCMZqwMCJ3KupFc=
|
||||
github.com/secsy/goftp v0.0.0-20200609142545-aa2de14babf4 h1:PT+ElG/UUFMfqy5HrxJxNzj3QBOf7dZwupeVC+mG1Lo=
|
||||
github.com/secsy/goftp v0.0.0-20200609142545-aa2de14babf4/go.mod h1:MnkX001NG75g3p8bhFycnyIjeQoOjGL6CEIsdE/nKSY=
|
||||
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e h1:MRM5ITcdelLK2j1vwZ3Je0FKVCfqOLp5zO6trqMLYs0=
|
||||
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e/go.mod h1:XV66xRDqSt+GTGFMVlhk3ULuV0y9ZmzeVGR4mloJI3M=
|
||||
github.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I=
|
||||
github.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg=
|
||||
github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf h1:pvbZ0lM0XWPBqUKqFU8cmavspvIl9nulOYwdy6IFRRo=
|
||||
github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf/go.mod h1:RJID2RhlZKId02nZ62WenDCkgHFerpIOmW0iT7GKmXM=
|
||||
github.com/stangelandcl/ppmd v0.1.1 h1:c25QazhlWUn5nmR1QOzafKhQxBicAr7GGCKER2aJ8H8=
|
||||
github.com/stangelandcl/ppmd v0.1.1/go.mod h1:Rrv7M+/2P5jYr/GMLhBl7Ug3uJ1bUiVzr5LbbaV6xgY=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
|
||||
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
|
||||
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
|
||||
github.com/ulikunitz/xz v0.5.16 h1:ld6NyySjx5lowVKwJvMRLnW5nxKX/xnpSiFYZ/Lxur0=
|
||||
github.com/ulikunitz/xz v0.5.16/go.mod h1:H9Rt/W6/Qj27PGauhQc6nfCDy7vHpzsOThBSaYDoEhw=
|
||||
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
|
||||
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
|
||||
github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU=
|
||||
github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E=
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ=
|
||||
github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0=
|
||||
github.com/zeebo/bencode v1.0.0 h1:zgop0Wu1nu4IexAZeCZ5qbsjU4O1vMrfCrVgUjbHVuA=
|
||||
github.com/zeebo/bencode v1.0.0/go.mod h1:Ct7CkrWIQuLWAy9M3atFHYq4kG9Ao/SsY5cdtCXmp9Y=
|
||||
github.com/zeebo/xxh3 v1.1.0 h1:s7DLGDK45Dyfg7++yxI0khrfwq9661w9EN78eP/UZVs=
|
||||
github.com/zeebo/xxh3 v1.1.0/go.mod h1:IisAie1LELR4xhVinxWS5+zf1lA4p0MW4T+w+W07F5s=
|
||||
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
|
||||
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
|
||||
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
|
||||
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
|
||||
go4.org v0.0.0-20260112195520-a5071408f32f h1:ziUVAjmTPwQMBmYR1tbdRFJPtTcQUI12fH9QQjfb0Sw=
|
||||
go4.org v0.0.0-20260112195520-a5071408f32f/go.mod h1:ZRJnO5ZI4zAwMFp+dS1+V6J6MSyAowhRqAE+DPa1Xp0=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.54.0 h1:YLIA59K4fiNzHzjnZt2tUJQjQtUWfWbeHBqKtk3eScw=
|
||||
golang.org/x/crypto v0.54.0/go.mod h1:KWL8ny2AZdGR2cWmzeHrp2azQPGogOv+HeQaVEXC2dk=
|
||||
golang.org/x/exp v0.0.0-20260727155853-b88d891fe743 h1:ex206bKw+v3K0dm3andkrIF+ijyQKJG1pLgwQ2PYdQM=
|
||||
golang.org/x/exp v0.0.0-20260727155853-b88d891fe743/go.mod h1:EdfpwwqSu+0Li0mzskwHU6FWDV3t9Q+RZDo3QMUtL3Q=
|
||||
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/image v0.44.0 h1:+tDekMZED9+LrtB3G5xzRggpVh9CARjZqROla3R3R+I=
|
||||
golang.org/x/image v0.44.0/go.mod h1:V8K3KE9KKKE+pLpQDOeN18w9oacNSvy1tDOirTu4xtY=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.57.0 h1:K5+3DljvIuDG9/Jv9rvyMywYNFCQ9RSUY6OOTTkT+tE=
|
||||
golang.org/x/net v0.57.0/go.mod h1:KpXc8iv+r3XplLAG/f7Jsf9RPszJzdR0f58q9vGOuEU=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek=
|
||||
golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs=
|
||||
golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||
golang.org/x/term v0.45.0 h1:NwWyBmoJCbfTHpxrWoZ9C6/VxOf7ic219I8xZZFdrf0=
|
||||
golang.org/x/term v0.45.0/go.mod h1:9aqxs0blBcrm/n0L9QW0aRVD+ktan8ssZromtqJC43w=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/text v0.40.0 h1:Ub2Z6/xjgF1WrYQz2nuITOEegKFtiIy+rieRJ5lHZKs=
|
||||
golang.org/x/text v0.40.0/go.mod h1:hpnzDAfGV753zIKo+wk3u1bVKCGPbrnF7+7LBF/UHVY=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
|
||||
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
lukechampine.com/frand v1.5.1 h1:fg0eRtdmGFIxhP5zQJzM1lFDbD6CUfu/f+7WgAZd5/w=
|
||||
lukechampine.com/frand v1.5.1/go.mod h1:4VstaWc2plN4Mjr10chUD46RAVGWhpkZ5Nja8+Azp0Q=
|
||||
@@ -1,4 +0,0 @@
|
||||
<svg role="img" viewBox="0 0 24 24" width="24" height="24" xmlns="http://www.w3.org/2000/svg">
|
||||
<title>GitHub</title>
|
||||
<path fill="#ffffff" d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 866 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 216.4144 232.00976">
|
||||
<path fill="#ffffff" d="M211.80734 139.0875c-3.18125 16.36625-28.4925 34.2775-57.5625 37.74875-15.15875 1.80875-30.08375 3.47125-45.99875 2.74125-26.0275-1.1925-46.565-6.2125-46.565-6.2125 0 2.53375.15625 4.94625.46875 7.2025 3.38375 25.68625 25.47 27.225 46.39125 27.9425 21.11625.7225 39.91875-5.20625 39.91875-5.20625l.8675 19.09s-14.77 7.93125-41.08125 9.39c-14.50875.7975-32.52375-.365-53.50625-5.91875C9.23234 213.82 1.40609 165.31125.20859 116.09125c-.365-14.61375-.14-28.39375-.14-39.91875 0-50.33 32.97625-65.0825 32.97625-65.0825C49.67234 3.45375 78.20359.2425 107.86484 0h.72875c29.66125.2425 58.21125 3.45375 74.8375 11.09 0 0 32.975 14.7525 32.975 65.0825 0 0 .41375 37.13375-4.59875 62.915"/>
|
||||
<path fill="#000000" d="M177.50984 80.077v60.94125h-24.14375v-59.15c0-12.46875-5.24625-18.7975-15.74-18.7975-11.6025 0-17.4175 7.5075-17.4175 22.3525v32.37625H96.20734V85.42325c0-14.845-5.81625-22.3525-17.41875-22.3525-10.49375 0-15.74 6.32875-15.74 18.7975v59.15H38.90484V80.077c0-12.455 3.17125-22.3525 9.54125-29.675 6.56875-7.3225 15.17125-11.07625 25.85-11.07625 12.355 0 21.71125 4.74875 27.8975 14.2475l6.01375 10.08125 6.015-10.08125c6.185-9.49875 15.54125-14.2475 27.8975-14.2475 10.6775 0 19.28 3.75375 25.85 11.07625 6.36875 7.3225 9.54 17.22 9.54 29.675"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 4.7 KiB |
@@ -1,6 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 100 100">
|
||||
<g fill="#ffffff" fill-rule="evenodd">
|
||||
<path d="M64.1102,0.1004 C44.259,0.1004 28.1086,16.2486 28.1086,36.0986 C28.1086,55.8884 44.259,71.989 64.1102,71.989 C83.9,71.989 100,55.8884 100,36.0986 C100,16.2486 83.9,0.1004 64.1102,0.1004"/>
|
||||
<polygon points=".012 95.988 17.59 95.988 17.59 .1 .012 .1"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 409 B |
@@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="24" height="24" viewBox="0 0 24 24">
|
||||
<path fill="#ffffff" d="M22,12.14C22,10.92 21,9.96 19.81,9.96C19.22,9.96 18.68,10.19 18.29,10.57C16.79,9.5 14.72,8.79 12.43,8.7L13.43,4L16.7,4.71C16.73,5.53 17.41,6.19 18.25,6.19C19.11,6.19 19.81,5.5 19.81,4.63C19.81,3.77 19.11,3.08 18.25,3.08C17.65,3.08 17.11,3.43 16.86,3.95L13.22,3.18C13.11,3.16 13,3.18 12.93,3.24C12.84,3.29 12.79,3.38 12.77,3.5L11.66,8.72C9.33,8.79 7.23,9.5 5.71,10.58C5.32,10.21 4.78,10 4.19,10C2.97,10 2,10.96 2,12.16C2,13.06 2.54,13.81 3.29,14.15C3.25,14.37 3.24,14.58 3.24,14.81C3.24,18.18 7.16,20.93 12,20.93C16.84,20.93 20.76,18.2 20.76,14.81C20.76,14.6 20.75,14.37 20.71,14.15C21.46,13.81 22,13.04 22,12.14M7,13.7C7,12.84 7.68,12.14 8.54,12.14C9.4,12.14 10.1,12.84 10.1,13.7A1.56,1.56 0 0,1 8.54,15.26C7.68,15.28 7,14.56 7,13.7M15.71,17.84C14.63,18.92 12.59,19 12,19C11.39,19 9.35,18.9 8.29,17.84C8.13,17.68 8.13,17.43 8.29,17.27C8.45,17.11 8.7,17.11 8.86,17.27C9.54,17.95 11,18.18 12,18.18C13,18.18 14.47,17.95 15.14,17.27C15.3,17.11 15.55,17.11 15.71,17.27C15.85,17.43 15.85,17.68 15.71,17.84M15.42,15.28C14.56,15.28 13.86,14.58 13.86,13.72A1.56,1.56 0 0,1 15.42,12.16C16.28,12.16 17,12.86 17,13.72C17,14.56 16.28,15.28 15.42,15.28Z" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.2 KiB |
@@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="24" height="24" viewBox="0 0 24 24">
|
||||
<path fill="#ffffff" d="M22.46,6C21.69,6.35 20.86,6.58 20,6.69C20.88,6.16 21.56,5.32 21.88,4.31C21.05,4.81 20.13,5.16 19.16,5.36C18.37,4.5 17.26,4 16,4C13.65,4 11.73,5.92 11.73,8.29C11.73,8.63 11.77,8.96 11.84,9.27C8.28,9.09 5.11,7.38 3,4.79C2.63,5.42 2.42,6.16 2.42,6.94C2.42,8.43 3.17,9.75 4.33,10.5C3.62,10.5 2.96,10.3 2.38,10C2.38,10 2.38,10 2.38,10.03C2.38,12.11 3.86,13.85 5.82,14.24C5.46,14.34 5.08,14.39 4.69,14.39C4.42,14.39 4.15,14.36 3.89,14.31C4.43,16 6,17.26 7.89,17.29C6.43,18.45 4.58,19.13 2.56,19.13C2.22,19.13 1.88,19.11 1.54,19.07C3.44,20.29 5.7,21 8.12,21C16,21 20.33,14.46 20.33,8.79C20.33,8.6 20.33,8.42 20.32,8.23C21.16,7.63 21.88,6.87 22.46,6Z" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 777 B |
@@ -1,61 +0,0 @@
|
||||
# API documentation
|
||||
|
||||
Methods for using Nova programmatically.
|
||||
|
||||
## Authentication
|
||||
|
||||
All methods which create, modify or delete a resource require an API key. API
|
||||
keys can be obtained from your user account's [API keys page](/user/api_keys).
|
||||
|
||||
To use the API key you need to enter it in the password field of [HTTP Basic
|
||||
Access
|
||||
Authentication](https://en.wikipedia.org/wiki/Basic_access_authentication). The
|
||||
username field does not matter, it can be empty or anything else.
|
||||
|
||||
Example usage in JavaScript:
|
||||
|
||||
```js
|
||||
const resp = await fetch(
|
||||
"https://nova.storage/api/user/files",
|
||||
headers: {
|
||||
"Authorization": "Basic "+btoa(":"+api_key),
|
||||
// The btoa function encodes the key to Base64
|
||||
},
|
||||
)
|
||||
if(resp.status >= 400) {
|
||||
throw new Error(await resp.json())
|
||||
}
|
||||
result = await resp.json()
|
||||
```
|
||||
|
||||
Some JSON responses include fields which end in "_href" (some people don't know
|
||||
this, but "href" stands for "Hypertext Reference", the more you know). These
|
||||
point to different places in the API, which you can retrieve with a GET request.
|
||||
The path is to be appended to the API URL, so "/file/someid/thumbnail" becomes
|
||||
"{{apiUrl}}/file/someid/thumbnail".
|
||||
|
||||
The base URL for the API is "{{apiUrl}}", all paths below are relative to that
|
||||
URL.
|
||||
|
||||
## curl example
|
||||
|
||||
To upload files to Nova you will need an API key. Get an API key from the
|
||||
[API keys page](/user/api_keys) and enter it in the command. Replace the example
|
||||
API key here with your own:
|
||||
|
||||
`curl -T "file_name.txt" -u :5f45f184-64bb-4eaa-be19-4a5f0459db49
|
||||
https://nova.storage/api/file/`
|
||||
|
||||
## Form value order
|
||||
|
||||
I recommend you put files at the end of every file upload form. By doing this
|
||||
the Nova server can respond to malformed requests before the file upload
|
||||
finishes and this may save you a lot of time and bandwidth when uploading large
|
||||
files. Make sure your HTTP client has support for premature responses,
|
||||
Nova uses them a lot. If the server responds before your request is
|
||||
finished it will always indicate an error and you may abort the connection.
|
||||
|
||||
|
||||
{{template "api_file.md"}}
|
||||
{{template "api_list.md"}}
|
||||
{{template "api_user.md"}}
|
||||
@@ -1,350 +0,0 @@
|
||||
## File Methods
|
||||
|
||||
<details class="api_doc_details request_post">
|
||||
<summary><span class="method">POST</span>/file</summary>
|
||||
<div>
|
||||
|
||||
### Description
|
||||
|
||||
Upload a file. I recommend that you use the PUT API instead of the POST API.
|
||||
It's easier to use and the multipart encoding of the POST API can cause
|
||||
performance issues in certain environments.
|
||||
|
||||
### Parameters
|
||||
|
||||
Param | Type | Required | Maximum Size | Default | Description
|
||||
------|----------------|----------|------------------------------|---------------------|----------------------------
|
||||
name | string | false | 255 characters | multipart file name | Name of the file to upload
|
||||
file | multipart file | true | Depends on user subscription | none | File to upload
|
||||
|
||||
### Returns
|
||||
|
||||
HTTP 200: OK
|
||||
```
|
||||
{
|
||||
"success": true,
|
||||
"id": "abc123" // ID of the newly uploaded file
|
||||
}
|
||||
```
|
||||
|
||||
HTTP 422: Unprocessable Entity
|
||||
```
|
||||
{
|
||||
"success": false,
|
||||
"value": "no_file",
|
||||
"message": "The file does not exist or is empty."
|
||||
}
|
||||
```
|
||||
|
||||
HTTP 500: Internal Server Error
|
||||
```
|
||||
{
|
||||
"success": false,
|
||||
"value": "internal",
|
||||
"message": "An internal server error occurred."
|
||||
}
|
||||
```
|
||||
|
||||
HTTP 413: Payload Too Large
|
||||
```
|
||||
{
|
||||
"success": false,
|
||||
"value": "file_too_large",
|
||||
"message": "The file you tried to upload is too large"
|
||||
}
|
||||
```
|
||||
|
||||
HTTP 500: Internal Server Error
|
||||
```
|
||||
{
|
||||
"success": false,
|
||||
"value": "writing",
|
||||
"message": "Something went wrong while writing the file to disk, the server may be out of storage space."
|
||||
}
|
||||
```
|
||||
|
||||
HTTP 413: Payload Too Large
|
||||
```
|
||||
{
|
||||
"success": false,
|
||||
"value": "name_too_long",
|
||||
"message": "File Name is too long, Max 255 characters allowed."
|
||||
}
|
||||
```
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<details class="api_doc_details request_put">
|
||||
<summary><span class="method">PUT</span>/file/{name}</summary>
|
||||
<div>
|
||||
|
||||
### Description
|
||||
|
||||
Upload a file.
|
||||
|
||||
### Parameters
|
||||
|
||||
Param | Type | Required | Location | Maximum Size | Default | Description
|
||||
------|--------|----------|--------------|------------------------------|---------|----------------------------
|
||||
name | string | true | URL | 255 characters | none | Name of the file to upload
|
||||
file | file | true | request body | Depends on user subscription | none | File to upload
|
||||
|
||||
### Returns
|
||||
|
||||
HTTP 201: OK
|
||||
```
|
||||
{
|
||||
"id": "abc123" // ID of the newly uploaded file
|
||||
}
|
||||
```
|
||||
|
||||
HTTP 422: Unprocessable Entity
|
||||
```
|
||||
{
|
||||
"success": false,
|
||||
"value": "no_file",
|
||||
"message": "The file does not exist or is empty."
|
||||
}
|
||||
```
|
||||
|
||||
HTTP 500: Internal Server Error
|
||||
```
|
||||
{
|
||||
"success": false,
|
||||
"value": "internal",
|
||||
"message": "An internal server error occurred."
|
||||
}
|
||||
```
|
||||
|
||||
HTTP 413: Payload Too Large
|
||||
```
|
||||
{
|
||||
"success": false,
|
||||
"value": "file_too_large",
|
||||
"message": "The file you tried to upload is too large"
|
||||
}
|
||||
```
|
||||
|
||||
HTTP 500: Internal Server Error
|
||||
```
|
||||
{
|
||||
"success": false,
|
||||
"value": "writing",
|
||||
"message": "Something went wrong while writing the file to disk, the server may be out of storage space."
|
||||
}
|
||||
```
|
||||
|
||||
HTTP 413: Payload Too Large
|
||||
```
|
||||
{
|
||||
"success": false,
|
||||
"value": "name_too_long",
|
||||
"message": "File Name is too long, Max 255 characters allowed."
|
||||
}
|
||||
```
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<details class="api_doc_details request_get">
|
||||
<summary><span class="method">GET</span>/file/{id}</summary>
|
||||
<div>
|
||||
|
||||
### Description
|
||||
|
||||
Returns the full file associated with the ID. Supports byte range requests.
|
||||
|
||||
When '?download' is added to the URL the server will send an attachment header
|
||||
instead of inline rendering, which causes the browser to show a 'Save File'
|
||||
dialog.
|
||||
|
||||
Warning: If a file is using too much bandwidth it can be rate limited. The rate
|
||||
limit will be enabled if a file has three times more downloads than views. The
|
||||
owner of a file can always download it. When a file is rate limited the user
|
||||
will need to fill out a captcha in order to continue downloading the file. The
|
||||
captcha will only appear on the file viewer page (nova.storage/u/{id}). Rate
|
||||
limiting has been added to prevent the spread of viruses and to stop hotlinking.
|
||||
Hotlinking is only allowed when files are uploaded using a Pro account.
|
||||
|
||||
Nova also includes a virus scanner. If a virus has been detected in a file
|
||||
the user will also have to fill in a captcha to download it.
|
||||
|
||||
### Parameters
|
||||
|
||||
Param | Required | Location | Description
|
||||
---------|----------|----------|------------------------------------------
|
||||
id | true | URL | ID of the file to request
|
||||
download | false | URL | Sends attachment header instead of inline
|
||||
|
||||
### Returns
|
||||
|
||||
```
|
||||
HTTP 200: OK
|
||||
|
||||
Requested file data
|
||||
```
|
||||
|
||||
HTTP 404: Not Found
|
||||
```
|
||||
{
|
||||
"success": false,
|
||||
"value": "not_found",
|
||||
"message": "The entity you requested could not be found"
|
||||
}
|
||||
```
|
||||
|
||||
HTTP 403: Forbidden
|
||||
```
|
||||
{
|
||||
"success": false,
|
||||
"value": "file_rate_limited_captcha_required",
|
||||
"message": "This file is using too much bandwidth. For anonymous downloads a captcha is required now. The captcha entry is available on the download page"
|
||||
}
|
||||
```
|
||||
|
||||
HTTP 403: Forbidden
|
||||
```
|
||||
{
|
||||
"success": false,
|
||||
"value": "virus_detected_captcha_required",
|
||||
"message": "This file has been marked as malware by our scanning systems. To avoid infecting other systems through automated downloads we require you to enter a captcha. The captcha entry is available on the download page"
|
||||
}
|
||||
```
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<details class="api_doc_details request_get">
|
||||
<summary><span class="method">GET</span>/file/{id}/info</summary>
|
||||
<div>
|
||||
|
||||
### Description
|
||||
|
||||
Returns information about one or more files. You can also put a comma separated
|
||||
list of file IDs in the URL and it will return an array of file info, instead of
|
||||
a single object. There's a limit of 1000 files per request.
|
||||
|
||||
### Parameters
|
||||
|
||||
Param | Required | Location | Description
|
||||
------|----------|----------|---------------
|
||||
id | true | URL | ID of the file
|
||||
|
||||
### Returns
|
||||
|
||||
HTTP 200: OK
|
||||
```
|
||||
{
|
||||
"id": "1234abcd",
|
||||
"name": "screenshot.png",
|
||||
// Size of the file in bytes
|
||||
"size": 5694837,
|
||||
// Number of unique file views, views are counted once per IP address
|
||||
"views" 1234,
|
||||
// Total bandwidth usage of the file
|
||||
"bandwidth_used": 1234567890,
|
||||
// Premium bandwidth usage, from users with a Pro subscription or bandwidth sharing
|
||||
"bandwidth_used_paid": 1234567890,
|
||||
// Unique downloads per IP address
|
||||
"downloads": 1234,
|
||||
"date_upload": 2020-02-04T18:34:05.706801Z,
|
||||
"date_last_view": 2020-02-04T18:34:05.706801Z,
|
||||
"mime_type" "image/png",
|
||||
// Link to a thumbnail of this file
|
||||
"thumbnail_href": "/file/1234abcd/thumbnail"
|
||||
// SHA256 sum of the file, encoded in hexadecimal
|
||||
"hash_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
// If the current logged in user can edit the file
|
||||
"can_edit": true,
|
||||
}
|
||||
```
|
||||
|
||||
HTTP 404: Not Found
|
||||
```
|
||||
{
|
||||
"success": false,
|
||||
"value": "file_not_found"
|
||||
}
|
||||
```
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<details class="api_doc_details request_get">
|
||||
<summary><span class="method">GET</span>/file/{id}/thumbnail?width=x&height=x</summary>
|
||||
<div>
|
||||
|
||||
### Description
|
||||
|
||||
Returns a PNG thumbnail image representing the file. The thumbnail image will be
|
||||
128x128 px by default. You can specify the width and height with parameters in
|
||||
the URL. The width and height parameters need to be a multiple of 16. So the
|
||||
allowed values are 16, 32, 48, 64, 80, 96, 112 and 128. If a thumbnail cannot be
|
||||
generated for the file you will be redirected to a mime type image of 128x128
|
||||
px.
|
||||
|
||||
### Parameters
|
||||
|
||||
Param | Required | Location | Description
|
||||
-------|----------|----------|--------------------------------------
|
||||
id | true | URL | ID of the file to get a thumbnail for
|
||||
width | false | URL | Width of the thumbnail image
|
||||
height | false | URL | Height of the thumbnail image
|
||||
|
||||
### Returns
|
||||
|
||||
A PNG image if a thumbnail can be generated. If a thumbnail cannot be generated
|
||||
you will get a 301 redirect to an image representing the type of the file.
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<details class="api_doc_details request_delete">
|
||||
<summary><span class="method">DELETE</span>/file/{id}</summary>
|
||||
<div>
|
||||
|
||||
### Description
|
||||
|
||||
Deletes a file. Only works when the users owns the file.
|
||||
|
||||
### Parameters
|
||||
|
||||
Param | Required | Location | Description
|
||||
------|----------|----------|-------------------------
|
||||
id | true | URL | ID of the file to delete
|
||||
|
||||
### Returns
|
||||
|
||||
HTTP 200: OK
|
||||
```
|
||||
{
|
||||
"success": true,
|
||||
"value": "file_deleted",
|
||||
"message": "The file has been deleted."
|
||||
}
|
||||
```
|
||||
|
||||
HTTP 404: Not Found
|
||||
```
|
||||
{
|
||||
"success": false,
|
||||
"value": "file_not_found",
|
||||
"message": "File ID was not found in the database."
|
||||
}
|
||||
```
|
||||
|
||||
HTTP 401: Unauthorized
|
||||
```
|
||||
{
|
||||
"success": false,
|
||||
"value": "unauthorized",
|
||||
"message": "You are not logged in."
|
||||
}
|
||||
```
|
||||
|
||||
HTTP 403: Forbidden
|
||||
```
|
||||
{
|
||||
"success": false,
|
||||
"value": "forbidden",
|
||||
"message": "This is not your file."
|
||||
}
|
||||
```
|
||||
</div>
|
||||
</details>
|
||||
@@ -1,267 +0,0 @@
|
||||
## File Methods
|
||||
|
||||
<details class="api_doc_details request_post">
|
||||
<summary><span class="method">POST</span>/file</summary>
|
||||
<div>
|
||||
|
||||
### Description
|
||||
|
||||
Upload a file.
|
||||
|
||||
### Parameters
|
||||
|
||||
Param | Type | Required | Maximum Size | Default | Description
|
||||
----------|----------------|----------|------------------------------|---------------------|-----------------------------------
|
||||
name | string | false | 255 characters | multipart file name | Name of the file to upload
|
||||
anonymous | boolean | false | N/A | false | File is not linked to user if true
|
||||
file | multipart file | true | Depends on user subscription | none | File to upload
|
||||
|
||||
### Returns
|
||||
|
||||
HTTP 200: OK
|
||||
```
|
||||
{
|
||||
"success": true,
|
||||
"id": "abc123" // ID of the newly uploaded file
|
||||
}
|
||||
```
|
||||
|
||||
HTTP 422: Unprocessable Entity
|
||||
```
|
||||
{
|
||||
"success": false,
|
||||
"value": "no_file",
|
||||
"message": "The file does not exist or is empty."
|
||||
}
|
||||
```
|
||||
|
||||
HTTP 500: Internal Server Error
|
||||
```
|
||||
{
|
||||
"success": false,
|
||||
"value": "internal",
|
||||
"message": "An internal server error occurred."
|
||||
}
|
||||
```
|
||||
|
||||
HTTP 413: Payload Too Large
|
||||
```
|
||||
{
|
||||
"success": false,
|
||||
"value": "file_too_large",
|
||||
"message": "The file you tried to upload is too large"
|
||||
}
|
||||
```
|
||||
|
||||
HTTP 500: Internal Server Error
|
||||
```
|
||||
{
|
||||
"success": false,
|
||||
"value": "writing",
|
||||
"message": "Something went wrong while writing the file to disk, the server may be out of storage space."
|
||||
}
|
||||
```
|
||||
|
||||
HTTP 413: Payload Too Large
|
||||
```
|
||||
{
|
||||
"success": false,
|
||||
"value": "name_too_long",
|
||||
"message": "File Name is too long, Max 255 characters allowed."
|
||||
}
|
||||
```
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<details class="api_doc_details request_get">
|
||||
<summary><span class="method">GET</span>/file/{id}</summary>
|
||||
<div>
|
||||
|
||||
### Description
|
||||
|
||||
Returns the full file associated with the ID. Supports byte range requests.
|
||||
|
||||
When '?download' is added to the URL the server will send an attachment header
|
||||
instead of inline rendering, which causes the browser to show a 'Save File'
|
||||
dialog.
|
||||
|
||||
Warning: If a file is using too much bandwidth it can be rate limited. The rate
|
||||
limit will be enabled if a file has ten times more downloads than views. The
|
||||
owner of a file can always download it. When a file is rate limited the user
|
||||
will need to fill out a captcha in order to continue downloading the file. The
|
||||
captcha will only appear on the file viewer page (nova.storage/u/{id}). Rate
|
||||
limiting has been added to prevent the spread of viruses and to stop direct
|
||||
linking.
|
||||
|
||||
Nova also includes a virus scanner. If a virus has been detected in a file
|
||||
the user will also have to fill in a captcha to download it.
|
||||
|
||||
### Parameters
|
||||
|
||||
Param | Required | Location | Description
|
||||
---------|----------|----------|------------------------------------------
|
||||
id | true | URL | ID of the file to request
|
||||
download | false | URL | Sends attachment header instead of inline
|
||||
|
||||
### Returns
|
||||
|
||||
```
|
||||
HTTP 200: OK
|
||||
|
||||
Requested file data
|
||||
```
|
||||
|
||||
HTTP 404: Not Found
|
||||
```
|
||||
{
|
||||
"success": false,
|
||||
"value": "not_found",
|
||||
"message": "The entity you requested could not be found"
|
||||
}
|
||||
```
|
||||
|
||||
HTTP 403: Forbidden
|
||||
```
|
||||
{
|
||||
"success": false,
|
||||
"value": "file_rate_limited_captcha_required",
|
||||
"message": "This file is using too much bandwidth. For anonymous downloads a captcha is required now. The captcha entry is available on the download page"
|
||||
}
|
||||
```
|
||||
|
||||
HTTP 403: Forbidden
|
||||
```
|
||||
{
|
||||
"success": false,
|
||||
"value": "virus_detected_captcha_required",
|
||||
"message": "This file has been marked as malware by our scanning systems. To avoid infecting other systems through automated downloads we require you to enter a captcha. The captcha entry is available on the download page"
|
||||
}
|
||||
```
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<details class="api_doc_details request_get">
|
||||
<summary><span class="method">GET</span>/file/{id}/info</summary>
|
||||
<div>
|
||||
|
||||
### Description
|
||||
|
||||
Returns information about one or more files. You can also put a comma separated
|
||||
list of file IDs in the URL and it will return an array of file info, instead of
|
||||
a single object.
|
||||
|
||||
### Parameters
|
||||
|
||||
Param | Required | Location | Description
|
||||
------|----------|----------|---------------
|
||||
id | true | URL | ID of the file
|
||||
|
||||
### Returns
|
||||
|
||||
HTTP 200: OK
|
||||
```
|
||||
{
|
||||
"success": true,
|
||||
"id": "1234abcd",
|
||||
"name": "screenshot.png",
|
||||
"date_upload": 2020-02-04T18:34:05.706801Z,
|
||||
"date_last_view": 2020-02-04T18:34:05.706801Z,
|
||||
"size": 5694837, // Bytes
|
||||
"views" 1234, // Amount of unique file views
|
||||
"bandwidth_used": 1234567890, // Bytes
|
||||
"mime_type" "image/png",
|
||||
"thumbnail_href": "/file/1234abcd/thumbnail" // Link to a thumbnail of this file
|
||||
}
|
||||
```
|
||||
|
||||
HTTP 404: Not Found
|
||||
```
|
||||
{
|
||||
"success": false,
|
||||
"value": "file_not_found"
|
||||
}
|
||||
```
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<details class="api_doc_details request_get">
|
||||
<summary><span class="method">GET</span>/file/{id}/thumbnail?width=x&height=x</summary>
|
||||
<div>
|
||||
|
||||
### Description
|
||||
|
||||
Returns a PNG thumbnail image representing the file. The thumbnail image will be
|
||||
128x128 px by default. You can specify the width and height with parameters in
|
||||
the URL. The width and height parameters need to be a multiple of 16. So the
|
||||
allowed values are 16, 32, 48, 64, 80, 96, 112 and 128. If a thumbnail cannot be
|
||||
generated for the file you will be redirected to a mime type image of 128x128
|
||||
px.
|
||||
|
||||
### Parameters
|
||||
|
||||
Param | Required | Location | Description
|
||||
-------|----------|----------|--------------------------------------
|
||||
id | true | URL | ID of the file to get a thumbnail for
|
||||
width | false | URL | Width of the thumbnail image
|
||||
height | false | URL | Height of the thumbnail image
|
||||
|
||||
### Returns
|
||||
|
||||
A PNG image if a thumbnail can be generated. If a thumbnail cannot be generated
|
||||
you will get a 301 redirect to an image representing the type of the file.
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<details class="api_doc_details request_delete">
|
||||
<summary><span class="method">DELETE</span>/file/{id}</summary>
|
||||
<div>
|
||||
|
||||
### Description
|
||||
|
||||
Deletes a file. Only works when the users owns the file.
|
||||
|
||||
### Parameters
|
||||
|
||||
Param | Required | Location | Description
|
||||
------|----------|----------|-------------------------
|
||||
id | true | URL | ID of the file to delete
|
||||
|
||||
### Returns
|
||||
|
||||
HTTP 200: OK
|
||||
```
|
||||
{
|
||||
"success": true,
|
||||
"value": "file_deleted",
|
||||
"message": "The file has been deleted."
|
||||
}
|
||||
```
|
||||
|
||||
HTTP 404: Not Found
|
||||
```
|
||||
{
|
||||
"success": false,
|
||||
"value": "file_not_found",
|
||||
"message": "File ID was not found in the database."
|
||||
}
|
||||
```
|
||||
|
||||
HTTP 401: Unauthorized
|
||||
```
|
||||
{
|
||||
"success": false,
|
||||
"value": "unauthorized",
|
||||
"message": "You are not logged in."
|
||||
}
|
||||
```
|
||||
|
||||
HTTP 403: Forbidden
|
||||
```
|
||||
{
|
||||
"success": false,
|
||||
"value": "forbidden",
|
||||
"message": "This is not your file."
|
||||
}
|
||||
```
|
||||
</div>
|
||||
</details>
|
||||
@@ -1,160 +0,0 @@
|
||||
## Filesystem Methods
|
||||
|
||||
<details class="api_doc_details request_post">
|
||||
<summary><span class="method">POST</span>/filesystem/{path}</summary>
|
||||
<div>
|
||||
<h3>Description</h3>
|
||||
<p>
|
||||
Creates a new directory or uploads a file to an existing directory.
|
||||
</p>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<p>
|
||||
The form parameters <b>must</b> be sent in the order displayed below
|
||||
for the realtime error checking to work. If 'name' comes after
|
||||
'file' it will be ignored.
|
||||
</p>
|
||||
<table>
|
||||
<tr>
|
||||
<td>Param</td>
|
||||
<td>Location</td>
|
||||
<td>Description</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>Form Values</td>
|
||||
<td>The type of node to create, can either be 'directory', or 'file'</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>name</td>
|
||||
<td>Form Values</td>
|
||||
<td>
|
||||
Name of the directory to create, or of file to create. Not
|
||||
required if 'type' is 'file'
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>file</td>
|
||||
<td>Form Values</td>
|
||||
<td>
|
||||
Multipart file to upload to the directory. Will be ignored
|
||||
if 'type' is 'directory'
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h3>Returns</h3>
|
||||
<pre>HTTP 200: OK
|
||||
{
|
||||
"success": true,
|
||||
"id": "abc123" // ID of the newly uploaded file
|
||||
}</pre>
|
||||
todo
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<details class="api_doc_details request_get">
|
||||
<summary><span class="method">GET</span>/filesystem/{path}</summary>
|
||||
<div>
|
||||
<h3>Description</h3>
|
||||
<p>
|
||||
Returns information about the requested path.
|
||||
</p>
|
||||
<h3>Parameters</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<td>Param</td>
|
||||
<td>Required</td>
|
||||
<td>Location</td>
|
||||
<td>Description</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>path</td>
|
||||
<td>true</td>
|
||||
<td>URL</td>
|
||||
<td>Path to the directory or file to request</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>download</td>
|
||||
<td>false</td>
|
||||
<td>URL</td>
|
||||
<td>
|
||||
If the URL paramater '?download' is passed the requested
|
||||
file will be downloaded (if it is a file)
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h3>Returns</h3>
|
||||
<h4>When the requested entity is a directory:</h4>
|
||||
<pre>HTTP 200: OK
|
||||
{
|
||||
"success": true,
|
||||
"name": "some dir",
|
||||
"path": "/some dir",
|
||||
"type": "directory",
|
||||
"child_directories": [
|
||||
{
|
||||
"name": "some other directory",
|
||||
"type": "directory",
|
||||
"path": "/some dir/some other directory"
|
||||
}
|
||||
],
|
||||
"child_files": [
|
||||
{
|
||||
"name": "11. Lenny Kravitz - Fly away.ogg",
|
||||
"type": "file",
|
||||
"path": "/some dir/11. Lenny Kravitz - Fly away.ogg"
|
||||
}
|
||||
]
|
||||
}</pre>
|
||||
<h4>When the requested entity is a file:</h4>
|
||||
<pre>HTTP 200: OK
|
||||
{
|
||||
"success": true,
|
||||
"name": "11. Lenny Kravitz - Fly away.ogg",
|
||||
"path": "/some dir/11. Lenny Kravitz - Fly away.ogg",
|
||||
"type": "file",
|
||||
"file_info": {
|
||||
"success": true,
|
||||
"id": "Jf_u5TI9",
|
||||
"name": "11. Lenny Kravitz - Fly away.ogg",
|
||||
"date_upload": "2018-07-04T22:24:48Z",
|
||||
"date_last_view": "2018-07-04T22:24:48Z",
|
||||
"size": 9757269,
|
||||
"views": 0,
|
||||
"mime_type": "application/ogg",
|
||||
"thumbnail_href": "/file/Jf_u5TI9/thumbnail"
|
||||
}
|
||||
}</pre>
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<details class="api_doc_details request_delete">
|
||||
<summary><span class="method">DELETE</span>/filesystem/{path}</summary>
|
||||
<div>
|
||||
<h3>Description</h3>
|
||||
<p>
|
||||
Deletes a filesystem node.
|
||||
</p>
|
||||
<h3>Parameters</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<td>Param</td>
|
||||
<td>Required</td>
|
||||
<td>Location</td>
|
||||
<td>Description</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>path</td>
|
||||
<td>true</td>
|
||||
<td>URL</td>
|
||||
<td>Path of the entity to delete</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h3>Returns</h3>
|
||||
<pre>HTTP 200: OK
|
||||
{
|
||||
"success": true
|
||||
}</pre>
|
||||
</div>
|
||||
</details>
|
||||
@@ -1,188 +0,0 @@
|
||||
## List Methods
|
||||
|
||||
<details class="api_doc_details request_post">
|
||||
<summary><span class="method">POST</span>/list</summary>
|
||||
<div>
|
||||
|
||||
### Description
|
||||
|
||||
Creates a list of files that can be viewed together on the file viewer page.
|
||||
|
||||
### Parameters
|
||||
|
||||
POST body should be a JSON object, example below. A list can contain at most
|
||||
10000 files. If you try to add more the request will fail.
|
||||
|
||||
#### Example
|
||||
```
|
||||
{
|
||||
"title": "My beautiful photos", // Defaults to "Nova List"
|
||||
"anonymous": false / true, // If true this list will not be linked to your user account. Defaults to "false"
|
||||
"files": [ // Ordered array of files to add to the list
|
||||
{
|
||||
"id": "abc123",
|
||||
"description": "First photo of the week, such a beautiful valley"
|
||||
},
|
||||
{
|
||||
"id": "123abc",
|
||||
"description": "The week went by so quickly, here's a photo from the plane back"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Returns
|
||||
|
||||
HTTP 200: OK
|
||||
```
|
||||
{
|
||||
"success": true,
|
||||
"id": "yay137" // ID of the newly created list
|
||||
}
|
||||
```
|
||||
|
||||
HTTP 422: Unprocessable Entity
|
||||
```
|
||||
{
|
||||
"success": false,
|
||||
"value": "list_file_not_found",
|
||||
"message": "File Oh42No was not found in the database.",
|
||||
"extra": {
|
||||
"file_not_found": "0h42No" // The file you tried to add with this ID does not exist
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
HTTP 413: Payload too large
|
||||
```
|
||||
{
|
||||
"success": false,
|
||||
"value": "too_many_files",
|
||||
"message": "This list contains too many files, max 10000 allowed."
|
||||
}
|
||||
```
|
||||
|
||||
HTTP 422: Unprocessable Entity
|
||||
```
|
||||
{
|
||||
"success": false,
|
||||
"value": "json_parse_failed",
|
||||
"message": "The JSON object in the request body could not be read."
|
||||
}
|
||||
```
|
||||
|
||||
HTTP 413: Payload too large
|
||||
```
|
||||
{
|
||||
"success": false,
|
||||
"value": "title_too_long",
|
||||
"message": "The title of this list is too long, max 300 characters allowed."
|
||||
}
|
||||
```
|
||||
|
||||
HTTP 413: Payload too large
|
||||
```
|
||||
{
|
||||
"success": false,
|
||||
"value": "description_too_long",
|
||||
"message": "The description of one of the files in the list is too long, max 3000 characters allowed."
|
||||
}
|
||||
```
|
||||
|
||||
HTTP 422: Unprocessable Entity
|
||||
```
|
||||
{
|
||||
"success": false,
|
||||
"value": "cannot_create_empty_list",
|
||||
"message": "You cannot make a list with no files."
|
||||
}
|
||||
```
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<details class="api_doc_details request_get">
|
||||
<summary><span class="method">GET</span>/list/{id}</summary>
|
||||
<div>
|
||||
|
||||
### Description
|
||||
|
||||
Returns information about a file list and the files in it.
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Param | Required | Location | Description
|
||||
------|----------|----------|---------------
|
||||
id | true | URL | ID of the list
|
||||
|
||||
### Returns
|
||||
|
||||
The API will return some basic information about every file. Every file also has
|
||||
a "detail_href" field which contains a URL to the info API of the file. Follow
|
||||
that link to get more information about the file like size, checksum, mime type,
|
||||
etc. The address is relative to the API URL and should be appended to the end.
|
||||
|
||||
HTTP 200: OK
|
||||
```
|
||||
{
|
||||
"success": true,
|
||||
"id": "L8bhwx",
|
||||
"title": "Rust in Peace",
|
||||
"date_created": 2020-02-04T18:34:13.466276Z,
|
||||
"files": [
|
||||
// These structures are the same as the file info response, except for the detail_href and description fields
|
||||
{
|
||||
"detail_href": "/file/_SqVWi/info",
|
||||
"description": "",
|
||||
"success": true,
|
||||
"id": "_SqVWi",
|
||||
"name": "01 Holy Wars... The Punishment Due.mp3",
|
||||
"size": 123456,
|
||||
"date_created": 2020-02-04T18:34:13.466276Z,
|
||||
"date_last_view": 2020-02-04T18:34:13.466276Z,
|
||||
"mime_type": "audio/mp3",
|
||||
"views": 1,
|
||||
"bandwidth_used": 1234567890,
|
||||
"thumbnail_href": "/file/_SqVWi/thumbnail"
|
||||
},
|
||||
{
|
||||
"detail_href": "/file/RKwgZb/info",
|
||||
"description": "",
|
||||
"success": true,
|
||||
"id": "RKwgZb",
|
||||
"name": "02 Hangar 18.mp3",
|
||||
"size": 123456,
|
||||
"date_created": 2020-02-04T18:34:13.466276Z,
|
||||
"date_last_view": 2020-02-04T18:34:13.466276Z,
|
||||
"mime_type": "audio/mp3",
|
||||
"views": 2,
|
||||
"bandwidth_used": 1234567890,
|
||||
"thumbnail_href": "/file/RKwgZb/thumbnail"
|
||||
},
|
||||
{
|
||||
"detail_href": "/file/DRaL_e/info",
|
||||
"description": "",
|
||||
"success": true,
|
||||
"id": "DRaL_e",
|
||||
"name": "03 Take No Prisoners.mp3",
|
||||
"size": 123456,
|
||||
"date_created": 2020-02-04T18:34:13.466276Z,
|
||||
"date_last_view": 2020-02-04T18:34:13.466276Z,
|
||||
"mime_type": "audio/mp3",
|
||||
"views": 3,
|
||||
"bandwidth_used": 1234567890,
|
||||
"thumbnail_href": "/file/DRaL_e/thumbnail"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
HTTP 404: Not Found
|
||||
```
|
||||
{
|
||||
"success": false,
|
||||
"value": "list_not_found",
|
||||
}
|
||||
```
|
||||
</div>
|
||||
</details>
|
||||
@@ -1,18 +0,0 @@
|
||||
## User Methods
|
||||
|
||||
These methods all require authentication.
|
||||
|
||||
<details class="api_doc_details request_get">
|
||||
<summary><span class="method">GET</span>/user/files</summary>
|
||||
<div>
|
||||
Documentation pending. Click here to see the response for your account:
|
||||
[/user/files](/api/user/files).
|
||||
</div>
|
||||
</details>
|
||||
<details class="api_doc_details request_get">
|
||||
<summary><span class="method">GET</span>/user/lists</summary>
|
||||
<div>
|
||||
Documentation pending. Click here to see the response for your account:
|
||||
[/user/lists](/api/user/lists).
|
||||
</div>
|
||||
</details>
|
||||
|
Before Width: | Height: | Size: 410 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 103 KiB |
|
After Width: | Height: | Size: 75 KiB |
|
After Width: | Height: | Size: 73 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 65 KiB |
|
After Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 175 KiB |
@@ -0,0 +1,29 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="23.47 13.09 31.04 31.04">
|
||||
<defs>
|
||||
<linearGradient id="nbar" x1="27.2" y1="44.04" x2="27.2" y2="16.51" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" style="stop-color:#45ed52"/>
|
||||
<stop offset=".5" style="stop-color:#11a574"/>
|
||||
<stop offset="1" style="stop-color:#000"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="nbar2" x1="50.8" y1="13.18" x2="50.8" y2="40.72" href="#nbar"/>
|
||||
<linearGradient id="ndiagonal" x1="24.86" y1="28.61" x2="53.14" y2="28.61" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" style="stop-color:#24b880"/>
|
||||
<stop offset="1" style="stop-color:#39ef3d"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="nedge" x1="27.2" y1="16.42" x2="27.2" y2="44.13" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" style="stop-color:currentColor;stop-opacity:0"/>
|
||||
<stop offset="1" style="stop-color:currentColor"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="nedge2" x1="50.8" y1="40.81" x2="50.8" y2="13.09" href="#nedge"/>
|
||||
<linearGradient id="nedge3" x1="24.77" y1="28.61" x2="53.23" y2="28.61" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" style="stop-color:currentColor;stop-opacity:0"/>
|
||||
<stop offset=".54" style="stop-color:currentColor"/>
|
||||
<stop offset="1" style="stop-color:currentColor;stop-opacity:0"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<g stroke-width=".18" stroke-miterlimit="10">
|
||||
<path fill="url(#nbar)" stroke="url(#nedge)" d="M27.96,16.75c-2.08,0-2.93,1.83-3.11,3v21.81c0,1.37,1.05,2.48,2.34,2.48s2.34-1.11,2.34-2.48v-24.76c-.58-.63-.72-.05-1.57-.05Z"/>
|
||||
<path fill="url(#nbar2)" stroke="url(#nedge2)" d="M50.03,40.48c2.08,0,2.93-1.83,3.11-3v-.54s0-21.28,0-21.28c0-1.37-1.05-2.48-2.34-2.48s-2.34,1.11-2.34,2.48v20.98s0,2.54,0,2.54v1.24c.58.63.72.05,1.57.05Z"/>
|
||||
<path fill="url(#ndiagonal)" stroke="url(#nedge3)" d="M50.03,40.49c-.71,0-1.33-.32-1.86-.77-.18-.15-.33-.33-.45-.53l-1-1.66-12.34-21.84c-.8-1.43-2.19-2.5-3.83-2.5-.34,0-.68.05-1.01.13-2.49.63-4.68,3.44-4.68,5.96h0v.29c.18-1.1,1.03-2.83,3.11-2.83.71,0,1.33.32,1.86.77.18.15.33.33.45.53l1,1.66,12.34,21.84c.8,1.43,2.19,2.5,3.83,2.5.34,0,.68-.05,1.01-.13,2.49-.63,4.68-3.44,4.68-5.96h0v-.29c-.18,1.1-1.03,2.83-3.11,2.83Z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 122 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 5.5 KiB |
@@ -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>")}
|
||||
@@ -3,35 +3,113 @@
|
||||
Author : Fornax
|
||||
*/
|
||||
|
||||
/* The default theme, a dark and a light variant which follow the browser's
|
||||
preference. Branding colours are applied on top of these by the app, see
|
||||
Branding.ts */
|
||||
:root {
|
||||
--highlight_border: inset 0px 0px 5px 1px var(--highlight_color), 0px 0px 1px 0px var(--highlight_color);
|
||||
--color_scheme: dark;
|
||||
--background_color: #15161c;
|
||||
--background: var(--background_color);
|
||||
--background_text_color: #e6e8ef;
|
||||
--body_color: #1c1d25;
|
||||
--body_background: rgb(28 29 37 / 90%);
|
||||
--shaded_background: rgb(28 29 37 / 90%);
|
||||
--body_text_color: #e6e8ef;
|
||||
--card_color: #252733;
|
||||
--separator: #2e3040;
|
||||
--shadow_color: #0c0d12;
|
||||
--input_background: #2c2e3b;
|
||||
--input_hover_background: #363949;
|
||||
--input_text: #eceef4;
|
||||
--input_disabled_text: #737890;
|
||||
--accent_color: #49dfa0;
|
||||
--accent_shade: #243d32;
|
||||
--accent_background: #49dfa0;
|
||||
--accent_text_color: #05130d;
|
||||
--link_color: #70ebb8;
|
||||
--scrollbar_foreground_color: #33364a;
|
||||
--scrollbar_hover_color: #43475f;
|
||||
|
||||
/* Accents for success, errors, warnings and notices. They're the highlight
|
||||
colour with a different hue, see Branding.ts. The tints are backgrounds
|
||||
for messages */
|
||||
--green_color: #49df7b;
|
||||
--red_color: #df5d49;
|
||||
--yellow_color: #dfba49;
|
||||
--blue_color: #4987df;
|
||||
--green_tint: rgb(73 223 123 / 12%);
|
||||
--red_tint: rgb(223 93 73 / 12%);
|
||||
--yellow_tint: rgb(223 186 73 / 12%);
|
||||
--blue_tint: rgb(73 135 223 / 12%);
|
||||
|
||||
/* The logo's mint colourway, see NovaLogo.svelte */
|
||||
--logo_color_1: #45ed52;
|
||||
--logo_color_2: #11a574;
|
||||
--logo_color_3: #24b880;
|
||||
--logo_color_4: #39ef3d;
|
||||
}
|
||||
|
||||
@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('truetype');
|
||||
@media (prefers-color-scheme: light) {
|
||||
:root {
|
||||
--color_scheme: light;
|
||||
--background_color: #e9ebf0;
|
||||
--background_text_color: #1b1d25;
|
||||
--body_color: #f5f6f9;
|
||||
--body_background: rgb(245 246 249 / 90%);
|
||||
--shaded_background: rgb(245 246 249 / 90%);
|
||||
--body_text_color: #1b1d25;
|
||||
--card_color: #ffffff;
|
||||
--separator: #d3d7e0;
|
||||
--shadow_color: #b9bdc9;
|
||||
--input_background: #e2e5ec;
|
||||
--input_hover_background: #d7dbe4;
|
||||
--input_text: #1b1d25;
|
||||
--input_disabled_text: #80859a;
|
||||
--accent_color: #09714b;
|
||||
--accent_shade: #e2eeea;
|
||||
--accent_background: #09714b;
|
||||
--accent_text_color: #ffffff;
|
||||
--link_color: #09714b;
|
||||
--scrollbar_foreground_color: #c6cad5;
|
||||
--scrollbar_hover_color: #b0b5c3;
|
||||
|
||||
/* Accents derived from the accent colour are too light on white,
|
||||
these are the same ones branded light themes get */
|
||||
--green_color: #15793a;
|
||||
--red_color: #ba2c37;
|
||||
--yellow_color: #995c00;
|
||||
--blue_color: #2164ca;
|
||||
--green_tint: rgb(21 121 58 / 12%);
|
||||
--red_tint: rgb(186 44 55 / 12%);
|
||||
--yellow_tint: rgb(153 92 0 / 12%);
|
||||
--blue_tint: rgb(33 100 202 / 12%);
|
||||
}
|
||||
}
|
||||
|
||||
/* Branding can set a different scheme on the body, for a shared directory. The
|
||||
browser draws checkboxes and radio buttons in the accent colour */
|
||||
:root,
|
||||
body {
|
||||
color-scheme: var(--color_scheme);
|
||||
accent-color: var(--accent_color);
|
||||
}
|
||||
|
||||
/* 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 {
|
||||
@@ -117,21 +195,6 @@ pre>code {
|
||||
|
||||
/* Page layout elements */
|
||||
|
||||
.page_navigation {
|
||||
position: fixed;
|
||||
backface-visibility: hidden;
|
||||
background: var(--navigation_background);
|
||||
width: 300px;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
float: left;
|
||||
padding: 20px 0 10px 0;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
text-align: left;
|
||||
transition: left 0.5s;
|
||||
}
|
||||
|
||||
.page_content {
|
||||
background: var(--body_background);
|
||||
text-align: center;
|
||||
@@ -140,10 +203,6 @@ pre>code {
|
||||
}
|
||||
|
||||
@media (max-width: 1000px) {
|
||||
.page_navigation {
|
||||
left: -300px;
|
||||
}
|
||||
|
||||
header>h1 {
|
||||
/* We want the header text to appear below the menu button, so the top
|
||||
margin needs to be fairly large when the screen is small */
|
||||
@@ -173,29 +232,6 @@ section {
|
||||
|
||||
/* Page contents */
|
||||
|
||||
.page_navigation a {
|
||||
float: none;
|
||||
display: block;
|
||||
color: var(--background_text_color);
|
||||
text-align: center;
|
||||
padding: 4px;
|
||||
margin: 0.2em 15px 0.2em 15px;
|
||||
font-family: 'Open Sans Light', sans-serif;
|
||||
font-weight: lighter;
|
||||
font-size: 1.5em;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
transition: background 0.2s;
|
||||
border-radius: 24px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.page_navigation a:hover {
|
||||
background: var(--input_background);
|
||||
color: var(--input_text);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.highlight_shaded,
|
||||
.highlight_border,
|
||||
.highlight_green,
|
||||
@@ -218,23 +254,23 @@ section {
|
||||
}
|
||||
|
||||
.highlight_green {
|
||||
background-color: rgba(0, 255, 0, 0.1);
|
||||
border-color: #00D000;
|
||||
background-color: var(--green_tint);
|
||||
border-color: var(--green_color);
|
||||
}
|
||||
|
||||
.highlight_blue {
|
||||
background-color: rgba(0, 0, 255, 0.1);
|
||||
border-color: #3636FF;
|
||||
background-color: var(--blue_tint);
|
||||
border-color: var(--blue_color);
|
||||
}
|
||||
|
||||
.highlight_yellow {
|
||||
background-color: rgba(255, 255, 0, 0.1);
|
||||
border-color: #A0A000;
|
||||
background-color: var(--yellow_tint);
|
||||
border-color: var(--yellow_color);
|
||||
}
|
||||
|
||||
.highlight_red {
|
||||
background-color: rgba(255, 0, 0, 0.1);
|
||||
border-color: #B00000;
|
||||
background-color: var(--red_tint);
|
||||
border-color: var(--red_color);
|
||||
}
|
||||
|
||||
.highlight_green,
|
||||
@@ -386,53 +422,6 @@ tr>th {
|
||||
padding: 0.2em 0.5em;
|
||||
}
|
||||
|
||||
/* API documentation markup */
|
||||
|
||||
.api_doc_details {
|
||||
border-top: 1px solid;
|
||||
border-bottom: 1px solid;
|
||||
margin: 15px 0 15px 0;
|
||||
}
|
||||
|
||||
.api_doc_details>summary {
|
||||
padding: 2px;
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
.api_doc_details>summary>.method {
|
||||
display: inline-block;
|
||||
width: 80px;
|
||||
}
|
||||
|
||||
.api_doc_details>div {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.api_doc_details.request_get {
|
||||
border-color: #3636ff;
|
||||
background-color: rgba(32, 32, 255, 0.2);
|
||||
}
|
||||
|
||||
.api_doc_details.request_post {
|
||||
border-color: #00d000;
|
||||
background-color: rgba(0, 255, 0, 0.05);
|
||||
}
|
||||
|
||||
.api_doc_details.request_delete {
|
||||
border-color: #B00000;
|
||||
background-color: rgba(255, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.api_doc_details.request_put {
|
||||
border-color: #B06000;
|
||||
background-color: rgba(255, 128, 0, 0.05);
|
||||
}
|
||||
|
||||
.api_doc_details.request_patch {
|
||||
border-color: #6000B0;
|
||||
background-color: rgba(128, 0, 255, 0.1);
|
||||
}
|
||||
|
||||
/* BUTTONS */
|
||||
button,
|
||||
.button,
|
||||
@@ -486,7 +475,7 @@ input[type="color"]:focus {
|
||||
color: var(--input_text);
|
||||
text-decoration: none;
|
||||
background: var(--input_hover_background);
|
||||
box-shadow: 0px 0px 0px 1px var(--highlight_color) !important;
|
||||
box-shadow: 0px 0px 0px 1px var(--accent_color) !important;
|
||||
}
|
||||
|
||||
button:active,
|
||||
@@ -499,13 +488,25 @@ input[type="color"]:active {
|
||||
padding: 4px 0px 0px 4px;
|
||||
}
|
||||
|
||||
/* Selected buttons get the accent colour on a shade of it. The outline shows
|
||||
hover and keyboard focus, so it would be confusing to use it for this too */
|
||||
.button_highlight {
|
||||
box-shadow: 0px 0px 0px 1px var(--highlight_color) !important;
|
||||
color: var(--link_color) !important;
|
||||
background: var(--accent_shade) !important;
|
||||
}
|
||||
|
||||
.icon.button_highlight {
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.button_red {
|
||||
background: var(--danger_color) !important;
|
||||
color: var(--danger_text_color) !important;
|
||||
background: var(--red_tint) !important;
|
||||
color: var(--red_color) !important;
|
||||
}
|
||||
|
||||
.button_red:hover,
|
||||
.button_red:focus {
|
||||
box-shadow: 0px 0px 0px 1px var(--red_color) !important;
|
||||
}
|
||||
|
||||
button:disabled,
|
||||
@@ -631,7 +632,7 @@ input[type="email"]:focus,
|
||||
input[type="number"]:focus,
|
||||
input[type="date"]:focus,
|
||||
input[type="datetime-local"]:focus {
|
||||
box-shadow: inset 0px 0px 0px 1px var(--highlight_color);
|
||||
box-shadow: inset 0px 0px 0px 1px var(--accent_color);
|
||||
}
|
||||
|
||||
textarea:disabled,
|
||||
@@ -657,8 +658,8 @@ input[type=file] {
|
||||
|
||||
/* The selected option in multi select */
|
||||
option:checked {
|
||||
background-color: var(--highlight_background);
|
||||
color: var(--highlight_text_color);
|
||||
background-color: var(--accent_background);
|
||||
color: var(--accent_text_color);
|
||||
}
|
||||
|
||||
/* Webkit Scrollbars */
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
{{define "403"}}<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
{{template "meta_tags" "Forbidden"}}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{{template "page_top" .}}
|
||||
<header>
|
||||
<h1>Forbidden</h1>
|
||||
</header>
|
||||
<div id="page_content" class="page_content">
|
||||
<section>
|
||||
<p>
|
||||
You do not have permission to access this resource.
|
||||
</p>
|
||||
</section>
|
||||
</div>
|
||||
{{template "page_bottom" .}}
|
||||
</body>
|
||||
</html>
|
||||
{{end}}
|
||||
@@ -1,26 +0,0 @@
|
||||
{{define "404"}}<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
{{template "meta_tags" "Not Found"}}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{{template "page_top" .}}
|
||||
<header>
|
||||
<h1>This page does not exist!</h1>
|
||||
</header>
|
||||
<div id="page_content" class="page_content">
|
||||
<section>
|
||||
<p>
|
||||
There's nothing to see here, so you'll have to
|
||||
<a href='/'>head over to the home page</a>.
|
||||
</p>
|
||||
<p>
|
||||
Bye!
|
||||
</p>
|
||||
</section>
|
||||
</div>
|
||||
{{template "page_bottom" .}}
|
||||
</body>
|
||||
</html>
|
||||
{{end}}
|
||||
@@ -1,23 +0,0 @@
|
||||
{{define "451"}}<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
{{template "meta_tags" "451, Unavailable For Legal Reasons"}}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{{template "page_top" .}}
|
||||
<header>
|
||||
<h1>451, Unavailable For Legal Reasons</h1>
|
||||
</header>
|
||||
<div id="page_content" class="page_content">
|
||||
<section>
|
||||
<p>
|
||||
Hello. This file has received an abuse report and has been taken
|
||||
down. It cannot be shared anymore.
|
||||
</p>
|
||||
</section>
|
||||
</div>
|
||||
{{template "page_bottom" .}}
|
||||
</body>
|
||||
</html>
|
||||
{{end}}
|
||||
@@ -1,32 +0,0 @@
|
||||
{{define "500"}}<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
{{template "meta_tags" "500, Internal Server Error"}}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{{template "page_top" .}}
|
||||
<header>
|
||||
<h1>You broke Nova</h1>
|
||||
</header>
|
||||
<div id="page_content" class="page_content">
|
||||
<section>
|
||||
<p>
|
||||
Great job.
|
||||
</p>
|
||||
<p>
|
||||
Just kidding, something went wrong on the Nova server and
|
||||
it's my fault. This can happen when the website is overloaded,
|
||||
there is a problem with the software or there is a hardware
|
||||
problem. When there is a large scale outage you can usually find
|
||||
more info on my twitter <a
|
||||
href="https://twitter.com/Fornax96"></a>@Fornax96</a>. You can
|
||||
try again in a few minutes (or hours), or go back to the <a
|
||||
href='/'>home page</a> and start over.
|
||||
</p>
|
||||
</section>
|
||||
</div>
|
||||
{{template "page_bottom" .}}
|
||||
</body>
|
||||
</html>
|
||||
{{end}}
|
||||
@@ -1,20 +0,0 @@
|
||||
{{define "markdown_wrapper"}}<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
{{template "meta_tags" .Title}}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{{template "page_top" .}}
|
||||
<header>
|
||||
<h1>{{.Title}}</h1>
|
||||
</header>
|
||||
<div id="page_content" class="page_content">
|
||||
<section>
|
||||
{{.Other}}
|
||||
</section>
|
||||
</div>
|
||||
{{template "page_bottom" .}}
|
||||
</body>
|
||||
</html>
|
||||
{{end}}
|
||||
@@ -1,43 +0,0 @@
|
||||
{{define "meta_tags"}}
|
||||
<title>{{.}} ~ Nova</title>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="theme-color" content="#220735" />
|
||||
|
||||
<link id="stylesheet_layout" rel="stylesheet" type="text/css" href="/res/style/layout.css?v{{cacheID}}"/>
|
||||
<link id="stylesheet_theme" rel="stylesheet" type="text/css" href="/theme.css"/>
|
||||
|
||||
<link rel="icon" sizes="32x32" href="/res/img/nova_32.png" />
|
||||
<link rel="icon" sizes="128x128" href="/res/img/nova_128.png" />
|
||||
<link rel="icon" sizes="152x152" href="/res/img/nova_152.png" />
|
||||
<link rel="icon" sizes="180x180" href="/res/img/nova_180.png" />
|
||||
<link rel="icon" sizes="192x192" href="/res/img/nova_192.png" />
|
||||
<link rel="icon" sizes="196x196" href="/res/img/nova_196.png" />
|
||||
<link rel="icon" sizes="256x256" href="/res/img/nova_256.png" />
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="/res/img/nova_152.png" />
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/res/img/nova_180.png" />
|
||||
<link rel="shortcut icon" sizes="196x196" href="/res/img/nova_196.png" />
|
||||
|
||||
<meta name="description" content="Nova is a file transfer service, you
|
||||
can upload any file and you will be given a shareable link right away.
|
||||
Nova also supports previews for images, videos, audio, PDFs and much more." />
|
||||
<meta name="keywords" content="file sharing, free file sharing, file transfer,
|
||||
free file transfer, file hosting, free file hosting, hosting, file upload,
|
||||
free file upload, uploading, send file, large file, free file sharing,
|
||||
free file transfer, 20 GB free, free file sending, file storage, cloud storage,
|
||||
free cloud storage, image hosting, image sharing, photo hosting,
|
||||
photo transfer, photo sharing, video hosting, video sharing, video transfer,
|
||||
document sharing, upload documents, send documents, huge file, large video,
|
||||
large document, pdf, pdf sharing, pdf upload, pdf transfer, pdf reader,
|
||||
free pdf upload, text file upload, text sharing, photo storage,
|
||||
professional file transfer, cheap storage, cheap file storage, send large file,
|
||||
send big file, send huge file, audio sharing, music sharing, audio upload,
|
||||
music upload" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:title" content="{{.}} ~ Nova" />
|
||||
<meta property="og:site_name" content="Nova" />
|
||||
<meta property="og:description" content="Instant file and screenshot sharing." />
|
||||
<meta property="og:url" content="http://nova.storage/" />
|
||||
<meta property="og:image" content="/res/img/nova_256.png" />
|
||||
<meta property="og:image:type" content="image/png" />
|
||||
{{end}}
|
||||
@@ -1,13 +0,0 @@
|
||||
{{ define "opengraph" }}
|
||||
|
||||
{{ range $kv := .MetaPropRules }}
|
||||
<meta property="{{ $kv.Key }}" content="{{ $kv.Value }}" />
|
||||
{{ end }}
|
||||
{{ range $kv := .MetaNameRules }}
|
||||
<meta name="{{ $kv.Key }}" content="{{ $kv.Value }}" />
|
||||
{{ end }}
|
||||
{{ range $kv := .LinkRules }}
|
||||
<link rel="{{ $kv.Key }}" href="{{ $kv.Value }}" />
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
@@ -1,24 +0,0 @@
|
||||
{{ define "status" }}<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
{{template "meta_tags" "Server status"}}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{{template "page_top" .}}
|
||||
<div id="page_content" class="page_content">
|
||||
<script type="text/javascript" src="https://static.hetrix.io/iframeResizer/iframeResizer.min.js"></script>
|
||||
<iframe
|
||||
class="htframe"
|
||||
src="https://wl.hetrixtools.com/r/3e1b7bf5ddf9858527cbf209d3d9ef60/"
|
||||
width="100%"
|
||||
scrolling="no"
|
||||
style="border: none; display: block;"
|
||||
sandbox="allow-scripts allow-same-origin allow-popups"
|
||||
onload="iFrameResize([{log:false}],'.htframe')"
|
||||
></iframe>
|
||||
</div>
|
||||
{{template "page_bottom" .}}
|
||||
</body>
|
||||
</html>
|
||||
{{ end }}
|
||||
@@ -1,75 +0,0 @@
|
||||
{{define "widgets"}}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
{{template "meta_tags" "Cloud storage and data transfer services"}}
|
||||
</head>
|
||||
<body>
|
||||
{{template "page_top" .}}
|
||||
<header>
|
||||
<h1>Widget showcase</h1>
|
||||
</header>
|
||||
<div id="page_content" class="page_content">
|
||||
<section>
|
||||
<h2>Size 2 header</h2>
|
||||
<h3>Size 3 header</h3>
|
||||
<h4>Size 4 header</h4>
|
||||
<h5>Size 5 header</h5>
|
||||
<h6>Size 6 header</h6>
|
||||
|
||||
<div class="highlight_shaded">Shaded highlight</div>
|
||||
<br/>
|
||||
Link <a href="#">A link to someplace</a>.
|
||||
<hr/>
|
||||
Buttons <button>Regular ol' button!</button>
|
||||
Width indicator
|
||||
<button class="button_highlight">Important button!</button>
|
||||
Width indicator
|
||||
<button class="button_red">Dangerous button!</button>
|
||||
<hr/>
|
||||
Textarea <textarea>Hello!</textarea>
|
||||
<hr/>
|
||||
Checkbox <input type="checkbox"/>
|
||||
<hr/>
|
||||
Radio
|
||||
<input name="radioform" type="radio"/>
|
||||
<input name="radioform" type="radio"/>
|
||||
<hr/>
|
||||
Text field <input type="text"/>
|
||||
<hr/>
|
||||
Password <input type="password"/>
|
||||
<hr/>
|
||||
Number <input type="number"/>
|
||||
<hr/>
|
||||
Select
|
||||
<select name="select">
|
||||
<option>cherry</option>
|
||||
<option>orange</option>
|
||||
<option>apple</option>
|
||||
</select>
|
||||
<hr/>
|
||||
Select2 <select name="select2" size="3">
|
||||
<option>cherry</option>
|
||||
<option>orange</option>
|
||||
<option>apple</option>
|
||||
</select>
|
||||
<hr/>
|
||||
File <input type="file" name="file">
|
||||
<hr/>
|
||||
Color <input type="color" name="favcolor" value="#ff0000">
|
||||
<hr/>
|
||||
<fieldset>
|
||||
<legend>Legend</legend>
|
||||
<p>
|
||||
Fieldset
|
||||
</p>
|
||||
</fieldset>
|
||||
|
||||
<br/><br/>
|
||||
<iframe src="https://nova.storage/u/Nygt1on4?embed" style="border: none; width: 800px; max-width: 100%; height: 600px; max-height: 100%; border-radius: 16px;"></iframe>
|
||||
</section>
|
||||
</div>
|
||||
{{template "page_bottom" .}}
|
||||
</body>
|
||||
</html>
|
||||
{{end}}
|
||||
@@ -1,35 +1,42 @@
|
||||
{{define "wrap"}}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>{{.Title}}</title>
|
||||
<meta charset="UTF-8"/>
|
||||
<title>{{.Title}}</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
|
||||
<link id="stylesheet_layout" rel="stylesheet" type="text/css" href="/res/style/layout.css?v{{cacheID}}"/>
|
||||
<link id="stylesheet_theme" rel="stylesheet" type="text/css" href="/theme.css"/>
|
||||
<link rel="stylesheet" href="/res/style/layout.css?v{{.CacheID}}"/>
|
||||
<link rel="stylesheet" href="/res/style/icons.css?v{{.CacheID}}"/>
|
||||
|
||||
<link rel="icon" sizes="32x32" href="/res/img/nova_32.png" />
|
||||
<link rel="icon" sizes="64x64" href="/res/img/nova_64.png" />
|
||||
<link rel="icon" sizes="128x128" href="/res/img/nova_128.png" />
|
||||
<link rel="icon" sizes="152x152" href="/res/img/nova_152.png" />
|
||||
<link rel="icon" sizes="180x180" href="/res/img/nova_180.png" />
|
||||
<link rel="icon" sizes="192x192" href="/res/img/nova_192.png" />
|
||||
<link rel="icon" sizes="196x196" href="/res/img/nova_196.png" />
|
||||
<link rel="icon" sizes="256x256" href="/res/img/nova_256.png" />
|
||||
<link rel="apple-touch-icon" sizes="128x128" href="/res/img/nova_128.png" />
|
||||
<link rel="apple-touch-icon" sizes="256x256" href="/res/img/nova_256.png" />
|
||||
<link rel="shortcut icon" sizes="256x256" href="/res/img/nova_256.png" />
|
||||
<link rel="icon" href="/favicon.ico" sizes="32x32"/>
|
||||
<link rel="icon" href="/res/img/nova.svg" type="image/svg+xml"/>
|
||||
<link rel="apple-touch-icon" href="/res/img/nova_180.png"/>
|
||||
|
||||
{{range .OGData.MetaPropRules}}
|
||||
<meta property="{{.Key}}" content="{{.Value}}" />
|
||||
{{end}}
|
||||
{{range .OGData.MetaNameRules}}
|
||||
<meta name="{{.Key}}" content="{{.Value}}" />
|
||||
{{end}}
|
||||
{{range .OGData.LinkRules}}
|
||||
<link rel="{{.Key}}" href="{{.Value}}" />
|
||||
{{end}}
|
||||
|
||||
{{ template "opengraph" .OGData }}
|
||||
<script>
|
||||
// The branding of the user's home directory, saved on the previous
|
||||
// visit. Applying it before the page is drawn prevents a flash of
|
||||
// the default theme while the app loads
|
||||
try {
|
||||
document.documentElement.style.cssText = localStorage.getItem("branding") ?? ""
|
||||
} catch {}
|
||||
|
||||
window.api_endpoint = '{{.APIEndpoint}}';
|
||||
window.server_hostname = "{{.Hostname}}";
|
||||
{{with .User}}window.user = {{.}};{{end}}
|
||||
{{with .Node}}window.initial_node = {{.}};{{end}}
|
||||
</script>
|
||||
|
||||
<script defer src='/res/svelte/wrap.js?v{{cacheID}}' type="module"></script>
|
||||
<script src="/res/svelte/main.js" type="module"></script>
|
||||
</head>
|
||||
<body></body>
|
||||
</html>
|
||||
{{end}}
|
||||
@@ -1,16 +0,0 @@
|
||||
export default api => {
|
||||
api.cache(true);
|
||||
return {
|
||||
presets: [
|
||||
[
|
||||
"@babel/env",
|
||||
{
|
||||
"targets": {
|
||||
"firefox": "52",
|
||||
"esmodules": true,
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
};
|
||||
}
|
||||
@@ -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")
|
||||
@@ -3,35 +3,20 @@
|
||||
"version": "1.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"rbuild": "rollup -c",
|
||||
"rdev": "rollup -c -w",
|
||||
"vbuild": "vite build",
|
||||
"vdev": "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": {
|
||||
"@babel/core": "^7.26.0",
|
||||
"@babel/preset-env": "^7.26.0",
|
||||
"@rollup/plugin-babel": "^6.0.4",
|
||||
"@rollup/plugin-commonjs": "^26.0.3",
|
||||
"@rollup/plugin-node-resolve": "^15.3.1",
|
||||
"@rollup/plugin-terser": "^0.4.4",
|
||||
"@rollup/plugin-typescript": "^11.1.6",
|
||||
"@types/jsmediatags": "^3.9.6",
|
||||
"@types/node": "^24.10.0",
|
||||
"rollup": "^4.24.4",
|
||||
"rollup-plugin-livereload": "^2.0.5",
|
||||
"rollup-plugin-svelte": "^7.2.2",
|
||||
"svelte": "^5.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@sveltejs/vite-plugin-svelte": "^6.2.1",
|
||||
"behave-js": "^1.5.0",
|
||||
"chart.js": "^4.5.1",
|
||||
"country-data-list": "^1.4.0",
|
||||
"pure-color": "^1.3.0",
|
||||
"rollup-plugin-includepaths": "^0.2.4",
|
||||
"svelte-preprocess": "^6.0.3",
|
||||
"tslib": "^2.8.1",
|
||||
"vite": "^7.1.12"
|
||||
}
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
import svelte from 'rollup-plugin-svelte';
|
||||
import resolve from '@rollup/plugin-node-resolve';
|
||||
import commonjs from '@rollup/plugin-commonjs';
|
||||
import livereload from 'rollup-plugin-livereload';
|
||||
import terser from '@rollup/plugin-terser';
|
||||
import babel from '@rollup/plugin-babel'
|
||||
import typescript from '@rollup/plugin-typescript'
|
||||
import { sveltePreprocess } from 'svelte-preprocess';
|
||||
|
||||
const production = !process.env.ROLLUP_WATCH;
|
||||
|
||||
const builddir = "../res/static/svelte"
|
||||
export default [
|
||||
"wrap",
|
||||
].map((name, index) => ({
|
||||
input: `src/${name}.js`,
|
||||
output: {
|
||||
sourcemap: true,
|
||||
format: 'iife',
|
||||
name: 'app',
|
||||
file: `${builddir}/${name}.js`,
|
||||
},
|
||||
plugins: [
|
||||
sveltePreprocess(),
|
||||
|
||||
svelte({
|
||||
preprocess: sveltePreprocess(),
|
||||
compilerOptions: {
|
||||
// enable run-time checks when not in production
|
||||
dev: !production,
|
||||
},
|
||||
emitCss: false,
|
||||
}),
|
||||
|
||||
babel({
|
||||
extensions: [".js", ".ts", ".svelte"],
|
||||
babelHelpers: "bundled",
|
||||
}),
|
||||
|
||||
// If you have external dependencies installed from npm, you'll most
|
||||
// likely need these plugins. In some cases you'll need additional
|
||||
// configuration - consult the documentation for details:
|
||||
// https://github.com/rollup/plugins/tree/master/packages/commonjs
|
||||
resolve({
|
||||
browser: true,
|
||||
exportConditions: ['svelte'],
|
||||
modulePaths: [process.cwd() + "/src", process.cwd() + "/node_modules"],
|
||||
extensions: [".svelte", ".mjs", ".js", ".json", ".mts", ".ts"],
|
||||
}),
|
||||
commonjs(),
|
||||
typescript(),
|
||||
|
||||
// Watch the `public` directory and refresh the browser on changes when
|
||||
// not in production
|
||||
!production && livereload({
|
||||
watch: `${builddir}/${name}.*`,
|
||||
port: 5000 + index,
|
||||
}),
|
||||
|
||||
// If we're building for production (npm run build instead of npm run
|
||||
// dev), minify
|
||||
production && terser(),
|
||||
],
|
||||
watch: {
|
||||
clearScreen: false
|
||||
},
|
||||
}));
|
||||
@@ -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}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -124,8 +124,8 @@ onMount(() => {
|
||||
data: [],
|
||||
borderWidth: 2,
|
||||
pointRadius: 0,
|
||||
borderColor: color_by_name("highlight_color"),
|
||||
backgroundColor: color_by_name("highlight_color"),
|
||||
borderColor: color_by_name("accent_color"),
|
||||
backgroundColor: color_by_name("accent_color"),
|
||||
},
|
||||
];
|
||||
graphDownloads.data().datasets = [
|
||||
@@ -134,8 +134,8 @@ onMount(() => {
|
||||
data: [],
|
||||
borderWidth: 2,
|
||||
pointRadius: 0,
|
||||
borderColor: color_by_name("highlight_color"),
|
||||
backgroundColor: color_by_name("highlight_color"),
|
||||
borderColor: color_by_name("accent_color"),
|
||||
backgroundColor: color_by_name("accent_color"),
|
||||
},
|
||||
];
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -67,7 +67,7 @@ let pages = [
|
||||
}, {
|
||||
path: "/admin/paypal_taxes",
|
||||
title: "Paypal Taxes",
|
||||
icon: "paypal",
|
||||
icon: "payments",
|
||||
component: PayPalTaxes,
|
||||
}, {
|
||||
path: "/admin/invoices",
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<script lang="ts">
|
||||
import { fs_encode_path } from "lib/FilesystemAPI.svelte";
|
||||
import { path_link, type FSNavigator } from "./FSNavigator";
|
||||
import { move_target, path_link, type FSNavigator } from "./FSNavigator";
|
||||
import FileMenu from "./filemanager/FileMenu.svelte";
|
||||
import EditWindow from "./edit_window/EditWindow.svelte";
|
||||
import { onMount } from "svelte";
|
||||
import { breadcrumbs_store } from "wrap/BreadcrumbStore";
|
||||
import { breadcrumbs_store } from "wrap/HeaderStore";
|
||||
|
||||
let {
|
||||
nav,
|
||||
@@ -29,19 +29,20 @@ onMount(() => {
|
||||
href={"/d"+fs_encode_path(node.path)}
|
||||
class="breadcrumb button flat"
|
||||
use:path_link={{nav: nav, node: node}}
|
||||
use:move_target={{nav, node: () => node}}
|
||||
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}
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<script lang="ts">
|
||||
import Chart from "util/Chart.svelte";
|
||||
import type Chart from "util/Chart.svelte";
|
||||
import { formatDataVolume, formatDate, formatThousands } from "util/Formatting";
|
||||
import Modal from "util/Modal.svelte";
|
||||
import { fs_path_url, fs_share_hotlink_url, fs_share_url, fs_timeseries, type FSNode } from "lib/FilesystemAPI.svelte";
|
||||
import { color_by_name } from "util/Util";
|
||||
import { tick } from "svelte";
|
||||
import CopyButton from "layout/CopyButton.svelte";
|
||||
import type { FSNavigator } from "./FSNavigator";
|
||||
import { untrack } from "svelte";
|
||||
|
||||
let {
|
||||
nav,
|
||||
@@ -20,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))
|
||||
}
|
||||
})
|
||||
|
||||
@@ -43,12 +46,7 @@ let total_downloads = $state(0)
|
||||
let total_egress = $state(0)
|
||||
|
||||
let update_chart = async (base: FSNode, timespan: number, interval: number) => {
|
||||
if (chart === undefined) {
|
||||
// Wait for the chart element to render, if it's not rendered already
|
||||
await tick()
|
||||
}
|
||||
|
||||
if (!visible || base.type !== "file" || chart === undefined) {
|
||||
if (!visible || base.type !== "file" || !chart) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -116,15 +114,15 @@ let update_chart = async (base: FSNode, timespan: number, interval: number) => {
|
||||
label: "Downloads",
|
||||
borderWidth: 2,
|
||||
pointRadius: 0,
|
||||
borderColor: color_by_name("highlight_color"),
|
||||
backgroundColor: color_by_name("highlight_color"),
|
||||
borderColor: color_by_name("accent_color"),
|
||||
backgroundColor: color_by_name("accent_color"),
|
||||
data: resp.downloads.amounts,
|
||||
}, {
|
||||
label: "Egress",
|
||||
borderWidth: 2,
|
||||
pointRadius: 0,
|
||||
borderColor: color_by_name("danger_color"),
|
||||
backgroundColor: color_by_name("danger_color"),
|
||||
borderColor: color_by_name("red_color"),
|
||||
backgroundColor: color_by_name("red_color"),
|
||||
yAxisID: "y1",
|
||||
data: resp.egress.amounts,
|
||||
},
|
||||
@@ -244,7 +242,10 @@ let direct_share_url = $derived(fs_share_hotlink_url($nav.path))
|
||||
{/each}
|
||||
</div>
|
||||
|
||||
<Chart bind:this={chart} />
|
||||
<!-- Chart.js is big, so it's only downloaded when it's needed -->
|
||||
{#await import("util/Chart.svelte") then c}
|
||||
<c.default bind:this={chart} />
|
||||
{/await}
|
||||
{/if}
|
||||
</Modal>
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<script lang="ts">
|
||||
import TextBlock from "layout/TextBlock.svelte";
|
||||
import TextBlock from "layout/TextBlock.svelte";
|
||||
import Button from "layout/Button.svelte";
|
||||
import { type FSNavigator } from "./FSNavigator";
|
||||
import { onMount } from "svelte";
|
||||
import { breadcrumbs_store } from "wrap/BreadcrumbStore";
|
||||
import { breadcrumbs_store } from "wrap/HeaderStore";
|
||||
|
||||
let {
|
||||
nav
|
||||
@@ -17,6 +18,16 @@ onMount(() => {
|
||||
|
||||
|
||||
})
|
||||
|
||||
let password = $state("")
|
||||
let wrong_password = $state(false)
|
||||
const submit_password = async (e: SubmitEvent) => {
|
||||
e.preventDefault()
|
||||
await nav.navigate(nav.last_requested_path, false, password)
|
||||
|
||||
// This page is gone if the password was right
|
||||
wrong_password = true
|
||||
}
|
||||
</script>
|
||||
|
||||
{#snippet breadcrumbs()}
|
||||
@@ -29,6 +40,23 @@ onMount(() => {
|
||||
<p>
|
||||
This page could not be found.
|
||||
</p>
|
||||
{:else if $nav.navigation_error === "password_required"}
|
||||
<h1>Password required</h1>
|
||||
<p>
|
||||
This directory is protected with a password.
|
||||
</p>
|
||||
<form onsubmit={submit_password}>
|
||||
<!-- Password managers take the directory for the username. Without
|
||||
this they fill in the password of the visitor's Nova account. The
|
||||
hidden attribute does not work, the stylesheet overrides it -->
|
||||
<input type="text" autocomplete="username" value={$nav.last_requested_path.split("/")[1]} style="display: none;">
|
||||
<!-- svelte-ignore a11y_autofocus -->
|
||||
<input type="password" bind:value={password} placeholder="Password" required autofocus>
|
||||
<Button type="submit" icon="lock_open" label="Open"/>
|
||||
</form>
|
||||
{#if wrong_password}
|
||||
<p>This password is not correct.</p>
|
||||
{/if}
|
||||
{:else if $nav.navigation_error === "permission_denied" || $nav.navigation_error === "forbidden"}
|
||||
<h1>Permission denied</h1>
|
||||
<p>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { loading_finish, loading_start } from "lib/Loading";
|
||||
import { fs_get_node, fs_encode_path, fs_split_path } from "lib/FilesystemAPI.svelte";
|
||||
import { loading_finish, loading_run, loading_start } from "lib/Loading";
|
||||
import { fs_get_node, fs_encode_path, fs_split_path, fs_path_from_json, fs_path_url, fs_rename } from "lib/FilesystemAPI.svelte";
|
||||
import type { FSNode, FSPath, FSPermissions, FSContext } from "lib/FilesystemAPI.svelte";
|
||||
|
||||
export class FSNavigator {
|
||||
@@ -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
|
||||
@@ -24,16 +28,6 @@ export class FSNavigator {
|
||||
this.history_enabled = history_enabled
|
||||
}
|
||||
|
||||
// The popstate event can be used to listen for navigation events. Register
|
||||
// this event listener on the <svelte:window> in the parent element. When
|
||||
// the user presses the back or forward buttons in the browser we'll catch
|
||||
// the event and navigate to the proper directory
|
||||
popstate = (e: PopStateEvent) => {
|
||||
// Get the part of the URL after the fs root and navigate to it
|
||||
const path = window.location.pathname.replace(/^\/d/, "")
|
||||
this.navigate(decodeURI(path), false)
|
||||
}
|
||||
|
||||
// The FSNavigator acts as a svelte store. This allows for DOM reactivity.
|
||||
// This works by implementing the store contract:
|
||||
// https://svelte.dev/docs/svelte-components#script-4-prefix-stores-with-$-to-access-their-values
|
||||
@@ -55,8 +49,8 @@ export class FSNavigator {
|
||||
|
||||
last_requested_path: string = ""
|
||||
navigation_error: string = ""
|
||||
navigate = async (path: string, push_history: boolean) => {
|
||||
if (path === this.last_requested_path) {
|
||||
navigate = async (path: string, push_history: boolean, password?: string) => {
|
||||
if (path === this.last_requested_path && password === undefined) {
|
||||
console.debug("FSNavigator: Requested path ", path, " is equal to current path. Debouncing")
|
||||
return
|
||||
}
|
||||
@@ -66,17 +60,35 @@ export class FSNavigator {
|
||||
path = "/" + path
|
||||
}
|
||||
|
||||
// The password of a shared directory is entered by the visitor, or it's
|
||||
// in the link they opened. It's sent in a cookie, which is the only way
|
||||
// to get it into the requests for images, videos and downloads. The
|
||||
// cookie's path is the directory, so each directory has its own password
|
||||
if (password === undefined && this.history_enabled) {
|
||||
password = new URLSearchParams(window.location.search).get("password")
|
||||
}
|
||||
if (password) {
|
||||
document.cookie = "nova_fs_password=" + encodeURIComponent(password) +
|
||||
"; path=" + fs_path_url(path.split("/")[1]) + "; samesite=lax"
|
||||
}
|
||||
|
||||
console.debug("FSNavigator: Navigating to path", path, push_history)
|
||||
|
||||
try {
|
||||
loading_start()
|
||||
const resp = await fs_get_node(path)
|
||||
|
||||
// The server embeds the node which the page was opened on. It's only
|
||||
// valid for the first navigation, which is to that same page
|
||||
const resp = window.initial_node !== undefined
|
||||
? fs_path_from_json(window.initial_node)
|
||||
: await fs_get_node(path)
|
||||
window.initial_node = undefined
|
||||
this.open_node(resp, push_history)
|
||||
} catch (err: any) {
|
||||
if (err.value !== undefined && err.value === "path_not_found") {
|
||||
if (path !== this.path[0].path && path !== "/" && path !== "") {
|
||||
if (path !== this.path[0]?.path && path !== "/" && path !== "") {
|
||||
console.debug("Path", path, "was not found, trying to navigate to parent")
|
||||
this.navigate(fs_split_path(path).parent, push_history)
|
||||
this.navigate(fs_split_path(path).parent, push_history, password)
|
||||
}
|
||||
} else if (err.value !== undefined) {
|
||||
this.navigation_error = err.value
|
||||
@@ -255,6 +267,105 @@ export class FSNavigator {
|
||||
// the reactivity
|
||||
this.notify_subscribers()
|
||||
}
|
||||
|
||||
// The selection is kept by path, so it survives reloads and navigating to
|
||||
// other directories. The directory views look each entry up in it
|
||||
selecting = false
|
||||
selection = new Map<string, FSNode>()
|
||||
last_selected = ""
|
||||
|
||||
// Leaving selection mode clears the selection
|
||||
set_selecting = (on: boolean) => {
|
||||
this.selecting = on
|
||||
if (!on) {
|
||||
this.selection.clear()
|
||||
}
|
||||
this.notify_subscribers()
|
||||
}
|
||||
|
||||
// Toggles a node. With range, everything between it and the node which was
|
||||
// toggled before it is selected. Hidden nodes are left out of the range when
|
||||
// the view doesn't show them
|
||||
select = (node: FSNode, range = false, hidden = true) => {
|
||||
const from = range ? this.children.findIndex(c => c.path === this.last_selected) : -1
|
||||
if (from !== -1) {
|
||||
const to = this.children.indexOf(node)
|
||||
for (let i = Math.min(from, to); i <= Math.max(from, to); i++) {
|
||||
if (hidden || !this.children[i].is_hidden()) {
|
||||
this.selection.set(this.children[i].path, this.children[i])
|
||||
}
|
||||
}
|
||||
} else if (!this.selection.delete(node.path)) {
|
||||
this.selection.set(node.path, node)
|
||||
}
|
||||
this.last_selected = node.path
|
||||
this.set_selecting(true)
|
||||
}
|
||||
|
||||
// Downloads the selection, or the open node if nothing is selected. More
|
||||
// than one node is zipped by the closest directory which they are all in
|
||||
download = () => {
|
||||
const nodes = [...this.selection.values()]
|
||||
if (nodes.length < 2) {
|
||||
return (nodes[0] ?? this.base).download()
|
||||
}
|
||||
|
||||
let dir = nodes[0].path
|
||||
do {
|
||||
dir = dir.slice(0, dir.lastIndexOf("/"))
|
||||
} while (!nodes.every(n => n.path.startsWith(dir + "/")))
|
||||
|
||||
const a = document.createElement("a")
|
||||
a.href = fs_path_url(dir) + "?bulk_download&" + new URLSearchParams(
|
||||
nodes.map(n => ["include", n.path.slice(dir.length + 1)])
|
||||
)
|
||||
a.download = ""
|
||||
a.dispatchEvent(new MouseEvent("click"))
|
||||
}
|
||||
|
||||
// A directory can't be moved into itself, and there has to be at least one
|
||||
// node which is not in dir already
|
||||
can_move = (dir: string) => {
|
||||
let moves = false
|
||||
for (const node of this.selection.values()) {
|
||||
if ((dir + "/").startsWith(node.path + "/")) {
|
||||
return false
|
||||
}
|
||||
moves ||= node.path !== dir + "/" + node.name
|
||||
}
|
||||
return moves
|
||||
}
|
||||
|
||||
move_selection = async (dir: string) => {
|
||||
try {
|
||||
await loading_run(() => Promise.all(
|
||||
[...this.selection.values()]
|
||||
.filter(node => node.path !== dir + "/" + node.name)
|
||||
.map(node => fs_rename(node.path, dir + "/" + node.name))
|
||||
))
|
||||
} catch (err: any) {
|
||||
console.error(err)
|
||||
alert("Move failed: " + err.message + " (" + err.value + ")")
|
||||
}
|
||||
this.set_selecting(false)
|
||||
await this.reload()
|
||||
}
|
||||
|
||||
// Dragging a node drags the whole selection. The drag itself only carries a
|
||||
// marker, as the selection outlives the element which is being dragged when
|
||||
// the user navigates during the drag
|
||||
drag_start = (e: DragEvent, node: FSNode) => {
|
||||
e.dataTransfer.setData(drag_type, node.path)
|
||||
e.dataTransfer.effectAllowed = "move"
|
||||
|
||||
if (!this.selecting) {
|
||||
// The drag started the selection, so it ends it as well
|
||||
e.target.addEventListener("dragend", () => this.set_selecting(false), { once: true })
|
||||
}
|
||||
if (!this.selection.has(node.path)) {
|
||||
this.select(node)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const sort_children = (children: FSNode[], field: string, asc: boolean) => {
|
||||
@@ -291,7 +402,55 @@ const sort_children = (children: FSNode[], field: string, asc: boolean) => {
|
||||
|
||||
export let global_navigator = new FSNavigator(true)
|
||||
|
||||
const drag_type = "application/x-nova-selection"
|
||||
const is_drag = (e: DragEvent) => e.dataTransfer.types.includes(drag_type)
|
||||
|
||||
// Moves the selection into a directory when it's dropped on the element. The
|
||||
// node is a function because an action only gets its parameters once. Bookmarks
|
||||
// have no type, the server refuses the move if one turns out to be a file
|
||||
export const move_target = (
|
||||
el: HTMLElement,
|
||||
data: { nav: FSNavigator, node: () => { path: string, type?: string } },
|
||||
) => {
|
||||
const accepts = (e: DragEvent) => {
|
||||
if (!is_drag(e) || data.node().type === "file" || !data.nav.can_move(data.node().path)) {
|
||||
return false
|
||||
}
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
return true
|
||||
}
|
||||
el.addEventListener("dragover", e => {
|
||||
if (accepts(e)) {
|
||||
el.style.boxShadow = "var(--accent_color) 0 0 0 2px inset"
|
||||
}
|
||||
})
|
||||
el.addEventListener("dragleave", () => el.style.boxShadow = "")
|
||||
el.addEventListener("drop", e => {
|
||||
el.style.boxShadow = ""
|
||||
if (accepts(e)) {
|
||||
data.nav.move_selection(data.node().path)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// Clicks the element when the selection is held over it, so the navigation
|
||||
// buttons work during a drag
|
||||
export const drag_click = (el: HTMLElement) => {
|
||||
let timer: number
|
||||
el.addEventListener("dragenter", e => {
|
||||
if (is_drag(e)) {
|
||||
clearTimeout(timer)
|
||||
timer = window.setTimeout(() => el.click(), 500)
|
||||
}
|
||||
})
|
||||
el.addEventListener("dragleave", e => {
|
||||
// Moving onto a child of the element is not leaving it
|
||||
if (!el.contains(e.relatedTarget as Node)) {
|
||||
clearTimeout(timer)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export const path_link = (node: HTMLAnchorElement, data: { nav: FSNavigator, node: FSNode }) => {
|
||||
// Set url
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -5,22 +5,19 @@ import Toolbar from "./Toolbar.svelte";
|
||||
import Breadcrumbs from "./Breadcrumbs.svelte";
|
||||
import DetailsWindow from "./DetailsWindow.svelte";
|
||||
import FilePreview from "./viewers/FilePreview.svelte";
|
||||
import FSUploadWidget from "./upload_widget/FSUploadWidget.svelte";
|
||||
import { global_navigator } from "./FSNavigator"
|
||||
import { css_from_path } from "filesystem/edit_window/Branding";
|
||||
import { update_favicon } from "util/NovaLogo.svelte";
|
||||
import AffiliatePrompt from "user_home/AffiliatePrompt.svelte";
|
||||
import { current_page_store } from "wrap/RouterStore";
|
||||
import SearchBar from "./SearchBar.svelte";
|
||||
import ErrorPage from "./ErrorPage.svelte";
|
||||
|
||||
let file_preview: FilePreview = $state()
|
||||
let toolbar: Toolbar = $state()
|
||||
let upload_widget: FSUploadWidget = $state()
|
||||
let details_visible = $state(false)
|
||||
let edit_window: EditWindow = $state()
|
||||
let edit_visible = $state(false)
|
||||
let details_window: DetailsWindow = $state()
|
||||
let search_bar: SearchBar = $state()
|
||||
|
||||
const nav = global_navigator
|
||||
|
||||
@@ -41,29 +38,25 @@ onMount(() => {
|
||||
return
|
||||
}
|
||||
|
||||
// Custom CSS rules for the whole viewer. The MainMenu applies its
|
||||
// styles to the <html> element. So we apply to the <body> element, our
|
||||
// styles take precedence since they're lower level, and we can clean it
|
||||
// up afterwards without overwriting global style
|
||||
// Custom CSS rules for the whole viewer. App.svelte applies its styles
|
||||
// to the <html> element. So we apply to the <body> element, our styles
|
||||
// take precedence since they're lower level, and we can clean it up
|
||||
// afterwards without overwriting global style
|
||||
document.body.style = css_from_path(nav.path)
|
||||
update_favicon()
|
||||
})
|
||||
return () => {
|
||||
page_sub()
|
||||
nav_sub()
|
||||
document.body.style = ""
|
||||
update_favicon()
|
||||
}
|
||||
})
|
||||
|
||||
const keydown = (e: KeyboardEvent) => {
|
||||
if (e.ctrlKey || e.altKey || e.metaKey) {
|
||||
return // prevent custom shortcuts from interfering with system shortcuts
|
||||
} else if (
|
||||
(document.activeElement as any).type !== undefined &&
|
||||
(
|
||||
(document.activeElement as any).type === "text" ||
|
||||
(document.activeElement as any).type === "textarea"
|
||||
)
|
||||
) {
|
||||
} else if (["text", "password", "textarea"].includes((document.activeElement as any).type)) {
|
||||
return // Prevent shortcuts from interfering with input fields
|
||||
}
|
||||
|
||||
@@ -83,13 +76,10 @@ const keydown = (e: KeyboardEvent) => {
|
||||
}
|
||||
break;
|
||||
case "s":
|
||||
nav.base.download()
|
||||
nav.download()
|
||||
break;
|
||||
case "r":
|
||||
nav.shuffle = !nav.shuffle
|
||||
break;
|
||||
case "/":
|
||||
search_bar.open()
|
||||
nav.toggle_shuffle()
|
||||
break;
|
||||
case "a":
|
||||
case "ArrowLeft":
|
||||
@@ -150,10 +140,8 @@ const keydown = (e: KeyboardEvent) => {
|
||||
<FilePreview
|
||||
bind:this={file_preview}
|
||||
nav={nav}
|
||||
upload_widget={upload_widget}
|
||||
edit_window={edit_window}
|
||||
details_window={details_window}
|
||||
search_bar={search_bar}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -170,16 +158,10 @@ const keydown = (e: KeyboardEvent) => {
|
||||
<ErrorPage nav={nav} />
|
||||
{/if}
|
||||
|
||||
<SearchBar bind:this={search_bar} nav={nav}/>
|
||||
|
||||
<DetailsWindow nav={nav} bind:this={details_window} bind:visible={details_visible} />
|
||||
|
||||
<EditWindow nav={nav} bind:this={edit_window} bind:visible={edit_visible} />
|
||||
|
||||
<!-- This one is included at the highest level so uploads can keep running
|
||||
even when the user navigates to a different directory -->
|
||||
<FSUploadWidget nav={nav} bind:this={upload_widget} />
|
||||
|
||||
<AffiliatePrompt/>
|
||||
|
||||
<style>
|
||||
|
||||
@@ -1,132 +0,0 @@
|
||||
<script lang="ts">
|
||||
import NovaLogo from "util/NovaLogo.svelte";
|
||||
import Button from "layout/Button.svelte";
|
||||
import Euro from "util/Euro.svelte";
|
||||
import { formatDataVolume } from "util/Formatting";
|
||||
import { user } from "lib/UserStore";
|
||||
import Dialog from "layout/Dialog.svelte";
|
||||
|
||||
let button: HTMLButtonElement = $state()
|
||||
let dialog: Dialog = $state()
|
||||
|
||||
let {
|
||||
no_login_label = "Nova",
|
||||
hide_name = true,
|
||||
hide_logo = false,
|
||||
style = "",
|
||||
embedded = false
|
||||
}: {
|
||||
no_login_label?: string;
|
||||
// Hide the label if the screen is smaller than 800px
|
||||
hide_name?: boolean;
|
||||
hide_logo?: boolean;
|
||||
style?: string;
|
||||
embedded?: boolean;
|
||||
} = $props();
|
||||
|
||||
let target = $derived(embedded ? "_blank" : "_self")
|
||||
|
||||
const open = () => dialog.open(button.getBoundingClientRect())
|
||||
</script>
|
||||
|
||||
<div class="wrapper">
|
||||
<button bind:this={button} onclick={open} class="button round" title="Menu" style={style}>
|
||||
{#if !hide_logo}
|
||||
<NovaLogo style="height: 1.6em; width: 1.6em;"/>
|
||||
{/if}
|
||||
<span class="button_username" class:hide_name>
|
||||
{#if $user !== null}
|
||||
{$user.username === "" ? no_login_label : $user.username}
|
||||
{/if}
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<Dialog bind:this={dialog}>
|
||||
<div class="menu">
|
||||
{#if $user !== null}
|
||||
<Button link_href="/user" link_target={target} icon="dashboard" label="Dashboard" />
|
||||
<div class="separator"></div>
|
||||
|
||||
<div class="stats_table">
|
||||
<div>Subscription</div>
|
||||
<div>{$user.subscription.name}</div>
|
||||
|
||||
{#if $user.subscription.type === "prepaid"}
|
||||
<div>Credit</div>
|
||||
<div><Euro amount={$user.balance_micro_eur}/></div>
|
||||
{/if}
|
||||
|
||||
<div>Storage used</div>
|
||||
<div>{formatDataVolume($user.filesystem_storage_used, 3)}</div>
|
||||
<div>Transfer used</div>
|
||||
<div>{formatDataVolume($user.monthly_transfer_used, 3)}</div>
|
||||
</div>
|
||||
<div class="separator"></div>
|
||||
|
||||
<Button link_href="/d/me" link_target={target} icon="folder" label="My Filesystem"/>
|
||||
<Button link_href="/filesystem" link_target={target} icon="description" label="Filesystem Guide"/>
|
||||
|
||||
<div class="separator"></div>
|
||||
|
||||
<Button link_href="/user/filemanager#files" link_target={target} icon="image" label="My Files"/>
|
||||
<Button link_href="/user/filemanager#lists" link_target={target} icon="photo_library" label="My Albums"/>
|
||||
|
||||
<div class="separator"></div>
|
||||
|
||||
<Button link_href="/user/settings" link_target={target} icon="settings" label="Account Settings"/>
|
||||
<Button link_href="/user/subscription" link_target={target} icon="shopping_cart" label="Subscription"/>
|
||||
<Button link_href="/user/subscription/transactions" link_target={target} icon="receipt" label="Transactions"/>
|
||||
|
||||
{#if $user.is_admin}
|
||||
<div class="separator"></div>
|
||||
<Button link_href="/admin" link_target={target} icon="admin_panel_settings" label="Admin Panel"/>
|
||||
{/if}
|
||||
{:else}
|
||||
<Button link_href="/" link_target={target} icon="home" label="Home"/>
|
||||
<Button link_href="/#pro" link_target={target} icon="star" label="Get Premium"/>
|
||||
<Button link_href="/login" link_target={target} icon="person" label="Log in"/>
|
||||
<Button link_href="/register" link_target={target} icon="person" label="Register"/>
|
||||
{/if}
|
||||
</div>
|
||||
</Dialog>
|
||||
|
||||
<style>
|
||||
.wrapper {
|
||||
flex-grow: 0;
|
||||
flex-shrink: 0;
|
||||
display: inline-flex;
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
.button {
|
||||
flex: 0 0 content;
|
||||
}
|
||||
.button_username {
|
||||
margin: 0 4px;
|
||||
}
|
||||
.menu {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
max-width: 15em;
|
||||
}
|
||||
.separator {
|
||||
height: 1px;
|
||||
margin: 2px 0;
|
||||
width: 100%;
|
||||
background-color: var(--separator);
|
||||
}
|
||||
.stats_table {
|
||||
display: grid;
|
||||
grid-template-columns: auto auto;
|
||||
gap: 0.2em 1em;
|
||||
margin: 3px;
|
||||
}
|
||||
|
||||
/* Hide username on small screen */
|
||||
@media(max-width: 800px) {
|
||||
.hide_name {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,13 +1,17 @@
|
||||
<script lang="ts" module>
|
||||
// The search bar is mounted once, in App.svelte. It sets this function when it
|
||||
// mounts, so that other components can open it
|
||||
export let open_search: () => void
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
import { onMount, tick } from "svelte";
|
||||
import { fs_search, fs_encode_path, fs_thumbnail_url, FSNode } from "lib/FilesystemAPI.svelte";
|
||||
import type { FSNavigator } from "filesystem/FSNavigator";
|
||||
import { global_navigator as nav } from "filesystem/FSNavigator";
|
||||
import { loading_finish, loading_start } from "lib/Loading";
|
||||
import { user } from "lib/UserStore";
|
||||
import Modal from "util/Modal.svelte";
|
||||
|
||||
let { nav }: {
|
||||
nav: FSNavigator;
|
||||
} = $props();
|
||||
import { navigate } from "wrap/Router.svelte";
|
||||
|
||||
let modal: Modal
|
||||
let search_bar: HTMLInputElement = $state()
|
||||
@@ -32,8 +36,23 @@ onMount(() => {
|
||||
})
|
||||
})
|
||||
|
||||
export const open = async () => {
|
||||
search_prefix_node = nav.base
|
||||
// The path of the directory to search. Outside of the filesystem page the
|
||||
// navigator is stale or empty, there it's the home directory of the user.
|
||||
// Visitors who are not logged in don't have one, then the path is empty
|
||||
const search_path = (): FSNode[] => {
|
||||
if (nav.initialized && window.location.pathname.startsWith("/d/")) {
|
||||
// If the base is not a directory, we use the parent
|
||||
return nav.base.type === "dir" ? nav.path : nav.path.slice(0, -1)
|
||||
}
|
||||
return $user === null ? [] : [{name: $user.username, path: "/me"} as FSNode]
|
||||
}
|
||||
|
||||
open_search = async () => {
|
||||
const path = search_path()
|
||||
if (path.length === 0) {
|
||||
return
|
||||
}
|
||||
search_prefix_node = path[path.length-1]
|
||||
modal.show()
|
||||
await tick()
|
||||
search_bar.focus()
|
||||
@@ -62,18 +81,14 @@ const search = async (limit = 10) => {
|
||||
|
||||
try {
|
||||
loading_start()
|
||||
let search_node = nav.base
|
||||
// If the base is not a directory, we use the parent
|
||||
if (search_node.type !== "dir") {
|
||||
search_node = nav.path[nav.path.length-2]
|
||||
}
|
||||
|
||||
const path = search_path()
|
||||
let search_node = path[path.length-1]
|
||||
let search_results_tmp = await fs_search(search_node.path, search_term, limit)
|
||||
|
||||
// If there are no results, and we are not searching the filesystem
|
||||
// root, we will search the filesystem root
|
||||
if (search_results_tmp.length === 0 && search_node.path != nav.path[0].path) {
|
||||
search_node = nav.path[0]
|
||||
if (search_results_tmp.length === 0 && path.length > 1) {
|
||||
search_node = path[0]
|
||||
search_results_tmp = await fs_search(search_node.path, search_term, limit)
|
||||
}
|
||||
|
||||
@@ -158,14 +173,14 @@ const open_result = (index: number, e?: MouseEvent) => {
|
||||
if (e !== undefined) {
|
||||
e.preventDefault()
|
||||
}
|
||||
nav.navigate(search_results[index], true)
|
||||
navigate("/d" + fs_encode_path(search_results[index]))
|
||||
clear_search(false)
|
||||
}
|
||||
|
||||
const window_keydown = (e: KeyboardEvent) => {
|
||||
if (e.ctrlKey || e.altKey || e.metaKey) {
|
||||
return // prevent custom shortcuts from interfering with system shortcuts
|
||||
} else if ((document.activeElement as any).type !== undefined && (document.activeElement as any).type === "text") {
|
||||
} else if (document.activeElement.matches("input, textarea, select")) {
|
||||
return // Prevent shortcuts from interfering with input fields
|
||||
}
|
||||
|
||||
@@ -175,9 +190,7 @@ const window_keydown = (e: KeyboardEvent) => {
|
||||
} else if (e.key === "/" || e.key === "f") {
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
// search_bar.focus()
|
||||
open()
|
||||
return
|
||||
open_search()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -200,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"
|
||||
@@ -237,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>
|
||||
@@ -287,12 +300,12 @@ const window_keydown = (e: KeyboardEvent) => {
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
text-decoration: none;
|
||||
color: var(--text-color);
|
||||
color: var(--body_text_color);
|
||||
padding: 2px;
|
||||
}
|
||||
.node_selected {
|
||||
background: var(--highlight_background);
|
||||
color: var(--highlight_text_color);
|
||||
background: var(--accent_background);
|
||||
color: var(--accent_text_color);
|
||||
}
|
||||
.node:hover:not(.node_selected) {
|
||||
background: var(--input_background);
|
||||
|
||||
@@ -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.base.download()}>
|
||||
<i class="icon">save</i>
|
||||
<button onclick={() => nav.download()}>
|
||||
<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("")
|
||||
@@ -42,13 +41,13 @@ const add_password = (e: SubmitEvent) => {
|
||||
}
|
||||
const generate_password = () => {
|
||||
// 32 hexadecimal characters, which any S3 client accepts as secret key
|
||||
new_password = crypto.randomUUID().replaceAll("-", "")
|
||||
const bytes = crypto.getRandomValues(new Uint8Array(16))
|
||||
new_password = Array.from(bytes, b => b.toString(16).padStart(2, "0")).join("")
|
||||
}
|
||||
// Passwords stay hidden until their reveal button is pressed
|
||||
let revealed: {[password: string]: boolean} = $state({})
|
||||
const del_password = (pass: string) => {
|
||||
delete options.password_permissions[pass]
|
||||
options.password_permissions = options.password_permissions
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -94,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>
|
||||
@@ -134,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>
|
||||
|
||||
@@ -11,12 +11,11 @@ type Style = {
|
||||
input_background?: string,
|
||||
input_hover_background?: string,
|
||||
input_text?: string,
|
||||
highlight_color?: string,
|
||||
highlight_background?: string,
|
||||
highlight_text_color?: string,
|
||||
accent_color?: string,
|
||||
accent_shade?: string,
|
||||
accent_background?: string,
|
||||
accent_text_color?: string,
|
||||
link_color?: string,
|
||||
danger_color?: string,
|
||||
danger_text_color?: string,
|
||||
background_color?: string,
|
||||
background?: string,
|
||||
background_text_color?: string,
|
||||
@@ -32,8 +31,45 @@ type Style = {
|
||||
background_image_size?: string,
|
||||
background_image_position?: string,
|
||||
background_image_repeat?: string,
|
||||
color_scheme?: string,
|
||||
green_color?: string,
|
||||
red_color?: string,
|
||||
yellow_color?: string,
|
||||
blue_color?: string,
|
||||
green_tint?: string,
|
||||
red_tint?: string,
|
||||
yellow_tint?: string,
|
||||
blue_tint?: string,
|
||||
logo_color_1?: string,
|
||||
logo_color_2?: string,
|
||||
logo_color_3?: string,
|
||||
logo_color_4?: string,
|
||||
}
|
||||
|
||||
// The hues of the accents for success, errors, warnings and notices, and the
|
||||
// accents for light themes. The dark defaults in layout.css are derived from
|
||||
// the default accent colour, the light defaults are these light accents.
|
||||
// Branding can also set each accent by itself
|
||||
const accent_hues = { green: 140, red: 8, yellow: 45, blue: 215 }
|
||||
const light_accents = { green: "#15793a", red: "#ba2c37", yellow: "#995c00", blue: "#2164ca" }
|
||||
const default_accent = "#49dfa0"
|
||||
|
||||
// The colourways of the logo, as designed. The hue the colourway is closest to,
|
||||
// the colours of the bars and the colours of the diagonal
|
||||
const logo_colourways: [number, string, string, string, string][] = [
|
||||
[1, "#f62e27", "#bb1d1c", "#bb1c1c", "#ee2c26"], // Red
|
||||
[20, "#f78146", "#bb5420", "#ee7a40", "#c05823"], // Orange
|
||||
[54, "#ffe500", "#8c8015", "#ead204", "#6d6310"], // Yellow
|
||||
[71, "#dde741", "#74a511", "#8bb925", "#eaed38"], // Lime
|
||||
[120, "#15c615", "#0c750c", "#0c730c", "#0c730c"], // Green
|
||||
[141, "#45ed52", "#11a574", "#24b880", "#39ef3d"], // Mint
|
||||
[190, "#48eef1", "#1378a8", "#258eba", "#38e8ec"], // Light blue
|
||||
[230, "#4b82f5", "#1111a5", "#2354b5", "#393bee"], // Dark blue
|
||||
[253, "#974af2", "#212eae", "#2929b8", "#8e39ee"], // Purple blue
|
||||
[270, "#8447f0", "#7514a9", "#5924b8", "#b039ef"], // Purple
|
||||
[330, "#f74bbb", "#ad174e", "#b72484", "#f13a77"], // Pink
|
||||
]
|
||||
|
||||
// Generate a branding style from a file's properties map
|
||||
export const branding_from_path = (path: Array<FSNode>) => {
|
||||
const style = {}
|
||||
@@ -57,7 +93,7 @@ export const css_from_path = (path: Array<FSNode>) => {
|
||||
}
|
||||
|
||||
const gen_css = (style: Style) => {
|
||||
return Object.entries(style).map(([key, value]) => `--${key}:${value}`).join(';');
|
||||
return Object.entries(with_accents(style)).map(([key, value]) => `--${key}:${value}`).join(';');
|
||||
}
|
||||
|
||||
// add_styles adds the styles configured in the properties struct to the
|
||||
@@ -74,20 +110,33 @@ const add_styles = (style: Style, properties: FSNodeProperties) => {
|
||||
style.input_hover_background = properties.brand_input_color
|
||||
style.input_text = add_contrast(properties.brand_input_color, text_contrast)
|
||||
}
|
||||
if (properties.brand_highlight_color) {
|
||||
style.highlight_color = properties.brand_highlight_color
|
||||
style.highlight_background = properties.brand_highlight_color
|
||||
style.highlight_text_color = add_contrast(properties.brand_highlight_color, text_contrast)
|
||||
if (properties.brand_accent_color) {
|
||||
style.accent_color = properties.brand_accent_color
|
||||
style.accent_background = properties.brand_accent_color
|
||||
style.accent_text_color = add_contrast(properties.brand_accent_color, text_contrast)
|
||||
|
||||
// If we have a body colour to compare it to we use the highlight colour
|
||||
// If we have a body colour to compare it to we use the accent colour
|
||||
// to generate the link colour
|
||||
if (properties.brand_body_color) {
|
||||
style.link_color = generate_link_color(properties.brand_highlight_color, properties.brand_body_color)
|
||||
style.link_color = generate_link_color(properties.brand_accent_color, properties.brand_body_color)
|
||||
}
|
||||
|
||||
// The logo gets the colourway closest to the accent colour. Greys
|
||||
// have no meaningful hue, they keep the default
|
||||
const [hue, saturation] = rgb2hsl(parse(properties.brand_accent_color))
|
||||
if (saturation > 15) {
|
||||
const distance = (h: number) => Math.min(Math.abs(h - hue), 360 - Math.abs(h - hue))
|
||||
const way = logo_colourways.reduce((a, b) => distance(b[0]) < distance(a[0]) ? b : a)
|
||||
style.logo_color_1 = way[1]
|
||||
style.logo_color_2 = way[2]
|
||||
style.logo_color_3 = way[3]
|
||||
style.logo_color_4 = way[4]
|
||||
}
|
||||
}
|
||||
if (properties.brand_danger_color) {
|
||||
style.danger_color = properties.brand_danger_color
|
||||
style.danger_text_color = add_contrast(properties.brand_danger_color, text_contrast)
|
||||
for (const name of Object.keys(accent_hues)) {
|
||||
if (properties["brand_" + name + "_color"]) {
|
||||
style[name + "_color"] = properties["brand_" + name + "_color"]
|
||||
}
|
||||
}
|
||||
if (properties.brand_background_color) {
|
||||
style.background_color = properties.brand_background_color
|
||||
@@ -102,6 +151,10 @@ const add_styles = (style: Style, properties: FSNodeProperties) => {
|
||||
style.shaded_background = set_alpha(properties.brand_body_color, body_alpha)
|
||||
style.separator = add_contrast(properties.brand_body_color, 15)
|
||||
style.shadow_color = darken(properties.brand_body_color, 0.8)
|
||||
|
||||
// Makes the browser draw its own controls, like scrollbars and date
|
||||
// pickers, in matching colours
|
||||
style.color_scheme = rgb2hsl(parse(properties.brand_body_color))[2] < 50 ? "dark" : "light"
|
||||
}
|
||||
if (properties.brand_card_color) {
|
||||
style.card_color = properties.brand_card_color
|
||||
@@ -114,6 +167,45 @@ const add_styles = (style: Style, properties: FSNodeProperties) => {
|
||||
}
|
||||
}
|
||||
|
||||
// with_accents adds the accents for success, errors, warnings and notices, and
|
||||
// their tints. Accents which the branding doesn't set get the saturation and
|
||||
// lightness of the accent colour, so they match it. A light theme's
|
||||
// accent colour is too light for text, those get fixed accents. A branded
|
||||
// page always gets all accents, else a shared directory would inherit the
|
||||
// accents of the visitor's own theme
|
||||
const with_accents = (style: Style): Style => {
|
||||
if (Object.keys(style).length === 0) {
|
||||
return style
|
||||
}
|
||||
|
||||
// Greys have no hue to match, those use the default accent colour
|
||||
let [, saturation, lightness] = rgb2hsl(parse(style.accent_color ?? default_accent))
|
||||
if (saturation <= 15) {
|
||||
[, saturation, lightness] = rgb2hsl(parse(default_accent))
|
||||
}
|
||||
|
||||
// Without its own background colours the branding is shown on the default
|
||||
// theme, which follows the browser's preference
|
||||
const light = (style.color_scheme ?? (matchMedia("(prefers-color-scheme: light)").matches ? "light" : "dark")) === "light"
|
||||
|
||||
const full = { ...style }
|
||||
|
||||
// The background of selected buttons. A subtle dark shade of the accent on
|
||||
// dark themes and a light one on light themes, so the accent is readable on it
|
||||
const [accent_hue, accent_saturation] = rgb2hsl(parse(style.accent_color ?? default_accent))
|
||||
full.accent_shade = rgb2hex(hsl2rgb([accent_hue, Math.min(accent_saturation, 25), light ? 91 : 19]))
|
||||
|
||||
for (const [name, hue] of Object.entries(accent_hues)) {
|
||||
let colour = style[name + "_color"]
|
||||
if (!colour) {
|
||||
colour = light ? light_accents[name] : rgb2hex(hsl2rgb([hue, saturation, lightness]))
|
||||
}
|
||||
full[name + "_color"] = colour
|
||||
full[name + "_tint"] = set_alpha(colour, 0.12)
|
||||
}
|
||||
return full
|
||||
}
|
||||
|
||||
const add_contrast = (color: string, amt: number) => {
|
||||
let hsl = rgb2hsl(parse(color)) // Convert hex to hsl
|
||||
// If the lightness is less than 40 it is considered a dark colour. This
|
||||
@@ -147,9 +239,9 @@ const generate_link_color = (link_color: string, body_color: string) => {
|
||||
// If the body and link colours are both dark we lighten the link, and the
|
||||
// other way around too
|
||||
if (body[2] < 50 && link[2] < 50) {
|
||||
link[2] = link[2] + 40 // Dark color, add lightness
|
||||
link[2] = link[2] + 30 // Dark color, add lightness
|
||||
} else if (body[2] > 50 && link[2] > 50) {
|
||||
link[2] = link[2] - 40 // Light color, remove lightness
|
||||
link[2] = link[2] - 30 // Light color, remove lightness
|
||||
}
|
||||
return rgb2hex(hsl2rgb(link)) // Convert back to hex
|
||||
}
|
||||
@@ -67,7 +67,7 @@ const handle_picker = async (nodes: FSNode[]) => {
|
||||
}
|
||||
}
|
||||
|
||||
let highlight_info = $state(false)
|
||||
let accent_info = $state(false)
|
||||
</script>
|
||||
|
||||
<fieldset>
|
||||
@@ -93,14 +93,14 @@ let highlight_info = $state(false)
|
||||
<fieldset class="grid" disabled={!enabled}>
|
||||
<legend>Custom colours</legend>
|
||||
<div>
|
||||
<div style="display: inline-block">Highlight</div>
|
||||
<HelpButton bind:toggle={highlight_info}/>
|
||||
<div style="display: inline-block">Accent</div>
|
||||
<HelpButton bind:toggle={accent_info}/>
|
||||
</div>
|
||||
<input type="color" value={options.brand_highlight_color} onchange={e => options.brand_highlight_color = (e.target as HTMLInputElement).value}/>
|
||||
<input type="text" bind:value={options.brand_highlight_color}/>
|
||||
{#if highlight_info}
|
||||
<input type="color" value={options.brand_accent_color} onchange={e => options.brand_accent_color = (e.target as HTMLInputElement).value}/>
|
||||
<input type="text" bind:value={options.brand_accent_color}/>
|
||||
{#if accent_info}
|
||||
<p class="span3">
|
||||
The highlight colour is used for highlighting selected buttons and
|
||||
The accent colour is used for highlighting selected buttons and
|
||||
other elements. It's also used as the page's theme colour, this
|
||||
affects things like the embed colour in Discord and the colour of
|
||||
the address bar in some web browsers.
|
||||
@@ -109,9 +109,6 @@ let highlight_info = $state(false)
|
||||
<div>Button and input</div>
|
||||
<input type="color" value={options.brand_input_color} onchange={e => options.brand_input_color = (e.target as HTMLInputElement).value}/>
|
||||
<input type="text" bind:value={options.brand_input_color}/>
|
||||
<div>Delete button</div>
|
||||
<input type="color" value={options.brand_danger_color} onchange={e => options.brand_danger_color = (e.target as HTMLInputElement).value}/>
|
||||
<input type="text" bind:value={options.brand_danger_color}/>
|
||||
<div>Background</div>
|
||||
<input type="color" value={options.brand_background_color} onchange={e => options.brand_background_color = (e.target as HTMLInputElement).value}/>
|
||||
<input type="text" bind:value={options.brand_background_color}/>
|
||||
@@ -123,6 +120,26 @@ let highlight_info = $state(false)
|
||||
<input type="text" bind:value={options.brand_card_color}/>
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="grid" disabled={!enabled}>
|
||||
<legend>Accent colours</legend>
|
||||
<p class="span3">
|
||||
Colours for success messages, errors, warnings and notices. Colours you
|
||||
leave empty will be derived from the accent colour, so they match it.
|
||||
</p>
|
||||
<div>Success</div>
|
||||
<input type="color" value={options.brand_green_color} onchange={e => options.brand_green_color = (e.target as HTMLInputElement).value}/>
|
||||
<input type="text" bind:value={options.brand_green_color}/>
|
||||
<div>Error</div>
|
||||
<input type="color" value={options.brand_red_color} onchange={e => options.brand_red_color = (e.target as HTMLInputElement).value}/>
|
||||
<input type="text" bind:value={options.brand_red_color}/>
|
||||
<div>Warning</div>
|
||||
<input type="color" value={options.brand_yellow_color} onchange={e => options.brand_yellow_color = (e.target as HTMLInputElement).value}/>
|
||||
<input type="text" bind:value={options.brand_yellow_color}/>
|
||||
<div>Notice</div>
|
||||
<input type="color" value={options.brand_blue_color} onchange={e => options.brand_blue_color = (e.target as HTMLInputElement).value}/>
|
||||
<input type="text" bind:value={options.brand_blue_color}/>
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="grid" disabled={!enabled}>
|
||||
<legend>Image customization</legend>
|
||||
<p class="span3">
|
||||
@@ -134,7 +151,7 @@ let highlight_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}/>
|
||||
@@ -142,7 +159,7 @@ let highlight_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}/>
|
||||
@@ -165,15 +182,22 @@ let highlight_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">
|
||||
<input type="text" value="A text field"/>
|
||||
</div>
|
||||
|
||||
<div class="example_button_row" style="gap: 4px;">
|
||||
<div class="highlight_green">Success</div>
|
||||
<div class="highlight_red">Error</div>
|
||||
<div class="highlight_yellow">Warning</div>
|
||||
<div class="highlight_blue">Notice</div>
|
||||
</div>
|
||||
|
||||
<hr/>
|
||||
|
||||
<div class="example example_card">
|
||||
|
||||
@@ -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/>
|
||||
|
||||
@@ -12,6 +12,13 @@ let current_theme = $state(-1)
|
||||
const set_theme = (index: number) => {
|
||||
current_theme = index
|
||||
|
||||
// Presets without accents derive them from the accent colour, the
|
||||
// accents of an earlier preset shouldn't stick
|
||||
properties.brand_green_color = ""
|
||||
properties.brand_red_color = ""
|
||||
properties.brand_yellow_color = ""
|
||||
properties.brand_blue_color = ""
|
||||
|
||||
// Copy all the properties of the theme to the file, except for the theme
|
||||
// name
|
||||
Object.keys(themes[index]).forEach(key => {
|
||||
@@ -25,99 +32,91 @@ const themes = [
|
||||
{
|
||||
name: "PD classic",
|
||||
brand_input_color: "#2d2d2d",
|
||||
brand_highlight_color: "#75b72d",
|
||||
brand_danger_color: "#821b3f",
|
||||
brand_accent_color: "#75b72d",
|
||||
brand_background_color: "#141414",
|
||||
brand_body_color: "#1e1e1e",
|
||||
brand_card_color: "#282828",
|
||||
}, {
|
||||
name: "Nord (dark)",
|
||||
brand_input_color: "#4f596d",
|
||||
brand_highlight_color: "#a4be8c",
|
||||
brand_danger_color: "#bd5f69",
|
||||
brand_accent_color: "#a4be8c",
|
||||
brand_background_color: "#2f3541",
|
||||
brand_body_color: "#3b4252",
|
||||
brand_card_color: "#434c5f",
|
||||
}, {
|
||||
name: "Nord (light)",
|
||||
brand_input_color: "#cad2e1",
|
||||
brand_highlight_color: "#a4be8c",
|
||||
brand_danger_color: "#bd5f69",
|
||||
brand_accent_color: "#a4be8c",
|
||||
brand_background_color: "#d7dde8",
|
||||
brand_body_color: "#ebeef3",
|
||||
brand_card_color: "#e5e9f0",
|
||||
}, {
|
||||
name: "Black",
|
||||
brand_input_color: "#202020",
|
||||
brand_highlight_color: "#57e389",
|
||||
brand_danger_color: "#ed333b",
|
||||
brand_accent_color: "#57e389",
|
||||
brand_background_color: "#000000",
|
||||
brand_body_color: "#080808",
|
||||
brand_card_color: "#101010",
|
||||
}, {
|
||||
name: "White",
|
||||
brand_input_color: "#f4f4f4",
|
||||
brand_highlight_color: "#2ec27e",
|
||||
brand_danger_color: "#c01c28",
|
||||
brand_accent_color: "#2ec27e",
|
||||
brand_background_color: "#f8f8f8",
|
||||
brand_body_color: "#ffffff",
|
||||
brand_card_color: "#f0f0f0",
|
||||
}, {
|
||||
name: "Solarized (dark)",
|
||||
brand_input_color: "#084453",
|
||||
brand_highlight_color: "#849900",
|
||||
brand_danger_color: "#db302d",
|
||||
brand_accent_color: "#849900",
|
||||
brand_background_color: "#002c38",
|
||||
brand_body_color: "#063540",
|
||||
brand_card_color: "#073c49",
|
||||
}, {
|
||||
name: "Solarized (light)",
|
||||
brand_input_color: "#e7dfc5",
|
||||
brand_highlight_color: "#849900",
|
||||
brand_danger_color: "#db302d",
|
||||
brand_accent_color: "#849900",
|
||||
brand_background_color: "#ede7d3",
|
||||
brand_body_color: "#fdf5e2",
|
||||
brand_card_color: "#fcf2d8",
|
||||
}, {
|
||||
name: "Mocha",
|
||||
brand_input_color: "#313244",
|
||||
brand_highlight_color: "#a6e3a1",
|
||||
brand_danger_color: "#f38ba8",
|
||||
brand_accent_color: "#a6e3a1",
|
||||
brand_background_color: "#1e1e2e",
|
||||
brand_body_color: "#181825",
|
||||
brand_card_color: "#313244",
|
||||
}, {
|
||||
name: "Dracula",
|
||||
brand_input_color: "#424450",
|
||||
brand_highlight_color: "#50FA7B",
|
||||
brand_danger_color: "#FF5555",
|
||||
brand_accent_color: "#50FA7B",
|
||||
brand_green_color: "#50FA7B",
|
||||
brand_red_color: "#FF5555",
|
||||
brand_yellow_color: "#F1FA8C",
|
||||
brand_blue_color: "#8BE9FD",
|
||||
brand_background_color: "#191A21",
|
||||
brand_body_color: "#21222C",
|
||||
brand_card_color: "#343746",
|
||||
}, {
|
||||
name: "Nova",
|
||||
brand_input_color: "#28033f",
|
||||
brand_highlight_color: "#57e389",
|
||||
brand_danger_color: "#ed333b",
|
||||
brand_background_color: "#0d0015",
|
||||
brand_body_color: "#130020",
|
||||
brand_card_color: "#1a002b",
|
||||
name: "Deep purple",
|
||||
brand_input_color: "#342848",
|
||||
brand_accent_color: "#c49efa",
|
||||
brand_background_color: "#160f1f",
|
||||
brand_body_color: "#1d1429",
|
||||
brand_card_color: "#281e38",
|
||||
}, {
|
||||
name: "Green Phosphor",
|
||||
brand_input_color: "#001e09",
|
||||
brand_highlight_color: "#57e389",
|
||||
brand_danger_color: "#ed333b",
|
||||
brand_background_color: "#000502",
|
||||
brand_body_color: "#000903",
|
||||
brand_card_color: "#001707",
|
||||
brand_input_color: "#263129",
|
||||
brand_accent_color: "#69d38c",
|
||||
brand_background_color: "#0d120e",
|
||||
brand_body_color: "#141a16",
|
||||
brand_card_color: "#1d261f",
|
||||
}, {
|
||||
name: "Amber",
|
||||
brand_input_color: "#3c2b00",
|
||||
brand_highlight_color: "#f5c211",
|
||||
brand_danger_color: "#c01c28",
|
||||
brand_background_color: "#171100",
|
||||
brand_body_color: "#201700",
|
||||
brand_card_color: "#281d00",
|
||||
brand_input_color: "#363026",
|
||||
brand_accent_color: "#e2b05a",
|
||||
brand_background_color: "#16130e",
|
||||
brand_body_color: "#1f1b14",
|
||||
brand_card_color: "#2a251d",
|
||||
}
|
||||
]
|
||||
</script>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { fs_encode_path, fs_node_icon } from "lib/FilesystemAPI.svelte"
|
||||
import type { FSNavigator } from "filesystem/FSNavigator";
|
||||
import { move_target, type FSNavigator } from "filesystem/FSNavigator";
|
||||
import { FileAction, type FileActionHandler } from "./FileManagerLib";
|
||||
|
||||
let {
|
||||
@@ -24,25 +24,28 @@ let {
|
||||
href={"/d"+fs_encode_path(child.path)}
|
||||
onclick={e => file_event(FileAction.Click, index, e)}
|
||||
oncontextmenu={e => file_event(FileAction.Context, index, e)}
|
||||
ondragstart={e => file_event(FileAction.Drag, index, e)}
|
||||
use:move_target={{nav, node: () => child}}
|
||||
class="node"
|
||||
class:node_selected={child.fm_selected}
|
||||
class:node_selected={$nav.selection.has(child.path)}
|
||||
class:hidden={child.name.startsWith(".") && !show_hidden}
|
||||
>
|
||||
<img src={fs_node_icon(child, 64, 64)} class="node_icon" class:large_icons loading="lazy" alt="icon"/>
|
||||
<img src={fs_node_icon(child, 64, 64)} class="node_icon" class:large_icons loading="lazy" alt="icon" draggable="false"/>
|
||||
<div class="node_name">
|
||||
{child.name}
|
||||
</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>
|
||||
@@ -62,11 +65,10 @@ let {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
text-decoration: none;
|
||||
color: var(--body_text-color);
|
||||
color: var(--body_text_color);
|
||||
padding: 2px;
|
||||
align-items: center;
|
||||
background: var(--body_background);
|
||||
/* backdrop-filter: blur(4px); */
|
||||
border-radius: 4px;
|
||||
gap: 6px;
|
||||
content-visibility: auto;
|
||||
@@ -78,8 +80,8 @@ let {
|
||||
text-decoration: none;
|
||||
}
|
||||
.node.node_selected {
|
||||
background-color: var(--highlight_color) !important;
|
||||
color: var(--highlight_text_color);
|
||||
background-color: var(--accent_color) !important;
|
||||
color: var(--accent_text_color);
|
||||
}
|
||||
.node>* {
|
||||
flex: 0 0 content;
|
||||
|
||||
@@ -5,7 +5,7 @@ const scroll_positions = new Map<string, number>()
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
import { fs_rename, fs_trash, FSNode } from "lib/FilesystemAPI.svelte"
|
||||
import { fs_trash } from "lib/FilesystemAPI.svelte"
|
||||
import CreateDirectory from "./CreateDirectory.svelte"
|
||||
import ListView from "./ListView.svelte"
|
||||
import GalleryView from "./GalleryView.svelte"
|
||||
@@ -13,34 +13,32 @@ import CompactView from "./CompactView.svelte"
|
||||
import Button from "layout/Button.svelte";
|
||||
import { formatDate } from "util/Formatting";
|
||||
import { drop_target } from "lib/DropTarget"
|
||||
import type { FSNavigator } from "filesystem/FSNavigator";
|
||||
import FsUploadWidget from "filesystem/upload_widget/FSUploadWidget.svelte";
|
||||
import { drag_click, move_target, type FSNavigator } from "filesystem/FSNavigator";
|
||||
import { pick_files, upload_files } from "filesystem/upload_widget/FSUploadWidget.svelte";
|
||||
import EditWindow from "filesystem/edit_window/EditWindow.svelte";
|
||||
import { FileAction, type FileActionHandler } from "./FileManagerLib";
|
||||
import FileMenu from "./FileMenu.svelte";
|
||||
import { loading_finish, loading_start } from "lib/Loading";
|
||||
import SearchBar from "../SearchBar.svelte";
|
||||
import type { GenericResponse } from "lib/NovaAPI";
|
||||
import { open_search } from "../SearchBar.svelte";
|
||||
import { onMount } from "svelte";
|
||||
import { toolbar_store } from "wrap/HeaderStore";
|
||||
|
||||
let {
|
||||
nav = $bindable(),
|
||||
upload_widget,
|
||||
edit_window = $bindable(),
|
||||
search_bar = $bindable(),
|
||||
directory_view = $bindable(localStorage.getItem("directory_view") || "list"),
|
||||
children
|
||||
}: {
|
||||
nav: FSNavigator;
|
||||
upload_widget: FsUploadWidget;
|
||||
edit_window: EditWindow;
|
||||
search_bar: SearchBar;
|
||||
directory_view?: string;
|
||||
children?: import('svelte').Snippet;
|
||||
} = $props();
|
||||
|
||||
let large_icons = $state(localStorage.getItem("large_icons") === "true")
|
||||
let uploader!: FsUploadWidget
|
||||
let mode = $state("viewing")
|
||||
// In selection mode a click selects. Moving is the part of selection mode where
|
||||
// the user browses to the directory which the selection has to go to
|
||||
let moving = $state(false)
|
||||
let creating_dir = $state(false)
|
||||
let show_hidden = $state(false)
|
||||
let file_menu!: FileMenu
|
||||
@@ -48,12 +46,17 @@ $effect(() => {
|
||||
window.scrollTo(0, scroll_positions.get($nav.base.path) ?? 0)
|
||||
})
|
||||
|
||||
export const upload = (files: File[]) => {
|
||||
return uploader.upload_files(files)
|
||||
}
|
||||
|
||||
// Navigation functions
|
||||
const file_event: FileActionHandler = (action: FileAction, index: number, orig: Event) => {
|
||||
const node = nav.children[index]
|
||||
if (action === FileAction.Drag) {
|
||||
// Without write access it stays a normal drag of the link
|
||||
if (nav.permissions.write) {
|
||||
nav.drag_start(orig as DragEvent, node)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
orig.preventDefault()
|
||||
orig.stopPropagation()
|
||||
|
||||
@@ -61,42 +64,34 @@ const file_event: FileActionHandler = (action: FileAction, index: number, orig:
|
||||
case FileAction.Click:
|
||||
creating_dir = false
|
||||
|
||||
if (mode === "viewing") {
|
||||
nav.navigate(nav.children[index].path, true)
|
||||
} else if (mode === "moving") {
|
||||
if (!nav.selecting) {
|
||||
nav.navigate(node.path, true)
|
||||
} else if (!moving) {
|
||||
nav.select(node, (orig as MouseEvent).shiftKey, show_hidden)
|
||||
} else if (node.type === "dir" && !nav.selection.has(node.path)) {
|
||||
// If we are moving files we can only enter directories, and only if
|
||||
// they're not selected. That last requirement prevents people from
|
||||
// moving a directory into itself
|
||||
if (nav.children[index].type === "dir" && !nav.children[index].fm_selected) {
|
||||
nav.navigate(nav.children[index].path, true)
|
||||
}
|
||||
} else if (mode === "selecting") {
|
||||
select_node(index)
|
||||
nav.navigate(node.path, true)
|
||||
}
|
||||
break
|
||||
case FileAction.Context:
|
||||
// If this is a touch event we will select the item
|
||||
if (navigator.maxTouchPoints && navigator.maxTouchPoints > 0) {
|
||||
select_node(index)
|
||||
nav.select(node)
|
||||
} else {
|
||||
file_menu.open(nav.children[index], orig.target, orig)
|
||||
file_menu.open(node, orig.target, orig)
|
||||
}
|
||||
break
|
||||
case FileAction.Edit:
|
||||
edit_window.edit(nav.children[index], false, "file")
|
||||
break
|
||||
case FileAction.Share:
|
||||
creating_dir = false
|
||||
edit_window.edit(nav.children[index], false, "share")
|
||||
edit_window.edit(node, false, "share")
|
||||
break
|
||||
case FileAction.Branding:
|
||||
edit_window.edit(nav.children[index], false, "branding")
|
||||
break
|
||||
case FileAction.Select:
|
||||
select_node(index)
|
||||
edit_window.edit(node, false, "branding")
|
||||
break
|
||||
case FileAction.Menu:
|
||||
file_menu.open(nav.children[index], orig.target, orig)
|
||||
file_menu.open(node, orig.target, orig)
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -112,45 +107,17 @@ const delete_selected = async () => {
|
||||
try {
|
||||
loading_start()
|
||||
|
||||
// Save all promises with deletion requests in an array
|
||||
let promises: Promise<GenericResponse>[] = []
|
||||
nav.children.forEach(child => {
|
||||
if (!child.fm_selected) {
|
||||
return
|
||||
}
|
||||
promises.push(fs_trash(child.path))
|
||||
})
|
||||
|
||||
// Wait for all the promises to finish
|
||||
await Promise.all(promises)
|
||||
await Promise.all([...nav.selection.values()].map(node => fs_trash(node.path)))
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
alert("Delete failed: " + err.message + " ("+err.value+")")
|
||||
} finally {
|
||||
viewing_mode()
|
||||
nav.set_selecting(false)
|
||||
loading_finish()
|
||||
await nav.reload()
|
||||
}
|
||||
}
|
||||
|
||||
// Mode switches
|
||||
|
||||
const selecting_mode = () => {
|
||||
mode = "selecting"
|
||||
}
|
||||
const viewing_mode = () => {
|
||||
// Remove any items which we were moving
|
||||
moving_items = []
|
||||
|
||||
// Unmark all the selected files and return to viewing mode
|
||||
nav.children.forEach((child, i) => {
|
||||
if (child.fm_selected) {
|
||||
nav.children[i].fm_selected = false
|
||||
}
|
||||
})
|
||||
mode = "viewing"
|
||||
}
|
||||
|
||||
const toggle_view = () => {
|
||||
if (directory_view === "list") {
|
||||
directory_view = "gallery"
|
||||
@@ -167,14 +134,7 @@ const toggle_large_icons = () => {
|
||||
localStorage.setItem("large_icons", JSON.stringify(large_icons))
|
||||
}
|
||||
|
||||
// Moving functions
|
||||
|
||||
let moving_items: FSNode[] = []
|
||||
|
||||
// We need to detect if shift is pressed so we can select multiple items
|
||||
let shift_pressed = false
|
||||
let last_selected_node = -1
|
||||
const keypress = (e: KeyboardEvent) => {
|
||||
const keydown = (e: KeyboardEvent) => {
|
||||
if (
|
||||
(document.activeElement as any).type !== undefined &&
|
||||
(document.activeElement as any).type === "text"
|
||||
@@ -182,209 +142,157 @@ const keypress = (e: KeyboardEvent) => {
|
||||
return // Prevent shortcuts from interfering with input fields
|
||||
}
|
||||
|
||||
if (e.key === "Shift") {
|
||||
shift_pressed = e.type === "keydown"
|
||||
} else if (e.type === "keydown" && e.key === "a" && e.ctrlKey) {
|
||||
// CTRL + A selects all files
|
||||
selecting_mode()
|
||||
for (let i = 0; i < nav.children.length; i++) {
|
||||
nav.children[i].fm_selected = true
|
||||
if (e.key === "a" && e.ctrlKey) {
|
||||
// CTRL + A selects all files which are visible
|
||||
for (const child of nav.children) {
|
||||
if (show_hidden || !child.is_hidden()) {
|
||||
nav.selection.set(child.path, child)
|
||||
}
|
||||
}
|
||||
nav.set_selecting(true)
|
||||
e.preventDefault()
|
||||
} else if (e.type === "keydown" && e.key === "Escape" && (mode !== "viewing" || creating_dir)) {
|
||||
} else if (e.key === "Escape" && (nav.selecting || creating_dir)) {
|
||||
// When escape is pressed we return to viewing mode
|
||||
viewing_mode()
|
||||
nav.set_selecting(false)
|
||||
creating_dir = false
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
}
|
||||
}
|
||||
|
||||
const select_node = (index: number) => {
|
||||
mode = "selecting"
|
||||
if (shift_pressed) {
|
||||
// If shift is pressed we do a range select. We select all files between
|
||||
// the last selected file and the file that is being selected now
|
||||
let id_low = Math.min(last_selected_node, index)
|
||||
let id_high = Math.max(last_selected_node, index)
|
||||
|
||||
for (let i = id_low; i <= id_high; i++) {
|
||||
if (i != last_selected_node) {
|
||||
nav.children[i].fm_selected = !nav.children[i].fm_selected
|
||||
}
|
||||
}
|
||||
} else {
|
||||
nav.children[index].fm_selected = !nav.children[index].fm_selected
|
||||
}
|
||||
|
||||
last_selected_node = index
|
||||
}
|
||||
|
||||
// When the directory is reloaded we want to keep our selection, so this
|
||||
// function watches the children array for changes and updates the selection
|
||||
// when it changes
|
||||
// Runs every time the navigator changes
|
||||
$effect.pre(() => {
|
||||
creating_dir = false
|
||||
|
||||
// Highlight the files which were previously selected
|
||||
for (let i = 0; i < $nav.children.length; i++) {
|
||||
for (let j = 0; j < moving_items.length; j++) {
|
||||
if (moving_items[j].path === $nav.children[i].path) {
|
||||
$nav.children[i].fm_selected = true
|
||||
}
|
||||
}
|
||||
if (!$nav.selecting) {
|
||||
moving = false
|
||||
}
|
||||
creating_dir = false
|
||||
})
|
||||
|
||||
let moving_files = $state(0)
|
||||
let moving_directories = $state(0)
|
||||
const move_start = () => {
|
||||
moving_files = 0
|
||||
moving_directories = 0
|
||||
moving_items = nav.children.reduce((acc, child) => {
|
||||
if (child.fm_selected) {
|
||||
if (child.type === "file") {
|
||||
moving_files++
|
||||
} else if (child.type === "dir") {
|
||||
moving_directories++
|
||||
}
|
||||
acc.push(child)
|
||||
}
|
||||
return acc
|
||||
}, [])
|
||||
mode = "moving"
|
||||
}
|
||||
|
||||
const move_here = async () => {
|
||||
const target_dir = nav.base.path + "/"
|
||||
try {
|
||||
loading_start()
|
||||
|
||||
let promises = []
|
||||
moving_items.forEach(item => {
|
||||
console.log("moving", item.path, "to", target_dir + item.name)
|
||||
promises.push(fs_rename(item.path, target_dir + item.name))
|
||||
})
|
||||
|
||||
// Wait for all the promises to finish
|
||||
await Promise.all(promises)
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
alert("Move failed: " + err.message + " ("+err.value+")")
|
||||
} finally {
|
||||
viewing_mode()
|
||||
nav.reload()
|
||||
loading_finish()
|
||||
}
|
||||
}
|
||||
|
||||
// The toolbar is shown in the bar at the top of the page, under the breadcrumbs.
|
||||
// Other pages don't have it
|
||||
onMount(() => {
|
||||
toolbar_store.set(toolbar)
|
||||
return () => toolbar_store.set(null)
|
||||
})
|
||||
</script>
|
||||
|
||||
<svelte:window
|
||||
onkeydown={keypress}
|
||||
onkeyup={keypress}
|
||||
onkeydown={keydown}
|
||||
onscroll={() => scroll_positions.set(nav.base.path, window.scrollY)}
|
||||
/>
|
||||
|
||||
<div
|
||||
class="container"
|
||||
use:drop_target={{
|
||||
upload: (files) => upload_widget.upload_files(files),
|
||||
shadow: "var(--highlight_color) 0 0 10px 2px inset",
|
||||
}}
|
||||
>
|
||||
<div class="width_container bubble">
|
||||
{#if mode === "viewing"}
|
||||
<div class="toolbar">
|
||||
<div class="toolbar_left">
|
||||
<button onclick={() => {search_bar.open()}} title="Press / to search">
|
||||
<i class="icon">search</i>
|
||||
</button>
|
||||
<button onclick={navigate_back} title="Back">
|
||||
<i class="icon">arrow_back</i>
|
||||
</button>
|
||||
<button onclick={() => nav.navigate_up()} disabled={$nav.path.length <= 1} title="Up">
|
||||
<i class="icon">north</i>
|
||||
</button>
|
||||
<button onclick={() => nav.reload()} title="Refresh directory listing">
|
||||
<i class="icon">refresh</i>
|
||||
</button>
|
||||
{#if $nav.children.some(c => c.name === ".Trash" && c.type === "dir")}
|
||||
<button
|
||||
onclick={() => nav.navigate($nav.children.find(c => c.name === ".Trash").path, true)}
|
||||
title="Open trash bin"
|
||||
>
|
||||
<i class="icon">delete</i>
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
{#snippet nav_buttons()}
|
||||
<button onclick={navigate_back} use:drag_click title="Back">
|
||||
<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 i_north"></i>
|
||||
</button>
|
||||
<button onclick={() => nav.reload()} use:drag_click title="Refresh directory listing">
|
||||
<i class="icon i_refresh"></i>
|
||||
</button>
|
||||
{/snippet}
|
||||
|
||||
<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>
|
||||
{#snippet toolbar()}
|
||||
{#if !$nav.selecting}
|
||||
<div class="toolbar">
|
||||
<div class="toolbar_left">
|
||||
<button onclick={() => open_search()} title="Press / to search">
|
||||
<i class="icon i_search"></i>
|
||||
</button>
|
||||
{@render nav_buttons()}
|
||||
{#if $nav.children.some(c => c.name === ".Trash" && c.type === "dir")}
|
||||
<button
|
||||
onclick={() => nav.navigate($nav.children.find(c => c.name === ".Trash").path, true)}
|
||||
title="Open trash bin"
|
||||
>
|
||||
<i class="icon i_delete"></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>
|
||||
{:else}
|
||||
<i class="icon">zoom_in</i>
|
||||
{/if}
|
||||
</button>
|
||||
|
||||
<button onclick={() => {show_hidden = !show_hidden}} title="Toggle hidden files">
|
||||
{#if show_hidden}
|
||||
<i class="icon">visibility_off</i>
|
||||
{:else}
|
||||
<i class="icon">visibility</i>
|
||||
{/if}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="toolbar_right">
|
||||
{#if $nav.permissions.write}
|
||||
<button onclick={() => upload_widget.pick_files()} title="Upload files to this directory">
|
||||
<i class="icon">cloud_upload</i>
|
||||
</button>
|
||||
|
||||
<Button click={() => {creating_dir = !creating_dir}} highlight={creating_dir} icon="create_new_folder" title="Make folder"/>
|
||||
|
||||
<button onclick={selecting_mode} title="Select and delete files">
|
||||
<i class="icon">select_all</i>
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
{:else if mode === "selecting"}
|
||||
<div class="toolbar toolbar_edit">
|
||||
<Button click={viewing_mode} icon="close"/>
|
||||
<div class="toolbar_spacer">Selecting files</div>
|
||||
<Button click={move_start} icon="drive_file_move" label="Move"/>
|
||||
<button onclick={delete_selected} class="button_red">
|
||||
<i class="icon">delete</i>
|
||||
Delete
|
||||
<div class="toolbar_middle">
|
||||
<button onclick={() => toggle_view()} title="Switch between gallery, list and compact view">
|
||||
<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 i_zoom_out"></i>
|
||||
{:else}
|
||||
<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 i_visibility_off"></i>
|
||||
{:else}
|
||||
<i class="icon i_visibility"></i>
|
||||
{/if}
|
||||
</button>
|
||||
</div>
|
||||
{:else if mode === "moving"}
|
||||
<div class="toolbar toolbar_edit">
|
||||
<Button click={viewing_mode} icon="close"/>
|
||||
<Button click={() => nav.navigate_up()} disabled={$nav.path.length <= 1} icon="north"/>
|
||||
<div class="toolbar_spacer">
|
||||
Moving {moving_files} files and {moving_directories} directories
|
||||
</div>
|
||||
<Button click={() => {creating_dir = !creating_dir}} highlight={creating_dir} icon="create_new_folder" title="Make folder"/>
|
||||
<Button click={move_here} highlight icon="done" label="Move here"/>
|
||||
|
||||
<div class="toolbar_right">
|
||||
{#if $nav.permissions.write}
|
||||
<button onclick={() => pick_files()} title="Upload files to this directory">
|
||||
<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 i_select_all"></i>
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
{#if creating_dir}
|
||||
<CreateDirectory nav={nav} />
|
||||
{/if}
|
||||
</div>
|
||||
{:else}
|
||||
<div class="toolbar toolbar_edit">
|
||||
<div>
|
||||
<Button click={() => nav.set_selecting(false)} icon="close" title="Clear selection"/>
|
||||
{@render nav_buttons()}
|
||||
</div>
|
||||
<div class="toolbar_spacer">
|
||||
{moving ? "Moving" : "Selected"} {$nav.selection.size} items
|
||||
</div>
|
||||
<div>
|
||||
{#if moving}
|
||||
<Button click={() => {creating_dir = !creating_dir}} highlight={creating_dir} icon="create_new_folder" title="Make folder"/>
|
||||
<Button
|
||||
click={() => nav.move_selection(nav.base.path)}
|
||||
disabled={!$nav.can_move($nav.base.path)}
|
||||
highlight
|
||||
icon="done"
|
||||
label="Move here"
|
||||
/>
|
||||
{:else}
|
||||
<Button click={() => {moving = true}} icon="drive_file_move" label="Move"/>
|
||||
<button onclick={delete_selected} class="button_red">
|
||||
<i class="icon i_delete"></i>
|
||||
Delete
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if creating_dir}
|
||||
<CreateDirectory nav={nav} />
|
||||
{/if}
|
||||
{/snippet}
|
||||
|
||||
<div
|
||||
class="container"
|
||||
use:move_target={{nav, node: () => nav.base}}
|
||||
use:drop_target={{
|
||||
upload: files => upload_files(files),
|
||||
shadow: "var(--accent_color) 0 0 10px 2px inset",
|
||||
}}
|
||||
>
|
||||
{#if $nav.base.abuse_type !== undefined}
|
||||
<div class="highlight_red">
|
||||
This directory has received an abuse report. It cannot be
|
||||
@@ -410,28 +318,20 @@ const move_here = async () => {
|
||||
<style>
|
||||
.container {
|
||||
padding: 0;
|
||||
display: block;
|
||||
/* Keeps the margins of the views inside the container. As a normal block
|
||||
they would collapse through it and push it out of the file preview, which
|
||||
gives that a scrollbar */
|
||||
display: flow-root;
|
||||
min-height: 100%; /* Used for drop target */
|
||||
}
|
||||
.width_container {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
display: block;
|
||||
margin-top: 0;
|
||||
padding: 0;
|
||||
background: var(--body_background);
|
||||
}
|
||||
.toolbar {
|
||||
display: flex;
|
||||
flex: 1 1 auto;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
width: 100%;
|
||||
max-width: 1000px;
|
||||
margin: auto;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-top: 1px solid var(--separator);
|
||||
}
|
||||
.toolbar > * {
|
||||
flex: 0 0 content;
|
||||
@@ -443,10 +343,7 @@ const move_here = async () => {
|
||||
text-align: center;
|
||||
}
|
||||
.toolbar_edit {
|
||||
background-color: rgba(0, 255, 0, 0.05);
|
||||
}
|
||||
.icon.button_highlight {
|
||||
border-radius: 4px;
|
||||
background-color: var(--green_tint);
|
||||
}
|
||||
|
||||
/* Large icon mode only supported on wide screens. Hide the button on small screen */
|
||||
|
||||
@@ -1,17 +1,10 @@
|
||||
export type FileEvent = {
|
||||
index: number,
|
||||
action: FileAction,
|
||||
original: MouseEvent,
|
||||
}
|
||||
export enum FileAction {
|
||||
Click,
|
||||
Context,
|
||||
Edit,
|
||||
Share,
|
||||
Branding,
|
||||
Select,
|
||||
Download,
|
||||
Menu,
|
||||
Drag,
|
||||
}
|
||||
export type FileActionHandler = (
|
||||
action: FileAction,
|
||||
|
||||
@@ -63,6 +63,9 @@ const delete_node = async () => {
|
||||
<Button click={() => {dialog.close(); bookmark_add(node)}} icon="bookmark_add" label="Add bookmark"/>
|
||||
{/if}
|
||||
{#if $nav.permissions.write}
|
||||
{#if $nav.children.includes(node)}
|
||||
<Button click={() => {dialog.close(); nav.select(node)}} icon="select_all" label="Select"/>
|
||||
{/if}
|
||||
<Button click={() => {dialog.close(); delete_node()}} icon="delete" label="Delete"/>
|
||||
{#if edit_window !== null}
|
||||
<Button click={() => {dialog.close(); edit_window.edit(node, false, "file")}} icon="edit" label="Edit"/>
|
||||
|
||||
@@ -7,33 +7,33 @@ 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,
|
||||
select_multiple = false
|
||||
select_multiple = false,
|
||||
directories = false,
|
||||
}: {
|
||||
callback: (files: FSNode[]) => void
|
||||
select_multiple?: boolean
|
||||
// Picks the directory which is open, instead of files in it
|
||||
directories?: boolean
|
||||
} = $props();
|
||||
|
||||
export const open = (path: string) => {
|
||||
creating_dir = false
|
||||
modal.show()
|
||||
nav.set_selecting(false)
|
||||
nav.navigate(path, false)
|
||||
}
|
||||
|
||||
let selected_files = $derived($nav.children.reduce((acc, file) => {
|
||||
if (file.fm_selected) {
|
||||
acc++
|
||||
}
|
||||
return acc
|
||||
}, 0))
|
||||
|
||||
// Navigation functions
|
||||
|
||||
const file_event: FileActionHandler = (action: FileAction, index: number, orig: Event) => {
|
||||
@@ -42,21 +42,17 @@ const file_event: FileActionHandler = (action: FileAction, index: number, orig:
|
||||
orig.preventDefault()
|
||||
if (nav.children[index].type === "dir") {
|
||||
nav.navigate(nav.children[index].path, true)
|
||||
} else {
|
||||
select_node(index)
|
||||
} else if (!directories) {
|
||||
select_node(index, orig)
|
||||
}
|
||||
break
|
||||
case FileAction.Context:
|
||||
// If this is a touch event we will select the item
|
||||
if (navigator.maxTouchPoints && navigator.maxTouchPoints > 0) {
|
||||
if (!directories && navigator.maxTouchPoints && navigator.maxTouchPoints > 0) {
|
||||
orig.preventDefault()
|
||||
select_node(index)
|
||||
select_node(index, orig)
|
||||
}
|
||||
break
|
||||
case FileAction.Select:
|
||||
orig.preventDefault()
|
||||
nav.children[index].fm_selected = !nav.children[index].fm_selected
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,50 +68,18 @@ const toggle_view = () => {
|
||||
localStorage.setItem("directory_view", directory_view)
|
||||
}
|
||||
|
||||
// We need to detect if shift is pressed so we can select multiple items
|
||||
let shift_pressed = false
|
||||
let last_selected_node = -1
|
||||
const detect_shift = (e: KeyboardEvent) => {
|
||||
if (e.key === "Shift") {
|
||||
shift_pressed = e.type === "keydown"
|
||||
const select_node = (index: number, e: Event) => {
|
||||
if (!select_multiple) {
|
||||
nav.selection.clear()
|
||||
}
|
||||
}
|
||||
|
||||
const select_node = (index: number) => {
|
||||
if (select_multiple && shift_pressed) {
|
||||
// If shift is pressed we do a range select. We select all files between
|
||||
// the last selected file and the file that is being selected now
|
||||
let id_low = Math.min(last_selected_node, index)
|
||||
let id_high = Math.max(last_selected_node, index)
|
||||
|
||||
for (let i = id_low; i <= id_high; i++) {
|
||||
if (i != last_selected_node) {
|
||||
nav.children[i].fm_selected = !nav.children[i].fm_selected
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Deselect all other entries first
|
||||
if (!select_multiple) {
|
||||
for (let i = 0; i < nav.children.length; i++) {
|
||||
nav.children[i].fm_selected = false
|
||||
}
|
||||
}
|
||||
nav.children[index].fm_selected = !nav.children[index].fm_selected
|
||||
}
|
||||
|
||||
last_selected_node = index
|
||||
nav.select(nav.children[index], select_multiple && (e as MouseEvent).shiftKey, show_hidden)
|
||||
}
|
||||
|
||||
let done = () => {
|
||||
let selected_files: FSNode[] = []
|
||||
for (let i = 0; i < nav.children.length; i++) {
|
||||
if (nav.children[i].fm_selected) {
|
||||
selected_files.push(nav.children[i])
|
||||
}
|
||||
}
|
||||
|
||||
if (selected_files.length > 0) {
|
||||
callback(selected_files)
|
||||
if (directories) {
|
||||
callback([nav.base])
|
||||
} else if (nav.selection.size > 0) {
|
||||
callback([...nav.selection.values()])
|
||||
}
|
||||
modal.hide()
|
||||
}
|
||||
@@ -131,41 +95,48 @@ onMount(() => {
|
||||
})
|
||||
</script>
|
||||
|
||||
<svelte:window onkeydown={detect_shift} onkeyup={detect_shift} />
|
||||
|
||||
<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">
|
||||
Selected {selected_files} files
|
||||
{#if directories}
|
||||
Open the directory to pick
|
||||
{:else}
|
||||
Selected {$nav.selection.size} files
|
||||
{/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}
|
||||
@@ -177,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}
|
||||
@@ -237,7 +212,4 @@ onMount(() => {
|
||||
text-align: center;
|
||||
font-size: 1.2em;
|
||||
}
|
||||
.icon.button_highlight {
|
||||
border-radius: 4px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { fs_node_icon, fs_node_type, fs_encode_path } from "lib/FilesystemAPI.svelte";
|
||||
import type { FSNavigator } from "filesystem/FSNavigator";
|
||||
import { move_target, type FSNavigator } from "filesystem/FSNavigator";
|
||||
import { FileAction, type FileActionHandler } from "./FileManagerLib";
|
||||
|
||||
let {
|
||||
@@ -22,7 +22,9 @@ let {
|
||||
href={"/d"+fs_encode_path(child.path)}
|
||||
onclick={e => file_event(FileAction.Click, index, e)}
|
||||
oncontextmenu={e => file_event(FileAction.Context, index, e)}
|
||||
class:selected={child.fm_selected}
|
||||
ondragstart={e => file_event(FileAction.Drag, index, e)}
|
||||
use:move_target={{nav, node: () => child}}
|
||||
class:selected={$nav.selection.has(child.path)}
|
||||
class:hidden={child.name.startsWith(".") && !show_hidden}
|
||||
class:large_icons
|
||||
title={child.name}
|
||||
@@ -33,6 +35,7 @@ let {
|
||||
src={fs_node_icon(child, 256, 256)}
|
||||
loading="lazy"
|
||||
alt=""
|
||||
draggable="false"
|
||||
/>
|
||||
<div class="node_name">
|
||||
{child.name}
|
||||
@@ -59,7 +62,6 @@ let {
|
||||
contain-intrinsic-size: auto 150px;
|
||||
overflow: hidden;
|
||||
background: var(--body_background);
|
||||
/* backdrop-filter: blur(4px); */
|
||||
border-radius: 4px;
|
||||
color: var(--input_text);
|
||||
display: flex;
|
||||
@@ -95,8 +97,8 @@ let {
|
||||
background: var(--input_hover_background);
|
||||
}
|
||||
.file.selected {
|
||||
background: var(--highlight_background);
|
||||
color: var(--highlight_text_color);
|
||||
background: var(--accent_background);
|
||||
color: var(--accent_text_color);
|
||||
}
|
||||
.node_icon {
|
||||
flex: 1 1 0;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { formatDataVolume, formatDate, formatThousands } from "util/Formatting";
|
||||
import { fs_encode_path, fs_node_icon } from "lib/FilesystemAPI.svelte"
|
||||
import type { FSNavigator } from "filesystem/FSNavigator";
|
||||
import { move_target, type FSNavigator } from "filesystem/FSNavigator";
|
||||
import SortButton from "layout/SortButton.svelte";
|
||||
import { FileAction, type FileActionHandler } from "./FileManagerLib";
|
||||
import Dialog from "layout/Dialog.svelte";
|
||||
@@ -15,7 +15,8 @@ let {
|
||||
show_hidden = false,
|
||||
large_icons = false,
|
||||
hide_edit = false,
|
||||
hide_branding = false
|
||||
hide_branding = false,
|
||||
trash = false
|
||||
}: {
|
||||
nav: FSNavigator
|
||||
file_event: FileActionHandler
|
||||
@@ -23,6 +24,7 @@ let {
|
||||
large_icons?: boolean
|
||||
hide_edit?: boolean
|
||||
hide_branding?: boolean
|
||||
trash?: boolean
|
||||
} = $props();
|
||||
|
||||
let dialog: Dialog = $state()
|
||||
@@ -69,7 +71,7 @@ const load_settings = () => {
|
||||
onMount(load_settings)
|
||||
</script>
|
||||
|
||||
<table class="directory">
|
||||
<table class="directory bubble">
|
||||
<thead>
|
||||
<tr class="header_row">
|
||||
<td></td>
|
||||
@@ -78,6 +80,18 @@ onMount(load_settings)
|
||||
Name
|
||||
</SortButton>
|
||||
</td>
|
||||
{#if trash}
|
||||
<td class="hide_small">
|
||||
<SortButton active_field={$nav.sort_last_field} asc={$nav.sort_asc} sort_func={nav.sort_children} field="original_path">
|
||||
Original location
|
||||
</SortButton>
|
||||
</td>
|
||||
<td class="hide_small">
|
||||
<SortButton active_field={$nav.sort_last_field} asc={$nav.sort_asc} sort_func={nav.sort_children} field="deletion_date">
|
||||
Deleted on
|
||||
</SortButton>
|
||||
</td>
|
||||
{/if}
|
||||
{#each columns as col}
|
||||
<td class="hide_small" class:hidden={!config[col.field]}>
|
||||
<SortButton active_field={$nav.sort_last_field} asc={$nav.sort_asc} sort_func={nav.sort_children} field={col.field}>
|
||||
@@ -86,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>
|
||||
@@ -95,18 +109,27 @@ onMount(load_settings)
|
||||
<tr
|
||||
onclick={e => file_event(FileAction.Click, index, e)}
|
||||
oncontextmenu={e => file_event(FileAction.Context, index, e)}
|
||||
ondragstart={e => file_event(FileAction.Drag, index, e)}
|
||||
use:move_target={{nav, node: () => child}}
|
||||
draggable="true"
|
||||
class="node"
|
||||
class:node_selected={child.fm_selected}
|
||||
class:node_selected={$nav.selection.has(child.path)}
|
||||
class:hidden={child.name.startsWith(".") && !show_hidden}
|
||||
>
|
||||
<td>
|
||||
<img src={fs_node_icon(child, 64, 64)} class="node_icon" class:large_icons loading="lazy" alt="icon"/>
|
||||
<img src={fs_node_icon(child, 64, 64)} class="node_icon" class:large_icons loading="lazy" alt="icon" draggable="false"/>
|
||||
</td>
|
||||
<td class="node_name">
|
||||
<a class="title_link" href={"/d"+fs_encode_path(child.path)}>
|
||||
<td class="node_name" class:half={trash}>
|
||||
<a class="title_link" href={"/d"+fs_encode_path(child.path)} draggable="false">
|
||||
{child.name}
|
||||
</a>
|
||||
</td>
|
||||
{#if trash}
|
||||
<td class="node_name half hide_small">{child.original_path}</td>
|
||||
<td class="node_size hide_small">
|
||||
{formatDate(child.deletion_date, true, true, false)}
|
||||
</td>
|
||||
{/if}
|
||||
<td class="node_size hide_small" class:hidden={!config.modified}>
|
||||
{formatDate(child.modified, true, true, false)}
|
||||
</td>
|
||||
@@ -139,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>
|
||||
@@ -176,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>
|
||||
@@ -184,10 +208,12 @@ onMount(load_settings)
|
||||
|
||||
<style>
|
||||
.directory {
|
||||
background: var(--body_background);
|
||||
border-collapse: collapse;
|
||||
backdrop-filter: blur(4px);
|
||||
margin: auto; /* center */
|
||||
/* A table with collapsed borders can't have rounded corners */
|
||||
border-collapse: separate;
|
||||
border-spacing: 0;
|
||||
/* Tables are 100% wide, this leaves room for the bubble's margin */
|
||||
width: calc(100% - 8px);
|
||||
overflow: hidden;
|
||||
}
|
||||
td {
|
||||
padding-top: 0;
|
||||
@@ -202,20 +228,17 @@ td {
|
||||
}
|
||||
.node {
|
||||
text-decoration: none;
|
||||
color: var(--body_text-color);
|
||||
color: var(--body_text_color);
|
||||
cursor: pointer;
|
||||
}
|
||||
.node:not(:last-child) {
|
||||
border-bottom: 1px solid var(--separator);
|
||||
}
|
||||
.node:hover:not(.node_selected) {
|
||||
background: var(--input_hover_background);
|
||||
color: var(--input_text);
|
||||
text-decoration: none;
|
||||
}
|
||||
.node.node_selected {
|
||||
background-color: var(--highlight_color) !important;
|
||||
color: var(--highlight_text_color);
|
||||
background-color: var(--accent_shade) !important;
|
||||
color: var(--link_color);
|
||||
}
|
||||
td {
|
||||
vertical-align: middle;
|
||||
@@ -232,9 +255,13 @@ td {
|
||||
line-height: 1.2em;
|
||||
word-break: break-all;
|
||||
}
|
||||
/* In the trash the name shares its width with the original location */
|
||||
.half {
|
||||
width: 50%;
|
||||
}
|
||||
.title_link {
|
||||
text-decoration: none;
|
||||
color: var(--body_text_color);
|
||||
color: unset;
|
||||
}
|
||||
.node_size {
|
||||
min-width: 5em;
|
||||
@@ -266,5 +293,8 @@ td {
|
||||
.hide_small {
|
||||
display: none;
|
||||
}
|
||||
.half {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,10 +1,13 @@
|
||||
<script lang="ts">
|
||||
import { formatDataVolume, formatDate } from "util/Formatting";
|
||||
import { fs_check_response, fs_encode_path, fs_get_trash, fs_node_icon, fs_path_url, type TrashEntry } from "lib/FilesystemAPI.svelte";
|
||||
import { loading_finish, loading_run, loading_start, loading_store } from "lib/Loading";
|
||||
import { formatDataVolume } from "util/Formatting";
|
||||
import { fs_check_response, fs_get_trash, fs_path_url, fs_rename, fs_trash, type FSNode } from "lib/FilesystemAPI.svelte";
|
||||
import { loading_run } from "lib/Loading";
|
||||
import { onMount } from "svelte";
|
||||
import { breadcrumbs_store } from "wrap/BreadcrumbStore";
|
||||
import { toolbar_store } from "wrap/HeaderStore";
|
||||
import { FSNavigator } from "filesystem/FSNavigator";
|
||||
import Button from "layout/Button.svelte";
|
||||
import ListView from "./ListView.svelte";
|
||||
import { FileAction, type FileActionHandler } from "./FileManagerLib";
|
||||
|
||||
let {
|
||||
nav,
|
||||
@@ -14,214 +17,157 @@ let {
|
||||
root_path?: string
|
||||
} = $props();
|
||||
|
||||
let entries: TrashEntry[] = $state([]);
|
||||
let error: string = $state("");
|
||||
// The trash entries are not the children of the .Trash directory, so they get a
|
||||
// navigator of their own for the ListView to list and sort
|
||||
const trash = new FSNavigator(false)
|
||||
|
||||
const load = async () => {
|
||||
loading_run(async () => {
|
||||
try {
|
||||
entries = await fs_get_trash(root_path)
|
||||
error = "";
|
||||
} catch (err: any) {
|
||||
error = err?.message ?? JSON.stringify(err);
|
||||
let size = $derived($trash.children.reduce(
|
||||
(acc, node) => acc + (node.type === "dir" ? node.recursive_size : node.file_size), 0
|
||||
))
|
||||
|
||||
const load = () => loading_run(async () => {
|
||||
try {
|
||||
trash.children = await fs_get_trash(root_path)
|
||||
} catch (err: any) {
|
||||
alert("Failed to load the trash bin: " + (err.message ?? err))
|
||||
}
|
||||
trash.selecting = false
|
||||
trash.selection.clear()
|
||||
trash.sort_children("")
|
||||
})
|
||||
|
||||
const file_event: FileActionHandler = (action, index, e) => {
|
||||
if (action === FileAction.Drag) {
|
||||
return
|
||||
} else if (action === FileAction.Context) {
|
||||
// On a touch screen a long press starts selecting, like in the file
|
||||
// manager. A right click is left to the browser's own menu
|
||||
if (!navigator.maxTouchPoints) {
|
||||
return
|
||||
}
|
||||
})
|
||||
};
|
||||
trash.selecting = true
|
||||
}
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
|
||||
const delete_entry = async (entry: TrashEntry) => {
|
||||
if (!confirm(`Permanently delete "${entry.node.name}"?`)) return;
|
||||
try {
|
||||
loading_start();
|
||||
await fs_check_response(
|
||||
await fetch(fs_path_url(entry.node.path) + "?trash", { method: "DELETE" })
|
||||
);
|
||||
entries = entries.filter(e => e.node.id !== entry.node.id);
|
||||
} catch (err: any) {
|
||||
alert(err?.message ?? JSON.stringify(err));
|
||||
} finally {
|
||||
loading_finish();
|
||||
if (trash.selecting) {
|
||||
trash.select(trash.children[index], (e as MouseEvent).shiftKey)
|
||||
} else {
|
||||
nav.navigate(trash.children[index].path, true)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
const restore_entry = async (entry: TrashEntry) => {
|
||||
if (!entry.original_path) {
|
||||
alert("Original path is not known, cannot restore this file.");
|
||||
return;
|
||||
const selected = () => [...trash.selection.values()]
|
||||
|
||||
// Runs an action on all the selected entries and reloads the listing
|
||||
const run_selected = async (action: (node: FSNode) => Promise<any>) => {
|
||||
const results = await loading_run(() => Promise.allSettled(selected().map(action)))
|
||||
const failed = results.filter(r => r.status === "rejected") as PromiseRejectedResult[]
|
||||
if (failed.length !== 0) {
|
||||
alert(
|
||||
failed.length + " of " + results.length + " failed: " +
|
||||
(failed[0].reason.message ?? failed[0].reason)
|
||||
)
|
||||
}
|
||||
try {
|
||||
loading_start();
|
||||
const form = new FormData();
|
||||
form.append("action", "rename");
|
||||
form.append("target", "/me" + entry.original_path);
|
||||
await fs_check_response(
|
||||
await fetch(fs_path_url(entry.node.path), { method: "POST", body: form })
|
||||
);
|
||||
entries = entries.filter(e => e.node.id !== entry.node.id);
|
||||
} catch (err: any) {
|
||||
alert(err?.message ?? JSON.stringify(err));
|
||||
} finally {
|
||||
loading_finish();
|
||||
await load()
|
||||
}
|
||||
|
||||
const restore = () => run_selected(async node => {
|
||||
if (!node.original_path) {
|
||||
throw new Error("the original location of " + node.name + " is not known")
|
||||
}
|
||||
};
|
||||
return fs_rename(node.path, root_path + node.original_path)
|
||||
})
|
||||
|
||||
const delete_selected = () => {
|
||||
if (confirm(`Permanently delete ${selected().length} of the items in the trash?`)) {
|
||||
run_selected(node => fs_trash(node.path))
|
||||
}
|
||||
}
|
||||
|
||||
const empty_trash = async () => {
|
||||
if (!confirm("Permanently delete all items in the trash?")) return;
|
||||
try {
|
||||
loading_start();
|
||||
await fs_check_response(
|
||||
await fetch(fs_path_url(root_path) + "?empty_trash", { method: "DELETE" })
|
||||
);
|
||||
entries = [];
|
||||
} catch (err: any) {
|
||||
alert(err?.message ?? JSON.stringify(err));
|
||||
} finally {
|
||||
loading_finish();
|
||||
if (!confirm("Permanently delete all items in the trash?")) {
|
||||
return
|
||||
}
|
||||
};
|
||||
try {
|
||||
await loading_run(async () => fs_check_response(
|
||||
await fetch(fs_path_url(root_path) + "?empty_trash", { method: "DELETE" })
|
||||
))
|
||||
} catch (err: any) {
|
||||
alert(err.message ?? err)
|
||||
}
|
||||
await load()
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
breadcrumbs_store.set(breadcrumbs)
|
||||
|
||||
toolbar_store.set(toolbar)
|
||||
load()
|
||||
});
|
||||
return () => toolbar_store.set(null)
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
{#snippet breadcrumbs()}
|
||||
<i class="icon">delete</i>
|
||||
<div>
|
||||
Trash bin
|
||||
{#if $loading_store === 0 && entries.length === 0}
|
||||
(empty)
|
||||
{:else if entries.length !== 0}
|
||||
({formatDataVolume(entries.reduce(
|
||||
(acc, entry) => acc + entry.node.file_size, 0
|
||||
), 3)})
|
||||
{/if}
|
||||
</div>
|
||||
<div class="separator"></div>
|
||||
<button onclick={() => window.history.back()} title="Back">
|
||||
<i class="icon">arrow_back</i>
|
||||
</button>
|
||||
<button onclick={() => nav.navigate_up()} disabled={$nav.path.length <= 1} title="Up">
|
||||
<i class="icon">north</i>
|
||||
</button>
|
||||
<button onclick={() => nav.reload()} title="Refresh directory listing">
|
||||
<i class="icon">refresh</i>
|
||||
</button>
|
||||
{#if entries.length !== 0}
|
||||
<button class="button button_red" onclick={empty_trash}>
|
||||
<i class="icon">delete_forever</i>
|
||||
<span>Delete all</span>
|
||||
{#snippet toolbar()}
|
||||
{#if $trash.selecting}
|
||||
<div class="toolbar toolbar_edit">
|
||||
<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 i_delete_forever"></i>
|
||||
Delete
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
{:else}
|
||||
<div class="toolbar">
|
||||
<div>
|
||||
<button onclick={() => history.back()} title="Back">
|
||||
<i class="icon i_arrow_back"></i>
|
||||
</button>
|
||||
<button onclick={() => nav.navigate_up()} title="Up">
|
||||
<i class="icon i_north"></i>
|
||||
</button>
|
||||
<button onclick={load} title="Refresh trash bin">
|
||||
<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 i_select_all"></i>
|
||||
</button>
|
||||
<button onclick={empty_trash} class="button_red">
|
||||
<i class="icon i_delete_forever"></i>
|
||||
Delete all
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/snippet}
|
||||
|
||||
{#if error}
|
||||
<p class="error">{error}</p>
|
||||
{:else if entries.length > 0}
|
||||
<table class="trash_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Name</td>
|
||||
<td class="hide_small">Original location</td>
|
||||
<td class="hide_small">Deleted at</td>
|
||||
<td class="hide_small">Size</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{#each entries as entry (entry.node.id)}
|
||||
<tr class="entry">
|
||||
<td class="icon_cell">
|
||||
<img
|
||||
src={fs_node_icon(entry.node, 32, 32)}
|
||||
class="node_icon"
|
||||
alt="icon"
|
||||
/>
|
||||
</td>
|
||||
<td class="name_cell">
|
||||
<a class="entry_link" href={"/d" + fs_encode_path(entry.node.path)}>
|
||||
{entry.node.name}
|
||||
</a>
|
||||
</td>
|
||||
<td class="hide_small">
|
||||
{entry.original_path ? entry.original_path.slice(0, -entry.node.name.length) : "—"}
|
||||
</td>
|
||||
<td class="hide_small">
|
||||
{entry.deletion_date ? formatDate(entry.deletion_date) : "—"}
|
||||
</td>
|
||||
<td class="hide_small">
|
||||
{#if entry.node.type === "file"}
|
||||
{formatDataVolume(entry.node.file_size, 3)}
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
<div class="row_actions">
|
||||
<button title="Restore to original location" onclick={() => restore_entry(entry)}>
|
||||
<i class="icon">restore_from_trash</i>
|
||||
</button>
|
||||
<button class="button button_red" title="Delete permanently" onclick={() => delete_entry(entry)}>
|
||||
<i class="icon">delete_forever</i>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/each}
|
||||
</tbody>
|
||||
</table>
|
||||
{/if}
|
||||
<ListView nav={trash} file_event={file_event} show_hidden hide_edit hide_branding trash/>
|
||||
|
||||
<style>
|
||||
.separator {
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
.error {
|
||||
color: var(--danger_color, #c0392b);
|
||||
}
|
||||
.trash_table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
background: var(--body_background);
|
||||
border-radius: 8px;
|
||||
}
|
||||
.trash_table td {
|
||||
padding: 0;
|
||||
}
|
||||
.entry {
|
||||
cursor: default;
|
||||
/* Same as the toolbar of the file manager */
|
||||
.toolbar {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-top: 1px solid var(--separator);
|
||||
}
|
||||
.entry:hover {
|
||||
background: var(--input_hover_background);
|
||||
}
|
||||
.icon_cell {
|
||||
width: 2.5em;
|
||||
}
|
||||
.node_icon {
|
||||
display: block;
|
||||
width: 2em;
|
||||
height: 2em;
|
||||
object-fit: contain;
|
||||
}
|
||||
.name_cell {
|
||||
word-break: break-all;
|
||||
}
|
||||
.entry_link {
|
||||
color: var(--body_text_color);
|
||||
text-decoration: none;
|
||||
}
|
||||
.entry_link:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.row_actions {
|
||||
.toolbar > * {
|
||||
flex: 0 0 content;
|
||||
display: flex;
|
||||
gap: 0.25em;
|
||||
flex-direction: row;
|
||||
}
|
||||
@media (max-width: 600px) {
|
||||
.hide_small {
|
||||
display: none;
|
||||
}
|
||||
.toolbar_spacer {
|
||||
flex: 1 1 auto;
|
||||
text-align: center;
|
||||
}
|
||||
.toolbar_edit {
|
||||
background-color: var(--green_tint);
|
||||
}
|
||||
</style>
|
||||
@@ -1,157 +1,363 @@
|
||||
<script lang="ts" module>
|
||||
export type UploadJob = {
|
||||
task_id: number,
|
||||
file: File,
|
||||
path: string,
|
||||
component: UploadProgress,
|
||||
status: string,
|
||||
total_size: number,
|
||||
loaded_size: number,
|
||||
};
|
||||
// A file, and its path relative to the directory which it is uploaded to
|
||||
export type Upload = { file: File, path: string }
|
||||
|
||||
// The widget is mounted once, in App.svelte, so that uploads keep running when
|
||||
// the user opens another page. It sets these functions when it mounts
|
||||
export let upload_files: (files: Upload[] | Promise<Upload[]>) => void
|
||||
export let pick_files: () => void
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
import { tick } from "svelte";
|
||||
import UploadProgress from "./UploadProgress.svelte";
|
||||
import type { FSNavigator } from "filesystem/FSNavigator";
|
||||
import { global_navigator as nav } from "filesystem/FSNavigator";
|
||||
import { fs_path_url } from "lib/FilesystemAPI.svelte";
|
||||
import { loading_run } from "lib/Loading";
|
||||
import { user } from "lib/UserStore";
|
||||
import { formatDataVolume, formatDuration } from "util/Formatting";
|
||||
import ProgressBar from "util/ProgressBar.svelte";
|
||||
import Button from "layout/Button.svelte";
|
||||
|
||||
let { nav }: {
|
||||
nav: FSNavigator;
|
||||
} = $props();
|
||||
|
||||
let file_input_field: HTMLInputElement = $state()
|
||||
let file_input_change = (e: Event) => {
|
||||
// Start uploading the files async
|
||||
upload_files((e.target as HTMLInputElement).files)
|
||||
|
||||
// This resets the file input field
|
||||
file_input_field.nodeValue = ""
|
||||
}
|
||||
export const pick_files = () => {
|
||||
file_input_field.click()
|
||||
}
|
||||
|
||||
let visible = $state(false)
|
||||
let upload_queue: UploadJob[] = $state([]);
|
||||
let task_id_counter = 0
|
||||
|
||||
export const upload_files = async (files: File[]|FileList) => {
|
||||
if (files.length === 0) {
|
||||
return
|
||||
} else if (nav.base.type !== "dir") {
|
||||
alert("Can only upload to directory")
|
||||
return
|
||||
}
|
||||
|
||||
// Add files to the queue
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
await upload_file(files[i])
|
||||
}
|
||||
}
|
||||
|
||||
export const upload_file = async (file: File) => {
|
||||
if (nav.base.type !== "dir") {
|
||||
alert("Can only upload to directory")
|
||||
return
|
||||
} else if (file.type === "" && file.size === 0) {
|
||||
return
|
||||
}
|
||||
|
||||
let path = nav.base.path + "/"
|
||||
if (file.webkitRelativePath) {
|
||||
path += file.webkitRelativePath
|
||||
} else {
|
||||
path += file.name
|
||||
}
|
||||
|
||||
upload_queue.push({
|
||||
task_id: task_id_counter,
|
||||
file: file,
|
||||
path: path,
|
||||
component: null,
|
||||
status: "queued",
|
||||
total_size: file.size,
|
||||
loaded_size: 0,
|
||||
})
|
||||
task_id_counter++
|
||||
|
||||
// Reassign array and wait for tick to complete. After the tick is completed
|
||||
// each upload progress bar will have bound itself to its array item
|
||||
upload_queue = upload_queue
|
||||
|
||||
if (active_uploads === 0 && status !== "uploading") {
|
||||
status = "uploading"
|
||||
visible = true
|
||||
await tick()
|
||||
await start_upload()
|
||||
}
|
||||
type Job = Upload & {
|
||||
dir: string,
|
||||
loaded: number,
|
||||
// What loaded was at the previous update, the difference gives the speed
|
||||
prev: number,
|
||||
speed: number,
|
||||
xhr?: XMLHttpRequest,
|
||||
}
|
||||
|
||||
const min_uploads = 2
|
||||
const max_uploads = 20
|
||||
// Milliseconds between two updates of the widget. The progress bars take as
|
||||
// long to move to their new position
|
||||
const update_interval = 250
|
||||
|
||||
let active_uploads = 0
|
||||
let status = $state("idle")
|
||||
// The uploads are deliberately not reactive. A dropped directory can hold
|
||||
// hundreds of thousands of files, and every running upload reports progress
|
||||
// many times per second. Every update_interval, update() copies what the
|
||||
// widget shows to view, so the cost of rendering does not depend on the size of
|
||||
// the queue
|
||||
let queue: Job[] = []
|
||||
let active: Job[] = []
|
||||
let failed: { path: string, message: string }[] = []
|
||||
let files_total = 0
|
||||
let files_done = 0
|
||||
// In bytes. Files which failed or were cancelled are taken off the total
|
||||
let size_total = 0
|
||||
let size_done = 0
|
||||
// Every byte which was sent, also for uploads which were aborted later
|
||||
let transferred = 0
|
||||
let transferred_prev = 0
|
||||
let speed = 0
|
||||
let updated = 0
|
||||
let timer = 0
|
||||
// What was transferred at each update of the last ten seconds, and how many
|
||||
// bytes the running uploads may have left to send together, see schedule()
|
||||
let samples: { time: number, sent: number }[] = []
|
||||
let threshold = 0
|
||||
// The title which the page set, and the one we replaced it with
|
||||
let page_title = ""
|
||||
let title = ""
|
||||
|
||||
const start_upload = async () => {
|
||||
active_uploads = 0
|
||||
let uploading_size = 0
|
||||
for (let i = 0; i < upload_queue.length; i++) {
|
||||
if (upload_queue[i]) {
|
||||
// If this file is queued, start the upload
|
||||
if (upload_queue[i].status === "queued") {
|
||||
upload_queue[i].component.start()
|
||||
upload_queue[i].status = "uploading"
|
||||
}
|
||||
let visible = $state(false)
|
||||
let collapsed = $state(false)
|
||||
let paused = $state(false)
|
||||
// The timer which waits to try again after the connection was lost
|
||||
let retry = $state(0)
|
||||
let view = $state.raw({
|
||||
uploading: false,
|
||||
running: 0,
|
||||
percent: 0,
|
||||
loaded: 0,
|
||||
total: 0,
|
||||
speed: 0,
|
||||
eta: "",
|
||||
files_done: 0,
|
||||
files_total: 0,
|
||||
rows: [] as { job: Job, loaded: number, speed: number, queued: boolean }[],
|
||||
failed,
|
||||
failed_count: 0,
|
||||
})
|
||||
|
||||
// If this file is already uploading (or just started), count it
|
||||
if (upload_queue[i].status === "uploading") {
|
||||
uploading_size += upload_queue[i].total_size
|
||||
active_uploads++
|
||||
}
|
||||
let file_input: HTMLInputElement
|
||||
pick_files = () => file_input.click()
|
||||
const file_input_change = () => {
|
||||
upload_files(Array.from(file_input.files, file => ({ file, path: file.name })))
|
||||
|
||||
// If the size threshold or the concurrent upload limit is reached
|
||||
// we break the loop. The system tries to keep an upload queue of
|
||||
// 100 MB and a minimum of two concurrent uploads.
|
||||
if (
|
||||
(uploading_size >= 100e6 && active_uploads >= min_uploads) ||
|
||||
active_uploads >= max_uploads
|
||||
) {
|
||||
console.debug("Current uploads", active_uploads, "uploads size", uploading_size)
|
||||
break
|
||||
}
|
||||
}
|
||||
// Without this the same file can't be picked twice in a row
|
||||
file_input.value = ""
|
||||
}
|
||||
|
||||
upload_files = async files => {
|
||||
// Reading a large directory takes a while. The files go to the directory
|
||||
// which they were dropped on, also if the user has left it by then
|
||||
const dir = nav.base.path
|
||||
try {
|
||||
files = await loading_run(async () => files)
|
||||
} catch (err) {
|
||||
alert("Failed to read the files: " + err)
|
||||
return
|
||||
}
|
||||
if (files.length === 0) {
|
||||
return
|
||||
}
|
||||
|
||||
if (active_uploads === 0) {
|
||||
status = "finished"
|
||||
nav.reload()
|
||||
if (active.length + queue.length === 0) {
|
||||
files_total = files_done = size_total = size_done = speed = 0
|
||||
timer = window.setInterval(() => {
|
||||
update()
|
||||
schedule()
|
||||
}, update_interval)
|
||||
}
|
||||
|
||||
// Empty the queue to free any references to lingering components
|
||||
upload_queue = []
|
||||
const limit = $user?.subscription.file_size_limit || 20e9
|
||||
for (const { file, path } of files) {
|
||||
if (file.size > limit) {
|
||||
failed.push({ path, message: "This file is too large. Check out " +
|
||||
"the Pro subscription to increase the file size limit" })
|
||||
continue
|
||||
}
|
||||
queue.push({ file, path, dir, loaded: 0, prev: 0, speed: 0 })
|
||||
files_total++
|
||||
size_total += file.size
|
||||
}
|
||||
|
||||
// In ten seconds we close the popup
|
||||
visible = true
|
||||
schedule()
|
||||
update()
|
||||
}
|
||||
|
||||
// Starts queued uploads until enough are running: at least two, and as many
|
||||
// as it takes to have ten seconds of work at the speed of the last ten seconds.
|
||||
// Small files are sent in large numbers at a time that way, and a slow
|
||||
// connection is not divided over more large files than it can handle. A new
|
||||
// connection starts with two uploads, and gets more as its speed shows
|
||||
const schedule = () => {
|
||||
let size = 0
|
||||
for (const job of active) {
|
||||
size += job.file.size - job.loaded
|
||||
}
|
||||
|
||||
// Empty files don't count towards the speed, a directory full of them
|
||||
// never gets over a threshold of zero. Hence the <=
|
||||
while (
|
||||
!paused && retry === 0 &&
|
||||
queue.length > 0 && active.length < max_uploads &&
|
||||
(size <= threshold || active.length < min_uploads)
|
||||
) {
|
||||
const job = queue.shift()
|
||||
size += job.file.size
|
||||
active.push(job)
|
||||
|
||||
// Takes the job off the running uploads. Without an error it's done
|
||||
const end = (error?: string) => {
|
||||
job.xhr = undefined
|
||||
active.splice(active.indexOf(job), 1)
|
||||
if (error === undefined) {
|
||||
transferred += job.file.size - job.loaded
|
||||
files_done++
|
||||
size_done += job.file.size
|
||||
} else {
|
||||
failed.push({ path: job.path, message: error })
|
||||
files_total--
|
||||
size_total -= job.file.size
|
||||
}
|
||||
schedule()
|
||||
}
|
||||
|
||||
const xhr = job.xhr = new XMLHttpRequest()
|
||||
xhr.open("PUT", fs_path_url(job.dir + "/" + job.path) + "?make_parents=true")
|
||||
xhr.upload.onprogress = e => {
|
||||
transferred += e.loaded - job.loaded
|
||||
job.loaded = e.loaded
|
||||
}
|
||||
xhr.onloadend = () => {
|
||||
if (job.xhr !== xhr) {
|
||||
return // Aborted by stop or cancel
|
||||
} else if (xhr.status >= 400) {
|
||||
// A proxy in front of the API does not answer with JSON
|
||||
let error = xhr.statusText
|
||||
try {
|
||||
error = JSON.parse(xhr.response).message
|
||||
} catch {}
|
||||
end(error)
|
||||
} else if (xhr.status !== 0) {
|
||||
end()
|
||||
} else {
|
||||
// No response, the connection is gone. The file goes back to
|
||||
// the front of the queue, and the queue waits. Without the
|
||||
// wait every file in it would fail within seconds
|
||||
job.xhr = undefined
|
||||
active.splice(active.indexOf(job), 1)
|
||||
job.loaded = job.prev = job.speed = 0
|
||||
queue.unshift(job)
|
||||
clearTimeout(retry)
|
||||
retry = window.setTimeout(() => {
|
||||
retry = 0
|
||||
schedule()
|
||||
}, 10e3)
|
||||
}
|
||||
}
|
||||
|
||||
// Firefox never ends the request for a file which was removed or
|
||||
// truncated after it was picked: there is no error, it hangs. Reading
|
||||
// the last byte of the file first shows if all of it is still there.
|
||||
// Chromium refuses to read a file which changed in any way, with a
|
||||
// NotReadableError, but does upload it. That one is not a reason to
|
||||
// give up
|
||||
job.file.slice(-1).arrayBuffer().then(
|
||||
last => last.byteLength === Math.min(1, job.file.size),
|
||||
err => err.name === "NotReadableError",
|
||||
).then(readable => {
|
||||
if (job.xhr !== xhr) {
|
||||
return
|
||||
} else if (readable) {
|
||||
xhr.send(job.file)
|
||||
} else {
|
||||
end("The file was changed or removed after it was added")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
if (timer !== 0 && active.length + queue.length === 0) {
|
||||
clearInterval(timer)
|
||||
timer = 0
|
||||
paused = false
|
||||
update()
|
||||
|
||||
// Show the new files. The other pages don't use the navigator, there a
|
||||
// reload would put the directory in the address bar
|
||||
if (window.location.pathname.startsWith("/d/")) {
|
||||
nav.reload()
|
||||
}
|
||||
|
||||
// Errors stay until the user has closed them
|
||||
setTimeout(() => {
|
||||
if (status === "finished") {
|
||||
if (timer === 0 && failed.length === 0) {
|
||||
visible = false
|
||||
}
|
||||
}, 10000)
|
||||
} else {
|
||||
status = "uploading"
|
||||
}, 10e3)
|
||||
}
|
||||
}
|
||||
|
||||
const finish_upload = () => {
|
||||
// Update the queue so the status updates are properly rendered
|
||||
upload_queue = upload_queue
|
||||
start_upload()
|
||||
// The request is taken off the job first, that is how its loadend handler knows
|
||||
// that it was aborted on purpose
|
||||
const abort = (job: Job) => {
|
||||
const xhr = job.xhr
|
||||
job.xhr = undefined
|
||||
xhr.abort()
|
||||
}
|
||||
|
||||
// A pause only holds the queue, the uploads which are running finish
|
||||
const toggle_pause = () => {
|
||||
paused = !paused
|
||||
schedule()
|
||||
update()
|
||||
}
|
||||
|
||||
const stop = () => {
|
||||
clearTimeout(retry)
|
||||
retry = 0
|
||||
active.forEach(abort)
|
||||
active = []
|
||||
queue = []
|
||||
failed = []
|
||||
visible = false
|
||||
schedule()
|
||||
}
|
||||
|
||||
const cancel = (job: Job) => {
|
||||
const list = job.xhr === undefined ? queue : active
|
||||
const index = list.indexOf(job)
|
||||
if (index === -1) {
|
||||
return // The row is older than the job, it has finished since
|
||||
}
|
||||
if (list === active) {
|
||||
abort(job)
|
||||
}
|
||||
list.splice(index, 1)
|
||||
files_total--
|
||||
size_total -= job.file.size
|
||||
schedule()
|
||||
update()
|
||||
}
|
||||
|
||||
const update = () => {
|
||||
const now = performance.now()
|
||||
const dt = (now - updated) / 1000
|
||||
updated = now
|
||||
|
||||
// Speeds are moving averages over about the last three seconds. A sample
|
||||
// weighs as much as the time which it covers, because the timer is not
|
||||
// steady: browsers slow it down in a background tab, to once per minute even
|
||||
const weight = 1 - Math.exp(-dt / 3)
|
||||
const average = (speed: number, bytes: number) =>
|
||||
dt > 0 ? speed + (bytes / dt - speed) * weight : speed
|
||||
|
||||
speed = average(speed, transferred - transferred_prev)
|
||||
transferred_prev = transferred
|
||||
|
||||
// Ten seconds at the average speed of the last ten seconds is what was
|
||||
// sent in that time. One sample from before it stays as the start of the
|
||||
// period: in a background tab the timer runs as little as once per minute,
|
||||
// and the period would be empty. It is longer than ten seconds then, so
|
||||
// the amount is scaled back to ten
|
||||
samples.push({ time: now, sent: transferred })
|
||||
while (samples.length > 2 && now - samples[1].time >= 10e3) {
|
||||
samples.shift()
|
||||
}
|
||||
threshold = (transferred - samples[0].sent) * 10e3 /
|
||||
Math.max(10e3, now - samples[0].time)
|
||||
|
||||
let loaded = size_done
|
||||
const rows = active.map(job => {
|
||||
job.speed = average(job.speed, job.loaded - job.prev)
|
||||
job.prev = job.loaded
|
||||
loaded += job.loaded
|
||||
return { job, loaded: job.loaded, speed: job.speed, queued: false }
|
||||
})
|
||||
// The start of the queue is shown too. With only the running uploads the
|
||||
// list changes height all the time, and the widget jumps with it
|
||||
for (const job of queue.slice(0, 50)) {
|
||||
rows.push({ job, loaded: 0, speed: 0, queued: true })
|
||||
}
|
||||
|
||||
const uploading = active.length + queue.length > 0
|
||||
const percent = Math.floor(loaded / size_total * 100) || 0
|
||||
// There is no sensible estimate while nothing is being sent, nor when it
|
||||
// is over a hundred days, which is what a stalled connection gives.
|
||||
// ponytail: estimated from bytes alone, which is too low when small files
|
||||
// with their overhead per request are mixed with large ones. Weigh in the
|
||||
// files per second if that turns out to matter
|
||||
const left = (Math.floor((size_total - loaded) / speed) + 1) * 1000
|
||||
const eta = !paused && active.length > 0 && left < 100 * 86400e3
|
||||
? formatDuration(left, left < 60e3 ? 1 : 2)
|
||||
: ""
|
||||
|
||||
view = {
|
||||
uploading, percent, loaded, speed, eta, rows, files_done, files_total,
|
||||
running: active.length,
|
||||
total: size_total,
|
||||
failed: failed.slice(0, 100),
|
||||
failed_count: failed.length,
|
||||
}
|
||||
|
||||
// Pages set the title when the user navigates. A title which is not the one
|
||||
// we set is a new one, the progress goes in front of it
|
||||
if (document.title !== title) {
|
||||
page_title = document.title
|
||||
}
|
||||
document.title = !uploading ? page_title
|
||||
: (paused ? `Paused ${percent}% ` : `${percent}% ${eta}`) + "/ " + page_title
|
||||
|
||||
// The browser collapses the whitespace in a title, so what we get back
|
||||
// is not always what we set
|
||||
title = document.title
|
||||
}
|
||||
|
||||
const leave_confirmation = (e: BeforeUnloadEvent) => {
|
||||
if (status === "uploading") {
|
||||
if (active.length + queue.length > 0) {
|
||||
e.preventDefault()
|
||||
return "If you close this page your files will stop uploading. Do you want to continue?"
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -159,33 +365,94 @@ const leave_confirmation = (e: BeforeUnloadEvent) => {
|
||||
<svelte:window onbeforeunload={leave_confirmation} />
|
||||
|
||||
<input
|
||||
bind:this={file_input_field}
|
||||
bind:this={file_input}
|
||||
onchange={file_input_change}
|
||||
class="upload_input" type="file" name="file" multiple
|
||||
/>
|
||||
|
||||
{#if visible}
|
||||
<div class="upload_widget">
|
||||
<div class="upload_widget bubble">
|
||||
<div class="header">
|
||||
{#if status === "idle"}
|
||||
Waiting for files
|
||||
{:else if status === "uploading"}
|
||||
Uploading files...
|
||||
{:else if status === "finished"}
|
||||
Done
|
||||
<div class="grow">
|
||||
<div class="ellipsis">
|
||||
{#if !view.uploading}
|
||||
Done{#if view.failed_count > 0}, {view.failed_count} failed{/if}
|
||||
{:else}
|
||||
{retry !== 0 ? "Connection lost" : paused ? "Paused" : "Uploading"}
|
||||
{view.percent}%{#if view.running > 0}, {formatDataVolume(view.speed, 3)}/s{/if}{#if view.eta !== ""}, {view.eta}left{/if}
|
||||
{/if}
|
||||
</div>
|
||||
<ProgressBar total={view.total} used={view.loaded} speed={update_interval} animation="linear"/>
|
||||
</div>
|
||||
{#if view.uploading}
|
||||
<Button
|
||||
flat
|
||||
icon={paused ? "play_arrow" : "pause"}
|
||||
title={paused
|
||||
? "Resume: start uploading the files in the queue again"
|
||||
: "Pause: finish the uploads which are running, but don't start the files in the queue"}
|
||||
click={toggle_pause}
|
||||
/>
|
||||
<Button
|
||||
flat icon="stop"
|
||||
title="Stop: abort the uploads which are running and empty the queue"
|
||||
click={stop}
|
||||
/>
|
||||
{:else}
|
||||
<Button flat icon="close" title="Close" click={stop}/>
|
||||
{/if}
|
||||
<Button
|
||||
flat
|
||||
icon={collapsed ? "expand_less" : "expand_more"}
|
||||
title={collapsed ? "Expand" : "Collapse"}
|
||||
click={() => collapsed = !collapsed}
|
||||
/>
|
||||
</div>
|
||||
<div class="body">
|
||||
{#each upload_queue as job, i}
|
||||
{#if job.status !== "finished"}
|
||||
<UploadProgress
|
||||
bind:this={upload_queue[i].component}
|
||||
bind:job={upload_queue[i]}
|
||||
finish={finish_upload}
|
||||
/>
|
||||
|
||||
{#if !collapsed}
|
||||
<div class="stats">
|
||||
{view.files_done} / {view.files_total} files,
|
||||
{formatDataVolume(view.loaded, 3)} /
|
||||
{formatDataVolume(view.total, 3)}
|
||||
{#if retry !== 0}
|
||||
<br/>
|
||||
Trying again every 10 seconds
|
||||
{/if}
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
<div class="body">
|
||||
{#each view.rows as row (row.job)}
|
||||
<div class="row" class:queued={row.queued}>
|
||||
<div class="grow">
|
||||
<div class="ellipsis path" title={row.job.path}>
|
||||
<span dir="ltr">{row.job.path}</span>
|
||||
</div>
|
||||
{#if row.queued}
|
||||
{formatDataVolume(row.job.file.size, 3)}
|
||||
{:else}
|
||||
{formatDataVolume(row.loaded, 3)} /
|
||||
{formatDataVolume(row.job.file.size, 3)},
|
||||
{formatDataVolume(row.speed, 3)}/s
|
||||
<ProgressBar total={row.job.file.size} used={row.loaded} speed={update_interval} animation="linear"/>
|
||||
{/if}
|
||||
</div>
|
||||
<Button icon="cancel" title="Cancel" click={() => cancel(row.job)}/>
|
||||
</div>
|
||||
{/each}
|
||||
{#each view.failed as file}
|
||||
<div class="error">
|
||||
<div class="ellipsis path" title={file.path}>
|
||||
<span dir="ltr">{file.path}</span>
|
||||
</div>
|
||||
{file.message}
|
||||
</div>
|
||||
{/each}
|
||||
{#if view.failed_count > view.failed.length}
|
||||
<div class="error">
|
||||
And {view.failed_count - view.failed.length} more
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -200,34 +467,59 @@ const leave_confirmation = (e: BeforeUnloadEvent) => {
|
||||
position: fixed;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: auto;
|
||||
min-width: 400px;
|
||||
max-width: 80%;
|
||||
height: auto;
|
||||
width: 600px;
|
||||
max-width: calc(100% - 40px);
|
||||
max-height: 50%;
|
||||
right: 20px;
|
||||
bottom: 20px;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
color: var(--body_text_color);
|
||||
box-shadow: 1px 1px 8px var(--shadow_color);
|
||||
}
|
||||
|
||||
.header {
|
||||
flex: 0 0 auto;
|
||||
background: var(--background_color);
|
||||
color: var(--background_text_color);
|
||||
text-align: center;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 0 0 8px;
|
||||
border-bottom: 1px solid var(--separator);
|
||||
}
|
||||
.header .ellipsis {
|
||||
font-size: 1.2em;
|
||||
padding: 4px;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
.stats {
|
||||
flex: 0 0 auto;
|
||||
padding: 4px 8px;
|
||||
text-align: center;
|
||||
}
|
||||
.body {
|
||||
flex: 1 1 auto;
|
||||
background: var(--body_color);
|
||||
color: var(--body_text_color);
|
||||
overflow-y: auto;
|
||||
}
|
||||
.row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 2px 8px;
|
||||
}
|
||||
.grow {
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
}
|
||||
.ellipsis {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
/* A path which does not fit loses its start, the file name is the part which
|
||||
matters. Text is cut off where it overflows, which is on the left in a box
|
||||
which runs from right to left. The path inside it still runs left to right */
|
||||
.path {
|
||||
direction: rtl;
|
||||
text-align: left;
|
||||
}
|
||||
.error {
|
||||
padding: 2px 8px;
|
||||
background: var(--red_tint);
|
||||
color: var(--red_color);
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
</style>
|
||||
@@ -1,83 +0,0 @@
|
||||
// Uploads a file to the logged in user's Nova account. If no user is
|
||||
// logged in the file is uploaded anonymously.
|
||||
//
|
||||
// on_progress reports progress on the file upload, parameter 1 is the uploaded
|
||||
// file size and parameter 2 is the total file size
|
||||
//
|
||||
// on_success is called when the upload is done, the only parameter is the file
|
||||
// ID
|
||||
//
|
||||
// on_error is called when the upload has failed. The parameters are the error
|
||||
|
||||
import { fs_path_url, type GenericResponse } from "lib/FilesystemAPI.svelte"
|
||||
import { get_user } from "lib/NovaAPI"
|
||||
|
||||
// code and an error message
|
||||
export const upload_file = async (
|
||||
file: Blob,
|
||||
path: string,
|
||||
on_progress: (loaded: number, total: number) => void,
|
||||
on_success: (id: string) => void,
|
||||
on_error: (code: string, message: string) => void,
|
||||
) => {
|
||||
const user = await get_user()
|
||||
// Check the file size limit. For free accounts it's 20 GB
|
||||
if (user !== null && user.subscription.file_size_limit === 0) {
|
||||
user.subscription.file_size_limit = 20e9
|
||||
}
|
||||
|
||||
if (file.size > user.subscription.file_size_limit) {
|
||||
on_error(
|
||||
"file_too_large",
|
||||
"This file is too large. Check out the Pro subscription to increase the file size limit"
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
console.debug("Uploading file to", fs_path_url(path))
|
||||
|
||||
let xhr = new XMLHttpRequest();
|
||||
xhr.open("PUT", fs_path_url(path) + "?make_parents=true", true);
|
||||
xhr.timeout = 86400000; // 24 hours, to account for slow connections
|
||||
|
||||
xhr.upload.addEventListener("progress", evt => {
|
||||
if (on_progress && evt.lengthComputable) {
|
||||
on_progress(evt.loaded, evt.total)
|
||||
}
|
||||
});
|
||||
|
||||
xhr.onreadystatechange = () => {
|
||||
// readystate 4 means the upload is done
|
||||
if (xhr.readyState !== 4) {
|
||||
return
|
||||
}
|
||||
|
||||
if (xhr.status >= 100 && xhr.status < 400) {
|
||||
// Request is a success
|
||||
on_success(JSON.parse(xhr.response).id)
|
||||
} else if (xhr.status >= 400) {
|
||||
// Request failed
|
||||
console.log("Upload error. status: " + xhr.status + " response: " + xhr.response);
|
||||
|
||||
let resp: GenericResponse
|
||||
if (xhr.status === 429) {
|
||||
resp = {
|
||||
value: "too_many_requests",
|
||||
message: "Too many requests. Please wait a few seconds",
|
||||
}
|
||||
} else {
|
||||
resp = JSON.parse(xhr.response) as GenericResponse
|
||||
}
|
||||
|
||||
on_error(resp.value, resp.message)
|
||||
} else if (xhr.status === 0) {
|
||||
on_error("request_failed", "Your request did not arrive, check your network connection")
|
||||
} else {
|
||||
on_error(xhr.responseText, xhr.responseText)
|
||||
}
|
||||
};
|
||||
|
||||
xhr.send(file);
|
||||
|
||||
return xhr
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
<script lang="ts">
|
||||
import { upload_file } from "./UploadFunc";
|
||||
import ProgressBar from "util/ProgressBar.svelte";
|
||||
import Button from "layout/Button.svelte"
|
||||
import type { UploadJob } from "./FSUploadWidget.svelte";
|
||||
|
||||
let {
|
||||
job = $bindable(),
|
||||
total = $bindable(0),
|
||||
loaded = $bindable(0),
|
||||
finish,
|
||||
}: {
|
||||
job: UploadJob
|
||||
total?: number
|
||||
loaded?: number
|
||||
finish: () => void
|
||||
} = $props();
|
||||
|
||||
let error_code = $state("")
|
||||
let error_message = $state("")
|
||||
let xhr: XMLHttpRequest = null
|
||||
|
||||
export const start = () => {
|
||||
upload_file(
|
||||
job.file,
|
||||
job.path,
|
||||
(prog_loaded, prog_total) => {
|
||||
loaded = prog_loaded
|
||||
total = prog_total
|
||||
},
|
||||
async () => {
|
||||
job.status = "finished"
|
||||
finish()
|
||||
},
|
||||
(code, message) => {
|
||||
if (job.status === "finished") {
|
||||
return
|
||||
}
|
||||
|
||||
console.log("Upload error", code, message)
|
||||
error_code = code
|
||||
error_message = message
|
||||
job.status = "error"
|
||||
|
||||
// We don't send the finished signal so the user can read the error
|
||||
// messsage and manually dismiss it through the cancel button
|
||||
},
|
||||
).then(result => {
|
||||
xhr = result
|
||||
job.status = "uploading"
|
||||
})
|
||||
}
|
||||
|
||||
const cancel = () => {
|
||||
job.status = "finished"
|
||||
|
||||
if (xhr && xhr.abort) {
|
||||
xhr.abort()
|
||||
}
|
||||
|
||||
xhr = null
|
||||
finish()
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="prog" class:error={job.status === "error"}>
|
||||
<div class="bar">
|
||||
{job.file.name}<br/>
|
||||
{#if error_code !== ""}
|
||||
{error_message}<br/>
|
||||
{error_code}<br/>
|
||||
{/if}
|
||||
<ProgressBar total={total} used={loaded} speed={500}/>
|
||||
</div>
|
||||
<div class="cancel">
|
||||
<Button icon="cancel" click={cancel}/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.prog {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
.bar {
|
||||
flex: 1 1 auto;
|
||||
padding: 2px 4px 1px 4px;
|
||||
margin: 4px;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
line-break: anywhere;
|
||||
}
|
||||
.cancel {
|
||||
flex: 0 0 content;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center; /* Stop stretching the button */
|
||||
}
|
||||
.error {
|
||||
background: var(--danger_color);
|
||||
color: var(--highlight_text_color);
|
||||
}
|
||||
</style>
|
||||
@@ -128,25 +128,25 @@ 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>
|
||||
{#each siblings as sibling (sibling.id)}
|
||||
{#if !sibling.is_hidden()}
|
||||
<a href={"/d"+fs_encode_path(sibling.path)} class="node" class:playing={sibling.path === $nav.base.path}>
|
||||
<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}
|
||||
@@ -185,7 +185,4 @@ onMount(() => {
|
||||
.play_arrow {
|
||||
margin: 4px;
|
||||
}
|
||||
.playing {
|
||||
color: var(--highlight_color);
|
||||
}
|
||||
</style>
|
||||
@@ -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}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -14,23 +14,17 @@ import Torrent from "./Torrent.svelte";
|
||||
import Zip from "./Zip.svelte";
|
||||
import CustomBanner from "./CustomBanner.svelte";
|
||||
import type { FSNavigator } from "filesystem/FSNavigator";
|
||||
import FsUploadWidget from "filesystem/upload_widget/FSUploadWidget.svelte";
|
||||
import EditWindow from "filesystem/edit_window/EditWindow.svelte";
|
||||
import DetailsWindow from "filesystem/DetailsWindow.svelte";
|
||||
import SearchBar from "filesystem/SearchBar.svelte";
|
||||
|
||||
let {
|
||||
nav,
|
||||
upload_widget,
|
||||
edit_window,
|
||||
details_window,
|
||||
search_bar,
|
||||
}: {
|
||||
nav: FSNavigator
|
||||
upload_widget: FsUploadWidget
|
||||
edit_window: EditWindow
|
||||
details_window: DetailsWindow
|
||||
search_bar: SearchBar
|
||||
} = $props();
|
||||
|
||||
let viewer: any = $state()
|
||||
@@ -92,7 +86,7 @@ export const seek = (delta: number) => {
|
||||
{:else if viewer_type === "dir" && $nav.base.name === ".Trash"}
|
||||
<TrashBin nav={nav} root_path={$nav.path[$nav.path.length - 2].path}/>
|
||||
{:else if viewer_type === "dir"}
|
||||
<FileManager nav={nav} upload_widget={upload_widget} edit_window={edit_window} search_bar={search_bar}>
|
||||
<FileManager nav={nav} edit_window={edit_window}>
|
||||
<CustomBanner path={$nav.path}/>
|
||||
</FileManager>
|
||||
{:else if viewer_type === "audio"}
|
||||
|
||||
@@ -52,14 +52,12 @@ export const update = async () => {
|
||||
// Figure out if there are previous or next files. If not then we disable
|
||||
// swiping controls in that direction
|
||||
const siblings = await nav.get_siblings()
|
||||
for (let i = 0; i < siblings.length; i++) {
|
||||
if (siblings[i].name === nav.base.name) {
|
||||
swipe_prev = i > 0
|
||||
swipe_next = i < siblings.length-1
|
||||
preload(siblings[i-1])
|
||||
preload(siblings[i+1])
|
||||
break
|
||||
}
|
||||
const i = siblings.findIndex(s => s.name === nav.base.name)
|
||||
swipe_prev = i > 0
|
||||
swipe_next = i !== -1 && i < siblings.length-1
|
||||
if (i !== -1) {
|
||||
preload(siblings[i-1])
|
||||
preload(siblings[i+1])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
@@ -206,7 +206,7 @@ const video_keydown = (e: KeyboardEvent) => {
|
||||
.compatibility_warning {
|
||||
background-color: var(--shaded_background);
|
||||
backdrop-filter: blur(4px);
|
||||
border-bottom: 2px solid #6666FF;
|
||||
border-bottom: 2px solid var(--blue_color);
|
||||
padding: 4px;
|
||||
}
|
||||
</style>
|
||||
@@ -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>
|
||||
|
||||