diff --git a/back/api/system.ts b/back/api/system.ts index 7623ef1f..5b747ab3 100644 --- a/back/api/system.ts +++ b/back/api/system.ts @@ -25,22 +25,9 @@ export default (app: Router) => { try { const userService = Container.get(UserService); const authInfo = await userService.getUserInfo(); - const { version, changeLog, changeLogLink } = await parseVersion( + const { version, changeLog, changeLogLink, publishTime } = await parseVersion( config.versionFile, ); - const lastCommitTime = ( - await promiseExec( - `cd ${config.rootPath} && git show -s --format=%ai | head -1`, - ) - ).replace('\n', ''); - const lastCommitId = ( - await promiseExec(`cd ${config.rootPath} && git rev-parse --short HEAD`) - ).replace('\n', ''); - const branch = ( - await promiseExec( - `cd ${config.rootPath} && git symbolic-ref --short HEAD`, - ) - ).replace('\n', ''); let isInitialized = true; if ( @@ -55,9 +42,8 @@ export default (app: Router) => { data: { isInitialized, version, - lastCommitTime: dayjs(lastCommitTime).unix(), - lastCommitId, - branch, + publishTime: dayjs(publishTime).unix(), + branch: process.env.QL_BRANCH || 'master', changeLog, changeLogLink, }, diff --git a/back/config/util.ts b/back/config/util.ts index e6588417..6e82ed3a 100644 --- a/back/config/util.ts +++ b/back/config/util.ts @@ -517,6 +517,7 @@ interface IVersion { version: string; changeLogLink: string; changeLog: string; + publishTime: string; } export async function parseVersion(path: string): Promise { diff --git a/back/data/dependence.ts b/back/data/dependence.ts index ae202928..5809e736 100644 --- a/back/data/dependence.ts +++ b/back/data/dependence.ts @@ -48,7 +48,7 @@ export enum InstallDependenceCommandTypes { export enum GetDependenceCommandTypes { 'pnpm ls -g ', - 'pip3 list --disable-pip-version-check --root-user-action=ignore', + 'pip3 list --disable-pip-version-check', 'apk info', } diff --git a/src/layouts/index.tsx b/src/layouts/index.tsx index 3ab72310..0a385d12 100644 --- a/src/layouts/index.tsx +++ b/src/layouts/index.tsx @@ -49,8 +49,7 @@ export interface SharedContext { interface TSystemInfo { branch: 'develop' | 'master'; isInitialized: boolean; - lastCommitId: string; - lastCommitTime: number; + publishTime: number; version: string; changeLog: string; changeLogLink: string; diff --git a/src/pages/setting/about.tsx b/src/pages/setting/about.tsx index 638cedcb..291768ea 100644 --- a/src/pages/setting/about.tsx +++ b/src/pages/setting/about.tsx @@ -31,13 +31,10 @@ const About = ({ systemInfo }: { systemInfo: SharedContext['systemInfo'] }) => { {TVersion[systemInfo.branch]} v{systemInfo.version} - {dayjs(systemInfo.lastCommitTime * 1000).format( - 'YYYY-MM-DD HH:mm:ss', + {dayjs(systemInfo.publishTime * 1000).format( + 'YYYY-MM-DD HH:mm', )} - - {systemInfo.lastCommitId} -