This commit is contained in:
CzBiX
2020-03-25 18:40:58 +08:00
parent 145bbb3268
commit 93baf53562
17 changed files with 519 additions and 523 deletions

View File

@@ -7,19 +7,12 @@ module.exports = {
],
extends: [
'plugin:vue/essential',
'@vue/airbnb',
'eslint:recommended',
'@vue/typescript',
],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'import/prefer-default-export': 'off',
'no-restricted-syntax': 'off',
'no-await-in-loop': 'off',
'no-plusplus': 'off',
'no-continue': 'off',
'func-names': ['warn', 'as-needed'],
},
parserOptions: {
parser: '@typescript-eslint/parser',

488
package-lock.json generated
View File

@@ -1550,6 +1550,11 @@
"integrity": "sha1-xOY69eiCPOnMPws097mYwhcfDEQ=",
"dev": true
},
"@types/node-polyglot": {
"version": "0.4.34",
"resolved": "https://registry.npm.taobao.org/@types/node-polyglot/download/@types/node-polyglot-0.4.34.tgz",
"integrity": "sha1-VxjKS4lEbSOAh1NNLLqeOC8ZxYs="
},
"@types/normalize-package-data": {
"version": "2.4.0",
"resolved": "https://registry.npm.taobao.org/@types/normalize-package-data/download/@types/normalize-package-data-2.4.0.tgz",
@@ -2327,17 +2332,6 @@
"tslib": "^1.9.3"
}
},
"@vue/eslint-config-airbnb": {
"version": "4.0.1",
"resolved": "https://registry.npm.taobao.org/@vue/eslint-config-airbnb/download/@vue/eslint-config-airbnb-4.0.1.tgz",
"integrity": "sha1-vwUQiFGosE3AQ6mDMAYIUp1QzH4=",
"dev": true,
"requires": {
"eslint-config-airbnb-base": "^13.1.0",
"eslint-import-resolver-webpack": "^0.11.1",
"eslint-plugin-import": "^2.17.3"
}
},
"@vue/eslint-config-typescript": {
"version": "4.0.0",
"resolved": "https://registry.npm.taobao.org/@vue/eslint-config-typescript/download/@vue/eslint-config-typescript-4.0.0.tgz",
@@ -2772,28 +2766,12 @@
"integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=",
"dev": true
},
"array-find": {
"version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/array-find/download/array-find-1.0.0.tgz",
"integrity": "sha1-bI4obRHtdoMn+OYuzuhzU8o+eLg=",
"dev": true
},
"array-flatten": {
"version": "1.1.1",
"resolved": "https://registry.npm.taobao.org/array-flatten/download/array-flatten-1.1.1.tgz",
"integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=",
"dev": true
},
"array-includes": {
"version": "3.0.3",
"resolved": "https://registry.npm.taobao.org/array-includes/download/array-includes-3.0.3.tgz",
"integrity": "sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0=",
"dev": true,
"requires": {
"define-properties": "^1.1.2",
"es-abstract": "^1.7.0"
}
},
"array-union": {
"version": "1.0.2",
"resolved": "https://registry.npm.taobao.org/array-union/download/array-union-1.0.2.tgz",
@@ -4534,12 +4512,6 @@
"proto-list": "~1.2.1"
}
},
"confusing-browser-globals": {
"version": "1.0.8",
"resolved": "https://registry.npm.taobao.org/confusing-browser-globals/download/confusing-browser-globals-1.0.8.tgz",
"integrity": "sha1-k//sH4Km4r8rw2dpzDqS+iDlAvM=",
"dev": true
},
"connect-history-api-fallback": {
"version": "1.6.0",
"resolved": "https://registry.npm.taobao.org/connect-history-api-fallback/download/connect-history-api-fallback-1.6.0.tgz",
@@ -4570,12 +4542,6 @@
"integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=",
"dev": true
},
"contains-path": {
"version": "0.1.0",
"resolved": "https://registry.npm.taobao.org/contains-path/download/contains-path-0.1.0.tgz",
"integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=",
"dev": true
},
"content-disposition": {
"version": "0.5.3",
"resolved": "https://registry.npm.taobao.org/content-disposition/download/content-disposition-0.5.3.tgz",
@@ -5325,7 +5291,6 @@
"version": "1.1.3",
"resolved": "https://registry.npm.taobao.org/define-properties/download/define-properties-1.1.3.tgz",
"integrity": "sha1-z4jabL7ib+bbcJT2HYcMvYTO6fE=",
"dev": true,
"requires": {
"object-keys": "^1.0.12"
}
@@ -6051,96 +6016,6 @@
}
}
},
"eslint-config-airbnb-base": {
"version": "13.2.0",
"resolved": "https://registry.npm.taobao.org/eslint-config-airbnb-base/download/eslint-config-airbnb-base-13.2.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feslint-config-airbnb-base%2Fdownload%2Feslint-config-airbnb-base-13.2.0.tgz",
"integrity": "sha1-9uqBRZ/03sLdogDDXx2PdBnVeUM=",
"dev": true,
"requires": {
"confusing-browser-globals": "^1.0.5",
"object.assign": "^4.1.0",
"object.entries": "^1.1.0"
}
},
"eslint-import-resolver-node": {
"version": "0.3.2",
"resolved": "https://registry.npm.taobao.org/eslint-import-resolver-node/download/eslint-import-resolver-node-0.3.2.tgz",
"integrity": "sha1-WPFfuDm40FdsqYBBNHaqskcttmo=",
"dev": true,
"requires": {
"debug": "^2.6.9",
"resolve": "^1.5.0"
},
"dependencies": {
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npm.taobao.org/debug/download/debug-2.6.9.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-2.6.9.tgz",
"integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=",
"dev": true,
"requires": {
"ms": "2.0.0"
}
}
}
},
"eslint-import-resolver-webpack": {
"version": "0.11.1",
"resolved": "https://registry.npm.taobao.org/eslint-import-resolver-webpack/download/eslint-import-resolver-webpack-0.11.1.tgz",
"integrity": "sha1-/PH9V6d19R4Y9EKRX4Xda6RdLyY=",
"dev": true,
"requires": {
"array-find": "^1.0.0",
"debug": "^2.6.8",
"enhanced-resolve": "~0.9.0",
"find-root": "^1.1.0",
"has": "^1.0.1",
"interpret": "^1.0.0",
"lodash": "^4.17.4",
"node-libs-browser": "^1.0.0 || ^2.0.0",
"resolve": "^1.10.0",
"semver": "^5.3.0"
},
"dependencies": {
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npm.taobao.org/debug/download/debug-2.6.9.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-2.6.9.tgz",
"integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=",
"dev": true,
"requires": {
"ms": "2.0.0"
}
},
"enhanced-resolve": {
"version": "0.9.1",
"resolved": "https://registry.npm.taobao.org/enhanced-resolve/download/enhanced-resolve-0.9.1.tgz",
"integrity": "sha1-TW5omzcl+GCQknzMhs2fFjW4ni4=",
"dev": true,
"requires": {
"graceful-fs": "^4.1.2",
"memory-fs": "^0.2.0",
"tapable": "^0.1.8"
}
},
"memory-fs": {
"version": "0.2.0",
"resolved": "https://registry.npm.taobao.org/memory-fs/download/memory-fs-0.2.0.tgz",
"integrity": "sha1-8rslNovBIeORwlIN6Slpyu4KApA=",
"dev": true
},
"semver": {
"version": "5.7.1",
"resolved": "https://registry.npm.taobao.org/semver/download/semver-5.7.1.tgz",
"integrity": "sha1-qVT5Ma66UI0we78Gnv8MAclhFvc=",
"dev": true
},
"tapable": {
"version": "0.1.10",
"resolved": "https://registry.npm.taobao.org/tapable/download/tapable-0.1.10.tgz",
"integrity": "sha1-KcNXB8K3DlDQdIK10gLo7URtr9Q=",
"dev": true
}
}
},
"eslint-loader": {
"version": "2.2.1",
"resolved": "https://registry.npm.taobao.org/eslint-loader/download/eslint-loader-2.2.1.tgz",
@@ -6154,119 +6029,6 @@
"rimraf": "^2.6.1"
}
},
"eslint-module-utils": {
"version": "2.4.1",
"resolved": "https://registry.npm.taobao.org/eslint-module-utils/download/eslint-module-utils-2.4.1.tgz",
"integrity": "sha1-e0Z1h1v5aw2/GyGXdFblux9eAYw=",
"dev": true,
"requires": {
"debug": "^2.6.8",
"pkg-dir": "^2.0.0"
},
"dependencies": {
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npm.taobao.org/debug/download/debug-2.6.9.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-2.6.9.tgz",
"integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=",
"dev": true,
"requires": {
"ms": "2.0.0"
}
},
"find-up": {
"version": "2.1.0",
"resolved": "https://registry.npm.taobao.org/find-up/download/find-up-2.1.0.tgz",
"integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=",
"dev": true,
"requires": {
"locate-path": "^2.0.0"
}
},
"locate-path": {
"version": "2.0.0",
"resolved": "https://registry.npm.taobao.org/locate-path/download/locate-path-2.0.0.tgz",
"integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=",
"dev": true,
"requires": {
"p-locate": "^2.0.0",
"path-exists": "^3.0.0"
}
},
"p-limit": {
"version": "1.3.0",
"resolved": "https://registry.npm.taobao.org/p-limit/download/p-limit-1.3.0.tgz",
"integrity": "sha1-uGvV8MJWkJEcdZD8v8IBDVSzzLg=",
"dev": true,
"requires": {
"p-try": "^1.0.0"
}
},
"p-locate": {
"version": "2.0.0",
"resolved": "https://registry.npm.taobao.org/p-locate/download/p-locate-2.0.0.tgz",
"integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=",
"dev": true,
"requires": {
"p-limit": "^1.1.0"
}
},
"p-try": {
"version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/p-try/download/p-try-1.0.0.tgz",
"integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=",
"dev": true
},
"pkg-dir": {
"version": "2.0.0",
"resolved": "https://registry.npm.taobao.org/pkg-dir/download/pkg-dir-2.0.0.tgz",
"integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=",
"dev": true,
"requires": {
"find-up": "^2.1.0"
}
}
}
},
"eslint-plugin-import": {
"version": "2.18.2",
"resolved": "https://registry.npm.taobao.org/eslint-plugin-import/download/eslint-plugin-import-2.18.2.tgz",
"integrity": "sha1-AvEYC5Cwd7M9RHoXojJs60AKzrY=",
"dev": true,
"requires": {
"array-includes": "^3.0.3",
"contains-path": "^0.1.0",
"debug": "^2.6.9",
"doctrine": "1.5.0",
"eslint-import-resolver-node": "^0.3.2",
"eslint-module-utils": "^2.4.0",
"has": "^1.0.3",
"minimatch": "^3.0.4",
"object.values": "^1.1.0",
"read-pkg-up": "^2.0.0",
"resolve": "^1.11.0"
},
"dependencies": {
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npm.taobao.org/debug/download/debug-2.6.9.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-2.6.9.tgz",
"integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=",
"dev": true,
"requires": {
"ms": "2.0.0"
}
},
"doctrine": {
"version": "1.5.0",
"resolved": "https://registry.npm.taobao.org/doctrine/download/doctrine-1.5.0.tgz",
"integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=",
"dev": true,
"requires": {
"esutils": "^2.0.2",
"isarray": "^1.0.0"
}
}
}
},
"eslint-plugin-vue": {
"version": "5.2.3",
"resolved": "https://registry.npm.taobao.org/eslint-plugin-vue/download/eslint-plugin-vue-5.2.3.tgz?cache=0&sync_timestamp=1561378693439&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feslint-plugin-vue%2Fdownload%2Feslint-plugin-vue-5.2.3.tgz",
@@ -6830,12 +6592,6 @@
"pkg-dir": "^3.0.0"
}
},
"find-root": {
"version": "1.1.0",
"resolved": "https://registry.npm.taobao.org/find-root/download/find-root-1.1.0.tgz",
"integrity": "sha1-q8/Iunb3CMQql7PWhbfpRQv7nOQ=",
"dev": true
},
"find-up": {
"version": "3.0.0",
"resolved": "https://registry.npm.taobao.org/find-up/download/find-up-3.0.0.tgz",
@@ -6887,6 +6643,14 @@
}
}
},
"for-each": {
"version": "0.3.3",
"resolved": "https://registry.npm.taobao.org/for-each/download/for-each-0.3.3.tgz",
"integrity": "sha1-abRH6IoKXTLD5whPPxcQA0shN24=",
"requires": {
"is-callable": "^1.1.3"
}
},
"for-in": {
"version": "1.0.2",
"resolved": "https://registry.npm.taobao.org/for-in/download/for-in-1.0.2.tgz",
@@ -7549,8 +7313,7 @@
"function-bind": {
"version": "1.1.1",
"resolved": "https://registry.npm.taobao.org/function-bind/download/function-bind-1.1.1.tgz",
"integrity": "sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0=",
"dev": true
"integrity": "sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0="
},
"functional-red-black-tree": {
"version": "1.0.1",
@@ -7711,7 +7474,6 @@
"version": "1.0.3",
"resolved": "https://registry.npm.taobao.org/has/download/has-1.0.3.tgz",
"integrity": "sha1-ci18v8H2qoJB8W3YFOAR4fQeh5Y=",
"dev": true,
"requires": {
"function-bind": "^1.1.1"
}
@@ -7742,8 +7504,7 @@
"has-symbols": {
"version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/has-symbols/download/has-symbols-1.0.0.tgz",
"integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=",
"dev": true
"integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q="
},
"has-value": {
"version": "1.0.0",
@@ -8345,8 +8106,7 @@
"is-callable": {
"version": "1.1.4",
"resolved": "https://registry.npm.taobao.org/is-callable/download/is-callable-1.1.4.tgz",
"integrity": "sha1-HhrfIZ4e62hNaR+dagX/DTCiTXU=",
"dev": true
"integrity": "sha1-HhrfIZ4e62hNaR+dagX/DTCiTXU="
},
"is-ci": {
"version": "1.2.1",
@@ -8394,8 +8154,7 @@
"is-date-object": {
"version": "1.0.1",
"resolved": "https://registry.npm.taobao.org/is-date-object/download/is-date-object-1.0.1.tgz",
"integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=",
"dev": true
"integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY="
},
"is-descriptor": {
"version": "0.1.6",
@@ -8583,7 +8342,6 @@
"version": "1.0.2",
"resolved": "https://registry.npm.taobao.org/is-symbol/download/is-symbol-1.0.2.tgz",
"integrity": "sha1-oFX2rlcZLK7jKeeoYBGLSXqVDzg=",
"dev": true,
"requires": {
"has-symbols": "^1.0.0"
}
@@ -9408,8 +9166,7 @@
"js-tokens": {
"version": "4.0.0",
"resolved": "https://registry.npm.taobao.org/js-tokens/download/js-tokens-4.0.0.tgz",
"integrity": "sha1-GSA/tZmR35jjoocFDUZHzerzJJk=",
"dev": true
"integrity": "sha1-GSA/tZmR35jjoocFDUZHzerzJJk="
},
"js-yaml": {
"version": "3.13.1",
@@ -10034,35 +9791,6 @@
"figures": "^2.0.0"
}
},
"load-json-file": {
"version": "2.0.0",
"resolved": "https://registry.npm.taobao.org/load-json-file/download/load-json-file-2.0.0.tgz",
"integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=",
"dev": true,
"requires": {
"graceful-fs": "^4.1.2",
"parse-json": "^2.2.0",
"pify": "^2.0.0",
"strip-bom": "^3.0.0"
},
"dependencies": {
"parse-json": {
"version": "2.2.0",
"resolved": "https://registry.npm.taobao.org/parse-json/download/parse-json-2.2.0.tgz",
"integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=",
"dev": true,
"requires": {
"error-ex": "^1.2.0"
}
},
"pify": {
"version": "2.3.0",
"resolved": "https://registry.npm.taobao.org/pify/download/pify-2.3.0.tgz",
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
"dev": true
}
}
},
"loader-fs-cache": {
"version": "1.0.3",
"resolved": "https://registry.npm.taobao.org/loader-fs-cache/download/loader-fs-cache-1.0.3.tgz?cache=0&sync_timestamp=1584820647539&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Floader-fs-cache%2Fdownload%2Floader-fs-cache-1.0.3.tgz",
@@ -10262,7 +9990,6 @@
"version": "1.4.0",
"resolved": "https://registry.npm.taobao.org/loose-envify/download/loose-envify-1.4.0.tgz",
"integrity": "sha1-ce5R+nvkyuwaY4OffmgtgTLTDK8=",
"dev": true,
"requires": {
"js-tokens": "^3.0.0 || ^4.0.0"
}
@@ -10873,6 +10600,17 @@
"which": "^1.3.0"
}
},
"node-polyglot": {
"version": "2.4.0",
"resolved": "https://registry.npm.taobao.org/node-polyglot/download/node-polyglot-2.4.0.tgz",
"integrity": "sha1-DScX7QZkDZ/0iirr6NE+Oe8DUY8=",
"requires": {
"for-each": "^0.3.3",
"has": "^1.0.3",
"string.prototype.trim": "^1.1.2",
"warning": "^4.0.3"
}
},
"node-releases": {
"version": "1.1.52",
"resolved": "https://registry.npm.taobao.org/node-releases/download/node-releases-1.1.52.tgz?cache=0&sync_timestamp=1584043111478&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fnode-releases%2Fdownload%2Fnode-releases-1.1.52.tgz",
@@ -11026,8 +10764,7 @@
"object-inspect": {
"version": "1.7.0",
"resolved": "https://registry.npm.taobao.org/object-inspect/download/object-inspect-1.7.0.tgz?cache=0&sync_timestamp=1573451929207&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fobject-inspect%2Fdownload%2Fobject-inspect-1.7.0.tgz",
"integrity": "sha1-9Pa9GBrXfwBrXs5gvQtvOY/3Smc=",
"dev": true
"integrity": "sha1-9Pa9GBrXfwBrXs5gvQtvOY/3Smc="
},
"object-is": {
"version": "1.0.2",
@@ -11038,8 +10775,7 @@
"object-keys": {
"version": "1.1.1",
"resolved": "https://registry.npm.taobao.org/object-keys/download/object-keys-1.1.1.tgz",
"integrity": "sha1-HEfyct8nfzsdrwYWd9nILiMixg4=",
"dev": true
"integrity": "sha1-HEfyct8nfzsdrwYWd9nILiMixg4="
},
"object-visit": {
"version": "1.0.1",
@@ -11054,7 +10790,6 @@
"version": "4.1.0",
"resolved": "https://registry.npm.taobao.org/object.assign/download/object.assign-4.1.0.tgz",
"integrity": "sha1-lovxEA15Vrs8oIbwBvhGs7xACNo=",
"dev": true,
"requires": {
"define-properties": "^1.1.2",
"function-bind": "^1.1.1",
@@ -11062,18 +10797,6 @@
"object-keys": "^1.0.11"
}
},
"object.entries": {
"version": "1.1.0",
"resolved": "https://registry.npm.taobao.org/object.entries/download/object.entries-1.1.0.tgz",
"integrity": "sha1-ICT8bWuiRq7ji9sP/Vz7zzcbdRk=",
"dev": true,
"requires": {
"define-properties": "^1.1.3",
"es-abstract": "^1.12.0",
"function-bind": "^1.1.1",
"has": "^1.0.3"
}
},
"object.getownpropertydescriptors": {
"version": "2.1.0",
"resolved": "https://registry.npm.taobao.org/object.getownpropertydescriptors/download/object.getownpropertydescriptors-2.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fobject.getownpropertydescriptors%2Fdownload%2Fobject.getownpropertydescriptors-2.1.0.tgz",
@@ -12549,87 +12272,6 @@
}
}
},
"read-pkg-up": {
"version": "2.0.0",
"resolved": "https://registry.npm.taobao.org/read-pkg-up/download/read-pkg-up-2.0.0.tgz",
"integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=",
"dev": true,
"requires": {
"find-up": "^2.0.0",
"read-pkg": "^2.0.0"
},
"dependencies": {
"find-up": {
"version": "2.1.0",
"resolved": "https://registry.npm.taobao.org/find-up/download/find-up-2.1.0.tgz",
"integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=",
"dev": true,
"requires": {
"locate-path": "^2.0.0"
}
},
"locate-path": {
"version": "2.0.0",
"resolved": "https://registry.npm.taobao.org/locate-path/download/locate-path-2.0.0.tgz",
"integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=",
"dev": true,
"requires": {
"p-locate": "^2.0.0",
"path-exists": "^3.0.0"
}
},
"p-limit": {
"version": "1.3.0",
"resolved": "https://registry.npm.taobao.org/p-limit/download/p-limit-1.3.0.tgz",
"integrity": "sha1-uGvV8MJWkJEcdZD8v8IBDVSzzLg=",
"dev": true,
"requires": {
"p-try": "^1.0.0"
}
},
"p-locate": {
"version": "2.0.0",
"resolved": "https://registry.npm.taobao.org/p-locate/download/p-locate-2.0.0.tgz",
"integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=",
"dev": true,
"requires": {
"p-limit": "^1.1.0"
}
},
"p-try": {
"version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/p-try/download/p-try-1.0.0.tgz",
"integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=",
"dev": true
},
"path-type": {
"version": "2.0.0",
"resolved": "https://registry.npm.taobao.org/path-type/download/path-type-2.0.0.tgz",
"integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=",
"dev": true,
"requires": {
"pify": "^2.0.0"
}
},
"pify": {
"version": "2.3.0",
"resolved": "https://registry.npm.taobao.org/pify/download/pify-2.3.0.tgz",
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
"dev": true
},
"read-pkg": {
"version": "2.0.0",
"resolved": "https://registry.npm.taobao.org/read-pkg/download/read-pkg-2.0.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fread-pkg%2Fdownload%2Fread-pkg-2.0.0.tgz",
"integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=",
"dev": true,
"requires": {
"load-json-file": "^2.0.0",
"normalize-package-data": "^2.3.2",
"path-type": "^2.0.0"
}
}
}
},
"readable-stream": {
"version": "2.3.6",
"resolved": "https://registry.npm.taobao.org/readable-stream/download/readable-stream-2.3.6.tgz",
@@ -14002,11 +13644,68 @@
}
}
},
"string.prototype.trim": {
"version": "1.2.1",
"resolved": "https://registry.npm.taobao.org/string.prototype.trim/download/string.prototype.trim-1.2.1.tgz",
"integrity": "sha1-FBIz3/Msgr+tgGhNfl8Iae4Pt4I=",
"requires": {
"define-properties": "^1.1.3",
"es-abstract": "^1.17.0-next.1",
"function-bind": "^1.1.1"
},
"dependencies": {
"es-abstract": {
"version": "1.17.5",
"resolved": "https://registry.npm.taobao.org/es-abstract/download/es-abstract-1.17.5.tgz?cache=0&sync_timestamp=1584909155190&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fes-abstract%2Fdownload%2Fes-abstract-1.17.5.tgz",
"integrity": "sha1-2MnR1myJgfuSAOIlHXme7pJ3Suk=",
"requires": {
"es-to-primitive": "^1.2.1",
"function-bind": "^1.1.1",
"has": "^1.0.3",
"has-symbols": "^1.0.1",
"is-callable": "^1.1.5",
"is-regex": "^1.0.5",
"object-inspect": "^1.7.0",
"object-keys": "^1.1.1",
"object.assign": "^4.1.0",
"string.prototype.trimleft": "^2.1.1",
"string.prototype.trimright": "^2.1.1"
}
},
"es-to-primitive": {
"version": "1.2.1",
"resolved": "https://registry.npm.taobao.org/es-to-primitive/download/es-to-primitive-1.2.1.tgz",
"integrity": "sha1-5VzUyc3BiLzvsDs2bHNjI/xciYo=",
"requires": {
"is-callable": "^1.1.4",
"is-date-object": "^1.0.1",
"is-symbol": "^1.0.2"
}
},
"has-symbols": {
"version": "1.0.1",
"resolved": "https://registry.npm.taobao.org/has-symbols/download/has-symbols-1.0.1.tgz?cache=0&sync_timestamp=1573950844856&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fhas-symbols%2Fdownload%2Fhas-symbols-1.0.1.tgz",
"integrity": "sha1-n1IUdYpEGWxAbZvXbOv4HsLdMeg="
},
"is-callable": {
"version": "1.1.5",
"resolved": "https://registry.npm.taobao.org/is-callable/download/is-callable-1.1.5.tgz",
"integrity": "sha1-9+RrWWiQRW23Tn9ul2yzJz0G+qs="
},
"is-regex": {
"version": "1.0.5",
"resolved": "https://registry.npm.taobao.org/is-regex/download/is-regex-1.0.5.tgz?cache=0&sync_timestamp=1576454688491&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fis-regex%2Fdownload%2Fis-regex-1.0.5.tgz",
"integrity": "sha1-OdWJo1i/GJZ/cmlnEguPwa7XTq4=",
"requires": {
"has": "^1.0.3"
}
}
}
},
"string.prototype.trimleft": {
"version": "2.1.1",
"resolved": "https://registry.npm.taobao.org/string.prototype.trimleft/download/string.prototype.trimleft-2.1.1.tgz",
"integrity": "sha1-m9uKxqvW1gKxek7TIYcNL43O/HQ=",
"dev": true,
"requires": {
"define-properties": "^1.1.3",
"function-bind": "^1.1.1"
@@ -14016,7 +13715,6 @@
"version": "2.1.1",
"resolved": "https://registry.npm.taobao.org/string.prototype.trimright/download/string.prototype.trimright-2.1.1.tgz?cache=0&sync_timestamp=1576706898686&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstring.prototype.trimright%2Fdownload%2Fstring.prototype.trimright-2.1.1.tgz",
"integrity": "sha1-RAMUsVmWyGbOigNBiU1FGGIAxdk=",
"dev": true,
"requires": {
"define-properties": "^1.1.3",
"function-bind": "^1.1.1"
@@ -15206,6 +14904,14 @@
"makeerror": "1.0.x"
}
},
"warning": {
"version": "4.0.3",
"resolved": "https://registry.npm.taobao.org/warning/download/warning-4.0.3.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fwarning%2Fdownload%2Fwarning-4.0.3.tgz",
"integrity": "sha1-Fungd+uKhtavfWSqHgX9hbRnjKM=",
"requires": {
"loose-envify": "^1.0.0"
}
},
"watchpack": {
"version": "1.6.0",
"resolved": "https://registry.npm.taobao.org/watchpack/download/watchpack-1.6.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fwatchpack%2Fdownload%2Fwatchpack-1.6.0.tgz",

View File

@@ -10,11 +10,13 @@
},
"dependencies": {
"@mdi/font": "^3.6.95",
"@types/node-polyglot": "^0.4.34",
"@vue/composition-api": "^0.5.0",
"axios": "^0.19.2",
"core-js": "^3.6.4",
"dayjs": "^1.8.23",
"lodash": "^4.17.15",
"node-polyglot": "^2.4.0",
"roboto-fontface": "*",
"vue": "^2.6.11",
"vue-router": "^3.1.6",
@@ -31,7 +33,6 @@
"@vue/cli-plugin-unit-jest": "^4.2.3",
"@vue/cli-plugin-vuex": "^4.2.3",
"@vue/cli-service": "^4.2.3",
"@vue/eslint-config-airbnb": "^4.0.0",
"@vue/eslint-config-typescript": "^4.0.0",
"@vue/test-utils": "1.0.0-beta.29",
"eslint": "^5.16.0",

View File

@@ -23,7 +23,7 @@
class="headline grey lighten-4"
>
<v-icon class="mr-2">mdi-link-plus</v-icon>
<span>Add Torrents</span>
<span>{{ $t('title.add_torrents') }}</span>
</v-card-title>
<v-card-text class="pb-0">
<v-form
@@ -42,16 +42,16 @@
multiple
chips
outlined
label="Files"
:label="$t('files')"
/>
<v-textarea
v-show="!files.length"
label="URLs"
hint="One link per line"
:placeholder="placeholder"
label="URL"
:hint="$t('dialog.add_torrents.hint')"
:placeholder="$t('dialog.add_torrents.placeholder')"
prepend-icon="mdi-link"
append-outer-icon="mdi-attachment"
:rules="[v => (!!files.length || !!v || 'URLs is required')]"
:rules="[v => (!!files.length || !!v || $t('msg.item_is_required', { item: 'URL' }))]"
:rows="$vuetify.breakpoint.xsOnly ? 1 : 3"
required
:autofocus="!phoneLayout"
@@ -65,7 +65,7 @@
<template v-if="showMore">
<v-col cols="12" sm="6">
<v-combobox
label="Category"
:label="$t('category', 1)"
prepend-icon="mdi-folder"
clearable
hide-no-data
@@ -77,7 +77,7 @@
<v-col cols="12" sm="6">
<v-checkbox
prepend-icon="mdi-file-tree"
label="Create subfolder"
:label="$t('label.create_subfolder')"
:input-value="true"
@change="setParams('root_path', $event)"
/>
@@ -86,14 +86,14 @@
<v-col cols="12" sm="6">
<v-checkbox
v-model="autoStart"
label="Start torrent"
:label="$t('label.start_torrent')"
prepend-icon="mdi-play-pause"
/>
</v-col>
<v-col cols="12" sm="6">
<v-checkbox
prepend-icon="mdi-progress-check"
label="Skip hash check"
:label="$t('label.skip_hash_check')"
:input-value="params.skip_checking"
@change="setParams('skip_checking', $event)"
/>
@@ -101,7 +101,7 @@
<template v-if="showMore">
<v-col cols="12" sm="6">
<v-checkbox
label="In sequential order"
:label="$t('label.in_sequential_order')"
prepend-icon="mdi-sort-descending"
:ipnut-value="params.sequentialDownload"
@change="setParams('sequentialDownload', $event.value)"
@@ -110,7 +110,7 @@
<v-col cols="12" sm="6">
<v-checkbox
prepend-icon="mdi-ray-start-end"
label="First and last pieces first"
:label="$t('label.first_and_last_pieces_first')"
:input-value="params.firstLastPiecePrio"
@change="setParams('firstLastPiecePrio', $event)"
/>
@@ -126,9 +126,9 @@
/>
</v-card-text>
<v-card-actions>
<v-btn text @click="showMore = !showMore" v-text="showMore ? 'Less' : 'More'" />
<v-btn text @click="showMore = !showMore" v-text="showMore ? $t('less') : $t('more')" />
<v-spacer />
<v-btn text @click="dialog = false">Cancel</v-btn>
<v-btn text @click="dialog = false">{{ $t('cancel') }}</v-btn>
<v-btn
text
@click="submit"
@@ -136,7 +136,7 @@
:disabled="!valid"
:loading="submitting"
>
Submit
{{ $t('submit') }}
</v-btn>
</v-card-actions>
</v-card>
@@ -148,6 +148,8 @@
import _ from 'lodash';
import Vue from 'vue';
import { mapState } from 'vuex';
import { tr } from '@/locale';
import api from '../Api';
const defaultParams = {
@@ -160,10 +162,21 @@ const defaultParams = {
firstLastPiecePrio: false,
};
export default Vue.extend({
data() {
interface Data {
tr: any,
dialog: boolean,
valid: boolean,
files: any[],
userParams: any,
error: string | null,
submitting: boolean,
showMore: boolean,
}
export default {
data(): Data {
return {
placeholder: 'Upload torrents by drop them here,\nor click attachment button at right to select.',
tr,
dialog: false,
valid: false,
files: [],
@@ -180,7 +193,7 @@ export default Vue.extend({
}),
...mapState({
categories(state, getters) {
return getters.allCategories.map(c => ({ text: c.name, value: c.key }));
return getters.allCategories.map((c: any) => ({ text: c.name, value: c.key }));
},
}),
params() {
@@ -289,7 +302,7 @@ export default Vue.extend({
this.$refs.form.validate();
},
},
});
};
</script>
<style lang="scss" scoped>

View File

@@ -5,23 +5,9 @@
class="drawer"
>
<template v-for="item in items">
<v-row
v-if="item.heading"
:key="item.heading"
align="center"
>
<v-col cols="6">
<v-subheader v-if="item.heading">
{{ item.heading }}
</v-subheader>
</v-col>
<v-col cols="6" class="text-center">
<a href="#!" class="body-2 black--text">EDIT</a>
</v-col>
</v-row>
<v-list-group
v-else-if="item.children"
:key="item.text"
v-if="item.children"
:key="item.title"
v-model="item.model"
:prepend-icon="item.model ? item.icon : item['icon-alt']"
append-icon=""
@@ -29,7 +15,7 @@
<template v-slot:activator>
<v-list-item-content>
<v-list-item-title>
{{ item.text }}
{{ item.title }}
</v-list-item-title>
</v-list-item-content>
</template>
@@ -43,7 +29,7 @@
</v-list-item-icon>
<v-list-item-content>
<v-list-item-title>
{{ child.text }}
{{ child.title }}
</v-list-item-title>
</v-list-item-content>
</v-list-item>
@@ -55,13 +41,13 @@
:group="child"
/>
</template>
<v-list-item v-else :key="item.text" @click="item.click ? item.click() : null">
<v-list-item v-else :key="item.title" @click="item.click ? item.click() : null">
<v-list-item-icon>
<v-icon>{{ item.icon }}</v-icon>
</v-list-item-icon>
<v-list-item-content>
<v-list-item-title>
{{ item.text }}
{{ item.title }}
</v-list-item-title>
</v-list-item-content>
</v-list-item>
@@ -73,6 +59,9 @@
import _ from 'lodash';
import Vue from 'vue';
import { mapState, mapMutations, mapGetters } from 'vuex';
import { tr } from '@/locale';
import { Torrent } from '@/types';
import FilterGroup from './drawer/FilterGroup.vue';
import api from '../Api';
import { formatSize } from '../filters';
@@ -80,47 +69,68 @@ import { SiteMap, StateType, AllStateTypes } from '../consts';
const stateList = [
{
title: 'Downloading',
title: tr('state.downloading'),
state: StateType.Downloading,
icon: 'download',
},
{
title: 'Seeding',
title: tr('state.seeding'),
state: StateType.Seeding,
icon: 'upload',
},
{
title: 'Completed',
title: tr('state.completed'),
state: StateType.Completed,
icon: 'check',
},
{
title: 'Resumed',
title: tr('state.resumed'),
state: StateType.Resumed,
icon: 'play',
},
{
title: 'Paused',
title: tr('state.paused'),
state: StateType.Paused,
icon: 'pause',
},
{
title: 'Active',
title: tr('state.active'),
state: StateType.Active,
icon: 'filter',
},
{
title: 'Inactive',
title: tr('state.inactive'),
state: StateType.Inactive,
icon: 'filter-outline',
},
{
title: 'Errored',
title: tr('state.errored'),
state: StateType.Errored,
icon: 'alert',
},
];
interface MenuItem {
icon: string,
'icon-alt'?: string,
title: string,
model?: boolean,
select?: string,
click?: () => void,
children?: MenuChildrenItem[],
}
interface MenuChildrenItem extends MenuItem {
key: string | null,
append?: string,
}
interface Data {
tr: any,
basicItems: MenuItem[],
endItems: MenuItem[],
}
export default {
components: {
FilterGroup,
@@ -130,21 +140,20 @@ export default {
value: Object,
},
data() {
return {
basicItems: null,
endItems: null,
};
},
data(): Data {
const basicItems = [
{ icon: 'mdi-settings', title: tr('settings'), click: () => alert(tr('todo')) },
];
const endItems = [
{ icon: 'mdi-delta', title: tr('logs'), click: () => this.updateOptions('showLogs', true) },
{ icon: 'mdi-history', title: tr('label.switch_to_old_ui'), click: this.switchUi },
];
created() {
this.basicItems = [
{ icon: 'mdi-settings', text: 'Settings', click: () => alert('TODO') },
];
this.endItems = [
{ icon: 'mdi-delta', text: 'Logs', click: () => this.updateOptions('showLogs', true) },
{ icon: 'mdi-history', text: 'Switch to old UI', click: this.switchUi },
];
return {
tr,
basicItems,
endItems,
};
},
computed: {
@@ -161,7 +170,7 @@ export default {
return _.concat(this.basicItems, this.endItems);
}
const filterGroups = [];
const filterGroups: MenuItem[] = [];
const totalSize = formatSize(_.sumBy(this.allTorrents, 'size'));
const states = stateList.map((item) => {
@@ -179,12 +188,12 @@ export default {
filterGroups.push({
icon: 'mdi-menu-up',
'icon-alt': 'mdi-menu-down',
title: 'State',
title: tr('state._'),
model: false,
select: 'state',
children: [
{
icon: 'mdi-filter-remove', title: `All (${this.allTorrents.length})`, key: null, append: `[${totalSize}]`,
icon: 'mdi-filter-remove', title: `${tr('all')} (${this.allTorrents.length})`, key: null, append: `[${totalSize}]`,
},
...states,
],
@@ -192,7 +201,7 @@ export default {
const categories: any[] = [{
key: '',
name: 'Uncategorized',
name: tr('uncategorized'),
}].concat(this.allCategories).map((category) => {
let value = this.torrentGroupByCategory[category.key];
if (_.isUndefined(value)) {
@@ -208,12 +217,12 @@ export default {
filterGroups.push({
icon: 'mdi-menu-up',
'icon-alt': 'mdi-menu-down',
title: 'Categories',
title: tr('category', 0),
model: !this.$vuetify.breakpoint.xsOnly,
select: 'category',
children: [
{
icon: 'mdi-folder-open', title: `All (${this.allTorrents.length})`, key: null, append: `[${totalSize}]`,
icon: 'mdi-folder-open', title: `${tr('all')} (${this.allTorrents.length})`, key: null, append: `[${totalSize}]`,
},
...categories,
],
@@ -222,7 +231,7 @@ export default {
const sites: any[] = _.sortBy(Object.entries(this.torrentGroupBySite).map(([key, value]) => {
const size = formatSize(_.sumBy(value, 'size'));
const site = (SiteMap as any)[key];
const title = `${site ? site.name : (key || 'Others')} (${value.length})`;
const title = `${site ? site.name : (key || tr('others'))} (${value.length})`;
const icon = _.defaultTo(site ? site.icon : null, 'mdi-server');
const append = `[${size}]`;
return {
@@ -232,18 +241,18 @@ export default {
filterGroups.push({
icon: 'mdi-menu-up',
'icon-alt': 'mdi-menu-down',
title: 'Sites',
title: tr('sites'),
model: false,
select: 'site',
children: [
{
icon: 'mdi-server', title: `All (${this.allTorrents.length})`, key: null, append: `[${totalSize}]`,
icon: 'mdi-server', title: `${tr('all')} (${this.allTorrents.length})`, key: null, append: `[${totalSize}]`,
},
...sites,
],
});
return _.concat(this.basicItems, [{ filterGroups }], this.endItems);
return _.concat(this.basicItems, [{filterGroups}] as any, this.endItems);
},
},

View File

@@ -27,21 +27,23 @@ import Vue from 'vue';
import {
computed, ref, watch, Ref,
} from '@vue/composition-api';
import { tr } from '@/locale';
import { DialogType, DialogConfig } from '@/store/types';
import { useMutations, useState } from '@/store';
import { timeout } from '@/utils';
const BUTTONS = {
[DialogType.Alert]: [
['Close', false],
[tr('close'), false],
],
[DialogType.YesNo]: [
['No', false],
['Yes', true],
[tr('no'), false],
[tr('yes'), true],
],
[DialogType.OkCancel]: [
['Cancel', false],
['OK', true],
[tr('cancel'), false],
[tr('ok'), true],
],
};

View File

@@ -11,13 +11,15 @@
color="info"
@click="clickBtn"
>
{{ config.btnText ? config.btnText : 'Close' }}
{{ config.btnText ? config.btnText : $t('close') }}
</v-btn>
</v-snackbar>
</template>
<script>
import { useMutations, useState } from '@/store';
import { tr } from '@/locale';
import { timeout } from '@/utils';
export default {
@@ -45,6 +47,7 @@ export default {
}
return {
tr,
config,
changed,
clickBtn,

View File

@@ -2,7 +2,7 @@
<v-dialog v-model="value" persistent width="25em">
<v-card>
<v-toolbar dark color="primary">
<v-toolbar-title>Login</v-toolbar-title>
<v-toolbar-title>{{ $t('login') }}</v-toolbar-title>
</v-toolbar>
<v-card-text>
<v-form
@@ -15,8 +15,8 @@
<v-text-field
v-model="params.username"
prepend-icon="mdi-account"
label="Username"
:rules="[v => !!v || 'Username is required']"
:label="$t('username')"
:rules="[v => !!v || $t('msg.item_is_required', { item: $t('username') })]"
autofocus
required
/>
@@ -25,9 +25,9 @@
prepend-icon="mdi-lock"
:append-icon="showPassword ? 'mdi-eye' : 'mdi-eye-off'"
@click:append="showPassword = !showPassword"
label="Password"
:label="$t('password')"
:type="showPassword ? 'text' : 'password'"
:rules="[v => !!v || 'Password is required']"
:rules="[v => !!v || $t('msg.item_is_required', { item: $t('password') })]"
required
/>
</div>
@@ -46,7 +46,7 @@
:disabled="!valid || submitting"
:loading="submitting"
>
Submit
{{ $t('submit') }}
</v-btn>
</v-card-actions>
</v-card>
@@ -55,6 +55,8 @@
<script lang="ts">
import Vue from 'vue';
import { tr } from '@/locale';
import api from '../Api';
export default Vue.extend({
@@ -63,6 +65,7 @@ export default Vue.extend({
},
data() {
return {
tr,
valid: false,
submitting: false,
showPassword: false,

View File

@@ -10,31 +10,31 @@
height="40px"
class="elevation-2"
>
<v-btn icon @click="confirmDelete" title="Delete" :disabled="!hasSelected">
<v-btn icon @click="confirmDelete" :title="$t('delete')" :disabled="!hasSelected">
<v-icon>mdi-delete</v-icon>
</v-btn>
<v-divider vertical inset />
<v-btn icon @click="resumeTorrents" title="Resume" :disabled="!hasSelected">
<v-btn icon @click="resumeTorrents" :title="$t('resume')" :disabled="!hasSelected">
<v-icon>mdi-play</v-icon>
</v-btn>
<v-btn icon @click="pauseTorrents" title="Pause" :disabled="!hasSelected">
<v-btn icon @click="pauseTorrents" :title="$t('pause')" :disabled="!hasSelected">
<v-icon>mdi-pause</v-icon>
</v-btn>
<v-divider vertical inset />
<v-btn icon @click="showInfo()" title="Info"
<v-btn icon @click="showInfo()" :title="$t('info')"
:disabled="!hasSelected || selectedRows.length > 5"
>
<v-icon>mdi-alert-circle</v-icon>
</v-btn>
<v-menu offset-y>
<template v-slot:activator="{ on }">
<v-btn icon v-on="on" title="Category" :disabled="!hasSelected">
<v-btn icon v-on="on" :title="$t('category')" :disabled="!hasSelected">
<v-icon>mdi-folder</v-icon>
</v-btn>
</template>
<v-list class="category-actions">
<v-subheader @click.stop="">
Set category
{{ $t('title.set_category') }}
</v-subheader>
<v-list-item
v-for="(item, i) in allCategories"
@@ -57,7 +57,7 @@
</v-list-item-action>
<v-list-item-content>
<v-list-item-title>
Reset
{{ $t('reset') }}
</v-list-item-title>
</v-list-item-content>
</v-list-item>
@@ -65,13 +65,13 @@
</v-menu>
<template v-if="!$vuetify.breakpoint.xsOnly">
<v-divider vertical inset />
<v-btn icon @click="reannounceTorrents" title="Reannounce">
<v-btn icon @click="reannounceTorrents" :title="$t('reannounce')">
<v-icon>mdi-bullhorn</v-icon>
</v-btn>
<v-btn icon @click="editTracker" title="Edit tracker">
<v-btn icon @click="editTracker" :title="$t('title.edit_tracker')">
<v-icon>mdi-server</v-icon>
</v-btn>
<v-btn icon @click="recheckTorrents" title="Recheck" :disabled="selectedRows.length == 0">
<v-btn icon @click="recheckTorrents" :title="$t('recheck')" :disabled="selectedRows.length == 0">
<v-icon>mdi-backup-restore</v-icon>
</v-btn>
</template>
@@ -159,6 +159,8 @@
import Vue from 'vue';
import { mapState, mapGetters, mapMutations } from 'vuex';
import _ from 'lodash';
import { tr } from '@/locale';
import ConfirmDeleteDialog from './dialogs/ConfirmDeleteDialog.vue';
import ConfirmSetCategoryDialog from './dialogs/ConfirmSetCategoryDialog.vue';
import EditTrackerDialog from './dialogs/EditTrackerDialog.vue';
@@ -256,17 +258,17 @@ export default Vue.extend({
data() {
const headers = [
{ text: 'Name', value: 'name' },
{ text: 'Size', value: 'size' },
{ text: 'Progress', value: 'progress' },
{ text: 'Status', value: 'state' },
{ text: 'Seeds', value: 'num_complete' },
{ text: 'Peers', value: 'num_incomplete' },
{ text: 'DL Speed', value: 'dlspeed' },
{ text: 'UP Speed', value: 'upspeed' },
{ text: 'ETA', value: 'eta' },
{ text: 'Ratio', value: 'ratio' },
{ text: 'Added', value: 'added_on' },
{ text: tr('name'), value: 'name' },
{ text: tr('size'), value: 'size' },
{ text: tr('progress'), value: 'progress' },
{ text: tr('status'), value: 'state' },
{ text: tr('seeds'), value: 'num_complete' },
{ text: tr('peers'), value: 'num_incomplete' },
{ text: tr('dl_speed'), value: 'dlspeed' },
{ text: tr('up_speed'), value: 'upspeed' },
{ text: tr('eta'), value: 'eta' },
{ text: tr('ratio'), value: 'ratio' },
{ text: tr('added_on'), value: 'added_on' },
];
const footerProps = {
@@ -274,6 +276,7 @@ export default Vue.extend({
};
return {
tr,
headers,
selectedRows: [],
toDelete: [],

View File

@@ -5,10 +5,10 @@
class="headline grey lighten-4"
>
<v-icon class="mr-2">mdi-delete</v-icon>
<span>Delete torrents</span>
<span>{{ $t('title.delete_torrents') }}</span>
</v-card-title>
<v-card-text class="pb-0">
Are you sure to delete selected torrents from transfer list?
{{ $t('dialog.delete_torrents.msg') }}
<ol class="torrents pt-6">
<li v-for="(row, i) in torrents" :key="i">
{{ row.name }}
@@ -18,26 +18,26 @@
<v-checkbox
v-model="deleteFiles"
prepend-icon="mdi-file-cancel"
label="Also delete files"
:label="$t('label.also_delete_files')"
/>
<v-checkbox
v-if="sameNamedTorrents.length > 0"
v-model="deleteSameNamed"
prepend-icon="mdi-file-multiple"
class="mt-0"
:label="`Also delete ${sameNamedTorrents.length} same named torrents`"
:label="$t('dialog.delete_torrents', sameNamedTorrents.length)"
/>
</v-card-text>
<v-card-actions>
<v-spacer />
<v-btn text @click="closeDialog">Cancel</v-btn>
<v-btn text @click="closeDialog">{{ $t('cancel') }}</v-btn>
<v-btn
@click="submit"
color="warning"
:disabled="submitting"
:loading="submitting"
>
Delete
{{ $t('delete') }}
</v-btn>
</v-card-actions>
</v-card>
@@ -48,6 +48,8 @@
import _ from 'lodash';
import Vue, { PropType } from 'vue';
import { mapGetters } from 'vuex';
import { tr } from '@/locale';
import api from '@/Api';
import { findSameNamedTorrents } from '@/utils';
import { Torrent } from '../../types';
@@ -58,6 +60,7 @@ export default Vue.extend({
},
data() {
return {
tr,
deleteFiles: false,
deleteSameNamed: false,
submitting: false,

View File

@@ -5,14 +5,14 @@
class="headline grey lighten-4"
>
<v-icon class="mr-2">mdi-folder</v-icon>
<span>Set category</span>
<span>{{ $t('title.set_category') }}</span>
</v-card-title>
<v-card-text class="pb-0">
<template v-if="category">
Are you sure to move selected torrents to category {{ category }}?
{{ $t('dialog.set_category.move', { category }) }}
</template>
<template v-else>
Are you sure to reset category of selected torrents?
{{ $t('dialog.set_category.reset') }}
</template>
<ol class="torrents pt-6">
<li v-for="(row, i) in torrents" :key="i">
@@ -25,19 +25,19 @@
v-model="moveSameNamed"
prepend-icon="mdi-file-multiple"
class="mt-0"
:label="`Also move ${sameNamedTorrents.length} same named torrents`"
:label="$t('dialog.set_category.also.move_same_name_torrents', sameNamedTorrents.length)"
/>
</v-card-text>
<v-card-actions>
<v-spacer />
<v-btn text @click="closeDialog">Cancel</v-btn>
<v-btn text @click="closeDialog">{{ $t('cancel') }}</v-btn>
<v-btn
@click="submit"
color="warning"
:disabled="submitting"
:loading="submitting"
>
Submit
{{ $t('submit') }}
</v-btn>
</v-card-actions>
</v-card>
@@ -48,6 +48,8 @@
import _ from 'lodash';
import Vue from 'vue';
import { mapGetters } from 'vuex';
import { tr } from '@/locale';
import api from '@/Api';
import { findSameNamedTorrents } from '@/utils';

100
src/locale/en.ts Normal file
View File

@@ -0,0 +1,100 @@
export default {
lang: 'English',
close: 'Close',
no: 'No',
yes: 'Yes',
cancel: 'Cancel',
ok: 'OK',
submit: 'Submit',
edit: 'Edit',
delete: 'Delete',
todo: 'To Do',
resume: 'Resume',
pause: 'Pause',
info: 'Info',
reset: 'Reset',
login: 'Login',
reannounce: 'Reannounce',
recheck: 'Recheck',
username: 'Username',
password: 'Password',
name: 'Name',
size: 'Size',
progress: 'progress',
status: 'Status',
seeds: 'Seeds',
peers: 'Peers',
dl_speed: 'DL Speed',
up_speed: 'UP Speed',
eta: 'ETA',
ratio: 'Ratio',
added_on: 'Added On',
settings: 'Settings',
logs: 'Logs',
all: 'All',
category: 'Category |||| Categories',
uncategorized: 'Uncategorized',
others: 'Others',
sites: 'Sites',
files: 'Files',
less: 'Less',
more: 'More',
title: {
add_torrents: 'Add Torrents',
delete_torrents: 'Delete Torrents',
set_category: 'Set category',
edit_tracker: 'Edit tracker',
},
label: {
switch_to_old_ui: 'Switch to old UI',
create_subfolder: 'Create subfolder',
start_torrent: 'Start torrent',
skip_hash_check: 'Skip hash check',
in_sequential_order: 'In sequential order',
first_and_last_pieces_first: 'First and last pieces first',
also_delete_files: 'Also delete files',
},
msg: {
item_is_required: '%{item} is required',
},
dialog: {
add_torrents: {
placeholder: 'Upload torrents by drop them here,\nor click attachment button at right to select.',
hint: 'One link per line',
},
delete_torrents: {
msg: 'Are you sure to delete selected torrents from transfer list?',
also_delete_same_name_torrents: 'Also delete one same named torrent |||| Also delete %{smart_count} same named torrents',
},
set_category: {
move: 'Are you sure to move selected torrents to category %{category}?',
reset: 'Are you sure to reset category of selected torrents?',
also_move_same_name_torrents: 'Also move one same named torrent |||| Also move %{smart_count} same named torrents',
}
},
state: {
_: 'State',
downloading: 'Downloading',
seeding: 'Seeding',
completed: 'Completed',
resumed: 'Resumed',
paused: 'Paused',
active: 'Active',
inactive: 'Inactive',
errored: 'Errored',
}
}

39
src/locale/index.ts Normal file
View File

@@ -0,0 +1,39 @@
import { isString } from 'lodash';
import Polyglot from 'node-polyglot';
import en from './en';
const polyglot = new Polyglot({
phrases: en,
});
const locales: any = {
en: 'English',
'zh-CN': '中文',
};
function updateLocale() {
const { languages } = navigator;
let locale;
for (const code of languages) {
if (code in locales) {
locale = code;
break;
}
}
if (!locale || locale === 'en') {
return;
}
polyglot.locale(locale);
const { default: translation } = require('./' + locale);
polyglot.extend(translation);
}
updateLocale();
export default polyglot;
export const tr = polyglot.t.bind(polyglot);
export { updateLocale };

100
src/locale/zh-CN.ts Normal file
View File

@@ -0,0 +1,100 @@
export default {
lang: '中文',
close: '关闭',
no: '否',
yes: '是',
cancel: '取消',
ok: '确定',
submit: '提交',
edit: '编辑',
delete: '删除',
todo: '待办',
resume: '恢复',
pause: '暂停',
info: '信息',
reset: '重置',
login: '登录',
reannounce: '重新通告',
recheck: '重新检查',
username: '用户名',
password: '密码',
name: '名称',
size: '大小',
progress: '进度',
status: '状态',
seeds: '做种',
peers: '用户',
dl_speed: '下载速度',
up_speed: '上传速度',
eta: '剩余时间',
ratio: '比率',
added_on: '添加时间',
settings: '设置',
logs: '日志',
all: '全部',
category: '分类',
uncategorized: '未分类',
others: '其他',
sites: '站点',
files: '文件',
less: '更少',
more: '更多',
title: {
add_torrents: '添加种子',
delete_torrents: '删除种子',
set_category: '设置分类',
edit_tracker: '编辑 Tracker',
},
label: {
switch_to_old_ui: '切换到原版 UI',
create_subfolder: '创建子文件夹',
start_torrent: '开始种子',
skip_hash_check: '跳过哈希校验',
in_sequential_order: '按顺序下载',
first_and_last_pieces_first: '先下载首尾文件块',
also_delete_files: '同时删除文件',
},
msg: {
'item_is_required': '%{item}不能为空',
},
dialog: {
add_torrents: {
placeholder: '将种子拖到这里上传,\n或者点击右边的附件图标来选择。',
hint: '每行一个链接',
},
delete_torrents: {
msg: '你确定要删除选中的种子吗?',
also_delete_same_name_torrents: '同时删除 %{smart_count} 个同名的种子',
},
set_category: {
move: '你确定要移动选中的种子到分类 %{category} 吗?',
reset: '你确定重置选中的种子的分类吗?',
also_move_same_name_torrents: '同时移动 %{smart_count} 个同名的种子',
}
},
state: {
_: '状态',
downloading: '下载',
seeding: '做种',
completed: '完成',
resumed: '恢复',
paused: '暂停',
active: '活动',
inactive: '空闲',
errored: '错误',
}
}

View File

@@ -1,10 +1,14 @@
import Vue from 'vue';
import vuetify from './plugins/vuetify';
import './plugins/i18n';
import './plugins/composition-api';
import vuetify from './plugins/vuetify';
import store from './store';
// import router from './router';
import './filters';
import './directives';
import './locale';
import App from './App.vue';
import 'roboto-fontface/css/roboto/roboto-fontface.css';

10
src/plugins/i18n.ts Normal file
View File

@@ -0,0 +1,10 @@
import Vue from 'vue';
import { tr } from '@/locale';
class I18n {
static install() {
Vue.prototype.$t = tr;
}
}
Vue.use(I18n);

View File

@@ -1,14 +1,19 @@
import Vue from 'vue';
import Vuetify from 'vuetify/lib';
// import zhHans from 'vuetify/src/locale/zh-Hans';
import i18n from '@/locale';
Vue.use(Vuetify);
let locale = i18n.locale();
locale = locale === 'zh-CN' ? 'zh-Hans' : locale.split('-', 1)[0];
const { default: translation } = require('vuetify/src/locale/' + locale);
export default new Vuetify({
// lang: {
// locales: { zhHans },
// current: 'zh-Hans',
// },
lang: {
locales: { [locale]: translation },
current: locale,
},
icons: {
iconfont: 'mdi',
},