Optimize version fetching and update logic
Release NapCat / validate-version (push) Canceled after 0s
Release NapCat / Build-Framework (push) Canceled after 0s
Release NapCat / Build-Shell (push) Canceled after 0s
Release NapCat / Download-QNX64 (push) Canceled after 0s
Release NapCat / release-napcat (push) Canceled after 0s
Release NapCat / validate-version (push) Canceled after 0s
Release NapCat / Build-Framework (push) Canceled after 0s
Release NapCat / Build-Shell (push) Canceled after 0s
Release NapCat / Download-QNX64 (push) Canceled after 0s
Release NapCat / release-napcat (push) Canceled after 0s
Introduces lazy loading for release and action artifact versions, adds support for nightly.link mirrors, and improves artifact retrieval reliability. Removes unused loginService references, refactors update logic to handle action artifacts, and streamlines frontend/backend API parameters for version selection.
This commit is contained in:
1 parent
4940d72867
commit
f1756c4d1c
8 files changed
+420
-134
No files matched your search
@@ -293,11 +293,11 @@ const VersionSelectDialogContent: React.FC<VersionSelectDialogProps> = ({
|
||||
const pageSize = 15;
|
||||
|
||||
// 获取所有可用版本(带分页、过滤和搜索)
|
||||
// 懒加载:根据 activeTab 只获取对应类型的版本
|
||||
const { data: releasesData, loading: releasesLoading, error: releasesError } = useRequest(
|
||||
() => WebUIManager.getAllReleases({
|
||||
page: currentPage,
|
||||
pageSize,
|
||||
includeActions: true,
|
||||
type: activeTab,
|
||||
search: debouncedSearch
|
||||
}),
|
||||
|
||||
@@ -65,15 +65,15 @@ export default class WebUIManager {
|
||||
|
||||
/**
|
||||
* 获取所有可用的版本列表(支持分页、过滤和搜索)
|
||||
* 懒加载:根据 type 参数只获取对应类型的版本
|
||||
*/
|
||||
public static async getAllReleases (options: {
|
||||
page?: number;
|
||||
pageSize?: number;
|
||||
includeActions?: boolean;
|
||||
type?: 'release' | 'action' | 'all';
|
||||
search?: string;
|
||||
} = {}) {
|
||||
const { page = 1, pageSize = 20, includeActions = true, type = 'all', search = '' } = options;
|
||||
const { page = 1, pageSize = 20, type = 'release', search = '' } = options;
|
||||
const { data } = await serverRequest.get<ServerResponse<{
|
||||
versions: Array<{
|
||||
tag: string;
|
||||
@@ -94,7 +94,7 @@ export default class WebUIManager {
|
||||
};
|
||||
mirror?: string;
|
||||
}>>('/base/getAllReleases', {
|
||||
params: { page, pageSize, includeActions, type, search },
|
||||
params: { page, pageSize, type, search },
|
||||
});
|
||||
return data.data;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user