From 89fdc96ad6b7ce7bc57ede98ff80110698c2441f Mon Sep 17 00:00:00 2001 From: Gael Girodon Date: Sun, 28 Oct 2018 17:59:22 +0100 Subject: [PATCH 1/9] Improve the form display --- assets/sass/dirstat.scss | 2 +- web/index.html | 20 +++++++++----------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/assets/sass/dirstat.scss b/assets/sass/dirstat.scss index ae9728d..95655dd 100644 --- a/assets/sass/dirstat.scss +++ b/assets/sass/dirstat.scss @@ -5,4 +5,4 @@ [v-cloak] { display: none; -} \ No newline at end of file +} diff --git a/web/index.html b/web/index.html index a595fba..882b9a1 100644 --- a/web/index.html +++ b/web/index.html @@ -13,26 +13,24 @@

🗃 DirStat

-

- DirStat is a simple graphical web application to show
+

+ DirStat is a simple graphical web application to show
where your disk space has gone to help you to clean it up.

-
- + -
- -
+
-
{{ error }}
+
{{ error }}
Date: Sun, 28 Oct 2018 18:00:34 +0100 Subject: [PATCH 2/9] Improve the treemap display --- assets/js/dirstat.js | 6 +++++- web/index.html | 4 +--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/assets/js/dirstat.js b/assets/js/dirstat.js index f3181ef..648de0a 100644 --- a/assets/js/dirstat.js +++ b/assets/js/dirstat.js @@ -47,8 +47,12 @@ var app = new Vue({ this.$http.get('stat?path=' + this.dir).then(function (data) { var entry = data.body; this.path = [entry]; + document.getElementById('treemap-container').innerHTML = ''; this.graph = new d3plus.Treemap() - .select('#treemap') + .select('#treemap-container') + .detectResize(true) + .detectResizeDelay(250) + .height(640) .data(this.entries) .groupBy('name').sum(this.mode) .tooltipConfig({ diff --git a/web/index.html b/web/index.html index 882b9a1..ce44a05 100644 --- a/web/index.html +++ b/web/index.html @@ -64,9 +64,7 @@

🗃 DirStat

-
- -
+
From 18035a3668daadea47d34fb6bb54ce3f23ed2158 Mon Sep 17 00:00:00 2001 From: Gael Girodon Date: Sun, 28 Oct 2018 18:03:31 +0100 Subject: [PATCH 3/9] Improve treemap tooltips --- assets/js/dirstat.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/assets/js/dirstat.js b/assets/js/dirstat.js index 648de0a..91f292c 100644 --- a/assets/js/dirstat.js +++ b/assets/js/dirstat.js @@ -70,8 +70,9 @@ var app = new Vue({ }, // Map entry stats to a string mapStats: function (d) { - return Math.round(d.size / (1024 * 1024)) + ' MB' - + ' / ' + d.count + ' entries / depth ' + d.depth + return 'Size: ' + Math.round(d.size / (1024 * 1024)) + ' MB
' + + 'Count: ' + d.count + ' entries
' + + 'Depth: ' + d.depth }, // Render the tree map renderTreemap: function () { From 2445100c18ec39c47b2004caa876bced0142a383 Mon Sep 17 00:00:00 2001 From: Gael Girodon Date: Sun, 28 Oct 2018 18:04:22 +0100 Subject: [PATCH 4/9] Add success log --- dirstat.go | 1 + 1 file changed, 1 insertion(+) diff --git a/dirstat.go b/dirstat.go index 677d4b8..c24d5d8 100644 --- a/dirstat.go +++ b/dirstat.go @@ -81,6 +81,7 @@ func statHandler(res http.ResponseWriter, req *http.Request) { // Send a success response with a body content func sendSuccess(res http.ResponseWriter, body []byte) { + log.Println("OK") res.Header().Set("Content-Type", "application/json") res.WriteHeader(http.StatusOK) res.Write(body) From c6577c03931e7173b3956272c6f8f24c81a35296 Mon Sep 17 00:00:00 2001 From: Gael Girodon Date: Sun, 28 Oct 2018 19:53:05 +0100 Subject: [PATCH 5/9] Improve the UI --- assets/sass/dirstat.scss | 11 +++++++++++ web/index.html | 23 ++++++++++++----------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/assets/sass/dirstat.scss b/assets/sass/dirstat.scss index 95655dd..7ebe979 100644 --- a/assets/sass/dirstat.scss +++ b/assets/sass/dirstat.scss @@ -6,3 +6,14 @@ [v-cloak] { display: none; } + +body { + background: #f5f5f5; +} + +.breadcrumb { + background: #ffffff; + border: solid 1px #ced4da; + padding-top: 0.4rem !important; + padding-bottom: 0.4rem !important; +} diff --git a/web/index.html b/web/index.html index ce44a05..d0fc61c 100644 --- a/web/index.html +++ b/web/index.html @@ -12,18 +12,19 @@
-

🗃 DirStat

-

+

🗃 DirStat

+
DirStat is a simple graphical web application to show
where your disk space has gone to help you to clean it up. -

+
-
+
- +
-
+ -
+
- +
@@ -62,9 +63,9 @@

🗃 DirStat

- + -
+
From 1bac9244e272abcfc05d21cf6aa3098448aa3b7a Mon Sep 17 00:00:00 2001 From: Gael Girodon Date: Sun, 28 Oct 2018 19:54:08 +0100 Subject: [PATCH 6/9] Improve packaging --- README.md | 2 +- package.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9f14ab0..60df94f 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ npm run build ### Package ```shell -./scripts/package.ps1 +npm run package ``` ### Release diff --git a/package.json b/package.json index 012f74e..73e825b 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "build:assets": "gulp", "build": "npm run build:assets && packr build -i -o dirstat.exe .", "ensure": "npm install && dep ensure", - "start": "dirstat" + "start": "dirstat", + "package": "powershell.exe ./scripts/package.ps1" }, "repository": { "type": "git", From 5ce5e59b8c6e5010886b2a5f36210506121d84e5 Mon Sep 17 00:00:00 2001 From: Gael Girodon Date: Sun, 28 Oct 2018 19:56:20 +0100 Subject: [PATCH 7/9] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 60df94f..c5dfb1f 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ where your disk space has gone to help you to clean it up. 1. Download the [latest release](https://github.com/GaelGirodon/dir-stat/releases) 2. Start **DirStat** 3. Set the path of the directory to scan -4. Click on the ๐Ÿ” **Scan** button +4. Click on the **Scan** button (or press Enter) 5. Navigate in the treemap to show where your disk space has gone ### CLI usage @@ -30,8 +30,11 @@ dirstat --port 8000 Install global dependencies: - Node.js >= 8 +- NPM >= 5 - Go >= 1.11 +- [Dep](https://github.com/golang/dep) >= 0.5.0 - [Packr](https://github.com/gobuffalo/packr) >= 1.15 +- PowerShell Then, install project dependencies: From 03827a304fb0976111b24107498b20dc68403cd9 Mon Sep 17 00:00:00 2001 From: Gael Girodon Date: Sun, 28 Oct 2018 21:06:41 +0100 Subject: [PATCH 8/9] Improve error display --- assets/js/dirstat.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/js/dirstat.js b/assets/js/dirstat.js index 91f292c..1d50e2b 100644 --- a/assets/js/dirstat.js +++ b/assets/js/dirstat.js @@ -65,7 +65,8 @@ var app = new Vue({ this.processing = false; }).catch(function (err) { this.processing = false; - this.error = 'Unable to analyse the given directory: ' + err.body.message; + this.error = 'Unable to scan the given directory' + + (err.body.message ? ': ' + err.body.message : '') + '.'; }); }, // Map entry stats to a string From 5506561f1b4ec8e8f75ac5d147611b9c0900eccf Mon Sep 17 00:00:00 2001 From: Gael Girodon Date: Sun, 28 Oct 2018 21:08:26 +0100 Subject: [PATCH 9/9] Bump the version number --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 95c2d54..526a011 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "dir-stat", - "version": "0.1.0", + "version": "0.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 73e825b..eebe898 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dir-stat", - "version": "0.1.0", + "version": "0.2.0", "description": "Simple directory statistics", "scripts": { "build:assets": "gulp",