Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
funkwhale
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zwordi
funkwhale
Commits
6dd9ad13
Commit
6dd9ad13
authored
5 years ago
by
Ciarán Ainsworth
Committed by
Eliot Berriot
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Human readable stats
parent
0e652103
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changes/changelog.d/873.enhancement
+1
-0
1 addition, 0 deletions
changes/changelog.d/873.enhancement
front/src/components/instance/Stats.vue
+9
-9
9 additions, 9 deletions
front/src/components/instance/Stats.vue
with
10 additions
and
9 deletions
changes/changelog.d/873.enhancement
0 → 100644
+
1
−
0
View file @
6dd9ad13
Numbers on the stats page will now be formatted in a human readable way and will update with the locale (#873)
This diff is collapsed.
Click to expand it.
front/src/components/instance/Stats.vue
+
9
−
9
View file @
6dd9ad13
...
...
@@ -9,19 +9,19 @@
<div
class=
"statistic"
>
<div
class=
"value"
>
<i
class=
"green user icon"
></i>
{{
stats
.
users
}}
{{
stats
.
users
.
toLocaleString
(
$store
.
state
.
ui
.
momentLocale
)
}}
</div>
<div
class=
"label"
><translate
translate-context=
"Content/About/Paragraph/Unit"
>
users
</translate></div>
</div>
<div
class=
"statistic"
>
<div
class=
"value"
>
<i
class=
"orange sound icon"
></i>
{{
stats
.
listenings
}}
<i
class=
"orange sound icon"
></i>
{{
stats
.
listenings
.
toLocaleString
(
$store
.
state
.
ui
.
momentLocale
)
}}
</div>
<div
class=
"label"
><translate
translate-context=
"Content/About/Paragraph/Unit"
>
tracks listened
</translate></div>
</div>
<div
class=
"statistic"
>
<div
class=
"value"
>
<i
class=
"pink heart icon"
></i>
{{
stats
.
trackFavorites
}}
<i
class=
"pink heart icon"
></i>
{{
stats
.
trackFavorites
.
toLocaleString
(
$store
.
state
.
ui
.
momentLocale
)
}}
</div>
<div
class=
"label"
><translate
translate-context=
"Content/About/Paragraph/Unit"
>
Tracks favorited
</translate></div>
</div>
...
...
@@ -32,25 +32,25 @@
<div
class=
"ui mini horizontal statistics"
>
<div
class=
"statistic"
>
<div
class=
"value"
>
{{
parseInt
(
stats
.
musicDuration
)
}}
{{
stats
.
musicDuration
.
toLocaleString
(
$store
.
state
.
ui
.
momentLocale
)
}}
</div>
<div
class=
"label"
><translate
translate-context=
"Content/About/Paragraph/Unit"
>
Hours of music
</translate></div>
</div>
<div
class=
"statistic"
>
<div
class=
"value"
>
{{
stats
.
artists
}}
{{
stats
.
artists
.
toLocaleString
(
$store
.
state
.
ui
.
momentLocale
)
}}
</div>
<div
class=
"label"
><translate
translate-context=
"*/*/*/Noun"
>
Artists
</translate></div>
</div>
<div
class=
"statistic"
>
<div
class=
"value"
>
{{
stats
.
albums
}}
{{
stats
.
albums
.
toLocaleString
(
$store
.
state
.
ui
.
momentLocale
)
}}
</div>
<div
class=
"label"
><translate
translate-context=
"*/*/*"
>
Albums
</translate></div>
</div>
<div
class=
"statistic"
>
<div
class=
"value"
>
{{
stats
.
tracks
}}
{{
stats
.
tracks
.
toLocaleString
(
$store
.
state
.
ui
.
momentLocale
)
}}
</div>
<div
class=
"label"
><translate
translate-context=
"*/*/*/Noun"
>
Tracks
</translate></div>
</div>
...
...
@@ -85,13 +85,13 @@ export default {
self
.
stats
.
users
=
_
.
get
(
d
,
'
usage.users.total
'
)
self
.
stats
.
listenings
=
_
.
get
(
d
,
'
metadata.usage.listenings.total
'
)
self
.
stats
.
trackFavorites
=
_
.
get
(
d
,
'
metadata.usage.favorites.tracks.total
'
)
self
.
stats
.
musicDuration
=
_
.
get
(
d
,
'
metadata.library.music.hours
'
)
self
.
stats
.
musicDuration
=
Math
.
round
(
_
.
get
(
d
,
'
metadata.library.music.hours
'
)
)
self
.
stats
.
artists
=
_
.
get
(
d
,
'
metadata.library.artists.total
'
)
self
.
stats
.
albums
=
_
.
get
(
d
,
'
metadata.library.albums.total
'
)
self
.
stats
.
tracks
=
_
.
get
(
d
,
'
metadata.library.tracks.total
'
)
self
.
isLoading
=
false
})
}
}
,
}
}
</
script
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment