feat(core): add staged self-updates and unify application version
This commit is contained in:
1 parent
c54aeffc77
commit
5032cbb8c0
45 files changed
+1860
-165
No files matched your search
@@ -23,6 +23,7 @@ import type {
|
||||
UiAppearance,
|
||||
UiConfig,
|
||||
UpdateInfo,
|
||||
UpdateStatus,
|
||||
} from '@/types';
|
||||
import type { PasswordRule } from '@/components/pages/change-password-form';
|
||||
import { normalizeOneBotConfig } from '@/lib/onebot-config';
|
||||
@@ -219,6 +220,9 @@ class HttpApiClient implements ApiClient {
|
||||
this.update = {
|
||||
check: (force) =>
|
||||
this.getJson<UpdateInfo>(`/api/update/check${force ? '?force=true' : ''}`),
|
||||
status: () => this.getJson<UpdateStatus>('/api/update/status'),
|
||||
download: (version) => this.postJson<UpdateStatus>('/api/update/download', { version }),
|
||||
restart: () => this.postJson<UpdateStatus>('/api/update/restart'),
|
||||
};
|
||||
|
||||
this.systemSettings = {
|
||||
|
||||
@@ -27,6 +27,7 @@ import type {
|
||||
UiAppearance,
|
||||
UiConfig,
|
||||
UpdateInfo,
|
||||
UpdateStatus,
|
||||
} from '@/types';
|
||||
import type { PasswordRule } from '@/components/pages/change-password-form';
|
||||
|
||||
@@ -275,6 +276,9 @@ export interface ApiClient {
|
||||
update: {
|
||||
/** Advisory check for a newer stable release. Read-only — never downloads. */
|
||||
check(force?: boolean): Promise<UpdateInfo>;
|
||||
status(): Promise<UpdateStatus>;
|
||||
download(version: string): Promise<UpdateStatus>;
|
||||
restart(): Promise<UpdateStatus>;
|
||||
};
|
||||
|
||||
// ---- WebUI customization (config/ui.json) ----
|
||||
|
||||
Reference in new issue
Block a user