Skip to content

Commit

Permalink
Removal of free disk space indicator
Browse files Browse the repository at this point in the history
Behavior was too erratic on different OSs and architectures.
  • Loading branch information
nmaggioni committed Oct 31, 2016
1 parent fbad52b commit 4a5d364
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 77 deletions.
18 changes: 0 additions & 18 deletions disk.go

This file was deleted.

48 changes: 0 additions & 48 deletions disk_win.go

This file was deleted.

4 changes: 1 addition & 3 deletions http.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ type (
BucketsNumber int `json:"bucketsNumber"`
KeysNumber int `json:"keysNumber"`
DiskUsed int64 `json:"diskUsedBytes"`
DiskFree uint64 `json:"diskFreeBytes"`
Keys bucketKeys `json:"keys"`
}
)
Expand Down Expand Up @@ -166,10 +165,9 @@ func serveWebStats(res http.ResponseWriter, req *http.Request, params goat.Param
keysNumber, _ := CountKeys()
dbFileStats, _ := os.Stat(DBPath)
dbSizeBytes := dbFileStats.Size()
diskAvailableBytes, _ := GetAvailableDiskSpace()
keys, _ := getAllBucketsAndKeys()

webStats := stats{bucketsNumber, keysNumber, dbSizeBytes, diskAvailableBytes, keys}
webStats := stats{bucketsNumber, keysNumber, dbSizeBytes, keys}

setPoweredByHeader(res)
goat.WriteJSON(res, webStats)
Expand Down
2 changes: 0 additions & 2 deletions public/assets/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ function getStats(wantedBucket) {
$('#number-keys').html(stats.keysNumber);
$('#disk-space-used').html((stats.diskUsedBytes / 1048576).toFixed(1)); // MB
$('#disk-space-used').attr('title', stats.diskUsedBytes + ' bytes');
$('#disk-space-free').html(stats.diskFreeBytes > 0 ? (stats.diskFreeBytes / 1073741824).toFixed(1) : 'N/A'); // GB
$('#disk-space-free').attr('title', stats.diskFreeBytes > 0 ? stats.diskFreeBytes + ' bytes' : 'Not applicable on this OS');
$('body').loadie(0.50);

var bucket, key, i = 0, keyIndex;
Expand Down
7 changes: 1 addition & 6 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<h1 class="page-header">Dashboard</h1>

<div class="row placeholders">
<div class="col-xs-6 col-sm-3 placeholder">
<div class="col-xs-6 col-sm-3 col-sm-offset-1 placeholder">
<div class="circle" id="number-buckets">N/A</div>
<h4>Buckets</h4>
<span class="text-muted">Number of buckets</span>
Expand All @@ -66,11 +66,6 @@ <h4>Keys</h4>
<h4>Size</h4>
<span class="text-muted">Occupied disk space (MB)</span>
</div>
<div class="col-xs-6 col-sm-3 placeholder">
<div class="circle" id="disk-space-free">N/A</div>
<h4>Available</h4>
<span class="text-muted">Available capacity (GB)</span>
</div>
</div>

<h2 class="sub-header" id="keys-table-header">
Expand Down

0 comments on commit 4a5d364

Please sign in to comment.