此模块要求 VirtFusion v1.7.3 或更高版本,因为它是基于该版本开发的。请参阅官方文档。
安装
- 从 发布页面 下载最新版本.
- 解压缩压缩包的内容,并将 modules 文件夹 上传到你的 WHMCS 安装目录中.
❗ 注意事项 ❗
你必须在 WHMCS 中创建 两个自定义字段 才能让此模块正常工作。
你需要在每一个要使用此模块的产品上配置以下自定义字段。
字段名 | 字段类型 | 描述 | 验证 | 选项 | 仅管理员 | 必须字段 | 显示在订单 | 显示在发票 |
---|---|---|---|---|---|---|---|---|
Initial Operating System | Text Box | Set to whatever you want | Leave Blank | Leave Blank | ❌ | ❌ | ✅ | ❌ |
Initial SSH Key | Text Box | Set to whatever you want | Leave Blank | Leave Blank | ❌ | ❌ | ✅ | ❌ |
你可以运行以下 SQL 查询 来创建这些自定义字段:
-- Insert records for Initial Operating System if they don't already exist
INSERT INTO tblcustomfields
(type, relid, fieldname, fieldtype, description, fieldoptions, regexpr, adminonly, required, showorder, showinvoice,
sortorder, created_at, updated_at)
SELECT 'product',
id,
'Initial Operating System',
'text',
'',
'',
'',
'',
'',
'on',
'',
0,
UTC_TIMESTAMP(),
UTC_TIMESTAMP()
FROM tblproducts
WHERE servertype = 'VirtFusionDirect'
AND NOT EXISTS (SELECT 1
FROM tblcustomfields
WHERE fieldname = 'Initial Operating System'
AND relid = tblproducts.id);
-- Insert records for Initial SSH Key if they don't already exist
INSERT INTO tblcustomfields
(type, relid, fieldname, fieldtype, description, fieldoptions, regexpr, adminonly, required, showorder, showinvoice,
sortorder, created_at, updated_at)
SELECT 'product',
id,
'Initial SSH Key',
'text',
'',
'',
'',
'',
'',
'on',
'',
0,
UTC_TIMESTAMP(),
UTC_TIMESTAMP()
FROM tblproducts
WHERE servertype = 'VirtFusionDirect'
AND NOT EXISTS (SELECT 1
FROM tblcustomfields
WHERE fieldname = 'Initial SSH Key'
AND relid = tblproducts.id);
What does this module change?
This module changes the following things:
- Adds configurable options to the product configuration page to allow the user to select the operating system and add an ssh key to the initial deployment.
TODO
- Add post checkout checks to ensure the user has selected an operating system and added a ssh key.