From 97fc5e9c1c3c6867d6d83c6fd1c353151fbfb113 Mon Sep 17 00:00:00 2001 From: Wim Brand Date: Thu, 13 Jun 2024 21:17:41 +0200 Subject: [PATCH] Add new upload history page --- go.mod | 14 +- go.sum | 12 +- res/template/history.html | 158 ----------------- res/template/upload_history.html | 19 +++ svelte/package-lock.json | 6 +- svelte/rollup.config.js | 1 + svelte/src/upload_history.js | 8 + .../src/upload_history/UploadHistory.svelte | 159 ++++++++++++++++++ webcontroller/web_controller.go | 6 +- 9 files changed, 208 insertions(+), 175 deletions(-) delete mode 100644 res/template/history.html create mode 100644 res/template/upload_history.html create mode 100644 svelte/src/upload_history.js create mode 100644 svelte/src/upload_history/UploadHistory.svelte diff --git a/go.mod b/go.mod index 99d7346..6933e40 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ module fornaxian.tech/pixeldrain_web -go 1.21 +go 1.22 -toolchain go1.22.0 +toolchain go1.22.4 replace ( fornaxian.tech/pixeldrain_api_client => ../pixeldrain_api_client @@ -12,21 +12,21 @@ replace ( require ( fornaxian.tech/config v0.0.0-20211108212237-6133aed90586 fornaxian.tech/log v0.0.0-20211102185326-552e9b1f8640 - fornaxian.tech/pixeldrain_api_client v0.0.0-20221207191816-6872676df741 - fornaxian.tech/util v0.0.0-20230520114728-bd827686fec7 + fornaxian.tech/pixeldrain_api_client v0.0.0-20240321144932-32993212d251 + fornaxian.tech/util v0.0.0-20240305140022-c865b3d36a3f github.com/julienschmidt/httprouter v1.3.0 github.com/microcosm-cc/bluemonday v1.0.26 github.com/russross/blackfriday/v2 v2.1.0 ) require ( - github.com/BurntSushi/toml v1.3.2 // indirect + github.com/BurntSushi/toml v1.4.0 // indirect github.com/aymerick/douceur v0.2.0 // indirect github.com/gocql/gocql v1.6.0 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/gorilla/css v1.0.1 // indirect github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed // indirect - golang.org/x/crypto v0.21.0 // indirect - golang.org/x/net v0.22.0 // indirect + golang.org/x/crypto v0.24.0 // indirect + golang.org/x/net v0.26.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect ) diff --git a/go.sum b/go.sum index 8addc8c..2272ae2 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ fornaxian.tech/config v0.0.0-20211108212237-6133aed90586 h1:/4a0Iq3cYeyTWcPHsN9p 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.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= -github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0= +github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= 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/bitly/go-hostpool v0.0.0-20171023180738-a3a6125de932 h1:mXoPYz/Ul5HYEDvkta6I8/rnYM5gSdSV2tJ6XbZuEtY= @@ -34,9 +34,9 @@ github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= +golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= diff --git a/res/template/history.html b/res/template/history.html deleted file mode 100644 index 49c7c05..0000000 --- a/res/template/history.html +++ /dev/null @@ -1,158 +0,0 @@ -{{define "history_cookies"}} - - - {{template "meta_tags" "Upload History"}} - - - - - {{template "page_top" .}} - -
-

Upload History

-
-
-
-

- Here are all files you have previously uploaded to pixeldrain using this computer. - This data is saved locally in your web browser and gets updated every time you upload a file through your current browser. -

-
- -
-
- {{template "page_bottom" .}} - - - {{template "analytics"}} - -{{end}} diff --git a/res/template/upload_history.html b/res/template/upload_history.html new file mode 100644 index 0000000..552d16f --- /dev/null +++ b/res/template/upload_history.html @@ -0,0 +1,19 @@ +{{define "upload_history"}} + + + + {{template "meta_tags" "Upload history"}} + + + + + + {{template "menu" .}} +
+ {{template "analytics"}} + + +{{end}} diff --git a/svelte/package-lock.json b/svelte/package-lock.json index bbb3d9f..4610dba 100644 --- a/svelte/package-lock.json +++ b/svelte/package-lock.json @@ -2064,9 +2064,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001538", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001538.tgz", - "integrity": "sha512-HWJnhnID+0YMtGlzcp3T9drmBJUVDchPJ08tpUGFLs9CYlwWPH2uLgpHn8fND5pCgXVtnGS3H4QR9XLMHVNkHw==", + "version": "1.0.30001599", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001599.tgz", + "integrity": "sha512-LRAQHZ4yT1+f9LemSMeqdMpMxZcc4RMWdj4tiFe3G8tNkWK+E58g+/tzotb5cU6TbcVJLr4fySiAW7XmxQvZQA==", "dev": true, "funding": [ { diff --git a/svelte/rollup.config.js b/svelte/rollup.config.js index af15143..788acbe 100644 --- a/svelte/rollup.config.js +++ b/svelte/rollup.config.js @@ -17,6 +17,7 @@ export default [ "home_page", "text_upload", "speedtest", + "upload_history", ].map((name, index) => ({ input: `src/${name}.js`, output: { diff --git a/svelte/src/upload_history.js b/svelte/src/upload_history.js new file mode 100644 index 0000000..25c0e53 --- /dev/null +++ b/svelte/src/upload_history.js @@ -0,0 +1,8 @@ +import App from './upload_history/UploadHistory.svelte'; + +const app = new App({ + target: document.getElementById("page_body"), + props: {} +}); + +export default app; diff --git a/svelte/src/upload_history/UploadHistory.svelte b/svelte/src/upload_history/UploadHistory.svelte new file mode 100644 index 0000000..f4d8771 --- /dev/null +++ b/svelte/src/upload_history/UploadHistory.svelte @@ -0,0 +1,159 @@ + + + + +
+

File upload history

+
+ +
+
+

+ Here are all files you have previously uploaded to pixeldrain using this + computer. This data is saved locally in your web browser and gets updated + every time you upload a file through your current browser. +

+
+ + {#each files as file (file.id)} + + {file.name} +
+ + {file.name} + +
+ + {formatDate(file.date_upload, true, true, true)} + +
+
+ +