* Open webhook async mode.

This commit is contained in:
wangyuting
2023-08-10 10:58:10 +08:00
parent 1e181ce7ea
commit 2e9545155a
4 changed files with 2 additions and 7 deletions
-3
View File
@@ -350,14 +350,12 @@ class webhook extends control
if(empty($webhooks))
{
echo "NO WEBHOOK EXIST.\n";
return false;
}
$dataList = $this->webhook->getDataList();
if(empty($dataList))
{
echo "OK\n";
return true;
}
$this->webhook->setSentStatus(array_keys($dataList), 'senting');
@@ -385,6 +383,5 @@ class webhook extends control
$this->dao->delete()->from(TABLE_NOTIFY)->where('status')->eq('sended')->exec();
echo "OK\n";
return true;
}
}
+1 -1
View File
@@ -3,7 +3,7 @@ $(function()
$('#type').change(function()
{
var type = $(this).val();
$('#sendTypeTR').toggle(type != 'dinggroup' && type != 'dinguser' && type != 'wechatuser' && type != 'wechatgroup' && type != 'feishuuser' && type != 'feishugroup');
//$('#sendTypeTR').toggle(type != 'dinggroup' && type != 'dinguser' && type != 'wechatuser' && type != 'wechatgroup' && type != 'feishuuser' && type != 'feishugroup');
$('#secretTR').toggle(type == 'dinggroup' || type == 'feishugroup');
$('#urlTR').toggle(type != 'dinguser' && type != 'wechatuser' && type != 'feishuuser');
$('.dinguserTR').toggle(type == 'dinguser');
+1 -1
View File
@@ -789,7 +789,7 @@ class webhookModel extends model
$log->url = $webhook->url;
$log->contentType = $webhook->contentType;
$log->data = $data;
$log->result = $result;
$log->result = (string)$result;
$this->dao->insert(TABLE_LOG)->data($log)->exec();
return !dao::isError();
-2
View File
@@ -91,13 +91,11 @@
<td><?php echo html::input('domain', $webhook->domain, "class='form-control'");?></td>
<td></td>
</tr>
<?php if(strpos("dinggroup|dinguser|wechatgroup|wechatuser|feishuuser|feishugroup", $webhook->type) === false):?>
<tr>
<th><?php echo $lang->webhook->sendType;?></th>
<td><?php echo html::select('sendType', $lang->webhook->sendTypeList, $webhook->sendType, "class='form-control'");?></td>
<td><?php echo $lang->webhook->note->async;?></td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->webhook->product;?></th>
<td><?php echo html::select('products[]', $products, $webhook->products, "class='form-control chosen' multiple");?></td>