mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-05 15:26:36 +08:00
feat: add manual server binary upload and confirmation upgrade process
- Implemented UploadManualServerBinary endpoint for uploading server binaries and checking their versions. - Added ConfirmManualServerUpgrade endpoint to confirm the upgrade with the uploaded binary. - Updated API routes to include manual upload and upgrade confirmation. - Enhanced service layer to handle manual binary uploads, version detection, and upgrade execution. - Introduced new types for handling uploaded binary information. - Updated frontend components to support manual binary upload and confirmation, including UI feedback for users. - Modified documentation to reflect new manual upload and upgrade features.
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import { apiRequest } from '@/lib/api/client';
|
||||
|
||||
import type { LatestReleaseInfo } from '@/features/update/types';
|
||||
import type {
|
||||
LatestReleaseInfo,
|
||||
UploadedServerBinaryInfo,
|
||||
} from '@/features/update/types';
|
||||
|
||||
export function getLatestRelease() {
|
||||
return apiRequest<LatestReleaseInfo>('/update/latest-release');
|
||||
@@ -11,3 +14,20 @@ export function upgradeServer() {
|
||||
method: 'POST',
|
||||
});
|
||||
}
|
||||
|
||||
export function uploadServerBinary(binary: File) {
|
||||
const formData = new FormData();
|
||||
formData.append('binary', binary);
|
||||
|
||||
return apiRequest<UploadedServerBinaryInfo>('/update/manual-upload', {
|
||||
method: 'POST',
|
||||
body: formData,
|
||||
});
|
||||
}
|
||||
|
||||
export function confirmManualServerUpgrade(uploadToken: string) {
|
||||
return apiRequest<UploadedServerBinaryInfo>('/update/manual-upgrade', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ upload_token: uploadToken }),
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user