Skip to content

Human readable sizes for Webadmin Interface#7880

Merged
kofemann merged 1 commit intodCache:masterfrom
mcmilk:human-readable-for-static-html
Aug 27, 2025
Merged

Human readable sizes for Webadmin Interface#7880
kofemann merged 1 commit intodCache:masterfrom
mcmilk:human-readable-for-static-html

Conversation

@mcmilk
Copy link
Contributor

@mcmilk mcmilk commented Aug 26, 2025

Motivation

During the last dcache hackathon meeting, there was the idea to display the rather large byte values of the web interface in a human-readable way.

Already during the meeting there was a first short version of the implementation. Today I have adjusted a few small things and now ask for a review.

Modification

Replace the old JavaScript code of 'httpd/static/scripts/sorting' with a better working one: https://github.com/White-Tiger/sorttable.js

The JavaScript file 'common.js' could be used for other modifications as well.

Result

Fix sorting of the times in 'ms' within the '/cellInfo' page. Display all sizes in human-readable format instead of MiB. The old and new views can be switched using a button in the top left corner.

Target: trunk
Request: 11.x, 10.x, 9.x
Require-book: no
Require-notes: yes

@mcmilk mcmilk force-pushed the human-readable-for-static-html branch from fa5ef37 to 47ffa86 Compare August 26, 2025 11:03
@mcmilk
Copy link
Contributor Author

mcmilk commented Aug 26, 2025

Some sample screenshots:

Old (broken) sorting of times:
2025-08-26_130047

New sorting, times are ordered correctly:
2025-08-26_130115

Old view in MiB:
2025-08-26_134739

New view in MiB, GiB, TiB, PiB, EiB ... whatever is needed:
2025-08-26_134729

@mcmilk mcmilk force-pushed the human-readable-for-static-html branch from 47ffa86 to 208f3e0 Compare August 26, 2025 20:06
@kofemann
Copy link
Member

Hi @mcmilk. Thanks for the contribution. Before we merge, could you please update that the table headers don't say xxx Space/MiB, as the unit is already displayed next the the value and not always MiB

@kofemann kofemann requested review from Copilot and kofemann August 27, 2025 08:03
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements human-readable size display for the dcache web admin interface and improves table sorting functionality. The changes replace the existing JavaScript table sorting library with a more capable one and add a toggle feature to switch between raw MiB values and human-readable size formats (GiB, TiB, etc.).

Key changes include:

  • Replace standardista-table-sorting.js with enhanced sorttable.js library
  • Add human-readable size conversion and toggle functionality in common.js
  • Update HTML header to reference new JavaScript files

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
standardista-table-sorting.js Removed old table sorting library
sorttable.js Added enhanced table sorting library with better functionality
css.js Removed CSS utility functions (no longer needed)
common.js Added size conversion functions and toggle button logic
HTMLWriter.java Updated script references to use new sorting library

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Motivation
----------

During the last dcache hackathon meeting, there was the idea to display
the rather large byte values of the web interface in a human-readable
way.

Already during the meeting there was a first short version of the
implementation. Today I have adjusted a few small things and now
ask for a review.

Modification
------------

Replace the old JavaScript code of 'httpd/static/scripts/sorting'
with a better working one: https://github.com/White-Tiger/sorttable.js

The JavaScript file 'common.js' could be used for other modifications
as well.

Result
------

Fix sorting of the times in 'ms' within the '/cellInfo' page.
Display all sizes in human-readable format instead of MiB. The old
and new views can be switched using a button in the top left corner.

Target: trunk
Request: 11.x, 10.x, 9.x
Require-book: no
Require-notes: yes
@mcmilk mcmilk force-pushed the human-readable-for-static-html branch from 208f3e0 to acf6cc0 Compare August 27, 2025 08:31
@kofemann kofemann merged commit 7ce5214 into dCache:master Aug 27, 2025
1 check passed
@kofemann
Copy link
Member

We won't backport the change to older branches.

@mcmilk
Copy link
Contributor Author

mcmilk commented Aug 27, 2025

We won't backport the change to older branches.

Even not v10.2.x - the Latest Golden Release?

@kofemann
Copy link
Member

Usually, we backport only bug fixes or significant performance improvements. This PR updates something that (a) nobody really suffers, (b) might break people's scripts if they scrape web pages.

I will spring this on dev meeting next week

@mcmilk mcmilk deleted the human-readable-for-static-html branch January 16, 2026 06:43
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