Skip to content

Commit

Permalink
Merge pull request #48 from pt-plugins/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Bright-W authored Dec 13, 2022
2 parents c9159aa + a80a962 commit 71d2c37
Show file tree
Hide file tree
Showing 9 changed files with 90 additions and 64 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"crx": "^5.0.1",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^9.0.0",
"git-commit-id": "^2.0.1",
"git-rev-sync": "^3.0.2",
"sass": "^1.54.8",
"sass-loader": "~7.3.1",
"stylus": "^0.54.5",
Expand Down
8 changes: 4 additions & 4 deletions resource/schemas/NexusPHP/details.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
_getDownloadUrlByPossibleHrefs() {
const possibleHrefs = [
// pthome
"a[href*='downhash'][href*='https']",
"a[href*='downhash'][href*='https'][class!='forward_a']",
// hdchina
"a[href*='hash'][href*='https']",
"a[href*='hash'][href*='https'][class!='forward_a']",
// misc
"a[href*='passkey'][href*='https']",
"a[href*='passkey']"
"a[href*='passkey'][href*='https'][class!='forward_a']",
"a[href*='passkey'][class!='forward_a']"
];

for (const href of possibleHrefs) {
Expand Down
8 changes: 4 additions & 4 deletions resource/sites/audiences.me/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,31 @@
"interval": "5",
"downloaded": "120GB",
"ratio": "2.0",
"seedingPoints": "160000",
"seedingPoints": "100000",
"privilege": "查看NFO文档;查看用户列表;请求续种;查看其它用户的种子历史;删除自己上传的字幕"
},{
"level": "2",
"name": "Elite User",
"interval": "15",
"downloaded": "240GB",
"ratio": "2.5",
"seedingPoints": "250000",
"seedingPoints": "180000",
"privilege": ""
},{
"level": "3",
"name": "Crazy User",
"interval": "24",
"downloaded": "400GB",
"ratio": "3.0",
"seedingPoints": "360000",
"seedingPoints": "320000",
"privilege": "查看排行榜"
},{
"level": "4",
"name": "Insane User",
"interval": "40",
"downloaded": "600GB",
"ratio": "3.5",
"seedingPoints": "500000",
"seedingPoints": "480000",
"privilege": ""
},{
"level": "5",
Expand Down
2 changes: 1 addition & 1 deletion resource/sites/hdsky.me/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"interval": "10",
"downloaded": "500GB",
"ratio": "2.5",
"privilege": ""
"privilege": "查看邀请区"
},{
"level": "3",
"name": "Crazy User",
Expand Down
2 changes: 1 addition & 1 deletion resource/sites/lemonhd.org/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"interval": "10",
"downloaded": "350GB",
"ratio": "2.5",
"privilege": "用户封存账号后不会被删除"
"privilege": "用户封存账号后不会被删除;查看官方邀请区"
},{
"level": "3",
"name": "Crazy User",
Expand Down
77 changes: 35 additions & 42 deletions src/options/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -171,35 +171,31 @@
<template v-if="props.item.levelRequirements">
<template v-if="props.item.user.nextLevel">
<template v-if="props.item.user.nextLevel.name">
<br />
<v-icon small color="black darken-4">keyboard_tab</v-icon>
<template v-if="props.item.user.nextLevel.requiredDate">
{{ props.item.user.nextLevel.requiredDate }}&nbsp;
</template>
<template v-if="props.item.user.nextLevel.uploaded">
<v-icon small color="red darken-4">arrow_upward</v-icon>
{{ props.item.user.nextLevel.uploaded | formatSize }}&nbsp;
</template>
<template v-if="props.item.user.nextLevel.downloaded">
<v-icon small color="green darken-4">arrow_downward</v-icon>
{{ props.item.user.nextLevel.downloaded | formatSize }}&nbsp;
</template>
<template v-if="props.item.user.nextLevel.trueDownloaded">
{{ $t("home.levelRequirement.trueDownloaded") }}
{{ props.item.user.nextLevel.trueDownloaded | formatSize }}&nbsp;
</template>
<template v-if="props.item.user.nextLevel.bonus">
<v-icon small color="green darken-4">attach_money</v-icon>
{{ props.item.user.nextLevel.bonus | formatNumber}}&nbsp;
</template>
<template v-if="props.item.user.nextLevel.seedingPoints">
{{ $t("home.levelRequirement.seedingPoints") }}
{{ props.item.user.nextLevel.seedingPoints | formatNumber }}&nbsp;
</template>
<template v-if="props.item.user.nextLevel.uploads">
<v-icon small color="green darken-4">file_upload</v-icon>
{{ props.item.user.nextLevel.uploads }}&nbsp;
</template>
<div>
<v-icon small color="black darken-4">keyboard_tab</v-icon>
<template v-if="props.item.user.nextLevel.requiredDate">
{{ props.item.user.nextLevel.requiredDate }}&nbsp;
</template>
<template v-if="props.item.user.nextLevel.uploaded">
<v-icon small color="red darken-4">arrow_upward</v-icon>{{ props.item.user.nextLevel.uploaded | formatSize }}&nbsp;
</template>
<template v-if="props.item.user.nextLevel.downloaded">
<v-icon small color="green darken-4">arrow_downward</v-icon>{{ props.item.user.nextLevel.downloaded | formatSize }}&nbsp;
</template>
<template v-if="props.item.user.nextLevel.trueDownloaded">
{{ $t("home.levelRequirement.trueDownloaded") }}
{{ props.item.user.nextLevel.trueDownloaded | formatSize }}&nbsp;
</template>
<template v-if="props.item.user.nextLevel.bonus">
<v-icon small color="green darken-4">attach_money</v-icon>{{ props.item.user.nextLevel.bonus | formatNumber}}&nbsp;
</template>
<template v-if="props.item.user.nextLevel.seedingPoints">
<v-icon small color="green darken-4">energy_savings_leaf</v-icon>{{ props.item.user.nextLevel.seedingPoints | formatNumber }}&nbsp;
</template>
<template v-if="props.item.user.nextLevel.uploads">
<v-icon small color="green darken-4">file_upload</v-icon>{{ props.item.user.nextLevel.uploads }}&nbsp;
</template>
</div>
</template>
</template>
<template v-else>
Expand All @@ -224,31 +220,26 @@
<template v-if="levelRequirement.requiredDate">
{{ levelRequirement.requiredDate }} </template>({{ levelRequirement.name }}):
<template v-if="levelRequirement.uploaded">
<v-icon small color="green darken-4">arrow_upward</v-icon>
{{ levelRequirement.uploaded }};
<v-icon small color="green darken-4">arrow_upward</v-icon>{{ levelRequirement.uploaded }};
</template>
<template v-if="levelRequirement.uploads">
<v-icon small color="green darken-4">file_upload</v-icon>
{{ levelRequirement.uploads }};
<v-icon small color="green darken-4">file_upload</v-icon>{{ levelRequirement.uploads }};
</template>
<template v-if="levelRequirement.downloaded">
<v-icon small color="red darken-4">arrow_downward</v-icon>
{{ levelRequirement.downloaded }};
<v-icon small color="red darken-4">arrow_downward</v-icon>{{ levelRequirement.downloaded }};
</template>
<template v-if="levelRequirement.trueDownloaded">
{{ $t("home.levelRequirement.trueDownloaded") }}
{{ levelRequirement.trueDownloaded }};
</template>
<template v-if="levelRequirement.ratio">
% {{ levelRequirement.ratio }};
<v-icon small color="black darken-4">balance</v-icon>{{ levelRequirement.ratio }};
</template>
<template v-if="levelRequirement.bonus">
<v-icon small color="green darken-4">attach_money</v-icon>
{{ levelRequirement.bonus | formatNumber }};
<v-icon small color="green darken-4">attach_money</v-icon>{{ levelRequirement.bonus | formatInteger }};
</template>
<template v-if="levelRequirement.seedingPoints">
{{ $t("home.levelRequirement.seedingPoints") }}
{{ levelRequirement.seedingPoints | formatNumber }};
<v-icon small color="green darken-4">energy_savings_leaf</v-icon>{{ levelRequirement.seedingPoints | formatInteger }};
</template>
{{ levelRequirement.privilege }}
<br />
Expand Down Expand Up @@ -278,9 +269,11 @@
</td>
<td v-if="showColumn('user.bonus')" class="number">
<template v-if="showSeedingPoints && props.item.user.seedingPoints">
<div>魔力:{{ props.item.user.bonus | formatNumber }}</div>
<div>
积分:{{ props.item.user.seedingPoints | formatNumber }}
<v-icon small color="green darken-4">attach_money</v-icon>{{ props.item.user.bonus | formatNumber }}
</div>
<div>
<v-icon small color="green darken-4">energy_savings_leaf</v-icon>{{ props.item.user.seedingPoints | formatNumber }}
</div>
</template>
<template v-else>
Expand Down
6 changes: 5 additions & 1 deletion src/service/filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ interface IFilter {
};
timeAgoToNumber: (source: string) => number;
[key: string]: any;
formatInteger:(source: number) => string;
}

/**
Expand Down Expand Up @@ -343,5 +344,8 @@ export const filters: IFilter = {
}

return result.getTime();
}
},
formatInteger(source: number) : string {
return this.formatNumber(source, "###,###,###,###")
},
};
8 changes: 6 additions & 2 deletions webpack/prod-background.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const merge = require("webpack-merge");
const common = require("./common.js");
const path = require("path");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const gitCommitId = require('git-commit-id');
const git = require('git-rev-sync');

// 用于替换 @ 符号的路径
function resolve(dir) {
Expand Down Expand Up @@ -32,7 +32,11 @@ module.exports = merge(common, {
to: path.join(resolve('dist'), "manifest.json"),
transform (content, path) {
var manifest = JSON.parse(content.toString());
manifest.version_name = `${manifest.version}.${gitCommitId().slice(0, 7)}`; // ex: '01ef00a'

// rewrite version to add Build number (simple from git count)
const build_number = git.count() % 65535;
manifest.version = `${manifest.version}.${build_number}`;

return JSON.stringify(manifest);
}
}
Expand Down
41 changes: 33 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4112,7 +4112,7 @@ escape-html@~1.0.3:
resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988"
integrity sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==

escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5:
escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==
Expand Down Expand Up @@ -4896,10 +4896,14 @@ getpass@^0.1.1:
dependencies:
assert-plus "^1.0.0"

git-commit-id@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/git-commit-id/-/git-commit-id-2.0.1.tgz#fe6cf5caa34579a33da8f6ba53552248b93b2bef"
integrity sha512-ltEuT5LdiSLK0dc0S8cOWF97mmsQO81KrajzPpNZmCnynXyn6AJklJNVOpNKwcG6Lq2Vp/d/y7DDTkrRFDW9YQ==
git-rev-sync@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/git-rev-sync/-/git-rev-sync-3.0.2.tgz#9763c730981187c3419b75dd270088cc5f0e161b"
integrity sha512-Nd5RiYpyncjLv0j6IONy0lGzAqdRXUaBctuGBbrEA2m6Bn4iDrN/9MeQTXuiquw8AEKL9D2BW0nw5m/lQvxqnQ==
dependencies:
escape-string-regexp "1.0.5"
graceful-fs "4.1.15"
shelljs "0.8.5"

glob-parent@^3.1.0:
version "3.1.0"
Expand All @@ -4926,7 +4930,7 @@ glob-to-regexp@^0.4.1:
resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e"
integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==

glob@^7.0.3, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6:
glob@^7.0.0, glob@^7.0.3, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6:
version "7.2.3"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b"
integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==
Expand Down Expand Up @@ -5035,6 +5039,11 @@ globby@^9.2.0:
pify "^4.0.1"
slash "^2.0.0"

graceful-fs@4.1.15:
version "4.1.15"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00"
integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==

graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.4, graceful-fs@^4.2.9:
version "4.2.10"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c"
Expand Down Expand Up @@ -5522,7 +5531,7 @@ internal-slot@^1.0.3:
has "^1.0.3"
side-channel "^1.0.4"

interpret@^1.4.0:
interpret@^1.0.0, interpret@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e"
integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==
Expand Down Expand Up @@ -8045,6 +8054,13 @@ readdirp@~3.6.0:
dependencies:
picomatch "^2.2.1"

rechoir@^0.6.2:
version "0.6.2"
resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384"
integrity sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==
dependencies:
resolve "^1.1.6"

regenerate-unicode-properties@^10.1.0:
version "10.1.0"
resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.0.tgz#7c3192cab6dd24e21cb4461e5ddd7dd24fa8374c"
Expand Down Expand Up @@ -8250,7 +8266,7 @@ resolve-url@^0.2.1:
resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a"
integrity sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg==

resolve@^1.10.0, resolve@^1.12.0, resolve@^1.14.2, resolve@^1.3.2, resolve@^1.4.0:
resolve@^1.1.6, resolve@^1.10.0, resolve@^1.12.0, resolve@^1.14.2, resolve@^1.3.2, resolve@^1.4.0:
version "1.22.1"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177"
integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==
Expand Down Expand Up @@ -8598,6 +8614,15 @@ shell-quote@^1.7.3:
resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.7.4.tgz#33fe15dee71ab2a81fcbd3a52106c5cfb9fb75d8"
integrity sha512-8o/QEhSSRb1a5i7TFR0iM4G16Z0vYB2OQVs4G3aAFXjn3T6yEx8AZxy1PgDF7I00LZHYA3WxaSYIf5e5sAX8Rw==

shelljs@0.8.5:
version "0.8.5"
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.5.tgz#de055408d8361bed66c669d2f000538ced8ee20c"
integrity sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==
dependencies:
glob "^7.0.0"
interpret "^1.0.0"
rechoir "^0.6.2"

side-channel@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf"
Expand Down

0 comments on commit 71d2c37

Please sign in to comment.