node-red-contrib-feishu
Version:
Node-RED节点用于发送飞书消息
98 lines (91 loc) • 4.34 kB
HTML
<!-- 节点类型注册脚本 -->
<script type="text/javascript">
// 注册名为'tencent-sms'的节点类型
RED.nodes.registerType('tencent-sms',{
category: 'social', // 节点分类:社交类
color: '#00A4FF', // 节点颜色
defaults: { // 默认配置项
name: {value:""}, // 节点名称,可选
secretId: {value:"", required: true}, // SecretId,必填
secretKey: {value:"", required: true}, // SecretKey,必填
region: {value:"ap-guangzhou", required: true}, // 地域,必填
sdkAppId: {value:"", required: true}, // SDK应用ID,必填
templateId: {value:"", required: true}, // 短信模板ID,必填
signName: {value:"", required: true} // 短信签名,必填
},
inputs:1, // 输入连接点数量
outputs:1, // 输出连接点数量
icon: "font-awesome/fa-comments-o", // 节点图标
label: function() { // 节点标签显示函数
return this.name||"腾讯云短信";
},
paletteLabel: "腾讯云短信" // 面板中显示的节点名称
});
</script>
<!-- 节点配置界面模板 -->
<script type="text/html" data-template-name="tencent-sms">
<!-- 节点名称配置 -->
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> 名称</label>
<input type="text" id="node-input-name" placeholder="名称">
</div>
<!-- SecretId配置 -->
<div class="form-row">
<label for="node-input-secretId"><i class="fa fa-key"></i> SecretId</label>
<input type="text" id="node-input-secretId" placeholder="腾讯云SecretId">
</div>
<!-- SecretKey配置 -->
<div class="form-row">
<label for="node-input-secretKey"><i class="fa fa-lock"></i> SecretKey</label>
<input type="password" id="node-input-secretKey" placeholder="腾讯云SecretKey">
</div>
<!-- 地域配置 -->
<div class="form-row">
<label for="node-input-region"><i class="fa fa-globe"></i> 地域</label>
<input type="text" id="node-input-region" placeholder="ap-guangzhou">
</div>
<!-- SDK应用ID配置 -->
<div class="form-row">
<label for="node-input-sdkAppId"><i class="fa fa-id-card-o"></i> SDK应用ID</label>
<input type="text" id="node-input-sdkAppId" placeholder="SDK应用ID">
</div>
<!-- 短信模板ID -->
<div class="form-row">
<label for="node-input-templateId"><i class="fa fa-file-text-o"></i> 模板ID</label>
<input type="text" id="node-input-templateId" placeholder="短信模板ID">
</div>
<!-- 短信签名 -->
<div class="form-row">
<label for="node-input-signName"><i class="fa fa-pencil"></i> 短信签名</label>
<input type="text" id="node-input-signName" placeholder="短信签名">
</div>
</script>
<!-- 节点帮助文档 -->
<script type="text/html" data-help-name="tencent-sms">
<!-- 节点功能简介 -->
<p>发送腾讯云短信</p>
<!-- 输入参数说明 -->
<h3>输入</h3>
<dl class="message-properties">
<!-- 必填参数:手机号码 -->
<dt>phoneNumber <span class="property-type">string | array</span></dt>
<dd>接收短信的手机号码,可以是单个号码或号码数组</dd>
<!-- 必填参数:模板参数 -->
<dt>templateParams <span class="property-type">object</span></dt>
<dd>短信模板参数,需要与模板中的参数一一对应</dd>
<!-- 可选参数:会话内容 -->
<dt class="optional">sessionContext <span class="property-type">string</span></dt>
<dd>用户自定义的上下文信息</dd>
</dl>
<!-- 输出参数说明 -->
<h3>输出</h3>
<dl class="message-properties">
<dt>payload <span class="property-type">object</span></dt>
<dd>短信发送结果</dd>
</dl>
<!-- 详细使用说明 -->
<h3>详细信息</h3>
<p>该节点用于发送腾讯云短信,支持单发和群发功能。</p>
<p>使用前需要在腾讯云配置中设置正确的SecretId和SecretKey。</p>
<p>模板参数需要按照腾讯云短信模板的定义顺序提供。</p>
</script>