Skip to content

Commit 8e7ad25

Browse files
committed
Merge branch 'github_develop' into develop
2 parents a482fd5 + 000e8d7 commit 8e7ad25

40 files changed

+203
-35
lines changed
Loading
167 KB
Loading
62.4 KB
Loading
243 KB
Loading
126 KB
Loading
33.1 KB
Loading
142 KB
Loading
48.8 KB
Loading
83.1 KB
Loading
13.8 KB
Loading
111 KB
Loading
215 KB
Loading
Loading

docs/.gitbook/assets/members0.png

5.82 KB
Loading

docs/.gitbook/assets/members1.png

602 KB
Loading

docs/.gitbook/assets/members2.gif

521 KB
Loading

docs/.gitbook/assets/members3.png

607 KB
Loading

docs/.gitbook/assets/members4.png

603 KB
Loading

docs/.gitbook/assets/members5.png

613 KB
Loading

docs/.gitbook/assets/module-10.jpeg

137 KB
Loading
75.5 KB
Loading
Loading

docs/.gitbook/assets/plugin-1.jpeg

61.8 KB
Loading

docs/.gitbook/assets/plugin-2.png

52.6 KB
Loading

docs/.gitbook/assets/plugin-3.png

19 KB
Loading

docs/SUMMARY.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* [Openblocks overview](README.md)
44
* [Self-hosting](self-hosting/README.md)
55
* [Access local database or API](self-hosting/access-local-database-or-api.md)
6+
* [DigitalOcean](self-hosting/digitalocean.md)
67
* [Security](security.md)
78

89
## Data sources
@@ -33,6 +34,10 @@
3334
* [Navigation](build-apps/navigation.md)
3435
* [Version and release management](build-apps/version-and-release-management.md)
3536

37+
## Build plugins
38+
39+
* [Develop your first plugin](build-plugins/develop-your-first-plugin.md)
40+
3641
## Workspace management
3742

3843
* [Members and groups](workspace-management/members-and-groups.md)

docs/build-apps/event-handlers.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
In Openblocks, event handlers are responsible for collecting and processing events from components and queries, and executing subsequent actions. For example, for a **Button** component, you can add an event handler to trigger the **Run query** action **** in response to the button **Click** event.
44

5-
<figure><img src="../.gitbook/assets/image (19).png" alt=""><figcaption></figcaption></figure>
5+
<figure><img src="../.gitbook/assets/image (8) (1).png" alt=""><figcaption></figcaption></figure>
66

77
Set event handlers wisely to provide a reactive and responsive user experience (UX). For example, triggering a **get-all** query after **insert-new-data** query finishes enables table automatically refresh.
88

@@ -32,7 +32,7 @@ Running a query can result in success or failure, so queries have two events: **
3232

3333
There are a number of event handler actions available in Openblocks for handling different scenarios. Set them in the **Action** dropdown list in an event handler.
3434

35-
![](<../.gitbook/assets/image (1) (1).png>)
35+
![](<../.gitbook/assets/image (9) (1).png>)
3636

3737
{% hint style="info" %}
3838
See [advanced](event-handlers.md#advanced) on this page to know advanced settings.
@@ -48,7 +48,7 @@ Trigger the selected query.
4848

4949
To control a component, select a component in the **Component** dropdown list and call one of its methods in the **Method** dropdown list.
5050

51-
![](<../.gitbook/assets/image (17).png>)
51+
![](<../.gitbook/assets/image (29).png>)
5252

5353
### Set temporary state
5454

docs/build-apps/module.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ When building an app, you want to reuse components and queries across different
44

55
<figure><img src="../.gitbook/assets/module-1.png" alt=""><figcaption><p>Build a <a href="module.md#demo-a-statistics-module">statistics module</a></p></figcaption></figure>
66

7-
<figure><img src="../.gitbook/assets/module-2.png" alt=""><figcaption><p>Reuse this module anywhere</p></figcaption></figure>
7+
<figure><img src="../.gitbook/assets/module-2 (1).png" alt=""><figcaption><p>Reuse this module anywhere</p></figcaption></figure>
88

99
## Module basics
1010

@@ -43,9 +43,9 @@ The other areas of the module editor are similar to those of the web app editor.
4343

4444
### Insert module to apps or other modules
4545

46-
When editing an app or module, select **Insert > Modules** to display the modules that you have access to.&#x20;
46+
When editing an app or module, select **Insert > Extensions > Modules** to display the modules that you have access to.&#x20;
4747

48-
<img src="../.gitbook/assets/module-10.png" alt="" data-size="original">
48+
<img src="../.gitbook/assets/module-10.jpeg" alt="" data-size="original">
4949

5050
Then drag and drop the module onto the canvas, and set input parameters, change styles inside the module's **Properties** panel.
5151

@@ -67,7 +67,7 @@ Module inputs are parameters passed to the module from external apps. The suppor
6767

6868
This section guides you through the steps to build a statistics module and reuse it in an app. &#x20;
6969

70-
<figure><img src="../.gitbook/assets/module-2.png" alt=""><figcaption></figcaption></figure>
70+
<figure><img src="../.gitbook/assets/module-2 (1).png" alt=""><figcaption></figcaption></figure>
7171

7272
1. Create module inputs:
7373

@@ -86,7 +86,7 @@ This section guides you through the steps to build a statistics module and reuse
8686
<figure><img src="../.gitbook/assets/module-17.png" alt=""><figcaption></figcaption></figure>
8787
5. Reuse the module multiple times by passing different input values.&#x20;
8888

89-
<figure><img src="../.gitbook/assets/module-2.png" alt=""><figcaption></figcaption></figure>
89+
<figure><img src="../.gitbook/assets/module-2 (1).png" alt=""><figcaption></figcaption></figure>
9090

9191
#### Input Test
9292

docs/build-apps/use-third-party-libraries.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,23 +70,23 @@ https://unpkg.com/cowsay@1.5.0/build/cowsay.umd.js
7070

7171
Navigate to the left sidebar, click <img src="../.gitbook/assets/image (1) (2).png" alt="" data-size="line"> > **Other** > **Scripts and style** > **Add a library**. Then paste the **cowsay** link here.
7272

73-
<figure><img src="../.gitbook/assets/Add a library (1).png" alt=""><figcaption></figcaption></figure>
73+
<figure><img src="../.gitbook/assets/Add a library (1) (1) (1).png" alt=""><figcaption></figcaption></figure>
7474

7575
Now you can write code in **JS query** to test its usage with `cowsay.say`:
7676

77-
<figure><img src="../.gitbook/assets/write code in JS query (1).png" alt=""><figcaption></figcaption></figure>
77+
<figure><img src="../.gitbook/assets/write code in JS query (1) (1).png" alt=""><figcaption></figcaption></figure>
7878

7979
or in component **Properties**:
8080

81-
<figure><img src="../.gitbook/assets/or in Properties (1).png" alt=""><figcaption></figcaption></figure>
81+
<figure><img src="../.gitbook/assets/or in Properties (1) (1) (1).png" alt=""><figcaption></figcaption></figure>
8282

8383
And since you have set up cowsay just for **Openblocks's new application 1,** you can not use cowsay in another app.
8484

85-
<figure><img src="../.gitbook/assets/in another app (2).png" alt=""><figcaption></figcaption></figure>
85+
<figure><img src="../.gitbook/assets/in another app (1) (1).png" alt=""><figcaption></figcaption></figure>
8686

8787
### Import on Workspace-level
8888

8989
Navigate to **Workspace settings** > **Advanced** > **JavaScript library** > **Add a library**. Then paste the **cowsay** link here and click **Save**. Now you can use **cowsay** library **** in any app of your workspace.\
90-
![](<../.gitbook/assets/Import on Workspace-level libraries (2).png>)
90+
![](<../.gitbook/assets/Import on Workspace-level libraries (1) (1) (1).png>)
9191

92-
<figure><img src="../.gitbook/assets/Import on Workspace-level libraries-advanced (1) (1).png" alt=""><figcaption></figcaption></figure>
92+
<figure><img src="../.gitbook/assets/Import on Workspace-level libraries-advanced (1).png" alt=""><figcaption></figcaption></figure>
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
---
2+
description: >-
3+
With Openblocks plugins, you can develop customized components that are
4+
consistent with native components for your specific scenarios.
5+
---
6+
7+
# Develop customized plugins
8+
9+
## Initialization
10+
11+
Execute the following `yarn start` file:
12+
13+
```bash
14+
# Project initiation
15+
yarn create openblocks-plugin my-plugin
16+
17+
# Go to the project root
18+
cd my-plugin
19+
20+
# Start the development environment
21+
yarn start
22+
```
23+
24+
## Component development environment
25+
26+
After executing `yarn start`, the browser is automatically opened and you enter the component development environment.
27+
28+
<figure><img src="../.gitbook/assets/plugin-1.jpeg" alt="Screenshot of component development environment"><figcaption></figcaption></figure>
29+
30+
## Plugin configurations
31+
32+
In `openblocks` field in `package.json` file, you need to define the component properties. For example, the following is the explanation of several fields:
33+
34+
* `comps` defines UI components contained in the plugin. For each component, the key name of the object is the unique identity, and the value is metadata.
35+
* `comps[someCompKey].name` defines the component name shown in the **Insert** tab.
36+
* `comps[someCompKey].icon` defines the component icon shown on the canvas. Use a relative path to where `package.json` file is located.
37+
* `comps[someCompKey].layoutInfo` defines the component layout:
38+
* w: width of the component. Counted by the number of grid cells (range: 1 - 24).
39+
* h: height of the component. Counted by the number of grid cells (range: >= 1).
40+
41+
```bash
42+
"openblocks": {
43+
"description": "",
44+
"comps": {
45+
"hello_world": {
46+
"name": "Hello World",
47+
"icon": "./icons/hello_world.png",
48+
"layoutInfo": {
49+
"w": 12,
50+
"h": 5
51+
}
52+
},
53+
"counter": {
54+
"name": "Counter",
55+
"icon": "./icons/hello_world.png"
56+
}
57+
}
58+
}
59+
```
60+
61+
## Export components
62+
63+
To export all the components, use `src/index.ts`, for example:
64+
65+
```bash
66+
import HelloWorldComp from "./HelloWorldComp";
67+
68+
export default {
69+
hello_world: HelloWorldComp,
70+
};
71+
```
72+
73+
The default exported object `key` needs to be consistent with the `key` configured in `comps` in `package.json` file.
74+
75+
## Publish plugins
76+
77+
When you finish developing and testing the plugin, you can publish it into the npm registry. Login in to the npm registry locally, and then execute the following command:
78+
79+
```
80+
yarn build --publish
81+
```
82+
83+
If you do not specify the parameter `--publish`, the `tar` file will be saved in the root folder.
84+
85+
## Import plugins
86+
87+
In the Openblocks app, click **Insert** > **Extensions** > **Add npm plugin** in the right pane. <img src="../.gitbook/assets/plugin-2.png" alt="" data-size="original">
88+
89+
Input your npm package's URL or name, and then you can use your customized components.
90+
91+
```bash
92+
my-plugin
93+
94+
# or
95+
96+
https://www.npmjs.com/package/my-plugin
97+
```
98+
99+
<figure><img src="../.gitbook/assets/plugin-3.png" alt=""><figcaption></figcaption></figure>
100+
101+
## Code demo
102+
103+
For code demo, refer to Openblocks [Github](https://github.com/openblocks-dev/openblocks/tree/develop/client/packages/openblocks-plugin-demo).

docs/data-sources/connect-to-databases/google-sheets.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Navigate back to to [Google Sheets](https://docs.google.com/spreadsheets), and f
3737
1. Open the JSON file of the key.
3838
2. Copy the value of `client_email`, which is an identity used for access management of your sheet.
3939

40-
<figure><img src="../../.gitbook/assets/Google-sheets-key-client-email (1).jpeg" alt=""><figcaption></figcaption></figure>
40+
<figure><img src="../../.gitbook/assets/Google-sheets-key-client-email.jpeg" alt=""><figcaption></figcaption></figure>
4141
3. Click **Share** at the top right and paste the copied `client_email` value to add a member with access.
4242

4343
<figure><img src="../../.gitbook/assets/Google-sheets-share.jpg" alt=""><figcaption></figcaption></figure>

docs/data-sources/data-source-basics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Follow the steps below:
1515
1. Click **Data Sources** on Openblocks homepage.
1616
2. Click **New data source** on the upper right. This permission is restricted to workspace admins and developers.
1717

18-
<figure><img src="../.gitbook/assets/image (12) (1).png" alt=""><figcaption></figcaption></figure>
18+
<figure><img src="../.gitbook/assets/image (31) (1).png" alt=""><figcaption></figcaption></figure>
1919
3. Select the database or API type you need to connect.&#x20;
2020

2121
<figure><img src="../.gitbook/assets/data source basics-2.png" alt=""><figcaption></figcaption></figure>

docs/queries/query-basics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Queries support you to read data from or write data to your data sources. You ca
66

77
You can connect to a data source that was already in your data source library or create a new one. For detailed information, see [data-source-basics.md](../data-sources/data-source-basics.md "mention").
88

9-
<figure><img src="../.gitbook/assets/image (31) (1).png" alt=""><figcaption></figcaption></figure>
9+
<figure><img src="../.gitbook/assets/image (12) (1).png" alt=""><figcaption></figcaption></figure>
1010

1111
## Create a query
1212

docs/self-hosting/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,22 +83,22 @@ docker rm openblocks
8383
{% endtab %}
8484
{% endtabs %}
8585

86-
### Use your own MongoDB
86+
### Use your own MongoDB and Redis
8787

88-
By default Openblocks uses the built-in MongoDB installed inside the container, and you can replace it with your own MongoDB cluster.
88+
By default Openblocks uses the built-in MongoDB and Redis installed inside the container, and you can replace them with your own MongoDB and Redis clusters.
8989

9090
{% tabs %}
9191
{% tab title="Docker-Compose" %}
92-
Add an environment variable `MONGODB_URI` in `docker-compose.yml` downloaded in your working directory.\
93-
<img src="../.gitbook/assets/mongodb-uri.png" alt="" data-size="original">
92+
Add environment variables `MONGODB_URI` and `REDIS_URI` in `docker-compose.yml` downloaded in your working directory.\
93+
<img src="../.gitbook/assets/mongodb-redis-uri.png" alt="" data-size="original">
9494
{% endtab %}
9595

9696
{% tab title="Docker" %}
97-
Add an environment variable `MONGODB_URI` to the deployment command, as shown below:
97+
Add environment variables `MONGODB_URI` and `REDIS_URI` to the deployment command, as shown below:
9898

9999
{% code overflow="wrap" %}
100100
```docker
101-
docker run -d --name openblocks -e MONGODB_URI=YOUR_MONGO_URI -p 3000:3000 -v "$PWD/stacks:/openblocks-stacks openblocksdev/openblocks-ce
101+
docker run -d --name openblocks -e MONGODB_URI=YOUR_MONGODB_URI REDIS_URI=YOUR_REDIS_URI -p 3000:3000 -v "$PWD/stacks:/openblocks-stacks openblocksdev/openblocks-ce
102102
```
103103
{% endcode %}
104104
{% endtab %}

docs/self-hosting/digitalocean.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# DigitalOcean
2+
3+
You can deploy Openblocks on DigitalOcean using our [Openblocks docker image](https://marketplace.digitalocean.com/apps/openblocks) from the DigitalOcean Marketplace. Based on the pre-built image, you can create a DigitalOcean droplet as your cloud-based infrastructure and set up an Openblocks instance in seconds. [Create a DigitalOcean account](https://cloud.digitalocean.com/registrations/new) or [Log in](https://cloud.digitalocean.com/login) to get started.
4+
5+
## Deploy
6+
7+
1. Search **Openblocks** in DigitalOcean Marketplace or visit [Openblocks page](https://marketplace.digitalocean.com/apps/openblocks) directly.
8+
2. Click **Create Openblocks Droplet** to enter the configuring page.
9+
10+
<figure><img src="../.gitbook/assets/DigitalOcean-1.png" alt=""><figcaption></figcaption></figure>
11+
3. Choose the region and datacenter. The closest one to you and your users is recommended.
12+
13+
<figure><img src="../.gitbook/assets/DigitalOcean-2.png" alt=""><figcaption></figcaption></figure>
14+
4. The Openblocks image should already be listed as shown below, so you don't need to choose here.
15+
16+
<figure><img src="../.gitbook/assets/DigitalOcean-3.png" alt=""><figcaption></figcaption></figure>
17+
5. Choose a plan and size for your Droplet, which determines its RAM, disk space, and vCPUs as well as its price. Note that the **Basic** shared CPU with **Regular with SSD (1 GB CPU / 25GB SSD Disk / 1000GB transfer)** CPU option is more than capable of hosting an Openblocks instance.
18+
19+
<figure><img src="../.gitbook/assets/DigitalOcean-4.png" alt=""><figcaption></figcaption></figure>
20+
6. Choose an [SSH key](https://docs.digitalocean.com/products/droplets/how-to/add-ssh-keys/) if you've added one, or create a root password for the Droplet.
21+
22+
<figure><img src="../.gitbook/assets/DigitalOcean-5.png" alt=""><figcaption></figcaption></figure>
23+
7. Set the droplet name, add tags, and click **Create Droplet** to finish the deployment.
24+
25+
<figure><img src="../.gitbook/assets/DigitalOcean-6.png" alt=""><figcaption></figcaption></figure>
26+
27+
It usually takes around a minute to start the droplet.
28+
29+
<figure><img src="../.gitbook/assets/DigitalOcean-7.png" alt=""><figcaption></figcaption></figure>
30+
31+
{% hint style="info" %}
32+
For more help, see [Droplets | DigitalOcean Documentation](https://docs.digitalocean.com/products/droplets/).
33+
{% endhint %}
34+
35+
## Sign up
36+
37+
After deployment, your new Openblocks instance should be available at **http://your\_droplet\_public\_ipv4:3000**.
38+
39+
<figure><img src="../.gitbook/assets/DigitalOcean-8.png" alt=""><figcaption></figcaption></figure>
40+
41+
In the welcome page, Click **Sign up** to get started. Openblocks will automatically create a workspace for you. Then you can start building your apps and invite members to your workspace.
42+
43+
<figure><img src="../.gitbook/assets/DigitalOcean-9.png" alt=""><figcaption></figcaption></figure>
44+
45+
## Droplet Web Console
46+
47+
Find the deployed droplet in your [DigitalOcean projects](https://cloud.digitalocean.com/) and redirect to its details page. Click **Console** on the right to enter the Droplet Web Console.
48+
49+
<figure><img src="../.gitbook/assets/DigitalOcean-10.png" alt=""><figcaption></figcaption></figure>
50+
51+
<figure><img src="../.gitbook/assets/DigitalOcean-11.png" alt=""><figcaption></figcaption></figure>
52+
53+
## Update
54+
55+
For information about how to update the Openblocks image to the latest version, see [Update](./#update).
56+
57+
## Customize deployment configurations
58+
59+
For information about how to customize deployment configurations, see [Customize deployment configurations](./#customize-deployment-configurations).

docs/workspace-management/members-and-groups.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
# Members and groups
22

3-
In Openblocks, you can organize the members of your workspace using different groups, and assign roles to groups to manage [permissions for resources](permissions-for-resources.md). You can find members and groups settings on the **Workspace settings** page by clicking the avatar in the top right corner.\
4-
<img src="../.gitbook/assets/workspace-settings.png" alt="" data-size="original">
3+
In Openblocks, you can organize the members of your workspace using different groups, and assign roles to groups to manage [permissions for resources](permissions-for-resources.md). You can find members and groups settings in <img src="../.gitbook/assets/members0.png" alt="" data-size="line">**Settings** on Openblocks homepage.
4+
5+
<figure><img src="../.gitbook/assets/members1.png" alt=""><figcaption></figcaption></figure>
56

67
## Manage workspace members
78

89
### Invite new members
910

10-
In the **Members** tab, click **Invite members** to invite new members to the workspace through the invitation link.
11+
In the **Members** tab, there are two pre-built groups by default: **All members** and **Developers**. You can invite members to your workspace by managing **All members** group. Open the group and click **Invite members**, then you can copy the invitation link.
1112

12-
<figure><img src="../.gitbook/assets/invite-members-1.png" alt=""><figcaption></figcaption></figure>
13+
<figure><img src="../.gitbook/assets/members2.gif" alt=""><figcaption></figcaption></figure>
1314

14-
You can also find the short cut to <img src="../.gitbook/assets/icon-members-2.png" alt="" data-size="line"> **Invite members** on the bottom left on Openblocks homepage.
15+
You can also find the short cut to <img src="../.gitbook/assets/icon-members-2.png" alt="" data-size="line"> **Invite members** on the bottom left on Openblocks homepage.&#x20;
1516

16-
<figure><img src="../.gitbook/assets/invite-members-2.png" alt=""><figcaption></figcaption></figure>
17+
<figure><img src="../.gitbook/assets/members3.png" alt=""><figcaption></figcaption></figure>
1718

1819
{% hint style="info" %}
1920
Permission to invite new members is restricted to workspace **admins** and **developers group**.
@@ -36,17 +37,17 @@ Group-based management helps to organize members from different functional depar
3637

3738
### Developers group
3839

39-
Openblocks creates a **Developers** group by default and it cannot be deleted, and workspace admins can add members into it. The members of it can create new apps, modules and data sources. Workspace admins can add members to the developers group.
40+
Openblocks creates a **Developers** group by default and it cannot be deleted, and workspace admins can add members into it. The members of it can create new resources including apps, modules, navigations, folders, and data sources, and can manage query library. Workspace admins can add members to the developers group.
4041

41-
<figure><img src="../.gitbook/assets/Developers-Group.png" alt=""><figcaption></figcaption></figure>
42+
<figure><img src="../.gitbook/assets/members4.png" alt=""><figcaption></figcaption></figure>
4243

4344
### Create groups and add members
4445

45-
In the **Members** tab of **Workspace settings** interface, workspace admins can click **Create group +** to add a new group. The group creator naturally works as a group admin.
46+
In the **Members** tab, workspace admins can click **+ Create group** to add a new group. The group creator naturally works as a group admin.
4647

47-
<figure><img src="../.gitbook/assets/create-group.png" alt=""><figcaption></figcaption></figure>
48+
<figure><img src="../.gitbook/assets/members5.png" alt=""><figcaption></figcaption></figure>
4849

49-
Group admins can add members into groups:
50+
Group admins can add members into groups.
5051

5152
<figure><img src="../.gitbook/assets/add-members.png" alt=""><figcaption></figcaption></figure>
5253

0 commit comments

Comments
 (0)