mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-03-01 16:20:25 +00:00
Add backend and frontend support for NapCat auto-update
Introduces backend API and router for updating NapCat, including update logic and pending update application on startup. Adds frontend integration with update button and request handling. Refactors system info component to remove legacy new version tip. Updates types and runtime to track working environment for update selection. Implements lazy loading for pty in unixTerminal to avoid early initialization.
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import store from 'napcat-common/src/store';
|
||||
import { napCatVersion } from 'napcat-common/src/version';
|
||||
import type { LoginRuntimeType } from '../types';
|
||||
import { NapCatCoreWorkingEnv, type LoginRuntimeType } from '../types';
|
||||
|
||||
const LoginRuntime: LoginRuntimeType = {
|
||||
workingEnv: NapCatCoreWorkingEnv.Unknown,
|
||||
LoginCurrentTime: Date.now(),
|
||||
LoginCurrentRate: 0,
|
||||
QQLoginStatus: false, // 已实现 但太傻了 得去那边注册个回调刷新
|
||||
@@ -36,6 +37,12 @@ const LoginRuntime: LoginRuntimeType = {
|
||||
},
|
||||
};
|
||||
export const WebUiDataRuntime = {
|
||||
setWorkingEnv (env: NapCatCoreWorkingEnv): void {
|
||||
LoginRuntime.workingEnv = env;
|
||||
},
|
||||
getWorkingEnv (): NapCatCoreWorkingEnv {
|
||||
return LoginRuntime.workingEnv;
|
||||
},
|
||||
setWebUiTokenChangeCallback (func: (token: string) => Promise<void>): void {
|
||||
LoginRuntime.onWebUiTokenChange = func;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user