From 8a1a59d37eca230392907ed2b83c4fd7da0e193c Mon Sep 17 00:00:00 2001 From: yxlimo Date: Thu, 21 Nov 2024 14:03:30 +0800 Subject: [PATCH] feat: add sort in user timeline card --- resource/i18n/en.json | 28 +++++--- resource/i18n/zh-CN.json | 29 +++++--- src/interface/common.ts | 1 - src/options/views/UserDataTimeline.vue | 97 ++++++++++++++++++++------ 4 files changed, 118 insertions(+), 37 deletions(-) diff --git a/resource/i18n/en.json b/resource/i18n/en.json index 93f375816..0caea96c2 100644 --- a/resource/i18n/en.json +++ b/resource/i18n/en.json @@ -320,14 +320,26 @@ }, "updateat": "Update at: ", "user": { - "uploads": "Uploads: ", - "uploaded": "Uploaded: ", - "downloaded": "Downloaded: ", - "seedingSize": "Seeding size: ", - "averageSeedtime": "Average Seedtime: {day} day(s)", - "ratio": "Ratio: ", - "bonus": "Bonus: ", - "bonusPerHour": "Bonus per hour: " + "colonSeparator": ": ", + "uploads": "Uploads", + "uploaded": "Uploaded", + "downloaded": "Downloaded", + "seedingSize": "Seeding size", + "averageSeedtime": "Average Seedtime(Day)", + "ratio": "Ratio", + "bonus": "Bonus", + "bonusPerHour": "Bonus per hour" + }, + "sortSites": { + "name": "Sort Sites", + "key": { + "label": "Sort By" + }, + "order": { + "label": "Sort Order", + "asc": "ascending", + "dsc": "descending" + } }, "inputDisplayName": "Please enter a name to display:", "inputShareMessage": "Please enter a message to display:" diff --git a/resource/i18n/zh-CN.json b/resource/i18n/zh-CN.json index c0ebf1909..4f920dbeb 100644 --- a/resource/i18n/zh-CN.json +++ b/resource/i18n/zh-CN.json @@ -314,14 +314,27 @@ }, "updateat": "数据更新于:", "user": { - "uploads": "发布数:", - "uploaded": "上传量:", - "downloaded": "下载量:", - "seedingSize": "做种量:", - "averageSeedtime": "均保时:{day} 天", - "ratio": "分享率:", - "bonus": "积分值:", - "bonusPerHour": "时 魔:" + "colonSeparator": ":", + "uploads": "发布数", + "uploaded": "上传量", + "downloaded": "下载量", + "seedingSize": "做种量", + "averageSeedtime": "均保时(天)", + "ratio": "分享率", + "bonus": "积分值", + "bonusPerHour": "时 魔", + "joinTime": "加入时间" + }, + "sortSites": { + "name": "站点排序", + "key": { + "label": "排序依据" + }, + "order": { + "label": "排序方式", + "asc": "正序", + "dsc": "倒序" + } }, "inputDisplayName": "请输入需要显示的名称:", "inputShareMessage": "请输入需要显示的信息:" diff --git a/src/interface/common.ts b/src/interface/common.ts index 24b783c96..5bef12f6a 100644 --- a/src/interface/common.ts +++ b/src/interface/common.ts @@ -319,7 +319,6 @@ export interface Site { apiCdn?: string[]; getInfoAjaxCache?: boolean; } - /** * desc & href 都不为空才被认为是有效链接 * href 必须是网址 diff --git a/src/options/views/UserDataTimeline.vue b/src/options/views/UserDataTimeline.vue index a6d07a5cd..7a6e81199 100644 --- a/src/options/views/UserDataTimeline.vue +++ b/src/options/views/UserDataTimeline.vue @@ -147,14 +147,14 @@
{{ site.name }}
-
{{ $t('timeline.user.uploads') }}{{ site.user.uploads }}
-
{{ $t('timeline.user.uploaded') }}{{ site.user.uploaded | formatSize}}
-
{{ $t('timeline.user.downloaded') }}{{ site.user.downloaded | formatSize }}
-
{{ $t('timeline.user.ratio') }}{{ site.user.ratio | formatRatio }}
-
{{ $t('timeline.user.seedingSize') }}{{ site.user.seedingSize | formatSize }} ({{ site.user.seeding }})
-
{{ $t('timeline.user.averageSeedtime', {day: site.user.averageSeedtime | formatInteger}) }}
-
{{ $t('timeline.user.bonus') }}{{ site.user.bonus | formatNumber }}
-
{{ $t('timeline.user.bonusPerHour') }}{{ site.user.bonusPerHour | formatNumber }}
+
{{ $t('timeline.user.uploads') }}{{$t('timeline.user.colonSeparator')}}{{ site.user.uploads }}
+
{{ $t('timeline.user.uploaded') }}{{$t('timeline.user.colonSeparator')}}{{ site.user.uploaded | formatSize}}
+
{{ $t('timeline.user.downloaded') }}{{$t('timeline.user.colonSeparator')}}{{ site.user.downloaded | formatSize }}
+
{{ $t('timeline.user.ratio') }}{{$t('timeline.user.colonSeparator')}}{{ site.user.ratio | formatRatio }}
+
{{ $t('timeline.user.seedingSize') }}{{$t('timeline.user.colonSeparator')}}{{ site.user.seedingSize | formatSize }} ({{ site.user.seeding }})
+
{{ $t('timeline.user.averageSeedtime') }}{{$t('timeline.user.colonSeparator')}}{{ site.user.averageSeedtime | formatInteger }}
+
{{ $t('timeline.user.bonus') }}{{$t('timeline.user.colonSeparator')}}{{ site.user.bonus | formatNumber }}
+
{{ $t('timeline.user.bonusPerHour') }}{{$t('timeline.user.colonSeparator')}}{{ site.user.bonusPerHour | formatNumber }}
@@ -220,12 +220,42 @@ > + + +

{{ $t('timeline.sortSites.name') }}

+ +

{{ $t('timeline.sortSites.key.label') }}

+ + + + + +

{{ $t('timeline.sortSites.order.label') }}

+ + + +