Skip to content

Commit

Permalink
feat: 发种数量统计 #973
Browse files Browse the repository at this point in the history
  • Loading branch information
fzlins committed Aug 1, 2023
1 parent 31e782f commit cfe072b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
7 changes: 5 additions & 2 deletions resource/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@
"blurSiteIcon": "Blur site icon",
"userName": "User name",
"userLevel": "User level",
"userId": "User UID",
"userUploads": "User uploads",
"userId": "User ID",
"showSites": "Show Sites",
"close": "Close",
"shareMessage": "Growth process",
Expand All @@ -283,14 +284,16 @@
"lessThanAWeek": "Less than a week"
},
"total": {
"uploaded": "Total uploads: ",
"uploads": "Total uploads: ",
"uploaded": "Total uploaded: ",
"downloaded": "Total download: ",
"seedingSize": "Seeding size: ",
"ratio": "Total ratio: ",
"years": "PT ages:≈ {year} year(s)"
},
"updateat": "Update at: ",
"user": {
"uploads":"Uploads: ",
"uploaded": "Uploaded: ",
"downloaded": "Downloaded: ",
"seedingSize": "Seeding size: ",
Expand Down
3 changes: 3 additions & 0 deletions resource/i18n/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@
"userName": "用户名称",
"userId": "用户UID",
"userLevel": "用户等级",
"userUploads": "用户发布数",
"showSites": "展示站点",
"close": "关闭",
"shareMessage": "这些年走过的路",
Expand All @@ -278,6 +279,7 @@
"lessThanAWeek": "不满一周"
},
"total": {
"uploads": "发布总数:",
"uploaded": "上传总量:",
"downloaded": "下载总量:",
"seedingSize": "做种总量:",
Expand All @@ -286,6 +288,7 @@
},
"updateat": "数据更新于:",
"user": {
"uploads":"发布数:",
"uploaded": "上传量:",
"downloaded": "下载量:",
"seedingSize": "做种量:",
Expand Down
15 changes: 15 additions & 0 deletions src/options/views/UserDataTimeline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

<v-card-title primary-title>
<div class="headline font-weight-bold">
<div v-if="showUserUploads">{{ $t('timeline.total.uploads') }}{{ infos.total.uploads }}</div>
<div>{{ $t('timeline.total.uploaded') }}{{ infos.total.uploaded | formatSize }}</div>
<div>{{ $t('timeline.total.downloaded') }}{{ infos.total.downloaded | formatSize }}</div>
<div>{{ $t('timeline.total.seedingSize') }}{{ infos.total.seedingSize | formatSize }} ({{ infos.total.seeding }})</div>
Expand Down Expand Up @@ -78,6 +79,7 @@
<div>
<v-divider v-if="i>0" class="mb-2"></v-divider>
<div class="headline font-weight-light mb-2" v-if="showSiteName">{{ site.name }}</div>
<div v-if="showUserUploads && site.user.uploads && site.user.uploads > 0">{{ $t('timeline.user.uploads') }}{{ site.user.uploads }}</div>
<div>{{ $t('timeline.user.uploaded') }}{{ site.user.uploaded | formatSize}}</div>
<div>{{ $t('timeline.user.downloaded') }}{{ site.user.downloaded | formatSize }}</div>
<div>{{ $t('timeline.user.ratio') }}{{ site.user.ratio | formatRatio }}</div>
Expand Down Expand Up @@ -122,6 +124,12 @@
:label="$t('timeline.userLevel')"
class="my-0"
></v-switch>
<v-switch
color="success"
v-model="showUserUploads"
:label="$t('timeline.userUploads')"
class="my-0"
></v-switch>
<v-switch
color="success"
v-model="showUid"
Expand Down Expand Up @@ -180,6 +188,7 @@ export default Vue.extend({
maxValue: 0
},
total: {
uploads: 0,
uploaded: 0,
downloaded: 0,
seedingSize: 0,
Expand All @@ -195,6 +204,7 @@ export default Vue.extend({
showUserName: true,
showSiteName: false,
showUserLevel: true,
showUserUploads: true,
showUid: true,
blurSiteIcon: true,
iconCache: {} as Dictionary<any>
Expand Down Expand Up @@ -234,6 +244,7 @@ export default Vue.extend({
let userNames: Dictionary<any> = {};
let result = this.infos;
result.total = {
uploads: 0,
uploaded: 0,
downloaded: 0,
seedingSize: 0,
Expand Down Expand Up @@ -275,6 +286,10 @@ export default Vue.extend({
result.joinTimeInfo.site = site;
}
if (user.uploads && user.uploads > 0) {
result.total.uploads += user.uploads;
}
if (user.uploaded && user.uploaded > 0) {
result.total.uploaded += user.uploaded;
// 获取上传最多的站点
Expand Down

0 comments on commit cfe072b

Please sign in to comment.