diff --git a/back/config/index.ts b/back/config/index.ts index ffdbb3e6..3c7ac0d8 100644 --- a/back/config/index.ts +++ b/back/config/index.ts @@ -20,6 +20,7 @@ const rootPath = process.env.QL_DIR as string; const envFound = dotenv.config({ path: path.join(rootPath, '.env') }); const dataPath = path.join(rootPath, 'data/'); +const shellPath = path.join(rootPath, 'shell/'); const tmpPath = path.join(rootPath, '.tmp/'); const samplePath = path.join(rootPath, 'sample/'); const configPath = path.join(dataPath, 'config/'); @@ -44,6 +45,7 @@ const loginFaild = '请先登录!'; const configString = 'config sample crontab shareCode diy'; const versionFile = path.join(rootPath, 'version.yaml'); const dataTgzFile = path.join(tmpPath, 'data.tgz'); +const shareShellFile = path.join(shellPath, 'share.sh'); if (envFound.error) { throw new Error("⚠️ Couldn't find .env file ⚠️"); @@ -64,6 +66,7 @@ export default { tmpPath, dataPath, dataTgzFile, + shareShellFile, configString, loginFaild, authError, diff --git a/back/data/dependence.ts b/back/data/dependence.ts index 296452fb..c8d7eb60 100644 --- a/back/data/dependence.ts +++ b/back/data/dependence.ts @@ -43,13 +43,13 @@ export enum DependenceTypes { export enum InstallDependenceCommandTypes { 'pnpm add -g', 'pip3 install --disable-pip-version-check --root-user-action=ignore', - 'apk add', + 'apk add --no-check-certificate', } export enum GetDependenceCommandTypes { 'pnpm ls -g ', 'pip3 show --disable-pip-version-check', - 'apk info', + 'apk info -es', } export enum versionDependenceCommandTypes { diff --git a/back/loaders/initData.ts b/back/loaders/initData.ts index e680d58e..678625d4 100644 --- a/back/loaders/initData.ts +++ b/back/loaders/initData.ts @@ -38,7 +38,7 @@ export default async () => { // 初始化时安装所有处于安装中,安装成功,安装失败的依赖 DependenceModel.findAll({ where: {}, - order: [['type', 'DESC']], + order: [['type', 'DESC'], ['createdAt', 'DESC']], raw: true, }).then(async (docs) => { await DependenceModel.update( diff --git a/back/services/dependence.ts b/back/services/dependence.ts index 70bf920b..1acb37de 100644 --- a/back/services/dependence.ts +++ b/back/services/dependence.ts @@ -209,7 +209,7 @@ export default class DependenceService { ? `${getCommandPrefix} | grep "${depName}" | head -1` : `${getCommandPrefix} ${depName}`, ) - ).replace(/\s{2,}/, ' '); + ).replace(/\s{2,}/, ' ').replace(/\s+$/, ''); if ( depInfo && @@ -219,7 +219,7 @@ export default class DependenceService { (!depVersion || depInfo.includes(depVersion)) ) { const endTime = dayjs(); - const _message = `检测到已经安装 ${depName}\n\n${depInfo}\n跳过安装\n\n依赖${actionText}成功,结束时间 ${endTime.format( + const _message = `检测到已经安装 ${depName}\n\n${depInfo}\n\n跳过安装\n\n依赖${actionText}成功,结束时间 ${endTime.format( 'YYYY-MM-DD HH:mm:ss', )},耗时 ${endTime.diff(startTime, 'second')} 秒`; this.sockService.sendMessage({ @@ -236,7 +236,7 @@ export default class DependenceService { } } - const cp = spawn(`${depRunCommand} ${depName}`, { + const cp = spawn(`${depRunCommand} ${dependency.name.trim()}`, { shell: '/bin/bash', }); diff --git a/shell/check.sh b/shell/check.sh index 33c7db8b..3886c73f 100755 --- a/shell/check.sh +++ b/shell/check.sh @@ -79,8 +79,6 @@ main() { npm i -g pnpm@8.3.1 patch_version - apk add procps netcat-openbsd - if [[ $PipMirror ]]; then pip3 config set global.index-url $PipMirror fi diff --git a/shell/share.sh b/shell/share.sh index 9cbc7955..52b4cab6 100755 --- a/shell/share.sh +++ b/shell/share.sh @@ -314,7 +314,6 @@ reload_pm2() { unset_proxy pm2 flush &>/dev/null pm2 startOrGracefulReload $file_ecosystem_js --update-env - pm2 sendSignal SIGKILL panel &>/dev/null } diff_time() { diff --git a/src/pages/dependence/index.tsx b/src/pages/dependence/index.tsx index 04308444..ec3cbbd6 100644 --- a/src/pages/dependence/index.tsx +++ b/src/pages/dependence/index.tsx @@ -290,7 +290,7 @@ const Dependence = () => { const handleDependence = (dependence: any) => { const result = [...value]; if (Array.isArray(dependence)) { - result.push(...dependence); + result.unshift(...dependence); } else { const index = value.findIndex((x) => x.id === dependence.id); if (index !== -1) { diff --git a/src/utils/http.ts b/src/utils/http.ts index 150ac8b6..5dc1d20a 100644 --- a/src/utils/http.ts +++ b/src/utils/http.ts @@ -11,6 +11,7 @@ interface IResponseData { code?: number; data?: any; message?: string; + error?: any; } type Override<