Skip to content

Commit

Permalink
feat: 添加图片处理函数WEBUI
Browse files Browse the repository at this point in the history
  • Loading branch information
rehiy committed Apr 2, 2024
1 parent dd3710e commit 243d275
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
2 changes: 1 addition & 1 deletion wclient/robot/receiver_3.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func receiver3(msg *wcferry.WxMsg) {
}

// 外部图片处理插件
keywords, err := keyword.FetchAll(&keyword.FetchAllParam{Group: "imager"})
keywords, err := keyword.FetchAll(&keyword.FetchAllParam{Group: "imagefn"})
if err == nil && len(keywords) > 0 {
img := msgImage(msg.Id, msg.Extra)
for _, v := range keywords {
Expand Down
14 changes: 12 additions & 2 deletions webview/src/apps/keyword/create.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,22 @@
<label class="form-label">命令 *</label>
<textarea name="target" class="form-control" rows="3" [(ngModel)]="formdata.target" required></textarea>
<div class="form-text">
填写可执行程序的绝对路径及参数,如:<i>node.exe D:\wrest\app.js</i><br />
填写可执行程序的绝对路径及参数,如:<i>node.exe D:\wrest\app.js</i>。指令收到的最后一个参数为聊天内容<br />
输出的内容将作为回复,发送文件或图片请输出 <b>http://</b> 开头的链接
</div>
</div>
}
@if (formdata.group == 'handler') {
@else if (formdata.group == 'imagefn') {
<div class="col-12">
<label class="form-label">命令 *</label>
<textarea name="target" class="form-control" rows="3" [(ngModel)]="formdata.target" required></textarea>
<div class="form-text">
填写可执行程序的绝对路径及参数,如:<i>node.exe D:\wrest\app.js</i>。指令收到的最后一个参数为图片路径<br />
输出的内容将作为回复,发送文件或图片请输出 <b>http://</b> 开头的链接
</div>
</div>
}
@else if (formdata.group == 'handler') {
<div class="col-12">
<label class="form-label">指令 *</label>
<select name="target" class="form-select" [(ngModel)]="formdata.target" (change)="changeHandler()" required>
Expand Down
14 changes: 12 additions & 2 deletions webview/src/apps/keyword/update.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,22 @@
<label class="form-label">命令 *</label>
<textarea name="target" class="form-control" rows="3" [(ngModel)]="formdata.target" required></textarea>
<div class="form-text">
填写可执行程序的绝对路径及参数,如:<i>node.exe D:\wrest\app.js</i><br />
填写可执行程序的绝对路径及参数,如:<i>node.exe D:\wrest\app.js</i>。指令收到的最后一个参数为聊天内容<br />
输出的内容将作为回复,发送文件或图片请输出 <b>http://</b> 开头的链接
</div>
</div>
}
@if (formdata.group == 'handler') {
@else if (formdata.group == 'imagefn') {
<div class="col-12">
<label class="form-label">命令 *</label>
<textarea name="target" class="form-control" rows="3" [(ngModel)]="formdata.target" required></textarea>
<div class="form-text">
填写可执行程序的绝对路径及参数,如:<i>node.exe D:\wrest\app.js</i>。指令收到的最后一个参数为图片路径<br />
输出的内容将作为回复,发送文件或图片请输出 <b>http://</b> 开头的链接
</div>
</div>
}
@else if (formdata.group == 'handler') {
<div class="col-12">
<label class="form-label">指令 *</label>
<select name="target" class="form-select" [(ngModel)]="formdata.target" (change)="changeHandler()" required>
Expand Down
3 changes: 2 additions & 1 deletion webview/src/openapi/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ export const CronjobTypes: Record<string, OptionData> = {

export const KeywordGroups: Record<string, OptionData> = {
badword: { name: '违禁词' },
command: { name: '外部指令' },
handler: { name: '指令别名' },
command: { name: '外部指令' },
imagefn: { name: '图片处理' },
};

export const BadwordLevels: Record<number, OptionData> = {
Expand Down

0 comments on commit 243d275

Please sign in to comment.