Skip to content

Commit

Permalink
fix:修复hda;修改主页过滤列保存方式
Browse files Browse the repository at this point in the history
  • Loading branch information
fzlins committed Dec 10, 2022
1 parent 784a5fe commit 6aca4eb
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 31 deletions.
75 changes: 74 additions & 1 deletion resource/sites/hdatmos.club/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,78 @@
"tags": ["影视", "综合"],
"url": "https://hdatmos.club",
"host": "hdatmos.club",
"collaborator": "luoyefe"
"collaborator": "luoyefe",
"levelRequirements": [{
"level": "1",
"name": "Power User",
"interval": "4",
"downloaded": "50GB",
"ratio": "1.05",
"privilege": "一个邀请名额;直接发布种子;查看NFO文档;查看用户列表;请求续种; 发送邀请;查看排行榜;查看其它用户的种子历史;删除自己上传的字幕。"
},{
"level": "2",
"name": "Elite User",
"interval": "8",
"downloaded": "120GB",
"ratio": "1.55",
"privilege": "封存账号后不会被删除"
},{
"level": "3",
"name": "Crazy User",
"interval": "15",
"downloaded": "300GB",
"ratio": "2.05",
"privilege": "两个邀请名额;在做种/下载/发布的时候选择匿名模式"
},{
"level": "4",
"name": "Insane User",
"interval": "25",
"downloaded": "500GB",
"ratio": "2.45",
"privilege": "查看普通日志"
},{
"level": "5",
"name": "Veteran User",
"interval": "40",
"downloaded": "750GB",
"ratio": "3.05",
"privilege": "三个邀请名额;查看其它用户的评论、帖子历史;永远保留账号"
},{
"level": "6",
"name": "Extreme User",
"interval": "60",
"downloaded": "1TB",
"ratio": "3.55",
"privilege": "更新过期的外部信息;查看Extreme User论坛"
},{
"level": "7",
"name": "Ultimate User",
"interval": "80",
"downloaded": "1.5TB",
"ratio": "4.05",
"privilege": "五个邀请名额"
},{
"level": "8",
"name": "Nexus Master",
"interval": "100",
"downloaded": "3TB",
"ratio": "4.55",
"privilege": "十个邀请名额"
}],
"selectors": {
"userSeedingTorrents": {
"prerequisites": "!user.seeding",
"page": "/getusertorrentlistajax.php?userid=$user.id$&type=seeding",
"fields": {
"seeding": {
"selector": ["tr:not(:eq(0))"],
"filters": ["query.find('td.rowfollow:eq(2)').length != 0 ? query.find('td.rowfollow:eq(2)').length : query.length"]
},
"seedingSize": {
"selector": ["tr:not(:eq(0))"],
"filters": ["query.find('td.rowfollow:eq(2)').length != 0 ? jQuery.map(query.find('td.rowfollow:eq(2)'), (item)=>{return $(item).text();}) : jQuery.map(query.find('td:eq(2)'), (item)=>{return $(item).text();})", "_self.getTotalSize(query)"]
}
}
}
}
}
50 changes: 20 additions & 30 deletions src/options/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,20 @@
</v-container>
</v-card>
</v-menu>
<v-select v-model="selectedHeaders" class="select" :items="headers" :label="$t('home.selectColumns')" multiple outlined return-object>
<template v-slot:selection="{ item, index }">
<v-chip v-if="index === 0">
<span>{{ item.text }}</span>
</v-chip>
<span
v-if="index === 1"
class="grey--text caption"
>(+{{ selectedHeaders.length - 1 }} others)</span>
</template>
<v-select v-model="selectedHeaders"
class="select" :items="headers"
:label="$t('home.selectColumns')"
@change="updateViewOptions"
multiple outlined return-object>
<template v-slot:selection="{ item, index }">
<v-chip v-if="index === 0">
<span>{{ item.text }}</span>
</v-chip>
<span
v-if="index === 1"
class="grey--text caption"
>(+{{ selectedHeaders.length - 1 }} others)</span>
</template>
</v-select>

<!-- <AutoSignWarning /> -->
Expand Down Expand Up @@ -310,7 +314,6 @@ export default Vue.extend({
text: this.$t("home.headers.userName"),
align: "left",
value: "user.name",
width: ""
},
{
text: this.$t("home.headers.levelName"),
Expand Down Expand Up @@ -381,28 +384,12 @@ export default Vue.extend({
};
},
created() {
let saveHeaders = localStorage.getItem("HomeHeaders");
console.log(saveHeaders)
if (saveHeaders && saveHeaders.length > 1)
{
let homeHeaders = saveHeaders.split(";");
this.selectedHeaders = this.headers.filter(s => homeHeaders.includes(s.value))
}
else
this.selectedHeaders = this.headers
this.init();
},
computed: {
//Done to get the ordered headers
showHeaders() : any[] {
var saveHeaders = "";
for (var header of this.headers.filter(s => this.selectedHeaders.includes(s)))
{
saveHeaders += ";"+ header.value;
}
localStorage.setItem('HomeHeaders', saveHeaders)
return this.headers.filter(s => this.selectedHeaders.includes(s));
return this.headers.filter(s => this.selectedHeaders.map(sh=>sh.value).includes(s.value));
}
},
Expand Down Expand Up @@ -467,9 +454,11 @@ console.log(saveHeaders)
showUserLevel: true,
showLevelRequirements: true,
showSeedingPoints: true,
showWeek: false
showWeek: false,
selectedHeaders: this.selectedHeaders
});
Object.assign(this, viewOptions);
this.selectedHeaders = this.headers.filter(s => this.selectedHeaders.map(sh=>sh.value).includes(s.value));
},
getInfos() {
this.loading = true;
Expand Down Expand Up @@ -784,7 +773,8 @@ console.log(saveHeaders)
showUserLevel: this.showUserLevel,
showLevelRequirements: this.showLevelRequirements,
showSeedingPoints: this.showSeedingPoints,
showWeek: this.showWeek
showWeek: this.showWeek,
selectedHeaders: this.selectedHeaders
}
});
},
Expand Down

0 comments on commit 6aca4eb

Please sign in to comment.