mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-05 07:26:36 +08:00
feat: add support for release channels in version upgrade and node agent updates
- Introduced ReleaseChannel type to manage stable and preview releases. - Updated DashboardTopbar to handle version upgrades based on selected release channel. - Enhanced node detail page to allow manual checks for agent updates on stable and preview channels. - Modified API endpoints to support fetching and upgrading based on release channels. - Updated UI components to reflect changes in version checking and upgrade processes. - Added tests for new functionality related to preview releases and agent updates.
This commit is contained in:
@@ -2,16 +2,20 @@ import { apiRequest } from '@/lib/api/client';
|
||||
|
||||
import type {
|
||||
LatestReleaseInfo,
|
||||
ReleaseChannel,
|
||||
UploadedServerBinaryInfo,
|
||||
} from '@/features/update/types';
|
||||
|
||||
export function getLatestRelease() {
|
||||
return apiRequest<LatestReleaseInfo>('/update/latest-release');
|
||||
export function getLatestRelease(channel: ReleaseChannel = 'stable') {
|
||||
return apiRequest<LatestReleaseInfo>(
|
||||
`/update/latest-release?channel=${channel}`,
|
||||
);
|
||||
}
|
||||
|
||||
export function upgradeServer() {
|
||||
export function upgradeServer(channel: ReleaseChannel = 'stable') {
|
||||
return apiRequest<LatestReleaseInfo>('/update/upgrade', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ channel }),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user