mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-22 22:36:06 +08:00
修改系统更新时间和版本获取
This commit is contained in:
parent
b69ff2895e
commit
936b565fb1
|
@ -25,22 +25,9 @@ export default (app: Router) => {
|
||||||
try {
|
try {
|
||||||
const userService = Container.get(UserService);
|
const userService = Container.get(UserService);
|
||||||
const authInfo = await userService.getUserInfo();
|
const authInfo = await userService.getUserInfo();
|
||||||
const { version, changeLog, changeLogLink } = await parseVersion(
|
const { version, changeLog, changeLogLink, publishTime } = await parseVersion(
|
||||||
config.versionFile,
|
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;
|
let isInitialized = true;
|
||||||
if (
|
if (
|
||||||
|
@ -55,9 +42,8 @@ export default (app: Router) => {
|
||||||
data: {
|
data: {
|
||||||
isInitialized,
|
isInitialized,
|
||||||
version,
|
version,
|
||||||
lastCommitTime: dayjs(lastCommitTime).unix(),
|
publishTime: dayjs(publishTime).unix(),
|
||||||
lastCommitId,
|
branch: process.env.QL_BRANCH || 'master',
|
||||||
branch,
|
|
||||||
changeLog,
|
changeLog,
|
||||||
changeLogLink,
|
changeLogLink,
|
||||||
},
|
},
|
||||||
|
|
|
@ -517,6 +517,7 @@ interface IVersion {
|
||||||
version: string;
|
version: string;
|
||||||
changeLogLink: string;
|
changeLogLink: string;
|
||||||
changeLog: string;
|
changeLog: string;
|
||||||
|
publishTime: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function parseVersion(path: string): Promise<IVersion> {
|
export async function parseVersion(path: string): Promise<IVersion> {
|
||||||
|
|
|
@ -48,7 +48,7 @@ export enum InstallDependenceCommandTypes {
|
||||||
|
|
||||||
export enum GetDependenceCommandTypes {
|
export enum GetDependenceCommandTypes {
|
||||||
'pnpm ls -g ',
|
'pnpm ls -g ',
|
||||||
'pip3 list --disable-pip-version-check --root-user-action=ignore',
|
'pip3 list --disable-pip-version-check',
|
||||||
'apk info',
|
'apk info',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,8 +49,7 @@ export interface SharedContext {
|
||||||
interface TSystemInfo {
|
interface TSystemInfo {
|
||||||
branch: 'develop' | 'master';
|
branch: 'develop' | 'master';
|
||||||
isInitialized: boolean;
|
isInitialized: boolean;
|
||||||
lastCommitId: string;
|
publishTime: number;
|
||||||
lastCommitTime: number;
|
|
||||||
version: string;
|
version: string;
|
||||||
changeLog: string;
|
changeLog: string;
|
||||||
changeLogLink: string;
|
changeLogLink: string;
|
||||||
|
|
|
@ -31,13 +31,10 @@ const About = ({ systemInfo }: { systemInfo: SharedContext['systemInfo'] }) => {
|
||||||
{TVersion[systemInfo.branch]} v{systemInfo.version}
|
{TVersion[systemInfo.branch]} v{systemInfo.version}
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label="更新时间" span={3}>
|
<Descriptions.Item label="更新时间" span={3}>
|
||||||
{dayjs(systemInfo.lastCommitTime * 1000).format(
|
{dayjs(systemInfo.publishTime * 1000).format(
|
||||||
'YYYY-MM-DD HH:mm:ss',
|
'YYYY-MM-DD HH:mm',
|
||||||
)}
|
)}
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label="更新ID" span={3}>
|
|
||||||
{systemInfo.lastCommitId}
|
|
||||||
</Descriptions.Item>
|
|
||||||
<Descriptions.Item label="更新日志" span={3}>
|
<Descriptions.Item label="更新日志" span={3}>
|
||||||
<Link
|
<Link
|
||||||
href={`https://qn.whyour.cn/version.yaml?t=${Date.now()}`}
|
href={`https://qn.whyour.cn/version.yaml?t=${Date.now()}`}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
version: 2.15.17
|
version: 2.15.17
|
||||||
changeLogLink: https://t.me/jiao_long/383
|
changeLogLink: https://t.me/jiao_long/383
|
||||||
|
publishTime: 2023-07-11 23:51
|
||||||
changeLog: |
|
changeLog: |
|
||||||
1. 系统设置增加定时任务并发数设置
|
1. 系统设置增加定时任务并发数设置
|
||||||
2. 修改默认并发数
|
2. 修改默认并发数
|
||||||
|
|
Loading…
Reference in New Issue
Block a user