Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e579146260 | |||
| 9d18333a93 | |||
| 5daece6dab | |||
| 8bfb7d906e | |||
| f4ece13ceb | |||
| 763ea6ee7a | |||
| cc27cb3459 | |||
| b8c57df4f5 | |||
| e6765380bc | |||
| 0172a003d3 | |||
| ef2b3a04b2 | |||
| 75f5760b33 | |||
| 1f033d1e47 | |||
| 458e21479b | |||
| 46e5324ae6 | |||
| de8996b3b3 | |||
| 1f83848358 | |||
| 69d3ade305 |
@@ -1,10 +1,10 @@
|
||||
'use strict'
|
||||
|
||||
const chalk = require('chalk')
|
||||
const electron = require('electron')
|
||||
const path = require('path')
|
||||
const path = require('node:path')
|
||||
const { spawn } = require('node:child_process')
|
||||
const { say } = require('cfonts')
|
||||
const { spawn } = require('child_process')
|
||||
const electron = require('electron')
|
||||
const chalk = require('chalk')
|
||||
const Webpack = require('webpack')
|
||||
const WebpackDevServer = require('webpack-dev-server')
|
||||
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
process.env.BABEL_ENV = 'main'
|
||||
|
||||
const devMode = process.env.NODE_ENV !== 'production'
|
||||
const path = require('path')
|
||||
const path = require('node:path')
|
||||
const Webpack = require('webpack')
|
||||
const ESLintPlugin = require('eslint-webpack-plugin')
|
||||
const TerserPlugin = require('terser-webpack-plugin')
|
||||
const { dependencies } = require('../package.json')
|
||||
const { appId } = require('../electron-builder.json')
|
||||
const Webpack = require('webpack')
|
||||
const TerserPlugin = require('terser-webpack-plugin');
|
||||
const ESLintPlugin = require('eslint-webpack-plugin');
|
||||
const devMode = process.env.NODE_ENV !== 'production'
|
||||
|
||||
let mainConfig = {
|
||||
entry: {
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
|
||||
process.env.BABEL_ENV = 'renderer'
|
||||
|
||||
const devMode = process.env.NODE_ENV !== 'production'
|
||||
const path = require('path')
|
||||
const { dependencies } = require('../package.json')
|
||||
const path = require('node:path')
|
||||
const Webpack = require('webpack')
|
||||
const TerserPlugin = require('terser-webpack-plugin');
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
||||
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
const { VueLoaderPlugin } = require('vue-loader')
|
||||
const ESLintPlugin = require('eslint-webpack-plugin');
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin')
|
||||
const ESLintPlugin = require('eslint-webpack-plugin')
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
||||
const TerserPlugin = require('terser-webpack-plugin')
|
||||
const { dependencies } = require('../package.json')
|
||||
const devMode = process.env.NODE_ENV !== 'production'
|
||||
|
||||
/**
|
||||
* List of node_modules to include in webpack bundle
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
|
||||
process.env.BABEL_ENV = 'web'
|
||||
|
||||
const devMode = process.env.NODE_ENV !== 'production'
|
||||
const path = require('path')
|
||||
const path = require('node:path')
|
||||
const { dependencies } = require('../package.json')
|
||||
const Webpack = require('webpack')
|
||||
const TerserPlugin = require('terser-webpack-plugin');
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
||||
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
const { VueLoaderPlugin } = require('vue-loader')
|
||||
const ESLintPlugin = require('eslint-webpack-plugin');
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin')
|
||||
const ESLintPlugin = require('eslint-webpack-plugin')
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
||||
const TerserPlugin = require('terser-webpack-plugin')
|
||||
const devMode = process.env.NODE_ENV !== 'production'
|
||||
|
||||
/**
|
||||
* List of node_modules to include in webpack bundle
|
||||
@@ -48,7 +48,7 @@ let webConfig = {
|
||||
loader: 'sass-loader',
|
||||
options: {
|
||||
implementation: require('sass'),
|
||||
additionalData: '@import "@/components/Theme/Variables.scss";',
|
||||
additionalData: '@import "@/components/Theme/Variables.scss"',
|
||||
sassOptions: {
|
||||
includePaths:[__dirname, 'src']
|
||||
}
|
||||
@@ -66,7 +66,7 @@ let webConfig = {
|
||||
options: {
|
||||
implementation: require('sass'),
|
||||
indentedSyntax: true,
|
||||
additionalData: '@import "@/components/Theme/Variables.scss";',
|
||||
additionalData: '@import "@/components/Theme/Variables.scss"',
|
||||
sassOptions: {
|
||||
includePaths:[__dirname, 'src']
|
||||
}
|
||||
|
||||
@@ -18,17 +18,17 @@ module.exports = {
|
||||
rules: {
|
||||
'no-console': 'off',
|
||||
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
|
||||
'indent': ['error', 2],
|
||||
indent: ['error', 2],
|
||||
'vue/script-indent': ['error', 2, {
|
||||
'baseIndent': 1
|
||||
}],
|
||||
baseIndent: 1
|
||||
}]
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
'files': ['*.vue'],
|
||||
'rules': {
|
||||
'indent': 'off'
|
||||
files: ['*.vue'],
|
||||
rules: {
|
||||
indent: 'off'
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
# Motrix
|
||||
|
||||
<a href="https://motrix.app">
|
||||
<img src="./static/512x512.png" width="256" alt="App Icon" />
|
||||
</a>
|
||||
<p>
|
||||
<a href="https://motrix.app">
|
||||
<img src="./static/512x512.png" width="256" alt="Motrix App Icon" />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
## 一款全能的下载工具
|
||||
|
||||
@@ -47,12 +49,21 @@ scoop install motrix
|
||||
|
||||
### macOS
|
||||
|
||||
macOS 用户可以使用 `brew cask` 安装 Motrix,感谢 [@Mitscherlich](https://github.com/Mitscherlich) 的 [PR](https://github.com/Homebrew/homebrew-cask/pull/59494)。
|
||||
macOS 用户可以使用 `brew` 安装 Motrix,感谢 [@Mitscherlich](https://github.com/Mitscherlich) 的 [PR](https://github.com/Homebrew/homebrew-cask/pull/59494)。
|
||||
|
||||
```bash
|
||||
brew update && brew install --cask motrix
|
||||
brew update && brew install motrix
|
||||
```
|
||||
|
||||
#### 自动更新
|
||||
Motrix v1.8.0+ 版本更改了应用 BundleID ( `net.agalwood.Motrix` => `app.motrix.native` ), Motrix v1.6.11 的自动更新会因为签名不一致而失败。[Motrix 安装助手](https://github.com/motrixapp/motrix-install-assistant)将帮助您安装最新的 Motrix 应用程序。
|
||||
|
||||
<p>
|
||||
<a href="https://github.com/motrixapp/motrix-install-assistant">
|
||||
<img src="https://raw.githubusercontent.com/motrixapp/motrix-install-assistant/main/build/256x256.png" width="192" alt="Motrix Install Assistant Icon" />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
### Linux
|
||||
|
||||
你可以下载 `AppImage` (适用于所有 Linux 发行版)或 `snap` 来安装 Motrix,更多 Linux 安装包格式请查看 [GitHub/release](https://github.com/agalwood/Motrix/releases) 。
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
# Motrix
|
||||
|
||||
<a href="https://motrix.app">
|
||||
<img src="./static/512x512.png" width="256" alt="App Icon" />
|
||||
</a>
|
||||
<p>
|
||||
<a href="https://motrix.app">
|
||||
<img src="./static/512x512.png" width="256" alt="Motrix App Icon" />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
## A full-featured download manager
|
||||
|
||||
@@ -47,12 +49,22 @@ scoop install motrix
|
||||
|
||||
### macOS
|
||||
|
||||
The macOS users can install Motrix using `brew cask`, thanks to [PR](https://github.com/Homebrew/homebrew-cask/pull/59494) of [@Mitscherlich](https://github.com/Mitscherlich).
|
||||
The macOS users can install Motrix using `brew`, thanks to [PR](https://github.com/Homebrew/homebrew-cask/pull/59494) of [@Mitscherlich](https://github.com/Mitscherlich).
|
||||
|
||||
```bash
|
||||
brew update && brew install --cask motrix
|
||||
brew update && brew install motrix
|
||||
```
|
||||
|
||||
#### Auto Update
|
||||
|
||||
Since Motrix v1.8.0 and later versions changed the App BundleID ( `net.agalwood.Motrix` => `app.motrix.native` ), the automatic update of Motrix v1.6.11 will fail. [Motrix Install Assistant](https://github.com/motrixapp/motrix-install-assistant) will help you install the latest Motrix application.
|
||||
|
||||
<p>
|
||||
<a href="https://github.com/motrixapp/motrix-install-assistant">
|
||||
<img src="https://raw.githubusercontent.com/motrixapp/motrix-install-assistant/main/build/256x256.png" width="192" alt="Motrix Install Assistant Icon" />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
### Linux
|
||||
|
||||
You can download the `AppImage` (for all Linux distributions) or `snap` to install Motrix, see [GitHub/release](https://github.com/agalwood/Motrix/releases) for more Linux installation package formats.
|
||||
|
||||
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 103 KiB |
@@ -29,9 +29,9 @@
|
||||
// TODO: Remove script once https://github.com/electron/electron/issues/17972 is solved by
|
||||
// `electron-builder`
|
||||
|
||||
const fs = require('fs')
|
||||
const { spawn } = require('child_process')
|
||||
const { chdir } = require('process')
|
||||
const fs = require('node:fs')
|
||||
const { spawn } = require('node:child_process')
|
||||
const { chdir } = require('node:process')
|
||||
|
||||
const pkg = require('../package.json')
|
||||
const binName = `${pkg.name}`.toLowerCase()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
require('dotenv').config()
|
||||
const { join } = require('path')
|
||||
const { join } = require('node:path')
|
||||
const { notarize } = require('@electron/notarize')
|
||||
const { appId } = require('../electron-builder.json')
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 451 KiB |
|
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 530 KiB |
@@ -32,14 +32,14 @@
|
||||
"postinstall": "electron-builder install-app-deps && npm run lint:fix"
|
||||
},
|
||||
"engines": {
|
||||
"node" : ">=16.0.0"
|
||||
"node": ">=16.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"node-fetch": "^2.6.1",
|
||||
"ws": "^8.13.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.21.5",
|
||||
"@babel/core": "^7.21.8",
|
||||
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
||||
"@babel/plugin-transform-runtime": "^7.21.4",
|
||||
"@babel/preset-env": "^7.21.5",
|
||||
@@ -60,15 +60,15 @@
|
||||
"babel-plugin-component": "^1.1.1",
|
||||
"bittorrent-peerid": "^1.3.6",
|
||||
"blob-util": "^2.0.2",
|
||||
"cfonts": "^3.1.1",
|
||||
"cfonts": "^3.2.0",
|
||||
"chalk": "^4.1.2",
|
||||
"copy-webpack-plugin": "^11.0.0",
|
||||
"cross-env": "^7.0.3",
|
||||
"css-loader": "^6.7.3",
|
||||
"css-minimizer-webpack-plugin": "^5.0.0",
|
||||
"del": "^6.1.1",
|
||||
"electron": "^22.3.7",
|
||||
"electron-builder": "^24.3.0",
|
||||
"electron": "^22.3.9",
|
||||
"electron-builder": "^24.4.0",
|
||||
"electron-devtools-installer": "^3.2.0",
|
||||
"electron-is": "^3.0.0",
|
||||
"electron-log": "^4.4.8",
|
||||
@@ -80,7 +80,7 @@
|
||||
"eslint-plugin-import": "^2.27.5",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"eslint-plugin-promise": "^6.1.1",
|
||||
"eslint-plugin-vue": "^9.11.0",
|
||||
"eslint-plugin-vue": "^9.12.0",
|
||||
"eslint-webpack-plugin": "^4.0.1",
|
||||
"file-loader": "^6.2.0",
|
||||
"html-webpack-plugin": "^5.5.1",
|
||||
@@ -94,7 +94,7 @@
|
||||
"sass": "1.62.1",
|
||||
"sass-loader": "^12.6.0",
|
||||
"style-loader": "^3.3.2",
|
||||
"terser-webpack-plugin": "^5.3.7",
|
||||
"terser-webpack-plugin": "^5.3.8",
|
||||
"vue": "^2.7.14",
|
||||
"vue-electron": "^1.0.6",
|
||||
"vue-loader": "^15.10.1",
|
||||
@@ -104,9 +104,9 @@
|
||||
"vue-template-compiler": "^2.7.14",
|
||||
"vuex": "^3.6.2",
|
||||
"vuex-router-sync": "^5.0.0",
|
||||
"webpack": "^5.81.0",
|
||||
"webpack-cli": "^5.0.2",
|
||||
"webpack-dev-server": "^4.13.3",
|
||||
"webpack": "^5.82.1",
|
||||
"webpack-cli": "^5.1.1",
|
||||
"webpack-dev-server": "^4.15.0",
|
||||
"webpack-hot-middleware": "^2.25.3",
|
||||
"webpack-merge": "^5.8.0",
|
||||
"worker-loader": "^3.0.8"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { EventEmitter } from 'events'
|
||||
import { EventEmitter } from 'node:events'
|
||||
import { readFile, unlink } from 'node:fs'
|
||||
import { extname, basename } from 'node:path'
|
||||
import { app, shell, dialog, ipcMain } from 'electron'
|
||||
import is from 'electron-is'
|
||||
import { readFile, unlink } from 'fs'
|
||||
import { extname, basename } from 'path'
|
||||
import { isEmpty, isEqual } from 'lodash'
|
||||
|
||||
import {
|
||||
@@ -16,6 +16,7 @@ import {
|
||||
fetchBtTrackerFromSource,
|
||||
reduceTrackerString
|
||||
} from '@shared/utils/tracker'
|
||||
import { showItemInFolder } from './utils'
|
||||
import logger from './core/Logger'
|
||||
import Context from './core/Context'
|
||||
import ConfigManager from './core/ConfigManager'
|
||||
@@ -694,7 +695,7 @@ export default class Application extends EventEmitter {
|
||||
|
||||
const sessionPath = this.context.get('session-path')
|
||||
setTimeout(() => {
|
||||
unlink(sessionPath, function (err) {
|
||||
unlink(sessionPath, (err) => {
|
||||
logger.info('[Motrix] Removed the download seesion file:', err)
|
||||
})
|
||||
|
||||
@@ -823,6 +824,17 @@ export default class Application extends EventEmitter {
|
||||
this.openExternal(url)
|
||||
})
|
||||
|
||||
this.on('application:reveal-in-folder', (data) => {
|
||||
const { gid, path } = data
|
||||
logger.info('[Motrix] application:reveal-in-folder===>', path)
|
||||
if (path) {
|
||||
showItemInFolder(path)
|
||||
}
|
||||
if (gid) {
|
||||
this.sendCommandToAll('application:show-task-detail', { gid })
|
||||
}
|
||||
})
|
||||
|
||||
this.on('help:official-website', () => {
|
||||
const url = 'https://motrix.app/'
|
||||
this.openExternal(url)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { EventEmitter } from 'events'
|
||||
import { EventEmitter } from 'node:events'
|
||||
import { app } from 'electron'
|
||||
import is from 'electron-is'
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ export default {
|
||||
'new-bt-task': 'application:new-bt-task',
|
||||
'pause-all-task': 'application:pause-all-task',
|
||||
'resume-all-task': 'application:resume-all-task',
|
||||
'reveal-in-folder': 'application:reveal-in-folder',
|
||||
'preferences': 'application:preferences',
|
||||
'about': 'application:about'
|
||||
}
|
||||
|
||||
@@ -3,14 +3,16 @@ import is from 'electron-is'
|
||||
import Store from 'electron-store'
|
||||
|
||||
import {
|
||||
getConfigBasePath,
|
||||
getDhtPath,
|
||||
getUserDownloadsPath,
|
||||
getMaxConnectionPerServer
|
||||
getMaxConnectionPerServer,
|
||||
getUserDownloadsPath
|
||||
} from '../utils/index'
|
||||
import {
|
||||
APP_RUN_MODE,
|
||||
APP_THEME,
|
||||
EMPTY_STRING,
|
||||
ENGINE_RPC_PORT,
|
||||
IP_VERSION,
|
||||
LOGIN_SETTING_OPTIONS,
|
||||
NGOSANG_TRACKERS_BEST_IP_URL_CDN,
|
||||
@@ -34,17 +36,15 @@ export default class ConfigManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* Some aria2 conf
|
||||
* Aria2 Configuration Priority
|
||||
* system.json > built-in aria2.conf
|
||||
* https://aria2.github.io/manual/en/html/aria2c.html
|
||||
*
|
||||
* Best bt trackers
|
||||
* @see https://github.com/ngosang/trackerslist
|
||||
*
|
||||
* @see https://github.com/XIU2/TrackersListCollection
|
||||
*/
|
||||
initSystemConfig () {
|
||||
this.systemConfig = new Store({
|
||||
name: 'system',
|
||||
cwd: getConfigBasePath(),
|
||||
/* eslint-disable quote-props */
|
||||
defaults: {
|
||||
'all-proxy': EMPTY_STRING,
|
||||
@@ -72,7 +72,7 @@ export default class ConfigManager {
|
||||
'no-proxy': EMPTY_STRING,
|
||||
'pause-metadata': false,
|
||||
'pause': true,
|
||||
'rpc-listen-port': 16800,
|
||||
'rpc-listen-port': ENGINE_RPC_PORT,
|
||||
'rpc-secret': EMPTY_STRING,
|
||||
'seed-ratio': 1,
|
||||
'seed-time': 60,
|
||||
@@ -87,6 +87,7 @@ export default class ConfigManager {
|
||||
initUserConfig () {
|
||||
this.userConfig = new Store({
|
||||
name: 'user',
|
||||
cwd: getConfigBasePath(),
|
||||
// Schema need electron-store upgrade to 3.x.x,
|
||||
// but it will cause the application build to fail.
|
||||
// schema: {
|
||||
|
||||
@@ -3,7 +3,6 @@ import {
|
||||
getEnginePath,
|
||||
getAria2BinPath,
|
||||
getAria2ConfPath,
|
||||
getLogPath,
|
||||
getSessionPath
|
||||
} from '../utils'
|
||||
|
||||
@@ -14,12 +13,17 @@ export default class Context {
|
||||
this.init()
|
||||
}
|
||||
|
||||
getLogPath () {
|
||||
const { path } = logger.transports.file.getFile()
|
||||
return path
|
||||
}
|
||||
|
||||
init () {
|
||||
// The key of Context cannot be the same as that of userConfig and systemConfig.
|
||||
this.context = {
|
||||
platform: platform,
|
||||
arch: arch,
|
||||
'log-path': getLogPath(),
|
||||
'log-path': this.getLogPath(),
|
||||
'session-path': getSessionPath(),
|
||||
'engine-path': getEnginePath(platform, arch),
|
||||
'aria2-bin-path': getAria2BinPath(platform, arch),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { spawn } from 'node:child_process'
|
||||
import { existsSync, writeFile, unlink } from 'node:fs'
|
||||
import is from 'electron-is'
|
||||
import { existsSync, writeFile, unlink } from 'fs'
|
||||
import { spawn } from 'child_process'
|
||||
|
||||
import logger from './Logger'
|
||||
import { getI18n } from '../ui/Locale'
|
||||
@@ -43,9 +43,9 @@ export default class Engine {
|
||||
const pid = this.instance.pid.toString()
|
||||
this.writePidFile(pidPath, pid)
|
||||
|
||||
this.instance.once('close', function () {
|
||||
this.instance.once('close', () => {
|
||||
try {
|
||||
unlink(pidPath, function (err) {
|
||||
unlink(pidPath, (err) => {
|
||||
if (err) {
|
||||
logger.warn(`[Motrix] Unlink engine process pid file failed: ${err}`)
|
||||
}
|
||||
@@ -56,11 +56,11 @@ export default class Engine {
|
||||
})
|
||||
|
||||
if (is.dev()) {
|
||||
this.instance.stdout.on('data', function (data) {
|
||||
this.instance.stdout.on('data', (data) => {
|
||||
logger.log('[Motrix] engine stdout===>', data.toString())
|
||||
})
|
||||
|
||||
this.instance.stderr.on('data', function (data) {
|
||||
this.instance.stderr.on('data', (data) => {
|
||||
logger.log('[Motrix] engine stderr===>', data.toString())
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,7 +1,16 @@
|
||||
import { join } from 'node:path'
|
||||
import is from 'electron-is'
|
||||
import logger from 'electron-log'
|
||||
|
||||
logger.transports.file.level = is.production() ? 'info' : 'silly'
|
||||
import { IS_PORTABLE, PORTABLE_EXECUTABLE_DIR } from '@shared/constants'
|
||||
|
||||
const level = is.production() ? 'info' : 'silly'
|
||||
logger.transports.file.level = level
|
||||
|
||||
if (IS_PORTABLE) {
|
||||
logger.transports.file.resolvePath = () => join(PORTABLE_EXECUTABLE_DIR, 'main.log')
|
||||
}
|
||||
|
||||
logger.info('[Motrix] Logger init')
|
||||
logger.warn('[Motrix] Logger init')
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { EventEmitter } from 'events'
|
||||
import { EventEmitter } from 'node:events'
|
||||
import { app } from 'electron'
|
||||
import is from 'electron-is'
|
||||
import { parse } from 'querystring'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { EventEmitter } from 'events'
|
||||
import { resolve } from 'path'
|
||||
import { EventEmitter } from 'node:events'
|
||||
import { resolve } from 'node:path'
|
||||
import { dialog } from 'electron'
|
||||
import is from 'electron-is'
|
||||
import { autoUpdater } from 'electron-updater'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import is from 'electron-is'
|
||||
import { EventEmitter } from 'events'
|
||||
import { EventEmitter } from 'node:events'
|
||||
import { app } from 'electron'
|
||||
|
||||
import { bytesToSize } from '@shared/utils'
|
||||
|
||||
@@ -5,20 +5,20 @@ const localeManager = new LocaleManager({
|
||||
resources
|
||||
})
|
||||
|
||||
export function getLocaleManager () {
|
||||
export const getLocaleManager = () => {
|
||||
return localeManager
|
||||
}
|
||||
|
||||
export function setupLocaleManager (locale) {
|
||||
export const setupLocaleManager = (locale) => {
|
||||
localeManager.changeLanguageByLocale(locale)
|
||||
|
||||
return localeManager
|
||||
}
|
||||
|
||||
export function getI18n () {
|
||||
export const getI18n = () => {
|
||||
return localeManager.getI18n()
|
||||
}
|
||||
|
||||
export function getI18nTranslator () {
|
||||
export const getI18nTranslator = () => {
|
||||
return localeManager.getI18n().t
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { EventEmitter } from 'events'
|
||||
import { EventEmitter } from 'node:events'
|
||||
import { Menu } from 'electron'
|
||||
|
||||
import keymap from '@shared/keymap'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { EventEmitter } from 'events'
|
||||
import { EventEmitter } from 'node:events'
|
||||
import { nativeTheme } from 'electron'
|
||||
|
||||
import { APP_THEME } from '@shared/constants'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { EventEmitter } from 'events'
|
||||
import { join } from 'path'
|
||||
import { EventEmitter } from 'node:events'
|
||||
import { join } from 'node:path'
|
||||
import { TouchBar, nativeImage } from 'electron'
|
||||
|
||||
import { handleCommand } from '../utils/menu'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { EventEmitter } from 'events'
|
||||
import { join } from 'path'
|
||||
import { EventEmitter } from 'node:events'
|
||||
import { join } from 'node:path'
|
||||
import { Tray, Menu, nativeImage } from 'electron'
|
||||
import is from 'electron-is'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { join } from 'path'
|
||||
import { EventEmitter } from 'events'
|
||||
import { join } from 'node:path'
|
||||
import { EventEmitter } from 'node:events'
|
||||
import { debounce } from 'lodash'
|
||||
import { app, shell, screen, BrowserWindow } from 'electron'
|
||||
import is from 'electron-is'
|
||||
@@ -168,6 +168,10 @@ export default class WindowManager extends EventEmitter {
|
||||
|
||||
destroyWindow (page) {
|
||||
const win = this.getWindow(page)
|
||||
if (!win) {
|
||||
return
|
||||
}
|
||||
|
||||
this.removeWindow(page)
|
||||
win.removeListener('closed')
|
||||
win.removeListener('move')
|
||||
|
||||
@@ -1,46 +1,54 @@
|
||||
import { app, nativeTheme } from 'electron'
|
||||
import { resolve } from 'node:path'
|
||||
import { access, constants, existsSync, lstatSync } from 'node:fs'
|
||||
import { app, nativeTheme, shell } from 'electron'
|
||||
import is from 'electron-is'
|
||||
import { resolve } from 'path'
|
||||
import { existsSync, lstatSync } from 'fs'
|
||||
|
||||
import {
|
||||
APP_THEME,
|
||||
ENGINE_MAX_CONNECTION_PER_SERVER,
|
||||
IP_VERSION
|
||||
IP_VERSION,
|
||||
IS_PORTABLE,
|
||||
PORTABLE_EXECUTABLE_DIR
|
||||
} from '@shared/constants'
|
||||
import { engineBinMap, engineArchMap } from '../configs/engine'
|
||||
import logger from '../core/Logger'
|
||||
|
||||
export function getLogPath () {
|
||||
export const getUserDataPath = () => {
|
||||
return IS_PORTABLE ? PORTABLE_EXECUTABLE_DIR : app.getPath('userData')
|
||||
}
|
||||
|
||||
export const getSystemLogPath = () => {
|
||||
return app.getPath('logs')
|
||||
}
|
||||
|
||||
export function getDhtPath (protocol) {
|
||||
const name = protocol === IP_VERSION.V6 ? 'dht6.dat' : 'dht.dat'
|
||||
return resolve(app.getPath('userData'), `./${name}`)
|
||||
}
|
||||
|
||||
export function getSessionPath () {
|
||||
return resolve(app.getPath('userData'), './download.session')
|
||||
}
|
||||
|
||||
export function getEnginePidPath () {
|
||||
return resolve(app.getPath('userData'), './engine.pid')
|
||||
}
|
||||
|
||||
export function getUserDataPath () {
|
||||
return app.getPath('userData')
|
||||
}
|
||||
|
||||
export function getUserDownloadsPath () {
|
||||
export const getUserDownloadsPath = () => {
|
||||
return app.getPath('downloads')
|
||||
}
|
||||
|
||||
export function getEngineBin (platform) {
|
||||
export const getConfigBasePath = () => {
|
||||
const path = getUserDataPath()
|
||||
return path
|
||||
}
|
||||
|
||||
export const getSessionPath = () => {
|
||||
return resolve(getUserDataPath(), './download.session')
|
||||
}
|
||||
|
||||
export const getEnginePidPath = () => {
|
||||
return resolve(getUserDataPath(), './engine.pid')
|
||||
}
|
||||
|
||||
export const getDhtPath = (protocol) => {
|
||||
const name = protocol === IP_VERSION.V6 ? 'dht6.dat' : 'dht.dat'
|
||||
return resolve(getUserDataPath(), `./${name}`)
|
||||
}
|
||||
|
||||
export const getEngineBin = (platform) => {
|
||||
const result = engineBinMap[platform] || ''
|
||||
return result
|
||||
}
|
||||
|
||||
export function getEngineArch (platform, arch) {
|
||||
export const getEngineArch = (platform, arch) => {
|
||||
if (!['darwin', 'win32', 'linux'].includes(platform)) {
|
||||
return ''
|
||||
}
|
||||
@@ -76,7 +84,7 @@ export const getAria2ConfPath = (platform, arch) => {
|
||||
return resolve(base, './aria2.conf')
|
||||
}
|
||||
|
||||
export function transformConfig (config) {
|
||||
export const transformConfig = (config) => {
|
||||
const result = []
|
||||
for (const [k, v] of Object.entries(config)) {
|
||||
if (v !== '') {
|
||||
@@ -86,7 +94,7 @@ export function transformConfig (config) {
|
||||
return result
|
||||
}
|
||||
|
||||
export function isRunningInDmg () {
|
||||
export const isRunningInDmg = () => {
|
||||
if (!is.macOS() || is.dev()) {
|
||||
return false
|
||||
}
|
||||
@@ -95,7 +103,7 @@ export function isRunningInDmg () {
|
||||
return result
|
||||
}
|
||||
|
||||
export function moveAppToApplicationsFolder (errorMsg = '') {
|
||||
export const moveAppToApplicationsFolder = (errorMsg = '') => {
|
||||
return new Promise((resolve, reject) => {
|
||||
try {
|
||||
const result = app.moveToApplicationsFolder()
|
||||
@@ -110,7 +118,7 @@ export function moveAppToApplicationsFolder (errorMsg = '') {
|
||||
})
|
||||
}
|
||||
|
||||
export function splitArgv (argv) {
|
||||
export const splitArgv = (argv) => {
|
||||
const args = []
|
||||
const extra = {}
|
||||
for (const arg of argv) {
|
||||
@@ -126,7 +134,7 @@ export function splitArgv (argv) {
|
||||
return { args, extra }
|
||||
}
|
||||
|
||||
export function parseArgvAsUrl (argv) {
|
||||
export const parseArgvAsUrl = (argv) => {
|
||||
const arg = argv[1]
|
||||
if (!arg) {
|
||||
return
|
||||
@@ -137,7 +145,7 @@ export function parseArgvAsUrl (argv) {
|
||||
}
|
||||
}
|
||||
|
||||
export function checkIsSupportedSchema (url = '') {
|
||||
export const checkIsSupportedSchema = (url = '') => {
|
||||
const str = url.toLowerCase()
|
||||
if (
|
||||
str.startsWith('ftp:') ||
|
||||
@@ -154,11 +162,11 @@ export function checkIsSupportedSchema (url = '') {
|
||||
}
|
||||
}
|
||||
|
||||
export function isDirectory (path) {
|
||||
export const isDirectory = (path) => {
|
||||
return existsSync(path) && lstatSync(path).isDirectory()
|
||||
}
|
||||
|
||||
export function parseArgvAsFile (argv) {
|
||||
export const parseArgvAsFile = (argv) => {
|
||||
let arg = argv[1]
|
||||
if (!arg || isDirectory(arg)) {
|
||||
return
|
||||
@@ -188,3 +196,19 @@ export const convertArrayBufferToBuffer = (arrayBuffer) => {
|
||||
}
|
||||
return buffer
|
||||
}
|
||||
|
||||
export const showItemInFolder = (fullPath) => {
|
||||
if (!fullPath) {
|
||||
return
|
||||
}
|
||||
|
||||
fullPath = resolve(fullPath)
|
||||
access(fullPath, constants.F_OK, (err) => {
|
||||
if (err) {
|
||||
logger.warn(`[Motrix] ${fullPath} ${err ? 'does not exist' : 'exists'}`)
|
||||
return
|
||||
}
|
||||
|
||||
shell.showItemInFolder(fullPath)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { parse } from 'querystring'
|
||||
|
||||
export function concat (template, submenu, submenuToAdd) {
|
||||
export const concat = (template, submenu, submenuToAdd) => {
|
||||
submenuToAdd.forEach(sub => {
|
||||
let relativeItem = null
|
||||
if (sub.position) {
|
||||
@@ -37,7 +37,7 @@ export function concat (template, submenu, submenuToAdd) {
|
||||
})
|
||||
}
|
||||
|
||||
export function merge (template, item) {
|
||||
export const merge = (template, item) => {
|
||||
if (item.id) {
|
||||
const matched = findById(template, item.id)
|
||||
if (matched) {
|
||||
@@ -73,7 +73,7 @@ function findById (template, id) {
|
||||
return null
|
||||
}
|
||||
|
||||
export function translateTemplate (template, keystrokesByCommand, i18n) {
|
||||
export const translateTemplate = (template, keystrokesByCommand, i18n) => {
|
||||
for (const i in template) {
|
||||
const item = template[i]
|
||||
if (item.command) {
|
||||
@@ -101,7 +101,7 @@ export function translateTemplate (template, keystrokesByCommand, i18n) {
|
||||
return template
|
||||
}
|
||||
|
||||
export function handleCommand (item) {
|
||||
export const handleCommand = (item) => {
|
||||
handleCommandBefore(item)
|
||||
|
||||
const args = item['command-arg']
|
||||
@@ -158,7 +158,7 @@ function acceleratorForCommand (command, keystrokesByCommand) {
|
||||
return null
|
||||
}
|
||||
|
||||
export function flattenMenuItems (menu) {
|
||||
export const flattenMenuItems = (menu) => {
|
||||
const flattenItems = {}
|
||||
menu.items.forEach(item => {
|
||||
if (item.id) {
|
||||
@@ -171,7 +171,7 @@ export function flattenMenuItems (menu) {
|
||||
return flattenItems
|
||||
}
|
||||
|
||||
export function updateStates (itemsById, visibleStates, enabledStates, checkedStates) {
|
||||
export const updateStates = (itemsById, visibleStates, enabledStates, checkedStates) => {
|
||||
if (visibleStates) {
|
||||
for (const command in visibleStates) {
|
||||
const item = itemsById[command]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { EventEmitter } from 'events'
|
||||
import { EventEmitter } from 'node:events'
|
||||
|
||||
export default class CommandManager extends EventEmitter {
|
||||
constructor () {
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import Icon from '@/components/Icons/Icon'
|
||||
|
||||
Icon.register({
|
||||
'document': {
|
||||
'width': 24,
|
||||
'height': 24,
|
||||
'raw': `<rect x="3" y="1" width="18" height="22"></rect>
|
||||
<line x1="15" y1="6" x2="17" y2="6"></line>
|
||||
<line x1="15" y1="10" x2="17" y2="10"></line>
|
||||
<line x1="7" y1="14" x2="17" y2="14"></line>
|
||||
<line x1="7" y1="18" x2="17" y2="18"></line>
|
||||
<rect x="7" y="6" width="4" height="4"></rect>`,
|
||||
'g': {
|
||||
'stroke': 'currentColor',
|
||||
'stroke-linecap': 'round',
|
||||
'stroke-linejoin': 'round',
|
||||
'stroke-width': '2',
|
||||
'fill': 'none'
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -226,7 +226,7 @@
|
||||
<el-input
|
||||
:show-password="hideRpcSecret"
|
||||
placeholder="RPC Secret"
|
||||
:maxlength="24"
|
||||
:maxlength="64"
|
||||
v-model="form.rpcSecret"
|
||||
>
|
||||
<i slot="append" @click.prevent="onRpcSecretDiceClick">
|
||||
@@ -643,7 +643,7 @@
|
||||
},
|
||||
onRpcSecretDiceClick () {
|
||||
this.hideRpcSecret = false
|
||||
const rpcSecret = randomize('Aa0', 12)
|
||||
const rpcSecret = randomize('Aa0', 16)
|
||||
this.form.rpcSecret = rpcSecret
|
||||
|
||||
setTimeout(() => {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
custom-class="tab-title-dialog add-task-dialog"
|
||||
width="67vw"
|
||||
:visible="visible"
|
||||
:top="dialogTop"
|
||||
:show-close="false"
|
||||
:before-close="beforeClose"
|
||||
@open="handleOpen"
|
||||
@@ -244,6 +245,9 @@
|
||||
}),
|
||||
taskType () {
|
||||
return this.type
|
||||
},
|
||||
dialogTop () {
|
||||
return this.showAdvanced ? '8vh' : '15vh'
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
@@ -65,6 +65,9 @@
|
||||
<el-button @click="toggleImageSelection()">
|
||||
<mo-icon name="image" width="12" height="12" />
|
||||
</el-button>
|
||||
<el-button @click="toggleDocumentSelection()">
|
||||
<mo-icon name="document" width="12" height="12" />
|
||||
</el-button>
|
||||
</el-button-group>
|
||||
</el-col>
|
||||
<el-col
|
||||
@@ -85,6 +88,7 @@
|
||||
import '@/components/Icons/video'
|
||||
import '@/components/Icons/audio'
|
||||
import '@/components/Icons/image'
|
||||
import '@/components/Icons/document'
|
||||
import {
|
||||
NONE_SELECTED_FILES,
|
||||
SELECTED_ALL_FILES
|
||||
@@ -92,9 +96,10 @@
|
||||
import {
|
||||
bytesToSize,
|
||||
calcProgress,
|
||||
filterVideoFiles,
|
||||
filterAudioFiles,
|
||||
filterDocumentFiles,
|
||||
filterImageFiles,
|
||||
filterVideoFiles,
|
||||
removeExtensionDot
|
||||
} from '@shared/utils'
|
||||
|
||||
@@ -192,6 +197,10 @@
|
||||
const filtered = filterImageFiles(this.files)
|
||||
this.toggleSelection(filtered)
|
||||
},
|
||||
toggleDocumentSelection () {
|
||||
const filtered = filterDocumentFiles(this.files)
|
||||
this.toggleSelection(filtered)
|
||||
},
|
||||
handleRowDbClick (row, column, event) {
|
||||
this.$refs.torrentTable.toggleRowSelection(row)
|
||||
},
|
||||
|
||||
@@ -6,6 +6,11 @@
|
||||
:label-width="formLabelWidth"
|
||||
v-if="task"
|
||||
>
|
||||
<el-form-item :label="`${$t('task.task-gid')}: `">
|
||||
<div class="form-static-value">
|
||||
{{ task.gid }}
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item :label="`${$t('task.task-name')}: `">
|
||||
<div class="form-static-value">
|
||||
{{ taskFullName }}
|
||||
|
||||
@@ -237,6 +237,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
.el-select-dropdown.is-multiple .el-select-dropdown__item.selected {
|
||||
background-color: #3d3d3d;
|
||||
color: $--color-primary;
|
||||
}
|
||||
|
||||
.el-upload-dragger {
|
||||
background-color: #2d2d2d;
|
||||
border-color: #606060;
|
||||
@@ -449,4 +454,13 @@
|
||||
border-color: $--dk-popover-border-color;
|
||||
}
|
||||
|
||||
.el-tag.el-tag--info.el-tag--light {
|
||||
background-color: #5b5b5b;
|
||||
border-color: #606060;
|
||||
color: #e6e6e6;
|
||||
}
|
||||
|
||||
.el-tag__close.el-icon-close {
|
||||
color: #2d2d2d;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,6 +160,14 @@ const selectAllTask = () => {
|
||||
store.dispatch('task/selectAllTask')
|
||||
}
|
||||
|
||||
const showTaskDetail = (payload = {}) => {
|
||||
const { gid } = payload
|
||||
navigateTaskList()
|
||||
if (gid) {
|
||||
store.dispatch('task/showTaskDetailByGid', gid)
|
||||
}
|
||||
}
|
||||
|
||||
const fetchPreference = () => {
|
||||
store.dispatch('preference/fetchPreference')
|
||||
}
|
||||
@@ -179,6 +187,7 @@ commands.register('application:move-task-down', moveTaskDown)
|
||||
commands.register('application:pause-all-task', pauseAllTask)
|
||||
commands.register('application:resume-all-task', resumeAllTask)
|
||||
commands.register('application:select-all-task', selectAllTask)
|
||||
commands.register('application:show-task-detail', showTaskDetail)
|
||||
|
||||
commands.register('application:update-preference-config', fetchPreference)
|
||||
commands.register('application:update-system-theme', updateSystemTheme)
|
||||
|
||||
@@ -88,6 +88,14 @@ const actions = {
|
||||
dispatch('updateCurrentTaskItem', data)
|
||||
})
|
||||
},
|
||||
showTaskDetailByGid ({ commit, dispatch }, gid) {
|
||||
api.fetchTaskItem({ gid })
|
||||
.then((task) => {
|
||||
dispatch('updateCurrentTaskItem', task)
|
||||
commit('UPDATE_CURRENT_TASK_GID', task.gid)
|
||||
commit('CHANGE_TASK_DETAIL_VISIBLE', true)
|
||||
})
|
||||
},
|
||||
showTaskDetail ({ commit, dispatch }, task) {
|
||||
dispatch('updateCurrentTaskItem', task)
|
||||
commit('UPDATE_CURRENT_TASK_GID', task.gid)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { access, constants } from 'node:fs'
|
||||
import { resolve } from 'node:path'
|
||||
import { shell, nativeTheme } from '@electron/remote'
|
||||
import { access, constants } from 'fs'
|
||||
import { resolve } from 'path'
|
||||
import { Message } from 'element-ui'
|
||||
|
||||
import {
|
||||
@@ -9,14 +9,15 @@ import {
|
||||
} from '@shared/utils'
|
||||
import { APP_THEME, TASK_STATUS } from '@shared/constants'
|
||||
|
||||
export function showItemInFolder (fullPath, { errorMsg }) {
|
||||
export const showItemInFolder = (fullPath, { errorMsg }) => {
|
||||
if (!fullPath) {
|
||||
return
|
||||
}
|
||||
|
||||
fullPath = resolve(fullPath)
|
||||
access(fullPath, constants.F_OK, (err) => {
|
||||
console.log(`[Motrix] ${fullPath} ${err ? 'does not exist' : 'exists'}`)
|
||||
if (err) {
|
||||
console.warn(`[Motrix] ${fullPath} ${err ? 'does not exist' : 'exists'}`)
|
||||
if (err && errorMsg) {
|
||||
Message.error(errorMsg)
|
||||
return
|
||||
}
|
||||
@@ -34,7 +35,7 @@ export const openItem = async (fullPath) => {
|
||||
return result
|
||||
}
|
||||
|
||||
export function getTaskFullPath (task) {
|
||||
export const getTaskFullPath = (task) => {
|
||||
const { dir, files, bittorrent } = task
|
||||
let result = resolve(dir)
|
||||
|
||||
@@ -108,7 +109,7 @@ export const moveTaskFilesToTrash = (task) => {
|
||||
return deleteResult1 && deleteResult2
|
||||
}
|
||||
|
||||
export function getSystemTheme () {
|
||||
export const getSystemTheme = () => {
|
||||
return nativeTheme.shouldUseDarkColors ? APP_THEME.DARK : APP_THEME.LIGHT
|
||||
}
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ export class Aria2 extends JSONRPCClient {
|
||||
defaultOptions = Object.assign({}, JSONRPCClient.defaultOptions, {
|
||||
secure: false,
|
||||
host: 'localhost',
|
||||
port: 6800,
|
||||
port: 16800,
|
||||
secret: '',
|
||||
path: '/jsonrpc'
|
||||
})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict'
|
||||
|
||||
import { EventEmitter } from 'events'
|
||||
import { EventEmitter } from 'node:events'
|
||||
import _fetch from 'node-fetch'
|
||||
import _WebSocket from 'ws'
|
||||
import { JSONRPCError } from './JSONRPCError'
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
export const EMPTY_STRING = ''
|
||||
export const PORTABLE_EXECUTABLE_DIR = process.env.PORTABLE_EXECUTABLE_DIR
|
||||
export const IS_PORTABLE = PORTABLE_EXECUTABLE_DIR && PORTABLE_EXECUTABLE_DIR !== EMPTY_STRING
|
||||
|
||||
export const APP_THEME = {
|
||||
AUTO: 'auto',
|
||||
@@ -227,7 +229,9 @@ export const IMAGE_SUFFIXES = [
|
||||
'.ai',
|
||||
'.bmp',
|
||||
'.eps',
|
||||
'.fig',
|
||||
'.gif',
|
||||
'.heic',
|
||||
'.icn',
|
||||
'.ico',
|
||||
'.jpeg',
|
||||
@@ -241,6 +245,7 @@ export const IMAGE_SUFFIXES = [
|
||||
'.webp',
|
||||
'.xd'
|
||||
]
|
||||
|
||||
export const AUDIO_SUFFIXES = [
|
||||
'.aac',
|
||||
'.ape',
|
||||
@@ -252,6 +257,7 @@ export const AUDIO_SUFFIXES = [
|
||||
'.wav',
|
||||
'.wma'
|
||||
]
|
||||
|
||||
export const VIDEO_SUFFIXES = [
|
||||
'.avi',
|
||||
'.m4v',
|
||||
@@ -273,3 +279,21 @@ export const SUB_SUFFIXES = [
|
||||
'.sst',
|
||||
'.sub'
|
||||
]
|
||||
|
||||
export const DOCUMENT_SUFFIXES = [
|
||||
'.azw3',
|
||||
'.csv',
|
||||
'.doc',
|
||||
'.docx',
|
||||
'.epub',
|
||||
'.key',
|
||||
'.mobi',
|
||||
'.numbers',
|
||||
'.pages',
|
||||
'.pdf',
|
||||
'.ppt',
|
||||
'.pptx',
|
||||
'.txt',
|
||||
'.xsl',
|
||||
'.xslx'
|
||||
]
|
||||
|
||||
@@ -17,6 +17,7 @@ export default {
|
||||
'file-completed-size': 'تم التنزيل',
|
||||
'selected-files-sum': 'الملف المختار: {{selectedFilesCount}} ملف, الحجم الكلي {{selectedFilesTotalSize}}',
|
||||
'select-at-least-one': 'الرجاء تحديد ملف واحد على الأقل',
|
||||
'task-gid': 'GID',
|
||||
'task-name': 'اسم التحميل',
|
||||
'task-out': 'إعادة تسمية',
|
||||
'task-out-tips': 'اختياري',
|
||||
|
||||
@@ -17,6 +17,7 @@ export default {
|
||||
'file-completed-size': 'Изтеглено',
|
||||
'selected-files-sum': 'избрано: {{selectedFilesCount}} файлове, общ размер {{selectedFilesTotalSize}}',
|
||||
'select-at-least-one': 'Моля, изберете поне един файл',
|
||||
'task-gid': 'GID',
|
||||
'task-name':'Име на изтегляне',
|
||||
'task-out': 'Преименуване',
|
||||
'task-out-tips':'незадължителен',
|
||||
|
||||
@@ -17,6 +17,7 @@ export default {
|
||||
'file-completed-size': 'Descarregat',
|
||||
'selected-files-sum': 'Seleccionat: {{selectedFilesCount}} arxius, mida total: {{selectedFilesTotalSize}}',
|
||||
'select-at-least-one': 'Seleccioneu com a mínim un fitxer',
|
||||
'task-gid': 'GID',
|
||||
'task-name': 'Nom de la tasca',
|
||||
'task-out': 'Canviar nom',
|
||||
'task-out-tips': 'Opcional',
|
||||
|
||||
@@ -17,6 +17,7 @@ export default {
|
||||
'file-completed-size': 'Heruntergeladen',
|
||||
'selected-files-sum': 'Ausgewählt: {{selectedFilesCount}} Dateien, insgesamt {{selectedFilesTotalSize}}',
|
||||
'select-at-least-one': 'Bitte wählen Sie mindestens eine Datei aus',
|
||||
'task-gid': 'GID',
|
||||
'task-name': 'Aufgaben Name',
|
||||
'task-out': 'Dateiname',
|
||||
'task-out-tips': 'Optional',
|
||||
|
||||
@@ -17,6 +17,7 @@ export default {
|
||||
'file-completed-size': 'Έγινε λήψη',
|
||||
'selected-files-sum': 'Επιλεγμένα: {{selectedFilesCount}} αρχεία, συνολικό μέγεθος {{selectedFilesTotalSize}}',
|
||||
'select-at-least-one': 'Επιλέξτε τουλάχιστον ένα αρχείο',
|
||||
'task-gid': 'GID',
|
||||
'task-name': 'Όνομα εργασίας',
|
||||
'task-out': 'Άλλο Όνομα',
|
||||
'task-out-tips': 'Προαιρετικό',
|
||||
|
||||
@@ -17,6 +17,7 @@ export default {
|
||||
'file-completed-size': 'Completed',
|
||||
'selected-files-sum': 'Selected: {{selectedFilesCount}} files, total size {{selectedFilesTotalSize}}',
|
||||
'select-at-least-one': 'Please select at least one file',
|
||||
'task-gid': 'GID',
|
||||
'task-name': 'Task Name',
|
||||
'task-out': 'Rename',
|
||||
'task-out-tips': 'Optional',
|
||||
|
||||
@@ -17,6 +17,7 @@ export default {
|
||||
'file-completed-size': 'Terminado',
|
||||
'selected-files-sum': 'Seleccionado: {{selectedFilesCount}} archivos, tamaño total {{selectedFilesTotalSize}}',
|
||||
'select-at-least-one': 'Seleccione al menos un archivo',
|
||||
'task-gid': 'GID',
|
||||
'task-name': 'Nombre de la tarea',
|
||||
'task-out': 'Renombrar',
|
||||
'task-out-tips': 'Opcional',
|
||||
|
||||
@@ -17,6 +17,7 @@ export default {
|
||||
'file-completed-size': 'تکمیل شده',
|
||||
'selected-files-sum': 'گزیده: {{selectedFilesCount}} پرونده، اندازه کل {{selectedFilesTotalSize}}',
|
||||
'select-at-least-one': 'لطفاً حداقل یک پرونده را انتخاب کنید',
|
||||
'task-gid': 'GID',
|
||||
'task-name': 'نام وظیفه',
|
||||
'task-out': 'تغییرنام',
|
||||
'task-out-tips': 'اختیاری',
|
||||
|
||||
@@ -17,6 +17,7 @@ export default {
|
||||
'file-completed-size': 'Téléchargé',
|
||||
'selected-files-sum': 'Sélectionné: {{selectedFilesCount}} fichiers, total {{selectedFilesTotalSize}}',
|
||||
'select-at-least-one': 'Veuillez sélectionner au moins un fichier',
|
||||
'task-gid': 'GID',
|
||||
'task-name': 'Nom de la tâche',
|
||||
'task-out': 'Renommer',
|
||||
'task-out-tips': 'Optionel',
|
||||
|
||||
@@ -17,6 +17,7 @@ export default {
|
||||
'file-completed-size': 'Letöltött',
|
||||
'selected-files-sum': 'Kijelölve: {{selectedFilesCount}} fájl, teljes méret {{selectedFilesTotalSize}}',
|
||||
'select-at-least-one': 'Válasszon legalább egy fájlt',
|
||||
'task-gid': 'GID',
|
||||
'task-name': 'Feladat név',
|
||||
'task-out': 'Átnevezés',
|
||||
'task-out-tips': 'Opcionális',
|
||||
|
||||
@@ -17,6 +17,7 @@ export default {
|
||||
'file-completed-size': 'Ukuran domplet',
|
||||
'selected-files-sum': 'Terpilih: {{selectedFilesCount}} berkas, total ukuran {{selectedFilesTotalSize}}',
|
||||
'select-at-least-one': 'Pilih setidaknya satu file',
|
||||
'task-gid': 'GID',
|
||||
'task-name': 'Nama Tugas',
|
||||
'task-out': 'Ubah Nama',
|
||||
'task-out-tips': 'Opsional',
|
||||
|
||||
@@ -112,7 +112,7 @@ export const availableLanguages = [
|
||||
}
|
||||
]
|
||||
|
||||
function checkLngIsAvailable (locale) {
|
||||
const checkLngIsAvailable = (locale) => {
|
||||
return availableLanguages.some(lng => lng.value === locale)
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ function checkLngIsAvailable (locale) {
|
||||
* pt, pt-BR, pt-PT
|
||||
* zh, zh-CN, zh-HK, zh-TW
|
||||
*/
|
||||
export function getLanguage (locale = 'en-US') {
|
||||
export const getLanguage = (locale = 'en-US') => {
|
||||
if (checkLngIsAvailable(locale)) {
|
||||
return locale
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ export default {
|
||||
'file-completed-size': 'Completato',
|
||||
'selected-files-sum': 'Selezionati: {{selectedFilesCount}} files, dimensione totale {{selectedFilesTotalSize}}',
|
||||
'select-at-least-one': 'Seleziona almeno un file',
|
||||
'task-gid': 'GID',
|
||||
'task-name': 'Nome attività',
|
||||
'task-out': 'Rinomina',
|
||||
'task-out-tips': '(opzionale)',
|
||||
|
||||
@@ -17,6 +17,7 @@ export default {
|
||||
'file-completed-size': '完成サイズ',
|
||||
'selected-files-sum': '選択済み:{{selectedFilesCount}}ファイル、合計{{selectedFilesTotalSize}}',
|
||||
'select-at-least-one': '少なくとも1つのファイルを選択してください',
|
||||
'task-gid': 'GID',
|
||||
'task-name': 'タスク名',
|
||||
'task-out': '名前を変更',
|
||||
'task-out-tips': 'オプション',
|
||||
|
||||
@@ -17,6 +17,7 @@ export default {
|
||||
'file-completed-size': '전체 크기',
|
||||
'selected-files-sum': '파일 {{selectedFilesCount}}개 선택됨, 총 {{selectedFilesTotalSize}}',
|
||||
'select-at-least-one': '하나 이상의 파일을 선택하십시오',
|
||||
'task-gid': 'GID',
|
||||
'task-name': '작업 이름',
|
||||
'task-out': '이름 변경',
|
||||
'task-out-tips': '선택',
|
||||
|
||||
@@ -17,6 +17,7 @@ export default {
|
||||
'file-completed-size': 'Fullført',
|
||||
'selected-files-sum': 'Valgt: {{selectedFilesCount}} filer, total størrelse {{selectedFilesTotalSize}}',
|
||||
'select-at-least-one': 'Velg minst én fil',
|
||||
'task-gid': 'GID',
|
||||
'task-name': 'Oppgavenavn',
|
||||
'task-out': 'Gi nytt navn',
|
||||
'task-out-tips': 'Valgfri',
|
||||
|
||||
@@ -17,6 +17,7 @@ export default {
|
||||
'file-completed-size': 'Gedownload',
|
||||
'selected-files-sum': 'Geselecteerd: {{selectedFilesCount}} bestanden, totale grootte {{selectedFilesTotalSize}}',
|
||||
'select-at-least-one': 'Kies a.u.b. ten minste 1 bestand',
|
||||
'task-gid': 'GID',
|
||||
'task-name': 'Taak naam',
|
||||
'task-out': 'Hernoemen',
|
||||
'task-out-tips': 'Optioneel',
|
||||
|
||||
@@ -17,6 +17,7 @@ export default {
|
||||
'file-completed-size': 'Pobrano',
|
||||
'selected-files-sum': 'Wybrano: {{selectedFilesCount}} plików, Wspólny rozmiar {{selectedFilesTotalSize}}',
|
||||
'select-at-least-one': 'Wybierz co najmniej jeden plik',
|
||||
'task-gid': 'GID',
|
||||
'task-name': 'Nazwa zadania',
|
||||
'task-out': 'Zmień nazwę',
|
||||
'task-out-tips': 'Opcjonalne',
|
||||
|
||||
@@ -17,6 +17,7 @@ export default {
|
||||
'file-completed-size': 'Baixado',
|
||||
'selected-files-sum': 'Selecionado: {{selectedFilesCount}} arquivos, total {{selectedFilesTotalSize}}',
|
||||
'select-at-least-one': 'Selecione pelo menos um arquivo',
|
||||
'task-gid': 'GID',
|
||||
'task-name': 'Nome da Tarefa',
|
||||
'task-out': 'Renomear',
|
||||
'task-out-tips': 'Opcional',
|
||||
|
||||
@@ -17,6 +17,7 @@ export default {
|
||||
'file-completed-size': 'Descărcat',
|
||||
'selected-files-sum': 'Selectate: {{selectedFilesCount}} fișiere, dimensiune totală {{selectedFilesTotalSize}}',
|
||||
'select-at-least-one': 'Vă rugăm să selectați cel puțin un fișier',
|
||||
'task-gid': 'GID',
|
||||
'task-name': 'Nume sarcină',
|
||||
'task-out': 'Redenumeşte',
|
||||
'task-out-tips': 'Opțional',
|
||||
|
||||
@@ -17,6 +17,7 @@ export default {
|
||||
'file-completed-size': 'Завершенный',
|
||||
'selected-files-sum': 'Выбрано: {{selectedFilesCount}} файлов, общий размер {{selectedFilesTotalSize}}',
|
||||
'select-at-least-one': 'Пожалуйста, выберите хотя бы один файл',
|
||||
'task-gid': 'GID',
|
||||
'task-name': 'Имя загрузки',
|
||||
'task-out': 'Переименовать',
|
||||
'task-out-tips': 'Необязательный',
|
||||
|
||||
@@ -17,6 +17,7 @@ export default {
|
||||
'file-completed-size': 'สำเร็จ',
|
||||
'selected-files-sum': 'เลือกแล้ว: {{selectedFilesCount}} ไฟล์, ขนามรวม {{selectedFilesTotalSize}}',
|
||||
'select-at-least-one': 'โปรดเลือกอย่างน้อยหนึ่งไฟล์',
|
||||
'task-gid': 'GID',
|
||||
'task-name': 'ชื่องาน',
|
||||
'task-out': 'เปลี่ยนชื่อ',
|
||||
'task-out-tips': 'ไม่จำเป็น',
|
||||
|
||||
@@ -17,6 +17,7 @@ export default {
|
||||
'file-completed-size': 'İndirildi',
|
||||
'selected-files-sum': 'Seçildi: {{selectedFilesCount}} dosya sayısı, total {{selectedFilesTotalSize}}',
|
||||
'select-at-least-one': 'Lütfen en az bir dosya seçin',
|
||||
'task-gid': 'GID',
|
||||
'task-name': 'Görev Adı',
|
||||
'task-out': 'Dosya Adı',
|
||||
'task-out-tips': 'Opsiyonel',
|
||||
|
||||
@@ -17,6 +17,7 @@ export default {
|
||||
'file-completed-size': 'Завершений',
|
||||
'selected-files-sum': 'Обрано: {{selectedFilesCount}} файлів, загальний розмір {{selectedFilesTotalSize}}',
|
||||
'select-at-least-one': 'Виберіть принаймні один файл',
|
||||
'task-gid': 'GID',
|
||||
'task-name': 'Ім\'я завдання',
|
||||
'task-out': 'Перейменувати',
|
||||
'task-out-tips': 'Необов\'язковий',
|
||||
|
||||
@@ -17,6 +17,7 @@ export default {
|
||||
'file-completed-size': 'Đã hoàn thành',
|
||||
'selected-files-sum': 'Đã chọn: {{selectedFilesCount}} tập tin, tổng kích thước {{selectedFilesTotalSize}}',
|
||||
'select-at-least-one': 'Vui lòng chọn ít nhất một tệp',
|
||||
'task-gid': 'GID',
|
||||
'task-name': 'Tên tác vụ',
|
||||
'task-out': 'Đổi tên',
|
||||
'task-out-tips': 'Không bắt buộc',
|
||||
|
||||
@@ -17,6 +17,7 @@ export default {
|
||||
'file-completed-size': '已完成',
|
||||
'selected-files-sum': '已选:{{selectedFilesCount}}个文件,共 {{selectedFilesTotalSize}}',
|
||||
'select-at-least-one': '请选择至少一个文件',
|
||||
'task-gid': 'GID',
|
||||
'task-name': '任务名称',
|
||||
'task-out': '重命名',
|
||||
'task-out-tips': '选填',
|
||||
|
||||
@@ -17,6 +17,7 @@ export default {
|
||||
'file-completed-size': '已下載',
|
||||
'selected-files-sum': '已選取:{{selectedFilesCount}}個檔案,總計 {{selectedFilesTotalSize}}',
|
||||
'select-at-least-one': '請選擇至少一個檔案',
|
||||
'task-gid': 'GID',
|
||||
'task-name': '任務名稱',
|
||||
'task-out': '重新命名',
|
||||
'task-out-tips': '選填',
|
||||
|
||||
@@ -28,10 +28,11 @@ import {
|
||||
SUB_SUFFIXES,
|
||||
UNKNOWN_PEERID,
|
||||
SUPPORT_RTL_LOCALES,
|
||||
UNKNOWN_PEERID_NAME
|
||||
UNKNOWN_PEERID_NAME,
|
||||
DOCUMENT_SUFFIXES
|
||||
} from '@shared/constants'
|
||||
|
||||
export function bytesToSize (bytes, precision = 1) {
|
||||
export const bytesToSize = (bytes, precision = 1) => {
|
||||
const b = parseInt(bytes, 10)
|
||||
const sizes = ['B', 'KB', 'MB', 'GB', 'TB']
|
||||
if (b === 0) { return '0 KB' }
|
||||
@@ -55,7 +56,7 @@ export const extractSpeedUnit = (speed = '') => {
|
||||
return match[2]
|
||||
}
|
||||
|
||||
export function bitfieldToPercent (text) {
|
||||
export const bitfieldToPercent = (text) => {
|
||||
const len = text.length - 1
|
||||
let p
|
||||
let one = 0
|
||||
@@ -69,7 +70,7 @@ export function bitfieldToPercent (text) {
|
||||
return Math.floor(one / (4 * len) * 100).toString()
|
||||
}
|
||||
|
||||
export function bitfieldToGraphic (text) {
|
||||
export const bitfieldToGraphic = (text) => {
|
||||
const len = text.length
|
||||
let result = ''
|
||||
for (let i = 0; i < len; i++) {
|
||||
@@ -78,7 +79,7 @@ export function bitfieldToGraphic (text) {
|
||||
return result
|
||||
}
|
||||
|
||||
export function peerIdParser (str) {
|
||||
export const peerIdParser = (str) => {
|
||||
if (!str || str === UNKNOWN_PEERID) {
|
||||
return UNKNOWN_PEERID_NAME
|
||||
}
|
||||
@@ -101,7 +102,7 @@ export function peerIdParser (str) {
|
||||
return result
|
||||
}
|
||||
|
||||
export function calcProgress (totalLength, completedLength, decimal = 2) {
|
||||
export const calcProgress = (totalLength, completedLength, decimal = 2) => {
|
||||
const total = parseInt(totalLength, 10)
|
||||
const completed = parseInt(completedLength, 10)
|
||||
if (total === 0 || completed === 0) {
|
||||
@@ -112,7 +113,7 @@ export function calcProgress (totalLength, completedLength, decimal = 2) {
|
||||
return result
|
||||
}
|
||||
|
||||
export function calcRatio (totalLength, uploadLength) {
|
||||
export const calcRatio = (totalLength, uploadLength) => {
|
||||
const total = parseInt(totalLength, 10)
|
||||
const upload = parseInt(uploadLength, 10)
|
||||
if (total === 0 || upload === 0) {
|
||||
@@ -124,7 +125,7 @@ export function calcRatio (totalLength, uploadLength) {
|
||||
return result
|
||||
}
|
||||
|
||||
export function timeRemaining (totalLength, completedLength, downloadSpeed) {
|
||||
export const timeRemaining = (totalLength, completedLength, downloadSpeed) => {
|
||||
const remainingLength = totalLength - completedLength
|
||||
return Math.ceil(remainingLength / downloadSpeed)
|
||||
}
|
||||
@@ -142,7 +143,7 @@ export function timeRemaining (totalLength, completedLength, downloadSpeed) {
|
||||
* second: 's'
|
||||
* }
|
||||
*/
|
||||
export function timeFormat (seconds, { prefix = '', suffix = '', i18n }) {
|
||||
export const timeFormat = (seconds, { prefix = '', suffix = '', i18n }) => {
|
||||
let result = ''
|
||||
let hours = ''
|
||||
let minutes = ''
|
||||
@@ -174,7 +175,7 @@ export function timeFormat (seconds, { prefix = '', suffix = '', i18n }) {
|
||||
return result ? `${prefix} ${result} ${suffix}` : result
|
||||
}
|
||||
|
||||
export function localeDateTimeFormat (timestamp, locale) {
|
||||
export const localeDateTimeFormat = (timestamp, locale) => {
|
||||
if (!timestamp) {
|
||||
return ''
|
||||
}
|
||||
@@ -193,7 +194,7 @@ export function localeDateTimeFormat (timestamp, locale) {
|
||||
})
|
||||
}
|
||||
|
||||
export function ellipsis (str = '', maxLen = 64) {
|
||||
export const ellipsis = (str = '', maxLen = 64) => {
|
||||
const len = str.length
|
||||
let result = str
|
||||
if (len < maxLen) {
|
||||
@@ -207,7 +208,7 @@ export function ellipsis (str = '', maxLen = 64) {
|
||||
return result
|
||||
}
|
||||
|
||||
export function getFileSelection (files = []) {
|
||||
export const getFileSelection = (files = []) => {
|
||||
console.log('getFileSelection===>', files)
|
||||
const selectedFiles = files.filter((file) => file.selected)
|
||||
if (files.length === 0 || selectedFiles.length === 0) {
|
||||
@@ -226,7 +227,7 @@ export function getFileSelection (files = []) {
|
||||
return result
|
||||
}
|
||||
|
||||
export function getTaskName (task, options = {}) {
|
||||
export const getTaskName = (task, options = {}) => {
|
||||
const o = {
|
||||
defaultName: '',
|
||||
maxLen: 64, // -1: No limit length
|
||||
@@ -251,7 +252,7 @@ export function getTaskName (task, options = {}) {
|
||||
return result
|
||||
}
|
||||
|
||||
export function getFileNameFromFile (file) {
|
||||
export const getFileNameFromFile = (file) => {
|
||||
if (!file) {
|
||||
return ''
|
||||
}
|
||||
@@ -270,17 +271,17 @@ export function getFileNameFromFile (file) {
|
||||
return path.substring(index + 1)
|
||||
}
|
||||
|
||||
export function isMagnetTask (task) {
|
||||
export const isMagnetTask = (task) => {
|
||||
const { bittorrent } = task
|
||||
return bittorrent && !bittorrent.info
|
||||
}
|
||||
|
||||
export function checkTaskIsSeeder (task) {
|
||||
export const checkTaskIsSeeder = (task) => {
|
||||
const { bittorrent, seeder } = task
|
||||
return !!bittorrent && seeder === 'true'
|
||||
}
|
||||
|
||||
export function getTaskUri (task, withTracker = false) {
|
||||
export const getTaskUri = (task, withTracker = false) => {
|
||||
const { files } = task
|
||||
let result = ''
|
||||
if (checkTaskIsBT(task)) {
|
||||
@@ -296,7 +297,7 @@ export function getTaskUri (task, withTracker = false) {
|
||||
return result
|
||||
}
|
||||
|
||||
export function buildMagnetLink (task, withTracker = false, btTracker = []) {
|
||||
export const buildMagnetLink = (task, withTracker = false, btTracker = []) => {
|
||||
const { bittorrent, infoHash } = task
|
||||
const { info } = bittorrent
|
||||
|
||||
@@ -319,7 +320,7 @@ export function buildMagnetLink (task, withTracker = false, btTracker = []) {
|
||||
return result
|
||||
}
|
||||
|
||||
export function checkTaskTitleIsEmpty (task) {
|
||||
export const checkTaskTitleIsEmpty = (task) => {
|
||||
const { files, bittorrent } = task
|
||||
const [file] = files
|
||||
const { path } = file
|
||||
@@ -330,17 +331,17 @@ export function checkTaskTitleIsEmpty (task) {
|
||||
return result === ''
|
||||
}
|
||||
|
||||
export function checkTaskIsBT (task = {}) {
|
||||
export const checkTaskIsBT = (task = {}) => {
|
||||
const { bittorrent } = task
|
||||
return !!bittorrent
|
||||
}
|
||||
|
||||
export function isTorrent (file) {
|
||||
export const isTorrent = (file) => {
|
||||
const { name, type } = file
|
||||
return name.endsWith('.torrent') || type === 'application/x-bittorrent'
|
||||
}
|
||||
|
||||
export function getAsBase64 (file, callback) {
|
||||
export const getAsBase64 = (file, callback) => {
|
||||
const reader = new FileReader()
|
||||
reader.addEventListener('load', () => {
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsDataURL
|
||||
@@ -350,7 +351,7 @@ export function getAsBase64 (file, callback) {
|
||||
reader.readAsDataURL(file)
|
||||
}
|
||||
|
||||
export function mergeTaskResult (response = []) {
|
||||
export const mergeTaskResult = (response = []) => {
|
||||
let result = []
|
||||
for (const res of response) {
|
||||
result = result.concat(...res)
|
||||
@@ -358,7 +359,7 @@ export function mergeTaskResult (response = []) {
|
||||
return result
|
||||
}
|
||||
|
||||
export function changeKeysCase (obj, caseConverter) {
|
||||
export const changeKeysCase = (obj, caseConverter) => {
|
||||
const result = {}
|
||||
if (isEmpty(obj) || !isFunction(caseConverter)) {
|
||||
return result
|
||||
@@ -372,19 +373,19 @@ export function changeKeysCase (obj, caseConverter) {
|
||||
return result
|
||||
}
|
||||
|
||||
export function changeKeysToCamelCase (obj = {}) {
|
||||
export const changeKeysToCamelCase = (obj = {}) => {
|
||||
return changeKeysCase(obj, camelCase)
|
||||
}
|
||||
|
||||
export function changeKeysToKebabCase (obj = {}) {
|
||||
export const changeKeysToKebabCase = (obj = {}) => {
|
||||
return changeKeysCase(obj, kebabCase)
|
||||
}
|
||||
|
||||
export function validateNumber (n) {
|
||||
export const validateNumber = (n) => {
|
||||
return !isNaN(parseFloat(n)) && isFinite(n) && Number(n) === n
|
||||
}
|
||||
|
||||
export function fixValue (obj = {}) {
|
||||
export const fixValue = (obj = {}) => {
|
||||
const result = {}
|
||||
for (const [k, v] of Object.entries(obj)) {
|
||||
if (v === 'true') {
|
||||
@@ -400,7 +401,7 @@ export function fixValue (obj = {}) {
|
||||
return result
|
||||
}
|
||||
|
||||
export function separateConfig (options) {
|
||||
export const separateConfig = (options) => {
|
||||
// user
|
||||
const user = {}
|
||||
// system
|
||||
@@ -422,13 +423,14 @@ export function separateConfig (options) {
|
||||
}
|
||||
}
|
||||
|
||||
export function compactUndefined (arr = []) {
|
||||
export const compactUndefined = (arr = []) => {
|
||||
return arr.filter((item) => {
|
||||
return item !== undefined
|
||||
})
|
||||
}
|
||||
|
||||
export function splitTextRows (text = '') {
|
||||
export const splitTextRows = (text = '') => {
|
||||
text = `${text}`
|
||||
let result = text
|
||||
.replace(/(?:\\\r\\\n|\\\r|\\\n)/g, ' ')
|
||||
.replace(/(?:\r\n|\r|\n)/g, '\n')
|
||||
@@ -437,38 +439,45 @@ export function splitTextRows (text = '') {
|
||||
return result
|
||||
}
|
||||
|
||||
export function convertCommaToLine (text = '') {
|
||||
export const convertCommaToLine = (text = '') => {
|
||||
text = `${text}`
|
||||
let arr = text.split(',')
|
||||
arr = arr.map((row) => row.trim())
|
||||
const result = arr.join('\n').trim()
|
||||
return result
|
||||
}
|
||||
|
||||
export function convertLineToComma (text = '') {
|
||||
export const convertLineToComma = (text = '') => {
|
||||
const result = text.trim().replace(/(?:\r\n|\r|\n)/g, ',')
|
||||
return result
|
||||
}
|
||||
|
||||
export function filterVideoFiles (files = []) {
|
||||
export const filterVideoFiles = (files = []) => {
|
||||
const suffix = [...VIDEO_SUFFIXES, ...SUB_SUFFIXES]
|
||||
return files.filter((item) => {
|
||||
return suffix.includes(item.extension)
|
||||
})
|
||||
}
|
||||
|
||||
export function filterAudioFiles (files = []) {
|
||||
export const filterAudioFiles = (files = []) => {
|
||||
return files.filter((item) => {
|
||||
return AUDIO_SUFFIXES.includes(item.extension)
|
||||
})
|
||||
}
|
||||
|
||||
export function filterImageFiles (files = []) {
|
||||
export const filterImageFiles = (files = []) => {
|
||||
return files.filter((item) => {
|
||||
return IMAGE_SUFFIXES.includes(item.extension)
|
||||
})
|
||||
}
|
||||
|
||||
export function isAudioOrVideo (uri = '') {
|
||||
export const filterDocumentFiles = (files = []) => {
|
||||
return files.filter((item) => {
|
||||
return DOCUMENT_SUFFIXES.includes(item.extension)
|
||||
})
|
||||
}
|
||||
|
||||
export const isAudioOrVideo = (uri = '') => {
|
||||
const suffixs = [...AUDIO_SUFFIXES, ...VIDEO_SUFFIXES]
|
||||
const result = suffixs.some((suffix) => {
|
||||
return uri.includes(suffix)
|
||||
@@ -476,7 +485,7 @@ export function isAudioOrVideo (uri = '') {
|
||||
return result
|
||||
}
|
||||
|
||||
export function needCheckCopyright (links = '') {
|
||||
export const needCheckCopyright = (links = '') => {
|
||||
const uris = splitTaskLinks(links)
|
||||
const avs = uris.filter(uri => {
|
||||
return isAudioOrVideo(uri)
|
||||
@@ -486,7 +495,7 @@ export function needCheckCopyright (links = '') {
|
||||
return result
|
||||
}
|
||||
|
||||
export function decodeThunderLink (url = '') {
|
||||
export const decodeThunderLink = (url = '') => {
|
||||
if (!url.startsWith('thunder://')) {
|
||||
return url
|
||||
}
|
||||
@@ -498,7 +507,7 @@ export function decodeThunderLink (url = '') {
|
||||
return result
|
||||
}
|
||||
|
||||
export function splitTaskLinks (links = '') {
|
||||
export const splitTaskLinks = (links = '') => {
|
||||
const temp = compact(splitTextRows(links))
|
||||
const result = temp.map((item) => {
|
||||
return decodeThunderLink(item)
|
||||
@@ -506,13 +515,13 @@ export function splitTaskLinks (links = '') {
|
||||
return result
|
||||
}
|
||||
|
||||
export function detectResource (content) {
|
||||
export const detectResource = (content) => {
|
||||
return RESOURCE_TAGS.some((type) => {
|
||||
return content.includes(type)
|
||||
})
|
||||
}
|
||||
|
||||
export function buildFileList (rawFile) {
|
||||
export const buildFileList = (rawFile) => {
|
||||
rawFile.uid = Date.now()
|
||||
const file = {
|
||||
status: 'ready',
|
||||
@@ -526,15 +535,15 @@ export function buildFileList (rawFile) {
|
||||
return fileList
|
||||
}
|
||||
|
||||
export function isRTL (locale = 'en-US') {
|
||||
export const isRTL = (locale = 'en-US') => {
|
||||
return SUPPORT_RTL_LOCALES.includes(locale)
|
||||
}
|
||||
|
||||
export function getLangDirection (locale = 'en-US') {
|
||||
export const getLangDirection = (locale = 'en-US') => {
|
||||
return isRTL(locale) ? 'rtl' : 'ltr'
|
||||
}
|
||||
|
||||
export function listTorrentFiles (files) {
|
||||
export const listTorrentFiles = (files) => {
|
||||
const result = files.map((file, index) => {
|
||||
const extension = getFileExtension(file.path)
|
||||
const item = {
|
||||
@@ -549,20 +558,20 @@ export function listTorrentFiles (files) {
|
||||
return result
|
||||
}
|
||||
|
||||
export function getFileName (fullPath) {
|
||||
export const getFileName = (fullPath) => {
|
||||
// eslint-disable-next-line
|
||||
return fullPath.replace(/^.*[\\\/]/, '')
|
||||
}
|
||||
|
||||
export function getFileExtension (filename) {
|
||||
export const getFileExtension = (filename) => {
|
||||
return filename.slice((filename.lastIndexOf('.') - 1 >>> 0) + 2)
|
||||
}
|
||||
|
||||
export function removeExtensionDot (extension = '') {
|
||||
export const removeExtensionDot = (extension = '') => {
|
||||
return extension.replace('.', '')
|
||||
}
|
||||
|
||||
export function diffConfig (current = {}, next = {}) {
|
||||
export const diffConfig = (current = {}, next = {}) => {
|
||||
const curr = pick(current, Object.keys(next))
|
||||
const result = omitBy(next, (val, key) => {
|
||||
if (isArray(val) || isPlainObject(val)) {
|
||||
@@ -570,14 +579,15 @@ export function diffConfig (current = {}, next = {}) {
|
||||
}
|
||||
return curr[key] === val
|
||||
})
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
export function calcFormLabelWidth (locale) {
|
||||
export const calcFormLabelWidth = (locale) => {
|
||||
return locale.startsWith('de') ? '28%' : '25%'
|
||||
}
|
||||
|
||||
export function parseHeader (header = '') {
|
||||
export const parseHeader = (header = '') => {
|
||||
header = header.trim()
|
||||
let result = {}
|
||||
if (!header) {
|
||||
@@ -596,7 +606,7 @@ export function parseHeader (header = '') {
|
||||
return result
|
||||
}
|
||||
|
||||
export function formatOptionsForEngine (options = {}) {
|
||||
export const formatOptionsForEngine = (options = {}) => {
|
||||
const result = {}
|
||||
|
||||
Object.keys(options).forEach((key) => {
|
||||
@@ -611,7 +621,7 @@ export function formatOptionsForEngine (options = {}) {
|
||||
return result
|
||||
}
|
||||
|
||||
export function buildRpcUrl (options = {}) {
|
||||
export const buildRpcUrl = (options = {}) => {
|
||||
const { port, secret } = options
|
||||
let result = `${ENGINE_RPC_HOST}:${port}/jsonrpc`
|
||||
if (secret) {
|
||||
@@ -622,7 +632,7 @@ export function buildRpcUrl (options = {}) {
|
||||
return result
|
||||
}
|
||||
|
||||
export function checkIsNeedRestart (changed = {}) {
|
||||
export const checkIsNeedRestart = (changed = {}) => {
|
||||
let result = false
|
||||
|
||||
if (isEmpty(changed)) {
|
||||
|
||||
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 103 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 257 KiB |
|
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 105 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 253 KiB |
|
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 103 KiB |
@@ -39,7 +39,7 @@
|
||||
resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.21.7.tgz#61caffb60776e49a57ba61a88f02bedd8714f6bc"
|
||||
integrity sha512-KYMqFYTaenzMK4yUtf4EW9wc4N9ef80FsbMtkwool5zpwl4YrT1SdWYSTRcT94KO4hannogdS+LxY7L+arP3gA==
|
||||
|
||||
"@babel/core@^7.21.5":
|
||||
"@babel/core@^7.21.8":
|
||||
version "7.21.8"
|
||||
resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.21.8.tgz#2a8c7f0f53d60100ba4c32470ba0281c92aa9aa4"
|
||||
integrity sha512-YeM22Sondbo523Sz0+CirSPnbj9bG3P0CdHcBZdqUuaeOaYEFbOLoGU7lebvGP6P5J/WE9wOn7u7C4J9HvS1xQ==
|
||||
@@ -1440,6 +1440,13 @@
|
||||
dependencies:
|
||||
"@types/node" "*"
|
||||
|
||||
"@types/debug@^4.1.6":
|
||||
version "4.1.7"
|
||||
resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.7.tgz#7cc0ea761509124709b8b2d1090d8f6c17aadb82"
|
||||
integrity sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg==
|
||||
dependencies:
|
||||
"@types/ms" "*"
|
||||
|
||||
"@types/eslint-scope@^3.7.3":
|
||||
version "3.7.4"
|
||||
resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.4.tgz#37fc1223f0786c39627068a12e94d6e6fc61de16"
|
||||
@@ -1480,6 +1487,13 @@
|
||||
"@types/qs" "*"
|
||||
"@types/serve-static" "*"
|
||||
|
||||
"@types/fs-extra@9.0.13", "@types/fs-extra@^9.0.11":
|
||||
version "9.0.13"
|
||||
resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-9.0.13.tgz#7594fbae04fe7f1918ce8b3d213f74ff44ac1f45"
|
||||
integrity sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==
|
||||
dependencies:
|
||||
"@types/node" "*"
|
||||
|
||||
"@types/html-minifier-terser@^6.0.0":
|
||||
version "6.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/html-minifier-terser/-/html-minifier-terser-6.1.0.tgz#4fc33a00c1d0c16987b1a20cf92d20614c55ac35"
|
||||
@@ -1538,6 +1552,11 @@
|
||||
resolved "https://registry.yarnpkg.com/@types/mime/-/mime-3.0.1.tgz#5f8f2bca0a5863cb69bc0b0acd88c96cb1d4ae10"
|
||||
integrity sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==
|
||||
|
||||
"@types/ms@*":
|
||||
version "0.7.31"
|
||||
resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.31.tgz#31b7ca6407128a3d2bbc27fe2d21b345397f6197"
|
||||
integrity sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==
|
||||
|
||||
"@types/node@*":
|
||||
version "18.15.11"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.11.tgz#b3b790f09cb1696cffcec605de025b088fa4225f"
|
||||
@@ -1786,20 +1805,20 @@
|
||||
"@webassemblyjs/ast" "1.11.5"
|
||||
"@xtuc/long" "4.2.2"
|
||||
|
||||
"@webpack-cli/configtest@^2.0.1":
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-2.0.1.tgz#a69720f6c9bad6aef54a8fa6ba9c3533e7ef4c7f"
|
||||
integrity sha512-njsdJXJSiS2iNbQVS0eT8A/KPnmyH4pv1APj2K0d1wrZcBLw+yppxOy4CGqa0OxDJkzfL/XELDhD8rocnIwB5A==
|
||||
"@webpack-cli/configtest@^2.1.0":
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-2.1.0.tgz#b59b33377b1b896a9a7357cfc643b39c1524b1e6"
|
||||
integrity sha512-K/vuv72vpfSEZoo5KIU0a2FsEoYdW0DUMtMpB5X3LlUwshetMZRZRxB7sCsVji/lFaSxtQQ3aM9O4eMolXkU9w==
|
||||
|
||||
"@webpack-cli/info@^2.0.1":
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-2.0.1.tgz#eed745799c910d20081e06e5177c2b2569f166c0"
|
||||
integrity sha512-fE1UEWTwsAxRhrJNikE7v4EotYflkEhBL7EbajfkPlf6E37/2QshOy/D48Mw8G5XMFlQtS6YV42vtbG9zBpIQA==
|
||||
|
||||
"@webpack-cli/serve@^2.0.2":
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-2.0.2.tgz#10aa290e44a182c02e173a89452781b1acbc86d9"
|
||||
integrity sha512-S9h3GmOmzUseyeFW3tYNnWS7gNUuwxZ3mmMq0JyW78Vx1SGKPSkt5bT4pB0rUnVfHjP0EL9gW2bOzmtiTfQt0A==
|
||||
"@webpack-cli/serve@^2.0.4":
|
||||
version "2.0.4"
|
||||
resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-2.0.4.tgz#3982ee6f8b42845437fc4d391e93ac5d9da52f0f"
|
||||
integrity sha512-0xRgjgDLdz6G7+vvDLlaRpFatJaJ69uTalZLRSMX5B3VUrDmXcrVA3+6fXXQgmYz7bY9AAgs348XQdmtLsK41A==
|
||||
|
||||
"@xtuc/ieee754@^1.2.0":
|
||||
version "1.2.0"
|
||||
@@ -1961,10 +1980,10 @@ app-builder-bin@4.0.0:
|
||||
resolved "https://registry.yarnpkg.com/app-builder-bin/-/app-builder-bin-4.0.0.tgz#1df8e654bd1395e4a319d82545c98667d7eed2f0"
|
||||
integrity sha512-xwdG0FJPQMe0M0UA4Tz0zEB8rBJTRA5a476ZawAqiBkMv16GRK5xpXThOjMaEOFnZ6zabejjG4J3da0SXG63KA==
|
||||
|
||||
app-builder-lib@24.3.0:
|
||||
version "24.3.0"
|
||||
resolved "https://registry.yarnpkg.com/app-builder-lib/-/app-builder-lib-24.3.0.tgz#3dc0244797abb9d37d9b0468481ee20b9ad83a6f"
|
||||
integrity sha512-FcZJAXoES+rZSST76v5Hn7SjAiKyIr25EPl5ECWK2cFYOkBLhav3MpTH9zc2g8VcXA/KbCH6a1Maz0WpfMdXfg==
|
||||
app-builder-lib@24.4.0:
|
||||
version "24.4.0"
|
||||
resolved "https://registry.yarnpkg.com/app-builder-lib/-/app-builder-lib-24.4.0.tgz#1606f94e99366eea9e7507228961b8396e40d546"
|
||||
integrity sha512-EcdqtWvg1LAApKCfyRBukcVkmsa94s2e1VKHjZLpvA9/D14QEt8rHhffYeaA+cH/pVeoNVn2ob735KnfJKEEow==
|
||||
dependencies:
|
||||
"7zip-bin" "~5.1.1"
|
||||
"@develar/schema-utils" "~2.6.5"
|
||||
@@ -1973,14 +1992,15 @@ app-builder-lib@24.3.0:
|
||||
"@electron/rebuild" "^3.2.13"
|
||||
"@electron/universal" "1.3.4"
|
||||
"@malept/flatpak-bundler" "^0.4.0"
|
||||
"@types/fs-extra" "9.0.13"
|
||||
async-exit-hook "^2.0.1"
|
||||
bluebird-lst "^1.0.9"
|
||||
builder-util "24.3.0"
|
||||
builder-util "24.4.0"
|
||||
builder-util-runtime "9.2.1"
|
||||
chromium-pickle-js "^0.2.0"
|
||||
debug "^4.3.4"
|
||||
ejs "^3.1.8"
|
||||
electron-publish "24.3.0"
|
||||
electron-publish "24.4.0"
|
||||
form-data "^4.0.0"
|
||||
fs-extra "^10.1.0"
|
||||
hosted-git-info "^4.1.0"
|
||||
@@ -2371,12 +2391,13 @@ builder-util-runtime@9.2.1:
|
||||
debug "^4.3.4"
|
||||
sax "^1.2.4"
|
||||
|
||||
builder-util@24.3.0:
|
||||
version "24.3.0"
|
||||
resolved "https://registry.yarnpkg.com/builder-util/-/builder-util-24.3.0.tgz#d1ff177a3021037ff9c53074e569a96e53138d9b"
|
||||
integrity sha512-/X3CYemDwtLO8akeOvEN9oHfpHIjCnNNHC0jktXF7NobKCu1paMRpMd8fQnYRVLxfdPPD7Rg/GUi12QPKbekdA==
|
||||
builder-util@24.4.0:
|
||||
version "24.4.0"
|
||||
resolved "https://registry.yarnpkg.com/builder-util/-/builder-util-24.4.0.tgz#dbb201a118fd573180e6a1070cf4c0be6de80cd7"
|
||||
integrity sha512-tONb/GIK1MKa1BcOPHE1naId3o5nj6gdka5kP7yUJh2DOfF+jMq3laiu+UOZH6A7ZtkMtnGNMYFKFTIv408n/A==
|
||||
dependencies:
|
||||
"7zip-bin" "~5.1.1"
|
||||
"@types/debug" "^4.1.6"
|
||||
app-builder-bin "4.0.0"
|
||||
bluebird-lst "^1.0.9"
|
||||
builder-util-runtime "9.2.1"
|
||||
@@ -2480,10 +2501,10 @@ caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001449:
|
||||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001478.tgz#0ef8a1cf8b16be47a0f9fc4ecfc952232724b32a"
|
||||
integrity sha512-gMhDyXGItTHipJj2ApIvR+iVB5hd0KP3svMWWXDvZOmjzJJassGLMfxRkQCSYgGd2gtdL/ReeiyvMSFD1Ss6Mw==
|
||||
|
||||
cfonts@^3.1.1:
|
||||
version "3.1.1"
|
||||
resolved "https://registry.yarnpkg.com/cfonts/-/cfonts-3.1.1.tgz#81bf9cfce2fcee581046d8912a55bab4366f9cfc"
|
||||
integrity sha512-PFknL/y+QVzoVmnm4X/PLd+t5Bt4aSvFBebpvyjcVUb81jHIVHFKvAopADbTk9tnfLLC2RHFZgdVa9YAwQp1mw==
|
||||
cfonts@^3.2.0:
|
||||
version "3.2.0"
|
||||
resolved "https://registry.yarnpkg.com/cfonts/-/cfonts-3.2.0.tgz#3c72b79679e48d19c620614d1134326a1f22cdec"
|
||||
integrity sha512-CFGxRY6aBuOgK85bceCpmMMhuyO6IwcAyyeapB//DtRzm7NbAEsDuuZzBoQxVonz+C2BmZ3swqB/YgcmW+rh3A==
|
||||
dependencies:
|
||||
supports-color "^8"
|
||||
window-size "^1.1.1"
|
||||
@@ -3135,13 +3156,13 @@ dir-glob@^3.0.1:
|
||||
dependencies:
|
||||
path-type "^4.0.0"
|
||||
|
||||
dmg-builder@24.3.0:
|
||||
version "24.3.0"
|
||||
resolved "https://registry.yarnpkg.com/dmg-builder/-/dmg-builder-24.3.0.tgz#c7eb3fe821ac75c678bd3b455f700a9bb398aba0"
|
||||
integrity sha512-U1HdvJG3MJi+BKJxn+g3wbQ9OsLaTFB4Issq0es3eBP1TDDKMxcb3Y6a2xT6IW9F+Iw8nAQopr97CZzFjzwjwg==
|
||||
dmg-builder@24.4.0:
|
||||
version "24.4.0"
|
||||
resolved "https://registry.yarnpkg.com/dmg-builder/-/dmg-builder-24.4.0.tgz#46c80f119465f6a7275766c72b4f3d514cc8013d"
|
||||
integrity sha512-p5z9Cx539GSBYb+b09Z+hMhuBTh/BrI71VRg4rgF6f2xtIRK/YlTGVS/O08k5OojoyhZcpS7JXxDVSmQoWgiiQ==
|
||||
dependencies:
|
||||
app-builder-lib "24.3.0"
|
||||
builder-util "24.3.0"
|
||||
app-builder-lib "24.4.0"
|
||||
builder-util "24.4.0"
|
||||
builder-util-runtime "9.2.1"
|
||||
fs-extra "^10.1.0"
|
||||
iconv-lite "^0.6.2"
|
||||
@@ -3288,16 +3309,16 @@ ejs@^3.1.8:
|
||||
dependencies:
|
||||
jake "^10.8.5"
|
||||
|
||||
electron-builder@^24.3.0:
|
||||
version "24.3.0"
|
||||
resolved "https://registry.yarnpkg.com/electron-builder/-/electron-builder-24.3.0.tgz#9eb298b7d27bdfdf12f0278f06b98833cc3f091e"
|
||||
integrity sha512-+MD9hRsoN1c4Fi/fyKredXgy3Bu6IGgd2nbc40FY7Pgi4Vthvnq0e5pql4BgwFUxBrspuvEB+tiH5QU3ZPq0zA==
|
||||
electron-builder@^24.4.0:
|
||||
version "24.4.0"
|
||||
resolved "https://registry.yarnpkg.com/electron-builder/-/electron-builder-24.4.0.tgz#8846efa45bac8f6b9afc181abf71a4e12530f045"
|
||||
integrity sha512-D5INxodxaUIJgEX6p/fqBd8wQNS8XRAToNIJ9SQC+taNS5D73ZsjLuXiRraFGCB0cVk9KeKhEkdEOH5AaVya4g==
|
||||
dependencies:
|
||||
app-builder-lib "24.3.0"
|
||||
builder-util "24.3.0"
|
||||
app-builder-lib "24.4.0"
|
||||
builder-util "24.4.0"
|
||||
builder-util-runtime "9.2.1"
|
||||
chalk "^4.1.2"
|
||||
dmg-builder "24.3.0"
|
||||
dmg-builder "24.4.0"
|
||||
fs-extra "^10.1.0"
|
||||
is-ci "^3.0.0"
|
||||
lazy-val "^1.0.5"
|
||||
@@ -3333,12 +3354,13 @@ electron-log@^4.4.8:
|
||||
resolved "https://registry.yarnpkg.com/electron-log/-/electron-log-4.4.8.tgz#fcb9f714dbcaefb6ac7984c4683912c74730248a"
|
||||
integrity sha512-QQ4GvrXO+HkgqqEOYbi+DHL7hj5JM+nHi/j+qrN9zeeXVKy8ZABgbu4CnG+BBqDZ2+tbeq9tUC4DZfIWFU5AZA==
|
||||
|
||||
electron-publish@24.3.0:
|
||||
version "24.3.0"
|
||||
resolved "https://registry.yarnpkg.com/electron-publish/-/electron-publish-24.3.0.tgz#9ad740e8a00ae97aca2210a3d7fa603d0db81140"
|
||||
integrity sha512-CSo37CNsJL4Vvy8naQMCI6unXxHF8fhx89p0JEy0EOnaWmDdlSZ21kqcJHUSP6pSXJsqKq1DW72pZYU6B6Bpqw==
|
||||
electron-publish@24.4.0:
|
||||
version "24.4.0"
|
||||
resolved "https://registry.yarnpkg.com/electron-publish/-/electron-publish-24.4.0.tgz#a58f49ecd727620f65372881788ebb1a9b853284"
|
||||
integrity sha512-U3mnVSxIfNrLW7ZnwiedFhcLf6ExPFXgAsx89WpfQFsV4gFAt/LG+H74p0m9NSvsLXiZuF82yXoxi7Ou8GHq4Q==
|
||||
dependencies:
|
||||
builder-util "24.3.0"
|
||||
"@types/fs-extra" "^9.0.11"
|
||||
builder-util "24.4.0"
|
||||
builder-util-runtime "9.2.1"
|
||||
chalk "^4.1.2"
|
||||
fs-extra "^10.1.0"
|
||||
@@ -3372,10 +3394,10 @@ electron-updater@^6.1.0:
|
||||
semver "^7.3.8"
|
||||
typed-emitter "^2.1.0"
|
||||
|
||||
electron@^22.3.7:
|
||||
version "22.3.7"
|
||||
resolved "https://registry.yarnpkg.com/electron/-/electron-22.3.7.tgz#1df3d15f8cee6468818485596b0d88840fa34018"
|
||||
integrity sha512-QUuRCl0QJk0w2yPAQXl6sk4YV1b9353w4e1eO/fF2OUmrGQV9Fy2pEpEDV1PIq/JJ/oeVVlI3H07LHpEcNb0TA==
|
||||
electron@^22.3.9:
|
||||
version "22.3.9"
|
||||
resolved "https://registry.yarnpkg.com/electron/-/electron-22.3.9.tgz#8b4551f9bcea436a0110e5680ba23df56819a4e2"
|
||||
integrity sha512-C+ws4LnGxd+BQGVbKRgR9L1hfslk1L6FHYBm3a7dWL6xcobVm4dLyqShT/5N8lNRXlN1BhIYsWmrAisdd537Tw==
|
||||
dependencies:
|
||||
"@electron/get" "^2.0.0"
|
||||
"@types/node" "^16.11.26"
|
||||
@@ -3431,10 +3453,10 @@ enhanced-resolve@^0.9.1:
|
||||
memory-fs "^0.2.0"
|
||||
tapable "^0.1.8"
|
||||
|
||||
enhanced-resolve@^5.13.0:
|
||||
version "5.13.0"
|
||||
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.13.0.tgz#26d1ecc448c02de997133217b5c1053f34a0a275"
|
||||
integrity sha512-eyV8f0y1+bzyfh8xAwW/WTSZpLbjhqc4ne9eGSH4Zo2ejdyiNG9pU6mf9DG8a7+Auk6MFTlNOT4Y2y/9k8GKVg==
|
||||
enhanced-resolve@^5.14.0:
|
||||
version "5.14.0"
|
||||
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.14.0.tgz#0b6c676c8a3266c99fa281e4433a706f5c0c61c4"
|
||||
integrity sha512-+DCows0XNwLDcUhbFJPdlQEVnT2zXlCv7hPxemTz86/O+B/hCQ+mb7ydkPKiflpVraqLPCAfu7lDy+hBXueojw==
|
||||
dependencies:
|
||||
graceful-fs "^4.2.4"
|
||||
tapable "^2.2.0"
|
||||
@@ -3662,10 +3684,10 @@ eslint-plugin-promise@^6.1.1:
|
||||
resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-6.1.1.tgz#269a3e2772f62875661220631bd4dafcb4083816"
|
||||
integrity sha512-tjqWDwVZQo7UIPMeDReOpUgHCmCiH+ePnVT+5zVapL0uuHnegBUs2smM13CzOs2Xb5+MHMRFTs9v24yjba4Oig==
|
||||
|
||||
eslint-plugin-vue@^9.11.0:
|
||||
version "9.11.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint-plugin-vue/-/eslint-plugin-vue-9.11.0.tgz#99a247455c02181f24d9240d422380fd16dd630c"
|
||||
integrity sha512-bBCJAZnkBV7ATH4Z1E7CvN3nmtS4H7QUU3UBxPdo8WohRU+yHjnQRALpTbxMVcz0e4Mx3IyxIdP5HYODMxK9cQ==
|
||||
eslint-plugin-vue@^9.12.0:
|
||||
version "9.12.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint-plugin-vue/-/eslint-plugin-vue-9.12.0.tgz#3174eaaedc143bf7b392b3defa3f18889606bb73"
|
||||
integrity sha512-xH8PgpDW2WwmFSmRfs/3iWogef1CJzQqX264I65zz77jDuxF2yLy7+GA2diUM8ZNATuSl1+UehMQkb5YEyau5w==
|
||||
dependencies:
|
||||
"@eslint-community/eslint-utils" "^4.3.0"
|
||||
natural-compare "^1.4.0"
|
||||
@@ -7220,6 +7242,17 @@ terser-webpack-plugin@^5.3.7:
|
||||
serialize-javascript "^6.0.1"
|
||||
terser "^5.16.5"
|
||||
|
||||
terser-webpack-plugin@^5.3.8:
|
||||
version "5.3.8"
|
||||
resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.8.tgz#415e03d2508f7de63d59eca85c5d102838f06610"
|
||||
integrity sha512-WiHL3ElchZMsK27P8uIUh4604IgJyAW47LVXGbEoB21DbQcZ+OuMpGjVYnEUaqcWM6dO8uS2qUbA7LSCWqvsbg==
|
||||
dependencies:
|
||||
"@jridgewell/trace-mapping" "^0.3.17"
|
||||
jest-worker "^27.4.5"
|
||||
schema-utils "^3.1.1"
|
||||
serialize-javascript "^6.0.1"
|
||||
terser "^5.16.8"
|
||||
|
||||
terser@^5.10.0, terser@^5.16.5:
|
||||
version "5.16.9"
|
||||
resolved "https://registry.yarnpkg.com/terser/-/terser-5.16.9.tgz#7a28cb178e330c484369886f2afd623d9847495f"
|
||||
@@ -7230,6 +7263,16 @@ terser@^5.10.0, terser@^5.16.5:
|
||||
commander "^2.20.0"
|
||||
source-map-support "~0.5.20"
|
||||
|
||||
terser@^5.16.8:
|
||||
version "5.17.3"
|
||||
resolved "https://registry.yarnpkg.com/terser/-/terser-5.17.3.tgz#7f908f16b3cdf3f6c0f8338e6c1c674837f90d25"
|
||||
integrity sha512-AudpAZKmZHkG9jueayypz4duuCFJMMNGRMwaPvQKWfxKedh8Z2x3OCoDqIIi1xx5+iwx1u6Au8XQcc9Lke65Yg==
|
||||
dependencies:
|
||||
"@jridgewell/source-map" "^0.3.2"
|
||||
acorn "^8.5.0"
|
||||
commander "^2.20.0"
|
||||
source-map-support "~0.5.20"
|
||||
|
||||
text-table@^0.2.0:
|
||||
version "0.2.0"
|
||||
resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
|
||||
@@ -7609,15 +7652,15 @@ webidl-conversions@^3.0.0:
|
||||
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"
|
||||
integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==
|
||||
|
||||
webpack-cli@^5.0.2:
|
||||
version "5.0.2"
|
||||
resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-5.0.2.tgz#2954c10ecb61c5d4dad6f68ee2d77f051741946c"
|
||||
integrity sha512-4y3W5Dawri5+8dXm3+diW6Mn1Ya+Dei6eEVAdIduAmYNLzv1koKVAqsfgrrc9P2mhrYHQphx5htnGkcNwtubyQ==
|
||||
webpack-cli@^5.1.1:
|
||||
version "5.1.1"
|
||||
resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-5.1.1.tgz#c211ac6d911e77c512978f7132f0d735d4a97ace"
|
||||
integrity sha512-OLJwVMoXnXYH2ncNGU8gxVpUtm3ybvdioiTvHgUyBuyMLKiVvWy+QObzBsMtp5pH7qQoEuWgeEUQ/sU3ZJFzAw==
|
||||
dependencies:
|
||||
"@discoveryjs/json-ext" "^0.5.0"
|
||||
"@webpack-cli/configtest" "^2.0.1"
|
||||
"@webpack-cli/configtest" "^2.1.0"
|
||||
"@webpack-cli/info" "^2.0.1"
|
||||
"@webpack-cli/serve" "^2.0.2"
|
||||
"@webpack-cli/serve" "^2.0.4"
|
||||
colorette "^2.0.14"
|
||||
commander "^10.0.1"
|
||||
cross-spawn "^7.0.3"
|
||||
@@ -7639,10 +7682,10 @@ webpack-dev-middleware@^5.3.1:
|
||||
range-parser "^1.2.1"
|
||||
schema-utils "^4.0.0"
|
||||
|
||||
webpack-dev-server@^4.13.3:
|
||||
version "4.13.3"
|
||||
resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-4.13.3.tgz#9feb740b8b56b886260bae1360286818a221bae8"
|
||||
integrity sha512-KqqzrzMRSRy5ePz10VhjyL27K2dxqwXQLP5rAKwRJBPUahe7Z2bBWzHw37jeb8GCPKxZRO79ZdQUAPesMh/Nug==
|
||||
webpack-dev-server@^4.15.0:
|
||||
version "4.15.0"
|
||||
resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-4.15.0.tgz#87ba9006eca53c551607ea0d663f4ae88be7af21"
|
||||
integrity sha512-HmNB5QeSl1KpulTBQ8UT4FPrByYyaLxpJoQ0+s7EvUrMc16m0ZS1sgb1XGqzmgCPk0c9y+aaXxn11tbLzuM7NQ==
|
||||
dependencies:
|
||||
"@types/bonjour" "^3.5.9"
|
||||
"@types/connect-history-api-fallback" "^1.3.5"
|
||||
@@ -7697,10 +7740,10 @@ webpack-sources@^3.2.3:
|
||||
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde"
|
||||
integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==
|
||||
|
||||
webpack@^5.81.0:
|
||||
version "5.81.0"
|
||||
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.81.0.tgz#27a2e8466c8b4820d800a8d90f06ef98294f9956"
|
||||
integrity sha512-AAjaJ9S4hYCVODKLQTgG5p5e11hiMawBwV2v8MYLE0C/6UAGLuAF4n1qa9GOwdxnicaP+5k6M5HrLmD4+gIB8Q==
|
||||
webpack@^5.82.1:
|
||||
version "5.82.1"
|
||||
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.82.1.tgz#8f38c78e53467556e8a89054ebd3ef6e9f67dbab"
|
||||
integrity sha512-C6uiGQJ+Gt4RyHXXYt+v9f+SN1v83x68URwgxNQ98cvH8kxiuywWGP4XeNZ1paOzZ63aY3cTciCEQJNFUljlLw==
|
||||
dependencies:
|
||||
"@types/eslint-scope" "^3.7.3"
|
||||
"@types/estree" "^1.0.0"
|
||||
@@ -7711,7 +7754,7 @@ webpack@^5.81.0:
|
||||
acorn-import-assertions "^1.7.6"
|
||||
browserslist "^4.14.5"
|
||||
chrome-trace-event "^1.0.2"
|
||||
enhanced-resolve "^5.13.0"
|
||||
enhanced-resolve "^5.14.0"
|
||||
es-module-lexer "^1.2.1"
|
||||
eslint-scope "5.1.1"
|
||||
events "^3.2.0"
|
||||
|
||||