Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d75a49fd
Commit
d75a49fd
authored
Mar 22, 2022
by
Miguel Rincon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor formatUsageSize to use a simple function
parent
3dbb300d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
ee/app/assets/javascripts/usage_quotas/storage/utils.js
ee/app/assets/javascripts/usage_quotas/storage/utils.js
+3
-4
No files found.
ee/app/assets/javascripts/usage_quotas/storage/utils.js
View file @
d75a49fd
import
{
numberToHumanSize
,
bytesToKiB
}
from
'
~/lib/utils/number_utils
'
;
import
{
getFormatter
,
SUPPORTED_FORMATS
}
from
'
~/lib/utils/unit_format
'
;
import
{
kibibytes
}
from
'
~/lib/utils/unit_format
'
;
import
{
PROJECT_STORAGE_TYPES
,
STORAGE_USAGE_THRESHOLDS
}
from
'
./constants
'
;
export
function
usageRatioToThresholdLevel
(
currentUsageRatio
)
{
...
...
@@ -22,9 +22,8 @@ export function usageRatioToThresholdLevel(currentUsageRatio) {
* @param {Number} size size in bytes
* @returns {String}
*/
export
const
formatUsageSize
=
(
size
)
=>
{
const
formatDecimalBytes
=
getFormatter
(
SUPPORTED_FORMATS
.
kibibytes
);
return
formatDecimalBytes
(
bytesToKiB
(
size
),
1
);
export
const
formatUsageSize
=
(
sizeInBytes
)
=>
{
return
kibibytes
(
bytesToKiB
(
sizeInBytes
),
1
);
};
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment