Add kickback fees

This commit is contained in:
2022-01-25 20:37:21 +01:00
parent 7518e6edec
commit 515badbf85
8 changed files with 201 additions and 155 deletions

View File

@@ -13,16 +13,12 @@ logged in and you accidentally upload something you shouldn't have, just don't
share the link. The file will expire eventually. File links are not indexed or
published anywhere. As long as you don't share it nobody will see it.
## Does pixeldrain cost any money?
## Can I donate to pixeldrain?
No, pixeldrain is completely free at the moment. While there is an advertisement
on the file downloading page, it doesn't generate nearly enough revenue to pay
for maintaining this service. That's why I'd really appreciate it if you could
spare some coins. Possible methods for donating are:
We provide extra features for users who support us on Patreon, but if you just
want to give some money and don't care about the perks these options are also
available:
* <a href="https://www.patreon.com/join/pixeldrain" target="_blank">
{{template `patreon.svg` .}} Support me on Patreon and get some perks too!
</a>
* Bitcoin:
[bc1qy8c2lx2zhetmnwwkpl9y7ygzs6yfaaev8nx09n](bitcoin:bc1qy8c2lx2zhetmnwwkpl9y7ygzs6yfaaev8nx09n?label=Pixeldrain%20Donation)
* BasicAttentionToken: Donate BAT by clicking the BAT icon in your address bar.

View File

@@ -17,6 +17,9 @@
layer2Color: "{{.Style.Layer2.RGB}}",
layer3Color: "{{.Style.Layer3.RGB}}",
layer4Color: "{{.Style.Layer4.RGB}}",
chart1Color: "{{.Style.Chart1.RGB}}",
chart2Color: "{{.Style.Chart2.RGB}}",
chart3Color: "{{.Style.Chart3.RGB}}",
}
</script>
{{ end }}

201
svelte/package-lock.json generated
View File

@@ -8,7 +8,7 @@
"name": "svelte-app",
"version": "1.0.0",
"dependencies": {
"chart.js": "^3.6.2"
"chart.js": "^3.7.0"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^14.0.0",
@@ -22,33 +22,33 @@
}
},
"node_modules/@babel/code-frame": {
"version": "7.16.0",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.0.tgz",
"integrity": "sha512-IF4EOMEV+bfYwOmNxGzSnjR2EmQod7f1UXOpZM3l4i4o4QNwzjtJAu/HxdjHq0aYBvdqMuQEY1eg0nqW9ZPORA==",
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz",
"integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==",
"dev": true,
"dependencies": {
"@babel/highlight": "^7.16.0"
"@babel/highlight": "^7.16.7"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-validator-identifier": {
"version": "7.15.7",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz",
"integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==",
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz",
"integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==",
"dev": true,
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/highlight": {
"version": "7.16.0",
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.0.tgz",
"integrity": "sha512-t8MH41kUQylBtu2+4IQA3atqevA2lRgqA2wyVB/YiWmsDSuylZZuXOUy9ric30hfzauEFfdsuk/eXTRrGrfd0g==",
"version": "7.16.10",
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.10.tgz",
"integrity": "sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==",
"dev": true,
"dependencies": {
"@babel/helper-validator-identifier": "^7.15.7",
"@babel/helper-validator-identifier": "^7.16.7",
"chalk": "^2.0.0",
"js-tokens": "^4.0.0"
},
@@ -128,9 +128,9 @@
"dev": true
},
"node_modules/@types/node": {
"version": "16.11.12",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.12.tgz",
"integrity": "sha512-+2Iggwg7PxoO5Kyhvsq9VarmPbIelXP070HMImEpbtGCoyWNINQj4wzjbQCXzdHTRXnqufutJb5KAURZANNBAw==",
"version": "17.0.12",
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.12.tgz",
"integrity": "sha512-4YpbAsnJXWYK/fpTVFlMIcUIho2AYCi4wg5aNPrG1ng7fn/1/RZfCIpRCiBX+12RVa34RluilnvCqD+g3KiSiA==",
"dev": true
},
"node_modules/@types/resolve": {
@@ -142,20 +142,6 @@
"@types/node": "*"
}
},
"node_modules/acorn": {
"version": "8.7.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz",
"integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==",
"dev": true,
"optional": true,
"peer": true,
"bin": {
"acorn": "bin/acorn"
},
"engines": {
"node": ">=0.4.0"
}
},
"node_modules/ansi-styles": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
@@ -251,15 +237,21 @@
}
},
"node_modules/chart.js": {
"version": "3.6.2",
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-3.6.2.tgz",
"integrity": "sha512-Xz7f/fgtVltfQYWq0zL1Xbv7N2inpG+B54p3D5FSvpCdy3sM+oZhbqa42eNuYXltaVvajgX5UpKCU2GeeJIgxg=="
"version": "3.7.0",
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-3.7.0.tgz",
"integrity": "sha512-31gVuqqKp3lDIFmzpKIrBeum4OpZsQjSIAqlOpgjosHDJZlULtvwLEZKtEhIAZc7JMPaHlYMys40Qy9Mf+1AAg=="
},
"node_modules/chokidar": {
"version": "3.5.2",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz",
"integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==",
"version": "3.5.3",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
"integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==",
"dev": true,
"funding": [
{
"type": "individual",
"url": "https://paulmillr.com/funding/"
}
],
"dependencies": {
"anymatch": "~3.1.2",
"braces": "~3.0.2",
@@ -459,9 +451,9 @@
}
},
"node_modules/is-core-module": {
"version": "2.8.0",
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.0.tgz",
"integrity": "sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw==",
"version": "2.8.1",
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz",
"integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==",
"dev": true,
"dependencies": {
"has": "^1.0.3"
@@ -647,9 +639,9 @@
"dev": true
},
"node_modules/picomatch": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz",
"integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==",
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
"dev": true,
"engines": {
"node": ">=8.6"
@@ -686,22 +678,26 @@
"dev": true
},
"node_modules/resolve": {
"version": "1.20.0",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz",
"integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==",
"version": "1.22.0",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz",
"integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==",
"dev": true,
"dependencies": {
"is-core-module": "^2.2.0",
"path-parse": "^1.0.6"
"is-core-module": "^2.8.1",
"path-parse": "^1.0.7",
"supports-preserve-symlinks-flag": "^1.0.0"
},
"bin": {
"resolve": "bin/resolve"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/rollup": {
"version": "2.61.1",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.61.1.tgz",
"integrity": "sha512-BbTXlEvB8d+XFbK/7E5doIcRtxWPRiqr0eb5vQ0+2paMM04Ye4PZY5nHOQef2ix24l/L0SpLd5hwcH15QHPdvA==",
"version": "2.66.1",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.66.1.tgz",
"integrity": "sha512-crSgLhSkLMnKr4s9iZ/1qJCplgAgrRY+igWv8KhG/AjKOJ0YX/WpmANyn8oxrw+zenF3BXWDLa7Xl/QZISH+7w==",
"dev": true,
"bin": {
"rollup": "dist/bin/rollup"
@@ -845,10 +841,22 @@
"node": ">=4"
}
},
"node_modules/supports-preserve-symlinks-flag": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz",
"integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==",
"dev": true,
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/svelte": {
"version": "3.44.3",
"resolved": "https://registry.npmjs.org/svelte/-/svelte-3.44.3.tgz",
"integrity": "sha512-aGgrNCip5PQFNfq9e9tmm7EYxWLVHoFsEsmKrtOeRD8dmoGDdyTQ+21xd7qgFd8MNdKGSYvg7F9dr+Tc0yDymg==",
"version": "3.46.2",
"resolved": "https://registry.npmjs.org/svelte/-/svelte-3.46.2.tgz",
"integrity": "sha512-RXSAtYNefe01Sb1lXtZ2I+gzn3t/h/59hoaRNeRrm8IkMIu6BSiAkbpi41xb+C44x54YKnbk9+dtfs3pM4hECA==",
"dev": true,
"engines": {
"node": ">= 8"
@@ -921,27 +929,27 @@
},
"dependencies": {
"@babel/code-frame": {
"version": "7.16.0",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.0.tgz",
"integrity": "sha512-IF4EOMEV+bfYwOmNxGzSnjR2EmQod7f1UXOpZM3l4i4o4QNwzjtJAu/HxdjHq0aYBvdqMuQEY1eg0nqW9ZPORA==",
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz",
"integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==",
"dev": true,
"requires": {
"@babel/highlight": "^7.16.0"
"@babel/highlight": "^7.16.7"
}
},
"@babel/helper-validator-identifier": {
"version": "7.15.7",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz",
"integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==",
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz",
"integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==",
"dev": true
},
"@babel/highlight": {
"version": "7.16.0",
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.0.tgz",
"integrity": "sha512-t8MH41kUQylBtu2+4IQA3atqevA2lRgqA2wyVB/YiWmsDSuylZZuXOUy9ric30hfzauEFfdsuk/eXTRrGrfd0g==",
"version": "7.16.10",
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.10.tgz",
"integrity": "sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.15.7",
"@babel/helper-validator-identifier": "^7.16.7",
"chalk": "^2.0.0",
"js-tokens": "^4.0.0"
}
@@ -1000,9 +1008,9 @@
"dev": true
},
"@types/node": {
"version": "16.11.12",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.12.tgz",
"integrity": "sha512-+2Iggwg7PxoO5Kyhvsq9VarmPbIelXP070HMImEpbtGCoyWNINQj4wzjbQCXzdHTRXnqufutJb5KAURZANNBAw==",
"version": "17.0.12",
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.12.tgz",
"integrity": "sha512-4YpbAsnJXWYK/fpTVFlMIcUIho2AYCi4wg5aNPrG1ng7fn/1/RZfCIpRCiBX+12RVa34RluilnvCqD+g3KiSiA==",
"dev": true
},
"@types/resolve": {
@@ -1014,14 +1022,6 @@
"@types/node": "*"
}
},
"acorn": {
"version": "8.7.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz",
"integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==",
"dev": true,
"optional": true,
"peer": true
},
"ansi-styles": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
@@ -1096,14 +1096,14 @@
}
},
"chart.js": {
"version": "3.6.2",
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-3.6.2.tgz",
"integrity": "sha512-Xz7f/fgtVltfQYWq0zL1Xbv7N2inpG+B54p3D5FSvpCdy3sM+oZhbqa42eNuYXltaVvajgX5UpKCU2GeeJIgxg=="
"version": "3.7.0",
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-3.7.0.tgz",
"integrity": "sha512-31gVuqqKp3lDIFmzpKIrBeum4OpZsQjSIAqlOpgjosHDJZlULtvwLEZKtEhIAZc7JMPaHlYMys40Qy9Mf+1AAg=="
},
"chokidar": {
"version": "3.5.2",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz",
"integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==",
"version": "3.5.3",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
"integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==",
"dev": true,
"requires": {
"anymatch": "~3.1.2",
@@ -1265,9 +1265,9 @@
}
},
"is-core-module": {
"version": "2.8.0",
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.0.tgz",
"integrity": "sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw==",
"version": "2.8.1",
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz",
"integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==",
"dev": true,
"requires": {
"has": "^1.0.3"
@@ -1419,9 +1419,9 @@
"dev": true
},
"picomatch": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz",
"integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==",
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
"dev": true
},
"randombytes": {
@@ -1449,19 +1449,20 @@
"dev": true
},
"resolve": {
"version": "1.20.0",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz",
"integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==",
"version": "1.22.0",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz",
"integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==",
"dev": true,
"requires": {
"is-core-module": "^2.2.0",
"path-parse": "^1.0.6"
"is-core-module": "^2.8.1",
"path-parse": "^1.0.7",
"supports-preserve-symlinks-flag": "^1.0.0"
}
},
"rollup": {
"version": "2.61.1",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.61.1.tgz",
"integrity": "sha512-BbTXlEvB8d+XFbK/7E5doIcRtxWPRiqr0eb5vQ0+2paMM04Ye4PZY5nHOQef2ix24l/L0SpLd5hwcH15QHPdvA==",
"version": "2.66.1",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.66.1.tgz",
"integrity": "sha512-crSgLhSkLMnKr4s9iZ/1qJCplgAgrRY+igWv8KhG/AjKOJ0YX/WpmANyn8oxrw+zenF3BXWDLa7Xl/QZISH+7w==",
"dev": true,
"requires": {
"fsevents": "~2.3.2"
@@ -1570,10 +1571,16 @@
"has-flag": "^3.0.0"
}
},
"supports-preserve-symlinks-flag": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz",
"integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==",
"dev": true
},
"svelte": {
"version": "3.44.3",
"resolved": "https://registry.npmjs.org/svelte/-/svelte-3.44.3.tgz",
"integrity": "sha512-aGgrNCip5PQFNfq9e9tmm7EYxWLVHoFsEsmKrtOeRD8dmoGDdyTQ+21xd7qgFd8MNdKGSYvg7F9dr+Tc0yDymg==",
"version": "3.46.2",
"resolved": "https://registry.npmjs.org/svelte/-/svelte-3.46.2.tgz",
"integrity": "sha512-RXSAtYNefe01Sb1lXtZ2I+gzn3t/h/59hoaRNeRrm8IkMIu6BSiAkbpi41xb+C44x54YKnbk9+dtfs3pM4hECA==",
"dev": true
},
"terser": {

View File

@@ -17,6 +17,6 @@
"svelte": "^3.0.0"
},
"dependencies": {
"chart.js": "^3.6.2"
"chart.js": "^3.7.0"
}
}

View File

@@ -25,10 +25,12 @@ let load_graphs = async (minutes, interval) => {
let downloads = get_graph_data("downloads", start, end, interval);
let bandwidth = get_graph_data("bandwidth", start, end, interval);
let transfer_paid = get_graph_data("transfer_paid", start, end, interval);
let transfer_kickback = get_graph_data("transfer_kickback", start, end, interval);
views = await views
downloads = await downloads
bandwidth = await bandwidth
transfer_paid = await transfer_paid
transfer_kickback = await transfer_kickback
graph_views_downloads.data().labels = views.timestamps;
graph_views_downloads.data().datasets[0].data = views.amounts
@@ -36,6 +38,7 @@ let load_graphs = async (minutes, interval) => {
graph_bandwidth.data().labels = bandwidth.timestamps;
graph_bandwidth.data().datasets[0].data = bandwidth.amounts
graph_bandwidth.data().datasets[1].data = transfer_paid.amounts
graph_bandwidth.data().datasets[2].data = transfer_kickback.amounts
graph_views_downloads.update()
graph_bandwidth.update()
@@ -150,18 +153,25 @@ onMount(() => {
];
graph_bandwidth.data().datasets = [
{
label: "Bandwidth (total)",
label: "Total bandwidth",
borderWidth: 2,
pointRadius: 0,
borderColor: "#"+window.style.highlightColor,
backgroundColor: "#"+window.style.highlightColor,
borderColor: "#"+window.style.chart1Color,
backgroundColor: "#"+window.style.chart1Color,
},
{
label: "Bandwidth (premium)",
label: "Premium bandwidth",
borderWidth: 2,
pointRadius: 0,
borderColor: "#"+window.style.dangerColor,
backgroundColor: "#"+window.style.dangerColor,
borderColor: "#"+window.style.chart2Color,
backgroundColor: "#"+window.style.chart2Color,
},
{
label: "Kickback bandwidth",
borderWidth: 2,
pointRadius: 0,
borderColor: "#"+window.style.chart3Color,
backgroundColor: "#"+window.style.chart3Color,
},
];
@@ -287,15 +297,22 @@ onDestroy(() => {
<section>
<h3>Premium transfers and total bandwidth usage</h3>
<p>
A premium transfer is when a file is downloaded using the data cap
on your subscription plan. These can be files you downloaded from
other people, or other people downloading your files if you have
bandwidth sharing enabled. Bandwidth sharing can be changed on
Total bandwidth usage is the combined bandwidth usage of all the files
on your account. This includes paid transfers.
</p>
<p>
A premium transfer is when a file is downloaded using the data cap on
your subscription plan. These can be files you downloaded from other
people, or other people downloading your files if you have bandwidth
sharing enabled. Bandwidth sharing can be changed on
<a href="/user/subscription">the subscription page</a>.
</p>
<p>
Total bandwidth usage is the combined bandwidth usage of all the
files on your account. This includes paid transfers.
Kickback bandwidth is counted when a paying pixeldrain user downloads
one of your files using their data cap. If you are on a prepaid plan
this usage will be compensated at a rate of €1 per TB. When this happens
a positive transaction will be logged on the
<a href="/user/transactions">transactions page</a>.
</p>
</section>
<Chart bind:this={graph_bandwidth} data_type="bytes"/>

View File

@@ -33,6 +33,7 @@ const load_transactions = async () => {
total_subscription_charge: 0,
total_storage_charge: 0,
total_bandwidth_charge: 0,
total_kickback_fee: 0,
total_deposited: 0,
total_deducted: 0,
}
@@ -47,6 +48,7 @@ const load_transactions = async () => {
month.total_subscription_charge += row.subscription_charge
month.total_storage_charge += row.storage_charge
month.total_bandwidth_charge += row.bandwidth_charge
month.total_kickback_fee += row.kickback_fee
month.total_deducted += row.subscription_charge + row.storage_charge + row.bandwidth_charge
})
months.push(month)
@@ -227,6 +229,7 @@ onMount(() => {
<li>Storage charge: <Euro amount={month.total_storage_charge}></Euro></li>
<li>Bandwidth charge: <Euro amount={month.total_bandwidth_charge}></Euro></li>
<li>Total charge: <Euro amount={month.total_deducted}></Euro></li>
<li>Earned: <Euro amount={month.total_kickback_fee}></Euro></li>
<li>Deposited: <Euro amount={month.total_deposited}></Euro></li>
</ul>
@@ -239,16 +242,19 @@ onMount(() => {
<td>Subscription</td>
<td colspan="2">Storage</td>
<td colspan="2">Bandwidth</td>
<td>Deposited</td>
<td colspan="2">Kickback</td>
<td>Deposit</td>
</tr>
<tr>
<td></td>
<td></td>
<td>Charged</td>
<td>Charged</td>
<td>Used</td>
<td>Charged</td>
<td>Used</td>
<td>Charge</td>
<td>Charge</td>
<td>Usage</td>
<td>Charge</td>
<td>Usage</td>
<td>Fee</td>
<td>Amount</td>
<td></td>
</tr>
</thead>
@@ -262,6 +268,8 @@ onMount(() => {
<td>{formatDataVolume(row.storage_used, 3)}</td>
<td><Euro amount={row.bandwidth_charge} precision="4"></Euro></td>
<td>{formatDataVolume(row.bandwidth_used, 3)}</td>
<td><Euro amount={row.kickback_fee} precision="4"></Euro></td>
<td>{formatDataVolume(row.kickback_amount, 3)}</td>
<td><Euro amount={row.deposit_amount}></Euro></td>
</tr>
{/each}

View File

@@ -5,7 +5,7 @@ export let precision = 2
<span>
<span class:red={amount < 0} class:green={amount > 0}>
<span class:red={amount < 0} class:green={amount > 0} class:zero={amount === 0}>
{(amount / 1000000).toFixed(precision)}
</span>
</span>
@@ -17,4 +17,7 @@ export let precision = 2
.green {
color: var(--highlight_color);
}
.zero {
color: var(--layer_4_color);
}
</style>

View File

@@ -9,7 +9,7 @@ import (
"time"
)
func userStyle(r *http.Request) pixeldrainStyleSheet {
func userStyle(r *http.Request) (s pixeldrainStyleSheet) {
// Get the chosen style from the URL
var style = r.URL.Query().Get("style")
@@ -22,30 +22,48 @@ func userStyle(r *http.Request) pixeldrainStyleSheet {
switch style {
case "classic":
return pixeldrainClassicStyle
s = pixeldrainClassicStyle
case "solarized_dark":
return solarizedDarkStyle
s = solarizedDarkStyle
case "sunny":
return sunnyPixeldrainStyle
s = sunnyPixeldrainStyle
case "maroon":
return maroonStyle
s = maroonStyle
case "hacker":
return hackerStyle
s = hackerStyle
case "canta":
return cantaPixeldrainStyle
s = cantaPixeldrainStyle
case "deepsea":
return deepseaPixeldrainStyle
s = deepseaPixeldrainStyle
case "skeuos":
return skeuosPixeldrainStyle
s = skeuosPixeldrainStyle
case "nord":
return nordPixeldrainStyle
s = nordPixeldrainStyle
case "snowstorm":
return snowstormPixeldrainStyle
s = snowstormPixeldrainStyle
case "default":
fallthrough // use default case
default:
return defaultPixeldrainStyle
s = defaultPixeldrainStyle
}
// Set default colors
var noColor = hsl{0, 0, 0}
var setDefault = func(color *hsl, def hsl) {
if *color == noColor {
*color = def
}
}
setDefault(&s.Link, s.Highlight.Add(0, 0, -.05))
setDefault(&s.InputDisabled, s.Input.Add(0, -.2, -.2))
setDefault(&s.ScrollbarForeground, s.Input)
setDefault(&s.ScrollbarHover, s.ScrollbarForeground.Add(0, 0, .1))
setDefault(&s.Layer1Text, s.Text)
setDefault(&s.Chart1, s.Highlight)
setDefault(&s.Chart2, s.Chart1.Add(120, 0, 0))
setDefault(&s.Chart3, s.Chart2.Add(120, 0, 0))
return s
}
type pixeldrainStyleSheet struct {
@@ -66,29 +84,16 @@ type pixeldrainStyleSheet struct {
Layer3 hsl
Layer4 hsl // Highest and brightest layer
// Colors to use in graphs
Chart1 hsl
Chart2 hsl
Chart3 hsl
Shadow hsl
Light bool // If this is a light theme
}
func (s pixeldrainStyleSheet) String() string {
var noColor = hsl{0, 0, 0}
if s.Link == noColor {
s.Link = s.Highlight.Add(0, 0, -.05)
}
if s.InputDisabled == noColor {
s.InputDisabled = s.Input.Add(0, -.2, -.2)
}
if s.ScrollbarForeground == noColor {
s.ScrollbarForeground = s.Input
}
if s.ScrollbarHover == noColor {
s.ScrollbarHover = s.ScrollbarForeground.Add(0, 0, .1)
}
if s.Layer1Text == noColor {
s.Layer1Text = s.Text
}
return fmt.Sprintf(
`:root {
--text_color: #%s;
@@ -116,6 +121,10 @@ func (s pixeldrainStyleSheet) String() string {
--layer_4_color: #%s;
--layer_4_color_border: #%s;
--chart_1_color: #%s;
--chart_2_color: #%s;
--chart_3_color: #%s;
--shadow_color: #%s;
}`,
s.Text.RGB(),
@@ -141,6 +150,9 @@ func (s pixeldrainStyleSheet) String() string {
s.Layer3.Add(0, 0, .05).RGB(),
s.Layer4.RGB(),
s.Layer4.Add(0, 0, .05).RGB(),
s.Chart1.RGB(),
s.Chart2.RGB(),
s.Chart3.RGB(),
s.Shadow.RGB(),
)
}