Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui): display storage usage #1929

Merged
merged 5 commits into from
Apr 26, 2024
Merged

feat(ui): display storage usage #1929

merged 5 commits into from
Apr 26, 2024

Conversation

wwayne
Copy link
Contributor

@wwayne wwayne commented Apr 23, 2024

Notable changes

We already have pretty-bytes. Why import a new library bytes?
Pretty-bytes cannot convert the size data correctly. The reason should be: Note that it uses base-10 (e.g. kilobyte) from pretty-bytes README

storage

Screen record: https://jam.dev/c/649c3857-52e5-4c46-9181-4addaa75b2e7

fix TAB-616

@wwayne wwayne requested a review from wsxiaoys April 23, 2024 03:34
Copy link
Member

@wsxiaoys wsxiaoys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise LGTM

<p className="font-bold">
Storage Usage
</p>
<p className="text-sm text-muted-foreground">Disk space used by Tabby</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<p className="text-sm text-muted-foreground">Disk space used by Tabby</p>
<p className="text-sm text-muted-foreground">Disk Space Utilization by Type</p>

Prompt:

image

@@ -47,6 +62,15 @@ export default function Workers() {

if (!healthInfo) return

// TODO: mock data
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// TODO: mock data
// FIXME(wwayne): connect with backend api

@@ -47,6 +62,15 @@ export default function Workers() {

if (!healthInfo) return

// TODO: mock data
const usageData = [
{ name: "Models", usage: 1024 * 1024 * 1024 * 1.1, color: "#0088FE", folders: ["~/.tabby/models"] },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove folders hover for now to simplify backend api

@wsxiaoys
Copy link
Member

Please also fix CI

@wsxiaoys wsxiaoys marked this pull request as draft April 23, 2024 03:40
@@ -47,6 +62,15 @@ export default function Workers() {

if (!healthInfo) return

// TODO: mock data
const usageData = [
{ name: "Models", usage: 1024 * 1024 * 1024 * 1.1, color: "#0088FE", folders: ["~/.tabby/models"] },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{ name: "Models", usage: 1024 * 1024 * 1024 * 1.1, color: "#0088FE", folders: ["~/.tabby/models"] },
{ name: "Model Cache", usage: 1024 * 1024 * 1024 * 1.1, color: "#0088FE", folders: ["~/.tabby/models"] },

// TODO: mock data
const usageData = [
{ name: "Models", usage: 1024 * 1024 * 1024 * 1.1, color: "#0088FE", folders: ["~/.tabby/models"] },
{ name: "Repository data", usage: 1024 * 1024 * 2.1, color: "#00C49F", folders: ["~/.tabby/dataset", "~/.tabby/index"] },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{ name: "Repository data", usage: 1024 * 1024 * 2.1, color: "#00C49F", folders: ["~/.tabby/dataset", "~/.tabby/index"] },
{ name: "Repository Context", usage: 1024 * 1024 * 2.1, color: "#00C49F", folders: ["~/.tabby/dataset", "~/.tabby/index"] },

const usageData = [
{ name: "Models", usage: 1024 * 1024 * 1024 * 1.1, color: "#0088FE", folders: ["~/.tabby/models"] },
{ name: "Repository data", usage: 1024 * 1024 * 2.1, color: "#00C49F", folders: ["~/.tabby/dataset", "~/.tabby/index"] },
{ name: "Database", usage: 1024 * 85, color: "#FFBB28", folders: ["~/.tabby/ee"] },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{ name: "Database", usage: 1024 * 85, color: "#FFBB28", folders: ["~/.tabby/ee"] },
{ name: "Other", usage: 1024 * 85, color: "#FFBB28", folders: ["~/.tabby/ee"] },

{ name: "Models", usage: 1024 * 1024 * 1024 * 1.1, color: "#0088FE", folders: ["~/.tabby/models"] },
{ name: "Repository data", usage: 1024 * 1024 * 2.1, color: "#00C49F", folders: ["~/.tabby/dataset", "~/.tabby/index"] },
{ name: "Database", usage: 1024 * 85, color: "#FFBB28", folders: ["~/.tabby/ee"] },
{ name: "Events", usage: 1024 * 1200 * 11, color: "#FF8042", folders: ["~/.tabby/events"] }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{ name: "Events", usage: 1024 * 1200 * 11, color: "#FF8042", folders: ["~/.tabby/events"] }
{ name: "Event Logs", usage: 1024 * 1200 * 11, color: "#FF8042", folders: ["~/.tabby/events"] }

fill={theme === 'dark' ? '#FDFDFD' : '#030302'}
className="text-sm"
>
Total Usuage
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Total Usuage
Total Usage

@wwayne wwayne force-pushed the ui-display-usage branch from da64b6e to 9660038 Compare April 26, 2024 12:21
@wwayne wwayne marked this pull request as ready for review April 26, 2024 12:29
@wwayne wwayne force-pushed the ui-display-usage branch from 84531de to 5c378ff Compare April 26, 2024 14:03
@wsxiaoys wsxiaoys enabled auto-merge (squash) April 26, 2024 19:57
@wsxiaoys wsxiaoys merged commit d42bfb4 into main Apr 26, 2024
4 checks passed
@wsxiaoys wsxiaoys deleted the ui-display-usage branch April 26, 2024 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants