Skip to content

Commit

Permalink
在时间轴数据图中,加入UID显示
Browse files Browse the repository at this point in the history
  • Loading branch information
SHL-COOL authored and Rhilip committed Mar 15, 2022
1 parent 0de9543 commit 43c291c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
1 change: 1 addition & 0 deletions resource/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@
"blurSiteIcon": "Blur site icon",
"userName": "User name",
"userLevel": "User level",
"userId": "User UID",
"showSites": "Show Sites",
"close": "Close",
"shareMessage": "Growth process",
Expand Down
1 change: 1 addition & 0 deletions resource/i18n/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@
"siteName": "网站名称",
"blurSiteIcon": "模糊站点图标",
"userName": "用户名称",
"userId": "用户UID",
"userLevel": "用户等级",
"showSites": "展示站点",
"close": "关闭",
Expand Down
18 changes: 15 additions & 3 deletions src/options/views/UserDataTimeline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,13 @@
<div class="caption">
<span v-if="showUserName" class="mr-2">{{ site.user.name }}</span>
<span v-if="showUserLevel">&lt;{{ site.user.levelName }}&gt;</span>
<span v-if="site.user.id && site.user.id.length > 0 && showUid">&lt;{{ site.user.id }}&gt;</span>
</div>
</template>
<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>{{ $t('timeline.user.uploaded') }}{{ site.user.uploaded | formatSize }}</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>
<div>{{ $t('timeline.user.seedingSize') }}{{ site.user.seedingSize | formatSize }} ({{ site.user.seeding }})</div>
Expand Down Expand Up @@ -120,6 +121,12 @@
:label="$t('timeline.userLevel')"
class="my-0"
></v-switch>
<v-switch
color="success"
v-model="showUid"
:label="$t('timeline.userId')"
class="my-0"
></v-switch>
<v-divider />
<h1 style="padding: 5px;">{{ $t('timeline.showSites') }}</h1>
<v-layout justify-start row wrap>
Expand Down Expand Up @@ -186,6 +193,7 @@ export default Vue.extend({
showUserName: true,
showSiteName: true,
showUserLevel: true,
showUid: true,
blurSiteIcon: false,
iconCache: {} as Dictionary<any>
};
Expand Down Expand Up @@ -242,7 +250,7 @@ export default Vue.extend({
if (!this.showSites.includes(site.name)) {
return;
}
let user = site.user;
if (user && user.name && user.joinTime) {
sites.push(site);
Expand Down Expand Up @@ -288,7 +296,6 @@ export default Vue.extend({
result.maxSeedingInfo.site = site;
}
}
user.ratio = this.getRatio(user);
}
});
Expand All @@ -304,12 +311,17 @@ export default Vue.extend({
// 按加入时间排序
this.datas = sites.sort((a, b) => {
if (!a.user || !b.user) {
return 0;
}
const sortA = a.user.joinTime || 0;
const sortB = b.user.joinTime || 0;
if(a.name == "sports"){
console.log( a.user.joinTime);
console.log( (sortA < sortB)+ "-"+b.name +"-"+ (sortA > sortB));
}
if (sortA < sortB) return -1;
if (sortA > sortB) return 1;
return 0;
Expand Down

0 comments on commit 43c291c

Please sign in to comment.