1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
| import type { ProviderConfig } from "@humansignal/app-common/blocks/StorageProviderForm/types/provider";
| import { IconCloudProviderAzure } from "@humansignal/icons";
| import { z } from "zod";
|
| export const azureProvider: ProviderConfig = {
| name: "azure",
| title: "Azure Blob 存储",
| description: "配置您的 Azure Blob 存储连接以及所有必需的 Label Studio 设置",
| icon: IconCloudProviderAzure,
| fields: [
| {
| name: "container",
| type: "text",
| label: "容器名称 (Container Name)",
| required: true,
| placeholder: "my-azure-container",
| schema: z.string().min(1, "Container name is required"),
| },
| {
| name: "prefix",
| type: "text",
| label: "存储桶前缀 (Bucket prefix)",
| placeholder: "path/to/files",
| schema: z.string().optional().default(""),
| target: "export",
| },
| {
| name: "account_name",
| type: "password",
| label: "账户名称 (Account Name)",
| autoComplete: "off",
| accessKey: true,
| placeholder: "mystorageaccount",
| schema: z.string().optional().default(""),
| },
| {
| name: "account_key",
| type: "password",
| label: "账户密钥 (Account Key)",
| autoComplete: "new-password",
| accessKey: true,
| placeholder: "Your storage account key",
| schema: z.string().optional().default(""),
| },
| {
| name: "presign",
| type: "toggle",
| label: "使用预签名 URL (开) / 通过平台代理 (关)",
| description:
| "启用预签名 URL 时,所有数据都将绕过平台,用户浏览器将直接从存储中读取数据",
| schema: z.boolean().default(true),
| target: "import",
| resetConnection: false,
| },
| {
| name: "presign_ttl",
| type: "counter",
| label: "预签名 URL 有效期(分钟)",
| min: 1,
| max: 10080,
| step: 1,
| schema: z.number().min(1).max(10080).default(15),
| target: "import",
| resetConnection: false,
| dependsOn: {
| field: "presign",
| value: true,
| },
| },
| ],
| layout: [
| { fields: ["container"] },
| { fields: ["prefix"] },
| { fields: ["account_name"] },
| { fields: ["account_key"] },
| { fields: ["presign", "presign_ttl"] },
| ],
| };
|
| export default azureProvider;
|
|