@nocobase/plugin-ai 3.0.0-alpha.6 → 3.0.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai/docs/nocobase/ai/ai-quick-start.md +1 -1
- package/dist/ai/docs/nocobase/ai/claude-code/index.md +1 -1
- package/dist/ai/docs/nocobase/ai/codex/index.md +1 -1
- package/dist/ai/docs/nocobase/ai/hermes-agent/index.md +1 -1
- package/dist/ai/docs/nocobase/ai/index.md +6 -25
- package/dist/ai/docs/nocobase/ai/install-nocobase-app.md +1 -1
- package/dist/ai/docs/nocobase/ai/openclaw/index.md +1 -1
- package/dist/ai/docs/nocobase/ai/opencode/index.md +1 -1
- package/dist/ai/docs/nocobase/ai/quick-start.mdx +9 -7
- package/dist/ai/docs/nocobase/ai/workbuddy/index.md +1 -1
- package/dist/ai/docs/nocobase/ai-builder/ai-portal/agent-workflow.md +153 -0
- package/dist/ai/docs/nocobase/ai-builder/ai-portal/components.md +134 -0
- package/dist/ai/docs/nocobase/ai-builder/ai-portal/deploy.md +164 -0
- package/dist/ai/docs/nocobase/ai-builder/ai-portal/index.md +144 -0
- package/dist/ai/docs/nocobase/ai-builder/ai-portal/model-selection.md +120 -0
- package/dist/ai/docs/nocobase/ai-builder/ai-portal/project-structure.md +128 -0
- package/dist/ai/docs/nocobase/ai-builder/index.md +73 -32
- package/dist/ai/docs/nocobase/ai-builder/ui-builder.md +2 -0
- package/dist/ai/docs/nocobase/ai-dev/index.md +2 -1
- package/dist/ai/docs/nocobase/api/cli/index.md +1 -1
- package/dist/ai/docs/nocobase/api/cli/portal/dev.md +21 -9
- package/dist/ai/docs/nocobase/file-manager/file-preview/index.md +44 -3
- package/dist/ai/docs/nocobase/file-manager/storage/aliyun-oss.md +100 -3
- package/dist/ai/docs/nocobase/nocobase-cli/installation/cli.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-action-bulk-edit/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-action-bulk-update/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-action-custom-request/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-action-duplicate/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-action-export/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-action-import/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-action-print/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-ai/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-ai-gigachat/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-api-doc/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-api-keys/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-async-task-manager/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-audit-logs/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-auth/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-auth-sms/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-backup-restore/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-backups/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-block-comment/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-block-grid-card/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-block-iframe/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-block-list/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-block-markdown/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-block-multi-step-form/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-block-template/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-block-tree/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-block-workbench/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-calendar/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-charts/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-client/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-collection-fdw/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-collection-sql/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-collection-tree/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-comments/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-custom-variables/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-data-source-main/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-data-source-manager/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-data-visualization/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-data-visualization-echarts/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-departments/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-embed/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-environment-variables/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-error-handler/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-attachment-url/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-china-region/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-code/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-formula/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-m2m-array/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-markdown-vditor/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-sequence/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-sort/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-file-manager/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-file-previewer-office/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-flow-engine/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-form-drafts/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-gantt/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-graph-collection-manager/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-idp-oauth/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-kanban/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-license/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-locale-tester/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-localization/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-logger/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-map/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-mcp-server/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-mobile/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-mobile-client/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-multi-app-manager/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-multi-app-share-collection/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-multi-keyword-filter/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-notification-email/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-notification-in-app-message/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-notification-manager/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-public-forms/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-snapshot-field/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-system-settings/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-text-copy/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-theme-editor/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-ui-layout/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-ui-schema-storage/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-ui-templates/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-user-data-sync/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-users/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-verification/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-action-trigger/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-aggregate/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-cc/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-custom-action-trigger/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-date-calculation/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-delay/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-dynamic-calculation/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-javascript/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-json-variable-mapping/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-loop/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-mailer/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-manual/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-notification/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-parallel/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-request/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-request-interceptor/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-response-message/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-sql/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-test/index.md +1 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-variable/index.md +1 -1
- package/dist/ai/docs/nocobase/workflow/nodes/javascript.md +21 -1
- package/dist/client/244.da833c04c5b64be4.js +10 -0
- package/dist/client/index.js +2 -2
- package/dist/client-v2/244.7451d5c4713eced3.js +10 -0
- package/dist/client-v2/index.js +2 -2
- package/dist/client-v2/models/ai-employees/AIEmployeeShortcutModel.d.ts +2 -0
- package/dist/client-v2/pages/EmployeesPage.d.ts +3 -0
- package/dist/externalVersion.js +15 -15
- package/dist/locale/en-US.json +3 -0
- package/dist/locale/zh-CN.json +3 -0
- package/dist/node_modules/@langchain/mistralai/package.json +1 -1
- package/dist/node_modules/@langchain/xai/package.json +1 -1
- package/dist/node_modules/fs-extra/package.json +1 -1
- package/dist/node_modules/jsonrepair/package.json +1 -1
- package/dist/node_modules/just-bash/package.json +1 -1
- package/dist/node_modules/nodejs-snowflake/package.json +1 -1
- package/dist/node_modules/openai/package.json +1 -1
- package/dist/node_modules/zod/package.json +1 -1
- package/dist/server/ai-employees/ai-conversations.d.ts +2 -1
- package/dist/server/ai-employees/ai-conversations.js +2 -0
- package/dist/server/collections/ai-conversations.js +5 -0
- package/dist/server/migrations/20260803185305-migrate-ai-conversations-portal-name.d.ts +14 -0
- package/dist/server/migrations/20260803185305-migrate-ai-conversations-portal-name.js +52 -0
- package/dist/server/resource/aiConversations.js +14 -2
- package/package.json +2 -2
- package/dist/client/244.145eb763339a109b.js +0 -10
- package/dist/client-v2/244.64cb9d3ee27dcdc6.js +0 -10
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "nb portal dev"
|
|
3
|
-
description: "nb portal dev command reference: start a
|
|
4
|
-
keywords: "nb portal dev,NocoBase CLI,Portal"
|
|
3
|
+
description: "nb portal dev command reference: start development mode for a Portal's local source directory."
|
|
4
|
+
keywords: "nb portal dev,NocoBase CLI,Portal,development mode,local development"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# nb portal dev
|
|
8
8
|
|
|
9
|
-
Start development mode for the specified portal
|
|
9
|
+
Start development mode for the specified Portal's local source directory. It is normally used after [`nb portal create`](./create.md) or [`nb portal pull`](./pull.md).
|
|
10
|
+
|
|
11
|
+
It refreshes `.env` and `.env.local` in the local source directory, then runs `pnpm dev` there.
|
|
10
12
|
|
|
11
13
|
## Usage
|
|
12
14
|
|
|
@@ -18,22 +20,32 @@ nb portal dev <portal> [flags]
|
|
|
18
20
|
|
|
19
21
|
| Flag | Type | Description |
|
|
20
22
|
| --- | --- | --- |
|
|
21
|
-
| `<portal>` | string | Portal name or slug
|
|
22
|
-
| `--env`, `-e` | string | CLI env name. If omitted, the current env is used
|
|
23
|
-
| `--yes`, `-y` | boolean | Skip
|
|
23
|
+
| `<portal>` | string | Portal name or slug |
|
|
24
|
+
| `--env`, `-e` | string | CLI env name. If omitted, the current env is used |
|
|
25
|
+
| `--yes`, `-y` | boolean | Skip the interactive confirmation when an explicit `--env` differs from the current env |
|
|
24
26
|
|
|
25
27
|
## Examples
|
|
26
28
|
|
|
29
|
+
Start development mode for a Portal in the current env:
|
|
30
|
+
|
|
27
31
|
```bash
|
|
28
32
|
nb portal dev customer
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Start development mode for a Portal in a specified env:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
29
38
|
nb portal dev customer --env dev --yes
|
|
30
39
|
```
|
|
31
40
|
|
|
32
41
|
## Notes
|
|
33
42
|
|
|
34
|
-
|
|
43
|
+
`dev` starts the dev server from the Portal's local source directory. It doesn't create a Portal record, and it doesn't pull remote source; if the local source directory doesn't exist, use [`nb portal create`](./create.md) or [`nb portal pull`](./pull.md) first.
|
|
44
|
+
|
|
45
|
+
The local source directory must contain `package.json`. `ssh` envs don't support starting Portal development mode yet.
|
|
35
46
|
|
|
36
47
|
## Related Commands
|
|
37
48
|
|
|
38
|
-
- [`nb portal`](./
|
|
39
|
-
- [`nb
|
|
49
|
+
- [`nb portal create`](./create.md)
|
|
50
|
+
- [`nb portal pull`](./pull.md)
|
|
51
|
+
- [`nb portal deploy`](./deploy.md)
|
|
@@ -8,12 +8,53 @@ For file types that do not support native preview, you can enable preview functi
|
|
|
8
8
|
|
|
9
9
|
Currently, NocoBase provides the following file preview plugins:
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
- [Office File Preview Plugin](./ms-office.md)
|
|
12
12
|
|
|
13
|
-
## PDF preview
|
|
13
|
+
## PDF preview mechanism
|
|
14
14
|
|
|
15
|
-
NocoBase
|
|
15
|
+
NocoBase selects the PDF preview method according to whether the file URL has the same origin as the current page:
|
|
16
|
+
|
|
17
|
+
| File URL | Common storage type | Preview method | CORS requirement |
|
|
18
|
+
| --- | --- | --- | --- |
|
|
19
|
+
| Same origin as NocoBase | Local storage | NocoBase reads the file and renders it with the built-in PDF.js viewer | No cross-origin CORS involved |
|
|
20
|
+
| Cross-origin | Third-party storage such as OSS, S3, COS, or a CDN | The browser opens the file URL in an iframe | The iframe preview itself does not require CORS |
|
|
21
|
+
|
|
22
|
+
:::tip What determines the preview method
|
|
23
|
+
|
|
24
|
+
The preview method depends on whether the file URL is same-origin, not directly on the storage engine name. Local storage served from a separate file domain is treated as cross-origin. Third-party storage accessed through a same-origin NocoBase proxy is treated as same-origin.
|
|
25
|
+
|
|
26
|
+
:::
|
|
27
|
+
|
|
28
|
+
### Local storage or a same-origin URL
|
|
29
|
+
|
|
30
|
+
Local storage URLs usually start with `/storage/uploads/` and have the same origin as the NocoBase page. During preview, NocoBase reads the PDF data and passes it to the built-in PDF.js viewer to render pages and text.
|
|
31
|
+
|
|
32
|
+
This method does not depend on the browser's built-in PDF reader. Even if the file response uses `Content-Disposition: attachment` for security, NocoBase can still read and render the file in the preview component. The file URL must remain accessible with the current login state.
|
|
33
|
+
|
|
34
|
+
### Third-party storage or a cross-origin URL
|
|
35
|
+
|
|
36
|
+
Third-party storage such as OSS, S3, COS, and CDNs usually uses a separate domain. NocoBase places this PDF URL in an iframe, so the browser and the storage service's response headers determine the result.
|
|
37
|
+
|
|
38
|
+
To open a PDF in the iframe, the storage service should normally return `Content-Type: application/pdf` and must not force a download with `Content-Disposition: attachment`. If the response requests a download, the browser downloads the file directly and NocoBase cannot override that behavior in the frontend.
|
|
39
|
+
|
|
40
|
+
Loading a cross-origin PDF in an iframe does not itself require CORS. However, the download button in the preview component reads the file with `fetch` and creates a Blob, so cross-origin downloads still require the storage service to allow CORS requests from the NocoBase site.
|
|
41
|
+
|
|
42
|
+
### Notes for Aliyun OSS
|
|
43
|
+
|
|
44
|
+
In some cases, the default Aliyun OSS domain forces a download by returning `Content-Disposition: attachment` and `x-oss-force-download: true`. Images may still preview normally, while a PDF placed in an iframe is downloaded.
|
|
45
|
+
|
|
46
|
+
You can usually resolve this by binding a custom domain to the bucket and configuring NocoBase to access files through that domain. See [Aliyun OSS troubleshooting](../storage/aliyun-oss.md#common-issues) for configuration and diagnostic steps.
|
|
47
|
+
|
|
48
|
+
### Security boundary for cross-origin previews
|
|
49
|
+
|
|
50
|
+
Some browsers or PDF readers may support scripts, forms, or other interactive content inside PDF files. If the previewed file comes from an untrusted source, pay attention to the security boundary for script execution.
|
|
16
51
|
|
|
17
52
|
We recommend isolating the file access domain from the NocoBase site and API domains. For example, serve files from OSS, S3, COS, or a CDN through a dedicated domain, instead of sharing the same origin with the NocoBase frontend or API.
|
|
18
53
|
|
|
19
54
|
If the file domain is different from the API domain, and the API does not enable CORS access for the file domain, scripts running in the PDF preview environment are usually restricted by the browser's same-origin policy. They cannot directly read the NocoBase page, browser storage, or API responses.
|
|
55
|
+
|
|
56
|
+
## Related links
|
|
57
|
+
|
|
58
|
+
- [Office File Preview Plugin](./ms-office.md)
|
|
59
|
+
- [Aliyun OSS](../storage/aliyun-oss.md)
|
|
60
|
+
- [S3 Pro](../storage/s3-pro.md)
|
|
@@ -7,7 +7,7 @@ A storage engine based on Aliyun OSS. Before use, you need to prepare the releva
|
|
|
7
7
|
|
|
8
8
|
This engine does not support private access. After a file is uploaded, NocoBase generates a directly accessible URL, and anyone who has that URL can access the file.
|
|
9
9
|
|
|
10
|
-
Even if the OSS bucket itself is private, the built-in Aliyun OSS engine does not generate temporary signed URLs for file access. If you need private access, use [S3 Pro](./s3-pro). If historical files already exist, see [Migrate to S3 Pro](./migrate-to-s3-pro.md).
|
|
10
|
+
Even if the OSS bucket itself is private, the built-in Aliyun OSS engine does not generate temporary signed URLs for file access. If you need private access, use [S3 Pro](./s3-pro.md). If historical files already exist, see [Migrate to S3 Pro](./migrate-to-s3-pro.md).
|
|
11
11
|
|
|
12
12
|
:::
|
|
13
13
|
|
|
@@ -18,9 +18,13 @@ Even if the OSS bucket itself is private, the built-in Aliyun OSS engine does no
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
:::info{title=Note}
|
|
21
|
-
This section only introduces the specific parameters for the Aliyun OSS storage engine. For general parameters,
|
|
21
|
+
This section only introduces the specific parameters for the Aliyun OSS storage engine. For general parameters, see [General Engine Parameters](./index.md#common-parameters).
|
|
22
22
|
:::
|
|
23
23
|
|
|
24
|
+
### Base URL
|
|
25
|
+
|
|
26
|
+
Enter the file access URL prefix, such as a custom domain bound to the current bucket: `https://oss.example.com`. Accessing PDFs through the default Aliyun OSS domain may cause the browser to download them. We recommend binding a custom domain first. See [Common issues](#common-issues) below for details.
|
|
27
|
+
|
|
24
28
|
### Region
|
|
25
29
|
|
|
26
30
|
Enter the region of the OSS storage, for example: `oss-cn-hangzhou`.
|
|
@@ -43,4 +47,97 @@ Enter the name of the OSS bucket.
|
|
|
43
47
|
|
|
44
48
|
### Timeout
|
|
45
49
|
|
|
46
|
-
Enter the timeout for uploading to Aliyun OSS, in milliseconds. The default is `60000` milliseconds (i.e., 60 seconds).
|
|
50
|
+
Enter the timeout for uploading to Aliyun OSS, in milliseconds. The default is `60000` milliseconds (i.e., 60 seconds).
|
|
51
|
+
|
|
52
|
+
## Common issues
|
|
53
|
+
|
|
54
|
+
### A PDF is downloaded instead of previewed
|
|
55
|
+
|
|
56
|
+
NocoBase previews cross-origin PDFs in an iframe. The browser accesses the OSS file URL directly, so the OSS response headers determine whether the file is displayed or downloaded.
|
|
57
|
+
|
|
58
|
+
If a PDF is downloaded from the iframe, inspect the file request in the browser developer tools. A typical problematic response looks like this:
|
|
59
|
+
|
|
60
|
+
```http
|
|
61
|
+
Content-Type: application/pdf
|
|
62
|
+
Content-Disposition: attachment
|
|
63
|
+
x-oss-force-download: true
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
`Content-Type: application/pdf` identifies the file correctly, but `Content-Disposition: attachment` instructs the browser to download it. The default Aliyun OSS domain forces downloads in some cases. See the official Aliyun documentation: [How do I configure a PDF file to be previewed instead of downloaded?](https://help.aliyun.com/zh/oss/user-guide/how-do-i-configure-an-object-to-be-previewed-instead-of-downloaded).
|
|
67
|
+
|
|
68
|
+
We recommend the following configuration:
|
|
69
|
+
|
|
70
|
+
1. Follow [Access OSS resources through a custom domain](https://help.aliyun.com/zh/oss/user-guide/access-buckets-via-custom-domain-names) to bind a custom domain to the bucket
|
|
71
|
+
2. Configure DNS and the HTTPS certificate, then verify that the custom domain can access the file directly
|
|
72
|
+
3. Configure the access URL for the NocoBase storage engine in use
|
|
73
|
+
|
|
74
|
+
For step 3:
|
|
75
|
+
|
|
76
|
+
- With the built-in **Aliyun OSS** engine, set **Base URL** to the bound custom domain, such as `https://oss.example.com`
|
|
77
|
+
- With [S3 Pro](./s3-pro.md) connected to Aliyun OSS, the upload endpoint can continue to use the regional OSS endpoint; set the access endpoint to the custom domain and set `Full access URL style` to `Ignore`
|
|
78
|
+
|
|
79
|
+
Upload a new PDF to verify the configuration. If an existing file record stores a complete URL, also make sure that the URL returned to the frontend now uses the custom domain.
|
|
80
|
+
|
|
81
|
+
:::tip Check the response headers
|
|
82
|
+
|
|
83
|
+
Previewing a cross-origin PDF in an iframe does not itself require CORS. Whether the PDF can be displayed inline primarily depends on `Content-Type` and `Content-Disposition`. This is separate from the CORS requirement for the download button described below.
|
|
84
|
+
|
|
85
|
+
:::
|
|
86
|
+
|
|
87
|
+
### An image previews correctly, but the download button reports a CORS error
|
|
88
|
+
|
|
89
|
+
Images are usually previewed with `<img>`, and cross-origin PDFs are previewed with an iframe. Both can display resources without CORS response headers. The download button, however, reads the file with `fetch` and creates a Blob for the browser to download. This request is subject to the browser's same-origin policy.
|
|
90
|
+
|
|
91
|
+
The following console error means that OSS did not return `Access-Control-Allow-Origin` for the current NocoBase site:
|
|
92
|
+
|
|
93
|
+
```text
|
|
94
|
+
Access to fetch at 'https://oss.example.com/path/to/file.jpg' from origin
|
|
95
|
+
'https://example.com' has been blocked by CORS policy:
|
|
96
|
+
No 'Access-Control-Allow-Origin' header is present on the requested resource.
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Follow the official Aliyun guide [Configure cross-origin resource sharing](https://help.aliyun.com/zh/oss/user-guide/configure-cross-origin-resource-sharing) and create a CORS rule for the bucket. For downloads from the preview component, use values like these:
|
|
100
|
+
|
|
101
|
+
| Setting | Recommended value |
|
|
102
|
+
| --- | --- |
|
|
103
|
+
| Allowed Origins | The complete NocoBase origin, such as `https://example.com` |
|
|
104
|
+
| Allowed Methods | `GET`, `HEAD` |
|
|
105
|
+
| Allowed Headers | `*` |
|
|
106
|
+
| Expose Headers | `ETag`, `Content-Disposition` |
|
|
107
|
+
| MaxAgeSeconds | `600` |
|
|
108
|
+
|
|
109
|
+
If S3 Pro also uploads files directly from the browser, add methods such as `PUT` and `POST` according to the actual upload requests shown in the browser Network panel, or create a separate upload rule.
|
|
110
|
+
|
|
111
|
+
After saving the rule, request the file again with the NocoBase site origin. The response should include at least:
|
|
112
|
+
|
|
113
|
+
```http
|
|
114
|
+
Access-Control-Allow-Origin: https://example.com
|
|
115
|
+
Access-Control-Allow-Methods: GET, HEAD
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
The browser may already have cached the response used for the image preview. That request did not include an `Origin` header, and the cached response may not contain `Access-Control-Allow-Origin`. If downloading still fails after you configure CORS, clear the browser cache for the file or select **Disable cache** in the developer tools and try again.
|
|
119
|
+
|
|
120
|
+
### Verify the response headers
|
|
121
|
+
|
|
122
|
+
Use `curl` to simulate a cross-origin request from the NocoBase site. Replace the example origin, file URL, and signature parameters with the actual values:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
curl -sS -D - -o /dev/null \
|
|
126
|
+
-H 'Origin: https://example.com' \
|
|
127
|
+
'https://oss.example.com/path/to/file.pdf?<signed-query>'
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Check the following results:
|
|
131
|
+
|
|
132
|
+
- PDF preview returns `Content-Type: application/pdf` without `Content-Disposition: attachment`
|
|
133
|
+
- Cross-origin download returns an `Access-Control-Allow-Origin` matching the NocoBase site
|
|
134
|
+
- The actual file URL uses the custom domain instead of the default `*.oss-cn-*.aliyuncs.com` domain
|
|
135
|
+
|
|
136
|
+
It is normal for a request without an `Origin` header to omit CORS response headers. Keep the `Origin` header in the example when verifying CORS.
|
|
137
|
+
|
|
138
|
+
## Related links
|
|
139
|
+
|
|
140
|
+
- [File Preview](../file-preview/index.md)
|
|
141
|
+
- [S3 Pro](./s3-pro.md)
|
|
142
|
+
- [Migrate to S3 Pro](./migrate-to-s3-pro.md)
|
|
143
|
+
- [Storage Engines](./index.md)
|
|
@@ -10,7 +10,7 @@ description: |
|
|
|
10
10
|
Duplicate a record, you can either duplicate it into a form and edit it before saving it, or you can duplicate it directly to generate a new record.
|
|
11
11
|
isFree: true
|
|
12
12
|
builtIn: true
|
|
13
|
-
defaultEnabled:
|
|
13
|
+
defaultEnabled: true
|
|
14
14
|
editionLevel: 0
|
|
15
15
|
---
|
|
16
16
|
|
|
@@ -7,7 +7,7 @@ description: |
|
|
|
7
7
|
Centrally manages and displays various actions, allowing users to efficiently perform tasks. It supports extensibility, with current action types including pop-ups, links, scanning, and custom requests.
|
|
8
8
|
isFree: true
|
|
9
9
|
builtIn: true
|
|
10
|
-
defaultEnabled:
|
|
10
|
+
defaultEnabled: true
|
|
11
11
|
editionLevel: 0
|
|
12
12
|
---
|
|
13
13
|
|
|
@@ -7,7 +7,7 @@ description: |
|
|
|
7
7
|
Provides callendar collection template and block for managing date data, typically for date/time related information such as events, appointments, tasks, and so on.
|
|
8
8
|
isFree: true
|
|
9
9
|
builtIn: true
|
|
10
|
-
defaultEnabled:
|
|
10
|
+
defaultEnabled: true
|
|
11
11
|
editionLevel: 0
|
|
12
12
|
---
|
|
13
13
|
|
|
@@ -10,7 +10,7 @@ description: |
|
|
|
10
10
|
Database-based foreign data wrapper (FDW) implementation for connecting to remote data tables, currently supports MySQL and PostgreSQL databases.
|
|
11
11
|
isFree: true
|
|
12
12
|
builtIn: true
|
|
13
|
-
defaultEnabled:
|
|
13
|
+
defaultEnabled: true
|
|
14
14
|
editionLevel: 0
|
|
15
15
|
---
|
|
16
16
|
|
|
@@ -7,7 +7,7 @@ description: |
|
|
|
7
7
|
Provides data visualization feature, including chart block and chart filter block, support line charts, area charts, bar charts and more than a dozen kinds of charts, you can also extend more chart types.
|
|
8
8
|
isFree: true
|
|
9
9
|
builtIn: true
|
|
10
|
-
defaultEnabled:
|
|
10
|
+
defaultEnabled: true
|
|
11
11
|
editionLevel: 0
|
|
12
12
|
---
|
|
13
13
|
|
|
@@ -9,7 +9,7 @@ description: |
|
|
|
9
9
|
Utilize ECharts for data visualization, supporting for funnel, radar and more chart types and offering user-friendly configurations.
|
|
10
10
|
isFree: true
|
|
11
11
|
builtIn: true
|
|
12
|
-
defaultEnabled:
|
|
12
|
+
defaultEnabled: true
|
|
13
13
|
deprecated: true
|
|
14
14
|
editionLevel: 0
|
|
15
15
|
---
|
|
@@ -7,7 +7,7 @@ description: |
|
|
|
7
7
|
Organize users by departments, set hierarchical relationships, link roles to control permissions, and use departments as variables in workflows and expressions.
|
|
8
8
|
isFree: true
|
|
9
9
|
builtIn: true
|
|
10
|
-
defaultEnabled:
|
|
10
|
+
defaultEnabled: true
|
|
11
11
|
editionLevel: 0
|
|
12
12
|
---
|
|
13
13
|
|