mirror of
https://github.com/cloudreve/frontend.git
synced 2025-12-25 19:52:48 +00:00
feat(oss): upgrade to SDK v2 (#2963)
This commit is contained in:
parent
18c4e3d845
commit
7c07a4cab9
|
|
@ -1032,7 +1032,8 @@
|
|||
"saveToSharePoint": "Dateien in SharePoint speichern",
|
||||
"sharePointUrlDes": "Geben Sie die SharePoint-Site-URL ein. Nach dem Verlust des Fokus konvertiert das System sie automatisch in die korrekte Treiber-Kennung.",
|
||||
"ks3selectRegionDes": "Geben Sie den Regionscode des Speicher-Buckets ein, z.B. <0>BEIJING</0>.",
|
||||
"ks3EndpointPathStyle": "Wählen Sie das Format der KS3-Endpoint-Adresse."
|
||||
"ks3EndpointPathStyle": "Wählen Sie das Format der KS3-Endpoint-Adresse.",
|
||||
"ossRegionDes": "Geben Sie den Regionscode ein, in dem sich der Bucket befindet, z.B. <0>cn-hangzhou</0>. Sie können die entsprechende Region in der Tabelle <1>OSS-Regionen und Endpunkte</1> finden und die entsprechende <2>Regions-ID</2> ausfüllen."
|
||||
},
|
||||
"node": {
|
||||
"slave": "Slave",
|
||||
|
|
|
|||
|
|
@ -1033,7 +1033,8 @@
|
|||
"saveToSharePoint": "Save files to SharePoint",
|
||||
"sharePointUrlDes": "Enter the SharePoint site URL. After losing focus, the system will automatically convert it to the correct driver identifier.",
|
||||
"ks3selectRegionDes": "Enter the region code of the storage bucket, e.g. <0>BEIJING</0> .",
|
||||
"ks3EndpointPathStyle": "Select the format of the KS3 Endpoint address."
|
||||
"ks3EndpointPathStyle": "Select the format of the KS3 Endpoint address.",
|
||||
"ossRegionDes": "Enter the region code of the storage bucket, e.g. <0>cn-hangzhou</0>. You can find the corresponding region in the <1>OSS regions and endpoints</1> table and fill in the corresponding <2>Region ID</2>."
|
||||
},
|
||||
"node": {
|
||||
"slave": "slave",
|
||||
|
|
|
|||
|
|
@ -1032,7 +1032,8 @@
|
|||
"saveToSharePoint": "Guardar archivos en SharePoint",
|
||||
"sharePointUrlDes": "Ingresa la URL del sitio SharePoint. Después de perder el foco, el sistema convertirá automáticamente a la identificación correcta del controlador.",
|
||||
"ks3selectRegionDes": "Ingresa el código de región del bucket de almacenamiento, ej. <0>BEIJING</0> .",
|
||||
"ks3EndpointPathStyle": "Selecciona el formato de la dirección del Endpoint KS3."
|
||||
"ks3EndpointPathStyle": "Selecciona el formato de la dirección del Endpoint KS3.",
|
||||
"ossRegionDes": "Ingresa el código de región donde se encuentra el bucket, ej. <0>cn-hangzhou</0>. Puedes encontrar la región correspondiente en la tabla <1>Regiones y endpoints de OSS</1> y completar el <2>ID de región</2> correspondiente."
|
||||
},
|
||||
"node": {
|
||||
"slave": "esclavo",
|
||||
|
|
|
|||
|
|
@ -1032,7 +1032,8 @@
|
|||
"saveToSharePoint": "Sauvegarder les fichiers dans SharePoint",
|
||||
"sharePointUrlDes": "Entrez l'URL du site SharePoint. Après avoir perdu le focus, le système convertira automatiquement vers l'identifiant de pilote correct.",
|
||||
"ks3selectRegionDes": "Entrez le code de région du bucket de stockage, par ex. <0>BEIJING</0> .",
|
||||
"ks3EndpointPathStyle": "Sélectionnez le format de l'adresse Endpoint KS3."
|
||||
"ks3EndpointPathStyle": "Sélectionnez le format de l'adresse Endpoint KS3.",
|
||||
"ossRegionDes": "Entrez le code de région où se trouve le bucket, par ex. <0>cn-hangzhou</0>. Vous pouvez trouver la région correspondante dans le tableau <1>Régions et points de terminaison OSS</1> et remplir l'<2>ID de région</2> correspondant."
|
||||
},
|
||||
"node": {
|
||||
"slave": "esclave",
|
||||
|
|
|
|||
|
|
@ -1031,7 +1031,8 @@
|
|||
"saveToSharePoint": "Salva i file su SharePoint",
|
||||
"sharePointUrlDes": "Inserisci l'URL del sito SharePoint. Dopo aver perso il focus, il sistema lo convertirà automaticamente nell'identificatore driver corretto.",
|
||||
"ks3selectRegionDes": "Inserisci il codice regione del bucket di archiviazione, ad es. <0>BEIJING</0>.",
|
||||
"ks3EndpointPathStyle": "Seleziona il formato dell'indirizzo KS3 Endpoint."
|
||||
"ks3EndpointPathStyle": "Seleziona il formato dell'indirizzo KS3 Endpoint.",
|
||||
"ossRegionDes": "Inserisci il codice regione dove si trova il bucket, ad es. <0>cn-hangzhou</0>. Puoi trovare la regione corrispondente nella tabella <1>Regioni ed endpoint OSS</1> e inserire il <2>ID regione</2> corrispondente."
|
||||
},
|
||||
"node": {
|
||||
"slave": "slave",
|
||||
|
|
|
|||
|
|
@ -1033,7 +1033,8 @@
|
|||
"saveToSharePoint": "SharePointにファイルを保存",
|
||||
"sharePointUrlDes": "SharePointサイトのURLを入力してください。フォーカスが外れると、システムが自動的に正しいドライブ識別子に変換します。",
|
||||
"ks3selectRegionDes": "バケットが存在するリージョンコードを入力してください(例:<0>BEIJING</0>)。",
|
||||
"ks3EndpointPathStyle": "パス形式エンドポイントの強制使用を選択してください。"
|
||||
"ks3EndpointPathStyle": "パス形式エンドポイントの強制使用を選択してください。",
|
||||
"ossRegionDes": "バケットが存在するリージョンコードを入力してください(例:<0>cn-hangzhou</0>)。<1>OSSリージョンとエンドポイント</1>の表で対応するリージョンを見つけ、対応する<2>リージョンID</2>を入力できます。"
|
||||
},
|
||||
"node": {
|
||||
"slave": "スレーブ",
|
||||
|
|
|
|||
|
|
@ -1033,7 +1033,8 @@
|
|||
"saveToSharePoint": "파일을 SharePoint에 저장",
|
||||
"sharePointUrlDes": "SharePoint 사이트 URL을 입력하세요. 포커스를 잃으면 시스템이 자동으로 올바른 드라이브 식별자로 변환합니다.",
|
||||
"ks3selectRegionDes": "스토리지 버킷이 위치한 지역 코드를 입력하세요. 예: <0>BEIJING</0>.",
|
||||
"ks3EndpointPathStyle": "경로 형식 Endpoint를 강제로 사용할지 선택하세요."
|
||||
"ks3EndpointPathStyle": "경로 형식 Endpoint를 강제로 사용할지 선택하세요.",
|
||||
"ossRegionDes": "버킷이 위치한 지역 코드를 입력하세요. 예: <0>cn-hangzhou</0>. <1>OSS 지역 및 엔드포인트</1> 표에서 해당 지역을 찾아 해당하는 <2>지역 ID</2>를 입력할 수 있습니다."
|
||||
},
|
||||
"node": {
|
||||
"slave": "슬레이브",
|
||||
|
|
|
|||
|
|
@ -1032,7 +1032,8 @@
|
|||
"saveToSharePoint": "Salvar arquivos no SharePoint",
|
||||
"sharePointUrlDes": "Digite a URL do site SharePoint. Após perder o foco, o sistema converterá automaticamente para o identificador de driver correto.",
|
||||
"ks3selectRegionDes": "Digite o código da região do bucket de armazenamento, ex. <0>BEIJING</0> .",
|
||||
"ks3EndpointPathStyle": "Selecione o formato do endereço do Endpoint KS3."
|
||||
"ks3EndpointPathStyle": "Selecione o formato do endereço do Endpoint KS3.",
|
||||
"ossRegionDes": "Digite o código da região onde está localizado o bucket, ex. <0>cn-hangzhou</0>. Você pode encontrar a região correspondente na tabela <1>Regiões e endpoints do OSS</1> e preencher o <2>ID da região</2> correspondente."
|
||||
},
|
||||
"node": {
|
||||
"slave": "escravo",
|
||||
|
|
|
|||
|
|
@ -1034,7 +1034,8 @@
|
|||
"saveToSharePoint": "Сохранить файлы в SharePoint",
|
||||
"sharePointUrlDes": "Введите URL сайта SharePoint. После потери фокуса система автоматически преобразует его в правильный идентификатор диска.",
|
||||
"ks3selectRegionDes": "Введите код региона, где находится корзина, например <0>BEIJING</0>.",
|
||||
"ks3EndpointPathStyle": "Выберите, принудительно ли использовать Endpoint в формате пути."
|
||||
"ks3EndpointPathStyle": "Выберите, принудительно ли использовать Endpoint в формате пути.",
|
||||
"ossRegionDes": "Введите код региона, где находится корзина, например <0>cn-hangzhou</0>. Вы можете найти соответствующий регион в таблице <1>Регионы и конечные точки OSS</1> и заполнить соответствующий <2>ID региона</2>."
|
||||
},
|
||||
"node": {
|
||||
"slave": "Подчиненный узел",
|
||||
|
|
|
|||
|
|
@ -1033,7 +1033,8 @@
|
|||
"saveToSharePoint": "保存文件到 SharePoint",
|
||||
"sharePointUrlDes": "输入 SharePoint 站点 URL。失去焦点后,系统将自动转换为正确的驱动器标识。",
|
||||
"ks3selectRegionDes": "输入存储桶所在的区域代码,如 <0>BEIJING</0>。",
|
||||
"ks3EndpointPathStyle": "选择是否强制使用路径格式 Endpoint。"
|
||||
"ks3EndpointPathStyle": "选择是否强制使用路径格式 Endpoint。",
|
||||
"ossRegionDes": "输入存储桶所在的区域代码,如 <0>cn-hangzhou</0>。你可以在 <1>OSS地域和访问域名</1> 的表格中找到对应地域,并填写对应的 <2>地域ID</2>。"
|
||||
},
|
||||
"node": {
|
||||
"slave": "从机",
|
||||
|
|
|
|||
|
|
@ -1033,7 +1033,8 @@
|
|||
"saveToSharePoint": "儲存檔案到 SharePoint",
|
||||
"sharePointUrlDes": "輸入 SharePoint 站點 URL。失去焦點後,系統將自動轉換為正確的驅動器標識。",
|
||||
"ks3selectRegionDes": "輸入儲存桶所在的區域程式碼,如 <0>BEIJING</0>。",
|
||||
"ks3EndpointPathStyle": "選擇是否強制使用路徑格式 Endpoint。"
|
||||
"ks3EndpointPathStyle": "選擇是否強制使用路徑格式 Endpoint。",
|
||||
"ossRegionDes": "輸入儲存桶所在的區域代碼,如 <0>cn-hangzhou</0>。你可以在 <1>OSS地域和訪問域名</1> 的表格中找到對應地域,並填寫對應的 <2>地域ID</2>。"
|
||||
},
|
||||
"node": {
|
||||
"slave": "從機",
|
||||
|
|
|
|||
|
|
@ -413,16 +413,10 @@ const BasicInfoSection = () => {
|
|||
</SettingForm>
|
||||
</>
|
||||
)}
|
||||
{(values.type === PolicyType.s3 || values.type === PolicyType.ks3) && (
|
||||
<SettingForm title={t("policy.s3Region")} lgWidth={5}>
|
||||
{policyProps.regionCode && (
|
||||
<SettingForm title={t(policyProps.regionCode ?? "")} lgWidth={5}>
|
||||
<DenseFilledTextField fullWidth required value={values.settings?.region} onChange={onS3RegionChange} />
|
||||
<NoMarginHelperText>
|
||||
<Trans
|
||||
i18nKey={values.type === PolicyType.s3 ? "policy.selectRegionDes" : "policy.ks3selectRegionDes"}
|
||||
ns="dashboard"
|
||||
components={[<Code />]}
|
||||
/>
|
||||
</NoMarginHelperText>
|
||||
<NoMarginHelperText>{policyProps.regionCodeDes}</NoMarginHelperText>
|
||||
</SettingForm>
|
||||
)}
|
||||
<SettingForm title={t("policy.accessCredential")} lgWidth={5}>
|
||||
|
|
|
|||
|
|
@ -62,6 +62,8 @@ export interface PolicyProps {
|
|||
corsExposedHeaders?: string[];
|
||||
endpointNotEnforcePrefix?: boolean;
|
||||
pro?: boolean;
|
||||
regionCode?: string;
|
||||
regionCodeDes?: React.ReactNode;
|
||||
}
|
||||
|
||||
export const PolicyPropsMap: Record<PolicyType, PolicyProps> = {
|
||||
|
|
@ -102,6 +104,8 @@ export const PolicyPropsMap: Record<PolicyType, PolicyProps> = {
|
|||
chunkSizeMin: 5 * 1024 * 1024, //5MB
|
||||
chunkSizeMax: 5 * 1024 * 1024 * 1024, //5GB
|
||||
chunkSizeDes: "policy.chunkSizeDesS3",
|
||||
regionCode: "policy.s3Region",
|
||||
regionCodeDes: <Trans i18nKey={"policy.selectRegionDes"} ns="dashboard" components={[<Code />]} />,
|
||||
},
|
||||
[PolicyType.ks3]: {
|
||||
name: "policy.ks3",
|
||||
|
|
@ -118,6 +122,8 @@ export const PolicyPropsMap: Record<PolicyType, PolicyProps> = {
|
|||
chunkSizeMin: 5 * 1024 * 1024, //5MB
|
||||
chunkSizeMax: 5 * 1024 * 1024 * 1024, //5GB
|
||||
chunkSizeDes: "policy.chunkSizeDesS3",
|
||||
regionCode: "policy.s3Region",
|
||||
regionCodeDes: <Trans i18nKey={"policy.ks3selectRegionDes"} ns="dashboard" components={[<Code />]} />,
|
||||
},
|
||||
[PolicyType.cos]: {
|
||||
name: "policy.cos",
|
||||
|
|
@ -195,6 +201,18 @@ export const PolicyPropsMap: Record<PolicyType, PolicyProps> = {
|
|||
]}
|
||||
/>
|
||||
),
|
||||
regionCode: "policy.s3Region",
|
||||
regionCodeDes: (
|
||||
<Trans
|
||||
i18nKey={"policy.ossRegionDes"}
|
||||
ns="dashboard"
|
||||
components={[
|
||||
<Code />,
|
||||
<Link href="https://www.alibabacloud.com/help/oss/regions-and-endpoints" target="_blank" />,
|
||||
<Code />,
|
||||
]}
|
||||
/>
|
||||
),
|
||||
},
|
||||
[PolicyType.obs]: {
|
||||
name: "policy.obs",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { Button, Checkbox, Collapse, FormControl, FormControlLabel, Stack } from "@mui/material";
|
||||
import { useSnackbar } from "notistack";
|
||||
import { useRef, useState } from "react";
|
||||
import { useMemo, useRef, useState } from "react";
|
||||
import { Trans, useTranslation } from "react-i18next";
|
||||
import { createStoragePolicyCors } from "../../../../../api/api";
|
||||
import { StoragePolicy } from "../../../../../api/dashboard";
|
||||
|
|
@ -15,6 +15,7 @@ import { NoMarginHelperText } from "../../../Settings/Settings";
|
|||
import { AddWizardProps } from "../../AddWizardDialog";
|
||||
import BucketACLInput from "../../EditStoragePolicy/BucketACLInput";
|
||||
import BucketCorsTable from "../../EditStoragePolicy/BucketCorsTable";
|
||||
import { PolicyPropsMap } from "../../StoragePolicySetting";
|
||||
|
||||
const KS3Wizard = ({ onSubmit }: AddWizardProps) => {
|
||||
const { t } = useTranslation("dashboard");
|
||||
|
|
@ -39,6 +40,10 @@ const KS3Wizard = ({ onSubmit }: AddWizardProps) => {
|
|||
edges: {},
|
||||
});
|
||||
|
||||
const policyProps = useMemo(() => {
|
||||
return PolicyPropsMap[PolicyType.ks3];
|
||||
}, []);
|
||||
|
||||
const hamdleCreateCors = () => {
|
||||
if (!formRef.current?.checkValidity()) {
|
||||
formRef.current?.reportValidity();
|
||||
|
|
@ -130,16 +135,14 @@ const KS3Wizard = ({ onSubmit }: AddWizardProps) => {
|
|||
<Trans i18nKey="policy.ks3EndpointPathStyle" ns="dashboard" components={[<Code />]} />
|
||||
</NoMarginHelperText>
|
||||
</SettingForm>
|
||||
<SettingForm title={t("policy.s3Region")} lgWidth={12}>
|
||||
<SettingForm title={t(policyProps.regionCode ?? "")} lgWidth={12}>
|
||||
<DenseFilledTextField
|
||||
fullWidth
|
||||
required
|
||||
value={policy.settings?.region}
|
||||
onChange={(e) => setPolicy({ ...policy, settings: { ...policy.settings, region: e.target.value } })}
|
||||
/>
|
||||
<NoMarginHelperText>
|
||||
<Trans i18nKey="policy.ks3selectRegionDes" ns="dashboard" components={[<Code />]} />
|
||||
</NoMarginHelperText>
|
||||
<NoMarginHelperText>{policyProps.regionCodeDes}</NoMarginHelperText>
|
||||
</SettingForm>
|
||||
<SettingForm title={t("policy.accessCredential")} lgWidth={12}>
|
||||
<FormControl fullWidth>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { Button, Collapse, FormControl, Link, Stack } from "@mui/material";
|
||||
import { useSnackbar } from "notistack";
|
||||
import { useRef, useState } from "react";
|
||||
import { useMemo, useRef, useState } from "react";
|
||||
import { Trans, useTranslation } from "react-i18next";
|
||||
import { createStoragePolicyCors } from "../../../../../api/api";
|
||||
import { StoragePolicy } from "../../../../../api/dashboard";
|
||||
|
|
@ -14,6 +14,7 @@ import { NoMarginHelperText } from "../../../Settings/Settings";
|
|||
import { AddWizardProps } from "../../AddWizardDialog";
|
||||
import BucketACLInput from "../../EditStoragePolicy/BucketACLInput";
|
||||
import BucketCorsTable from "../../EditStoragePolicy/BucketCorsTable";
|
||||
import { PolicyPropsMap } from "../../StoragePolicySetting";
|
||||
const OssWizard = ({ onSubmit }: AddWizardProps) => {
|
||||
const { t } = useTranslation("dashboard");
|
||||
const dispatch = useAppDispatch();
|
||||
|
|
@ -39,6 +40,10 @@ const OssWizard = ({ onSubmit }: AddWizardProps) => {
|
|||
edges: {},
|
||||
});
|
||||
|
||||
const policyProps = useMemo(() => {
|
||||
return PolicyPropsMap[PolicyType.oss];
|
||||
}, []);
|
||||
|
||||
const hamdleCreateCors = () => {
|
||||
if (!formRef.current?.checkValidity()) {
|
||||
formRef.current?.reportValidity();
|
||||
|
|
@ -111,6 +116,15 @@ const OssWizard = ({ onSubmit }: AddWizardProps) => {
|
|||
{t("policy.ossEndpointDesInternalHint")}
|
||||
</NoMarginHelperText>
|
||||
</SettingForm>
|
||||
<SettingForm title={t(policyProps.regionCode ?? "")} lgWidth={12}>
|
||||
<DenseFilledTextField
|
||||
fullWidth
|
||||
required
|
||||
value={policy.settings?.region}
|
||||
onChange={(e) => setPolicy({ ...policy, settings: { ...policy.settings, region: e.target.value } })}
|
||||
/>
|
||||
<NoMarginHelperText>{policyProps.regionCodeDes}</NoMarginHelperText>
|
||||
</SettingForm>
|
||||
<SettingForm title={t("policy.accessCredential")} lgWidth={12}>
|
||||
<FormControl fullWidth>
|
||||
<DenseFilledTextField
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { Button, Checkbox, Collapse, FormControl, FormControlLabel, Stack } from "@mui/material";
|
||||
import { useSnackbar } from "notistack";
|
||||
import { useRef, useState } from "react";
|
||||
import { useMemo, useRef, useState } from "react";
|
||||
import { Trans, useTranslation } from "react-i18next";
|
||||
import { createStoragePolicyCors } from "../../../../../api/api";
|
||||
import { StoragePolicy } from "../../../../../api/dashboard";
|
||||
|
|
@ -15,6 +15,7 @@ import { NoMarginHelperText } from "../../../Settings/Settings";
|
|||
import { AddWizardProps } from "../../AddWizardDialog";
|
||||
import BucketACLInput from "../../EditStoragePolicy/BucketACLInput";
|
||||
import BucketCorsTable from "../../EditStoragePolicy/BucketCorsTable";
|
||||
import { PolicyPropsMap } from "../../StoragePolicySetting";
|
||||
|
||||
const S3Wizard = ({ onSubmit }: AddWizardProps) => {
|
||||
const { t } = useTranslation("dashboard");
|
||||
|
|
@ -39,6 +40,10 @@ const S3Wizard = ({ onSubmit }: AddWizardProps) => {
|
|||
edges: {},
|
||||
});
|
||||
|
||||
const policyProps = useMemo(() => {
|
||||
return PolicyPropsMap[PolicyType.s3];
|
||||
}, []);
|
||||
|
||||
const hamdleCreateCors = () => {
|
||||
if (!formRef.current?.checkValidity()) {
|
||||
formRef.current?.reportValidity();
|
||||
|
|
@ -130,16 +135,14 @@ const S3Wizard = ({ onSubmit }: AddWizardProps) => {
|
|||
<Trans i18nKey="policy.s3EndpointPathStyle" ns="dashboard" components={[<Code />]} />
|
||||
</NoMarginHelperText>
|
||||
</SettingForm>
|
||||
<SettingForm title={t("policy.s3Region")} lgWidth={12}>
|
||||
<SettingForm title={t(policyProps.regionCode ?? "")} lgWidth={12}>
|
||||
<DenseFilledTextField
|
||||
fullWidth
|
||||
required
|
||||
value={policy.settings?.region}
|
||||
onChange={(e) => setPolicy({ ...policy, settings: { ...policy.settings, region: e.target.value } })}
|
||||
/>
|
||||
<NoMarginHelperText>
|
||||
<Trans i18nKey="policy.selectRegionDes" ns="dashboard" components={[<Code />]} />
|
||||
</NoMarginHelperText>
|
||||
<NoMarginHelperText>{policyProps.regionCodeDes}</NoMarginHelperText>
|
||||
</SettingForm>
|
||||
<SettingForm title={t("policy.accessCredential")} lgWidth={12}>
|
||||
<FormControl fullWidth>
|
||||
|
|
|
|||
Loading…
Reference in New Issue