feat: add custom webhook message
This commit is contained in:
+17
-3
@@ -34,7 +34,6 @@ const CONSTANT = {
|
||||
label: '钉钉',
|
||||
inputs: [
|
||||
{ subLabel: 'access_token', value: '', col: 'access_token', desc: "钉钉webhook中的access_token" },
|
||||
// { subLabel: '关键字过滤', value: '', col: 'keys', desc: "使用的关键字过滤,多个使用|隔开" },
|
||||
{ subLabel: '加签', value: '', col: 'secret', desc: "加签的签名,SEC开头" },
|
||||
{ subLabel: '渠道名', value: '', col: 'name', desc: "想要设置的渠道名字" },
|
||||
],
|
||||
@@ -46,8 +45,23 @@ const CONSTANT = {
|
||||
{ subLabel: 'markdown', content: 'markdown' },
|
||||
],
|
||||
taskInsInputs: [
|
||||
// { value: '', col: 'to_account', desc: "目的邮箱账号(发给fsfsf谁)" },
|
||||
// { value: '', col: 'title', desc: "邮箱标题fsfsf" },
|
||||
],
|
||||
},
|
||||
{
|
||||
type: 'Custom',
|
||||
label: '自定义',
|
||||
inputs: [
|
||||
{ subLabel: 'webhook地址', value: '', col: 'webhook', desc: "自定义webhook地址" },
|
||||
{ subLabel: '请求体', value: '', col: 'body', desc: "请求体, text内容请使用 TEXT 进行占位\n例如:{\"message\": \"TEXT\", \"other_field\": \"field_data\"}", isTextArea: true},
|
||||
{ subLabel: '渠道名', value: '', col: 'name', desc: "想要设置的渠道名字" },
|
||||
],
|
||||
tips: {
|
||||
text: "自定义webhook说明", desc: "自定义webhook暂时只支持text,消息将解析TEXT占位标识进行替换,暂时只支持POST方式"
|
||||
},
|
||||
taskInsRadios: [
|
||||
{ subLabel: 'text', content: 'text' },
|
||||
],
|
||||
taskInsInputs: [
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
<hr />
|
||||
<div ref="refContainer">
|
||||
<el-table :data="tableData" stripe empty-text="发信日志为空" :row-style="rowStyle()">
|
||||
<el-table-column label="ID" prop="id" width="100px" />
|
||||
<el-table-column label="ID" prop="id" width="50px" />
|
||||
<el-table-column label="任务名" prop="task_name" show-overflow-tooltip width="150px" />
|
||||
<el-table-column label="发信日志" prop="log">
|
||||
<template #default="scope">
|
||||
<el-tooltip placement="top">
|
||||
<el-tooltip enterable placement="top">
|
||||
<template #content>
|
||||
<div v-html="TransHtml(scope.row.log)"></div>
|
||||
</template>
|
||||
@@ -20,8 +20,9 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" prop="created_on" width="160px" />
|
||||
<el-table-column label="状态" prop="status" width="60px">
|
||||
<el-table-column label="状态" prop="status" width="120px">
|
||||
<template #default="scope">
|
||||
<el-button link size="small" style="margin-right: 10px;" type="primary" @click="drawer = true; logText = scope.row.log">日志</el-button>
|
||||
<el-tag v-if="scope.row.status == 0" type="danger">失败</el-tag>
|
||||
<el-tag v-if="scope.row.status == 1" type="success">成功</el-tag>
|
||||
</template>
|
||||
@@ -29,6 +30,10 @@
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<el-drawer v-model="drawer" :with-header="false">
|
||||
<el-text v-html="TransHtml(logText)" size="small"></el-text>
|
||||
</el-drawer>
|
||||
|
||||
<div class="pagination-block">
|
||||
<el-pagination layout="prev, pager, next" :total="total" :page-size="pageSize" @current-change="handPageChange" />
|
||||
<el-text class="total-tip" size="small">共{{ total }}条</el-text>
|
||||
@@ -53,9 +58,11 @@ export default {
|
||||
const state = reactive({
|
||||
search: '',
|
||||
optionValue: '',
|
||||
logText: '',
|
||||
drawer: false,
|
||||
tableData: [],
|
||||
total: CONSTANT.TOTAL,
|
||||
pageSize: CONSTANT.PAGE_SIZE,
|
||||
pageSize: CONSTANT.PAGE_SIZE,
|
||||
currPage: CONSTANT.PAGE,
|
||||
});
|
||||
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
<el-form label-width="100px" v-for="item in waysLabelData">
|
||||
<el-tab-pane :label="item.label" :name="item.type">
|
||||
<el-form-item :label="one.subLabel" v-for="one in item.inputs">
|
||||
<el-input size="small" v-model="one.value" :placeholder="one.desc" />
|
||||
<el-input v-if="one.isTextArea != true" size="small" v-model="one.value" :placeholder="one.desc" />
|
||||
<el-input v-if="one.isTextArea == true" size="small" type="textarea" v-model="one.value"
|
||||
:placeholder="one.desc" :autosize="{ minRows: 4, maxRows: 10 }" />
|
||||
</el-form-item>
|
||||
<textTips v-if="item.tips" :text="item.tips.text" :desc="item.tips.desc" />
|
||||
</el-tab-pane>
|
||||
|
||||
@@ -9,7 +9,9 @@
|
||||
<el-form label-width="100px" v-for="item in waysLabelData">
|
||||
<!-- <el-tab-pane :label="item.label" :name="item.type"> -->
|
||||
<el-form-item :label="one.subLabel" v-for="one in item.inputs">
|
||||
<el-input size="small" v-model="one.value" :placeholder="one.desc" />
|
||||
<el-input v-if="one.isTextArea != true" size="small" v-model="one.value" :placeholder="one.desc" />
|
||||
<el-input v-if="one.isTextArea == true" size="small" type="textarea" v-model="one.value"
|
||||
:placeholder="one.desc" :autosize="{ minRows: 4, maxRows: 10 }" />
|
||||
</el-form-item>
|
||||
<!-- </el-tab-pane> -->
|
||||
</el-form>
|
||||
|
||||
Reference in New Issue
Block a user