fix(update): recover from GitHub rate limits with configurable mirrors
This commit is contained in:
1 parent
68deb48811
commit
20cf7394e5
21 files changed
+1423
-93
No files matched your search
@@ -24,6 +24,9 @@ import type {
|
||||
UiConfig,
|
||||
UpdateInfo,
|
||||
UpdateStatus,
|
||||
UpdateSourceConfig,
|
||||
UpdateSourceProbe,
|
||||
UpdateSourceSaveResult,
|
||||
} from '@/types';
|
||||
import type { PasswordRule } from '@/components/pages/change-password-form';
|
||||
import { normalizeOneBotConfig } from '@/lib/onebot-config';
|
||||
@@ -175,6 +178,11 @@ class HttpApiClient implements ApiClient {
|
||||
check: (force) =>
|
||||
this.getJson<UpdateInfo>(`/api/update/check${force ? '?force=true' : ''}`),
|
||||
status: () => this.getJson<UpdateStatus>('/api/update/status'),
|
||||
sources: () => this.getJson<{ config: UpdateSourceConfig }>('/api/update/sources'),
|
||||
saveSources: (config) =>
|
||||
this.postJson<UpdateSourceSaveResult>('/api/update/sources', config),
|
||||
testSources: (config) =>
|
||||
this.postJson<{ results: UpdateSourceProbe[] }>('/api/update/sources/test', config),
|
||||
download: (version) => this.postJson<UpdateStatus>('/api/update/download', { version }),
|
||||
restart: () => this.postJson<UpdateStatus>('/api/update/restart'),
|
||||
};
|
||||
|
||||
@@ -28,6 +28,9 @@ import type {
|
||||
UiConfig,
|
||||
UpdateInfo,
|
||||
UpdateStatus,
|
||||
UpdateSourceConfig,
|
||||
UpdateSourceProbe,
|
||||
UpdateSourceSaveResult,
|
||||
} from '@/types';
|
||||
import type { PasswordRule } from '@/components/pages/change-password-form';
|
||||
|
||||
@@ -277,6 +280,9 @@ export interface ApiClient {
|
||||
/** Advisory check for a newer stable release. Read-only — never downloads. */
|
||||
check(force?: boolean): Promise<UpdateInfo>;
|
||||
status(): Promise<UpdateStatus>;
|
||||
sources(): Promise<{ config: UpdateSourceConfig }>;
|
||||
saveSources(config: UpdateSourceConfig): Promise<UpdateSourceSaveResult>;
|
||||
testSources(config: UpdateSourceConfig): Promise<{ results: UpdateSourceProbe[] }>;
|
||||
download(version: string): Promise<UpdateStatus>;
|
||||
restart(): Promise<UpdateStatus>;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user