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

enh(occ): print storage values human-friendly #48952

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

solracsf
Copy link
Member

@solracsf solracsf commented Oct 28, 2024

Summary

Values are printed humand-friendly.
IDK if there are some compatibility issues somewhere, or if this is on purpose...so please review.

Before

# occ user:info username
  - user_id: username
  - display_name: username
  - email: [email protected]
  - cloud_id: [email protected]
  - enabled: true
  - groups:
    - Users
  - quota: 20 GB
  - storage:
    - free: 2002327231
    - used: 19472509249
    - total: 21474836480
    - relative: 90.68
    - quota: 21474836480
  - last_seen: 2024-10-15T11:31:16+00:00
  - user_directory: /var/www/data/username
  - backend: Database

After

# occ user:info username
  - user_id: username
  - display_name: username
  - email: [email protected]
  - cloud_id: [email protected]
  - enabled: true
  - groups:
    - Users
  - quota: 20 GB
  - storage:
    - free: 1.9 GB
    - used: 18.1 GB
    - total: 20 GB
    - usedSpacePercent: 90.68%
    - quota: 20 GB
  - last_seen: 2024-10-15T11:31:16+00:00
  - user_directory: /var/www/data/username
  - backend: Database

@solracsf solracsf added 3. to review Waiting for reviews feature: occ labels Oct 28, 2024
@solracsf solracsf added this to the Nextcloud 31 milestone Oct 28, 2024
Signed-off-by: Git'Fellow <[email protected]>

fix: lint

Signed-off-by: Git'Fellow <[email protected]>

fix: value
Copy link
Contributor

@susnux susnux left a comment

Choose a reason for hiding this comment

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

I am not sure if the is used by administrators in scrips, so they would be broken now

Copy link
Member

@provokateurin provokateurin left a comment

Choose a reason for hiding this comment

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

Agreed, human friendly values are not usable in scripts and they also break compatibility.
The only option would be to introduce a flag to optionally print human readable values, but the default needs to stay in bytes.

@skjnldsv skjnldsv added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants