feat: add Yandex Disk support and update drive configurations

- Added Yandex Disk as a supported drive option in ImportDialog and SyncSetting components.
- Updated driveList to include Yandex Disk with appropriate configurations.
- Reorganized driveList entries for better clarity and consistency.
- Increased timeout duration for third-party requests from 6 seconds to 10 seconds in request utilities.
This commit is contained in:
troyeguo
2025-09-24 16:30:45 +08:00
parent d95d7909b4
commit 950fadf589
8 changed files with 123 additions and 97 deletions

View File

File diff suppressed because one or more lines are too long

View File

File diff suppressed because one or more lines are too long

View File

File diff suppressed because one or more lines are too long

View File

@@ -383,6 +383,7 @@ class ImportDialog extends React.Component<
let settingDrive = item.value;
if (
settingDrive === "dropbox" ||
settingDrive === "yandex" ||
settingDrive === "yiyiwu" ||
settingDrive === "dubox" ||
settingDrive === "google" ||

View File

@@ -8,96 +8,6 @@ export const driveList = [
scoped: false,
isCNAvailable: true,
},
{
label: "Dropbox",
value: "dropbox",
icon: "icon-dropbox",
isPro: true,
support: ["desktop", "browser", "phone"],
scoped: true,
isCNAvailable: false,
},
{
label: "Dubox",
value: "dubox",
icon: "icon-dubox",
isPro: true,
support: ["desktop", "phone"],
scoped: false,
isCNAvailable: true,
},
{
label: "115 Yun",
value: "yiyiwu",
icon: "icon-yiyiwu",
isPro: true,
support: ["desktop", "phone"],
scoped: false,
isCNAvailable: true,
},
{
label: "OneDrive",
value: "microsoft",
icon: "icon-onedrive",
isPro: true,
support: ["desktop", "browser", "phone"],
scoped: true,
isCNAvailable: true,
},
{
label: "Google Drive",
value: "google",
icon: "icon-googledrive",
isPro: true,
support: ["desktop", "browser", "phone"],
scoped: false,
isCNAvailable: false,
},
{
label: "MEGA",
value: "mega",
icon: "icon-mega",
isPro: true,
support: ["desktop", "browser"],
scoped: false,
isCNAvailable: false,
},
{
label: "Box",
value: "boxnet",
icon: "icon-box",
isPro: true,
support: ["desktop", "browser", "phone"],
scoped: false,
isCNAvailable: false,
},
{
label: "pCloud",
value: "pcloud",
icon: "icon-pcloud",
isPro: true,
support: ["desktop", "phone"],
scoped: true,
isCNAvailable: false,
},
{
label: "Aliyun Drive",
value: "adrive",
icon: "icon-adrive",
isPro: true,
support: ["desktop", "phone"],
scoped: false,
isCNAvailable: true,
},
{
label: "OneDrive (full access)",
value: "microsoft_exp",
icon: "icon-onedrive",
isPro: true,
support: ["desktop", "browser", "phone"],
scoped: false,
isCNAvailable: true,
},
{
label: "S3 Compatible",
value: "s3compatible",
@@ -116,6 +26,111 @@ export const driveList = [
scoped: true,
isCNAvailable: true,
},
{
label: "OneDrive",
value: "microsoft",
icon: "icon-onedrive",
isPro: true,
support: ["desktop", "browser", "phone"],
scoped: true,
isCNAvailable: true,
},
{
label: "Google Drive",
value: "google",
icon: "icon-googledrive",
isPro: true,
support: ["desktop", "browser", "phone"],
scoped: false,
isCNAvailable: false,
},
{
label: "Dropbox",
value: "dropbox",
icon: "icon-dropbox",
isPro: true,
support: ["desktop", "browser", "phone"],
scoped: true,
isCNAvailable: false,
},
{
label: "Dubox",
value: "dubox",
icon: "icon-dubox",
isPro: true,
support: ["desktop", "phone"],
scoped: false,
isCNAvailable: true,
},
{
label: "Box",
value: "boxnet",
icon: "icon-box",
isPro: true,
support: ["desktop", "browser", "phone"],
scoped: false,
isCNAvailable: false,
},
{
label: "MEGA",
value: "mega",
icon: "icon-mega",
isPro: true,
support: ["desktop", "browser"],
scoped: false,
isCNAvailable: false,
},
{
label: "Aliyun Drive",
value: "adrive",
icon: "icon-adrive",
isPro: true,
support: ["desktop", "phone"],
scoped: false,
isCNAvailable: true,
},
{
label: "Yandex Disk",
value: "yandex",
icon: "icon-yandex",
isPro: true,
support: ["desktop", "browser", "phone"],
scoped: false,
isCNAvailable: false,
},
{
label: "115 Yun",
value: "yiyiwu",
icon: "icon-yiyiwu",
isPro: true,
support: ["desktop", "phone"],
scoped: false,
isCNAvailable: true,
},
{
label: "pCloud",
value: "pcloud",
icon: "icon-pcloud",
isPro: true,
support: ["desktop", "phone"],
scoped: true,
isCNAvailable: false,
},
{
label: "OneDrive (full access)",
value: "microsoft_exp",
icon: "icon-onedrive",
isPro: true,
support: ["desktop", "browser", "phone"],
scoped: false,
isCNAvailable: true,
},
{
label: "FTP",
value: "ftp",
@@ -369,6 +384,14 @@ export const driveInputConfig: DriveInputConfig = {
required: true,
},
],
yandex: [
{
label: "Token",
value: "token",
type: "text",
required: true,
},
],
dubox: [
{
label: "Token",

View File

@@ -96,6 +96,7 @@ class SyncSetting extends React.Component<SettingInfoProps, SettingInfoState> {
let settingDrive = targetDrive;
if (
settingDrive === "dropbox" ||
settingDrive === "yandex" ||
settingDrive === "dubox" ||
settingDrive === "yiyiwu" ||
settingDrive === "google" ||
@@ -444,6 +445,7 @@ class SyncSetting extends React.Component<SettingInfoProps, SettingInfoState> {
</div>
{(this.props.settingDrive === "dropbox" ||
this.props.settingDrive === "dubox" ||
this.props.settingDrive === "yandex" ||
this.props.settingDrive === "yiyiwu" ||
this.props.settingDrive === "google" ||
this.props.settingDrive === "boxnet" ||

View File

@@ -37,7 +37,7 @@ export const onSyncCallback = async (service: string, authCode: string) => {
);
return;
}
}, 6000);
}, 10000);
let result = await syncUtil.authToken(authCode);
clearTimeout(timer);
if (!result.refresh_token) {
@@ -100,7 +100,7 @@ export const encryptToken = async (service: string, config: any) => {
);
return;
}
}, 6000);
}, 10000);
let response = await thirdpartyRequest.encryptToken({
token: syncToken,
});
@@ -148,7 +148,7 @@ export const decryptToken = async (service: string) => {
);
return;
}
}, 6000);
}, 10000);
let encryptedToken = await TokenService.getToken(service + "_token");
clearTimeout(timer);
if (!encryptedToken || encryptedToken === "{}") {

View File

@@ -32,7 +32,7 @@ export const loginRegister = async (service: string, code: string) => {
);
return;
}
}, 6000);
}, 10000);
let response = await userRequest.loginRegister({
code,
provider: service,