Repository navigation
Add demo 'Build an HTML Page with ChatGPT codex' #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,255 @@ | ||
| --- | ||
| description: Generate, preview, and package a SeaTable HTML page with ChatGPT Codex. Includes setup, permissions, example prompts, and upload steps. | ||
| --- | ||
|
|
||
| # Build an HTML page with ChatGPT Codex | ||
|
|
||
| This guide shows how to use the SeaTable HTML Page skill in the ChatGPT client to build an HTML page. It uses a customer registration form as an example. | ||
|
|
||
| The example uses two linked tables for customer management: a customer registration table and a sales personnel table. | ||
|
|
||
| When creating a customer record, users enter basic customer information and link one or more sales personnel records. | ||
|
|
||
| ## Prepare for page generation | ||
|
|
||
| ### Set up the app and HTML page | ||
|
|
||
| In the relevant base, create an app and add an HTML page to it. | ||
|
|
||
|  | ||
|
|
||
| ### Configure permissions | ||
|
|
||
| Configure page access permissions according to the page's intended use, as shown below. | ||
|
|
||
|  | ||
|
|
||
| Configure table permissions as shown below. | ||
|
|
||
|  | ||
|
|
||
| **Table 1: Customer Registration** | ||
|
|
||
| The page needs to add customer records to this table and update linked records. Enable the "Can add records" and "Can modify records" permissions for this table. | ||
|
|
||
| !!! warning "Review field permissions" | ||
|
|
||
| For testing, this example enables adding values to all fields. Adjust the field permissions to suit your needs, especially before using the page in production. | ||
|
|
||
|  | ||
|
|
||
| **Table 2: Sales Personnel** | ||
|
|
||
| When adding a customer record, users select one or more records from this table to link. Enable the table's "Can list records" permission so the page can display the available records. | ||
|
|
||
| !!! warning "Review field permissions" | ||
|
|
||
| For testing, this example also enables access to all fields. Adjust the field permissions to suit your needs, especially before using the page in production. | ||
|
|
||
|  | ||
|
|
||
|
|
||
|
|
||
| ### Install the skill | ||
|
|
||
| If you have not used the skill before, install it first. This guide assumes that the ChatGPT client is already installed on your computer. | ||
|
|
||
| You can install the skill in either of the following ways. | ||
|
|
||
| **Method 1**: Send an installation command | ||
|
|
||
| In a conversation with the ChatGPT client, send the following command: | ||
|
|
||
| ```plaintext | ||
| npx skills add seatable/skills@seatable-html-page | ||
| ``` | ||
|
|
||
| !!! note "GitHub connection required" | ||
|
|
||
| If the ChatGPT client cannot connect to GitHub, this method may fail. Resolve the connection issue and try again, or use Method 2. | ||
|
|
||
| **Method 2 (recommended)**: Copy the skill to your local AI tool's skills directory | ||
|
|
||
| The skill is available in the [seatable/skills repository](https://github.com/seatable/skills). Download the repository using your preferred method, then copy `seatable-html-page` from its `skills` directory to the directory where your AI tool stores skills. | ||
|
|
||
| The following screenshots show where the `seatable-html-page` skill is installed on a local computer. | ||
|
|
||
|  | ||
|
|
||
|  | ||
|
|
||
| In ChatGPT, open **Plugins -> Skills** and check that "SeaTable HTML Page" appears in the list. | ||
|
|
||
|  | ||
|
|
||
| You can also enter `/seatable` in a conversation. If "SeaTable HTML Page" appears in the list of available skills, the skill is installed. | ||
|
|
||
|  | ||
|
|
||
| ### Create a ChatGPT project | ||
|
|
||
| To keep your work organized, create a ChatGPT project for each HTML page. You will create a local folder for the page and link it to the project in the following steps. | ||
|
|
||
|  | ||
|
|
||
|
|
||
|
|
||
| Create a folder for the page in a convenient location, using any method you prefer. | ||
|
|
||
|  | ||
|
|
||
| The project name is optional. If you leave it blank, ChatGPT uses the folder name by default. | ||
|
|
||
|  | ||
|
|
||
| Once the project has been created, a new conversation for it starts automatically. | ||
|
|
||
|  | ||
|
|
||
|
|
||
|
|
||
| ## Generate a page with ChatGPT Codex | ||
|
|
||
| ### Select the skill and configure the local development environment | ||
|
|
||
| Enter `/seatable` and select the page-generation skill from the pop-up list. | ||
|
|
||
|  | ||
|
|
||
|  | ||
|
|
||
|
|
||
|
|
||
| After selecting the skill, ask it to set up the local development environment. | ||
|
|
||
|  | ||
|
|
||
|
|
||
|
|
||
| In the configuration file, enter the server address, `appUuid`, and `pageId` shown for the blank HTML page you created during setup. | ||
|
|
||
| !!! warning "Keep your account token private" | ||
|
|
||
| Find your `accountToken` under **Personal Settings -> Personal Information -> Account Token**. Do not share it in the conversation, because it could give others access to your account. | ||
|
|
||
|  | ||
|
|
||
|
|
||
|
|
||
| ### Describe the page and data structure | ||
|
|
||
| Describe the page you want to generate, including its functionality, workflow, and visual style. Providing detailed requirements can reduce the amount of revision needed later. For example: | ||
|
|
||
|  | ||
|
|
||
| !!! example "Example prompt" | ||
|
|
||
| ```plaintext | ||
| Create a customer registration page. | ||
|
|
||
| Functions: | ||
| - Validate required fields | ||
| - Allow multiple sales personnel to be linked | ||
| - After successful submission, display a confirmation message and clear the form | ||
|
|
||
| Process: | ||
| 1. Enter the customer's basic information in the registration form. | ||
| 2. Link one or more sales personnel records. | ||
| 3. When the form is submitted, first create a customer record, then link it to the selected sales personnel records. | ||
| 4. Select sales personnel from the existing records in the Sales Personnel table. | ||
| 5. Style the "Submit" button with a purple gradient. | ||
| ``` | ||
|
|
||
| The skill may ask for details about the tables, fields, and other data structures the page needs. If you have not already provided this information, the AI will prompt you for it. | ||
|
|
||
| You can also include these details in your initial request. If the AI detects that you have already specified the data structure, it will proceed directly to generating the page. | ||
|
|
||
| **Example of additional data structure details:** | ||
|
|
||
|  | ||
|
|
||
| !!! example "Example data structure" | ||
|
|
||
| ```plaintext | ||
| Table 1: Customer Registration. Relevant fields: | ||
| - Customer Name, text | ||
| - Contact Phone Number, text | ||
| - Customer Type, single select; options: Individual / Corporate | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Warning] 示例表结构与结果截图不一致 影响:这里定义 Customer Type 为 Individual / Corporate,但最终记录图中的选项是 Company,修改页面的截图又明确说仅改显示标签、仍保存 Corporate;Contact Phone Number 也声明为 text,结果图却显示数字列标识。读者无法确定应按哪一套字段类型和值生成提交逻辑,可能产生选项不匹配或电话号码格式丢失。 建议修复:统一示例表、提示词和截图的字段类型及精确选项值;若确有修改或显示值映射,写明修改步骤及实际保存值,并更新对应结果图。 |
||
| - Remarks, long text | ||
| - Sales Personnel, linked to the "Sales Personnel" table; allows each customer record to be associated with multiple sales personnel records. This is the key part of this example. | ||
|
|
||
| Table 2: Sales Personnel. Relevant fields: | ||
| - Name, text; used as the display name | ||
| - Department, single select; options for distinguishing departments: Sales Department I / Sales Department II | ||
| - Employee ID, text | ||
| - Mobile Number, number | ||
| - Email, email | ||
| - Date of Joining, date | ||
| - Customer, linked to the "Customer Registration" table; establishes the relationship between sales personnel and customers and is the key field in this table. | ||
| ``` | ||
|
|
||
|
|
||
| ### Generate and refine the page | ||
|
|
||
| After you provide the requirements and data structure, the AI begins generating the page. | ||
|
|
||
| If a confirmation prompt like the one below appears, select "Allow once." | ||
|
|
||
|  | ||
|
|
||
|  | ||
|
|
||
| The AI then completes the generation process. | ||
|
|
||
| When generation is complete, the AI displays a summary similar to the following: | ||
|
|
||
|  | ||
|
|
||
| Generated page: | ||
|
|
||
|  | ||
|
|
||
| The generated files are also saved in the corresponding local folder: | ||
|
|
||
|  | ||
|
|
||
|
|
||
|
|
||
| Choose **Preview Page** to preview the result. After making any needed changes, package the page for upload. | ||
|
|
||
| If the page does not meet your requirements, ask the AI to revise it. For example, you can correct field definitions, as shown below. | ||
|
|
||
|  | ||
|
|
||
|
|
||
|
|
||
| ## Preview page | ||
|
|
||
| When the preview service starts, the page opens automatically in ChatGPT. You can also open the service address in your preferred browser. By default, the address is [http://127.0.0.1:3005](http://127.0.0.1:3005/). | ||
|
|
||
|  | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Warning] 预览示例仍停留在数据加载失败状态 影响:这张预览图明确说明自动打开因 HTTP 403 失败,右侧销售人员区域仍显示 Could not load sales personnel;后续校验截图也保留该错误。销售人员是本例必须选择的关联项,但正文直接转入提交测试,没有说明如何从这个状态恢复,读者无法据此完成登记。 建议修复:使用通过本地预览服务打开、且人员列表成功加载的截图,并补充自动打开失败时手动访问预览地址、检查配置及读取权限、重试加载后再提交的步骤。 |
||
|
|
||
| When you finish testing, send the **Cancel Preview** command to stop the preview service. | ||
|
|
||
| **Test features such as input validation and form submission:** | ||
|
|
||
|  | ||
|
|
||
| **Check the data submitted to the base:** | ||
|
|
||
|  | ||
|
|
||
|
|
||
| ## Package and upload the page | ||
|
|
||
| After testing the page and confirming that it works as expected, send the instruction "Package as an upload ZIP". The AI will then run the packaging script. | ||
|
|
||
|  | ||
|
|
||
| Upload the ZIP file to the HTML page in the app. | ||
|
|
||
|  | ||
|
|
||
| The uploaded page appears in the app as follows: | ||
|
|
||
|  | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Warning] 销售人员表截图授予过多权限
影响:正文只要求读取销售人员供选择,但这张图同时开启 Can add records、Can delete records、Can modify records 和 Can view records。读者按前文‘按图配置’操作,会给无需增删的人员表开放额外写入能力;字段权限提醒未覆盖这些表级操作。
建议修复:将截图改为仅开启经示例所需操作确认的最小权限,至少关闭无关的新增、删除权限,并让正文的权限名称与界面保持一致。