Merge commit '6230bf94c5abfa7e67c6226e0b0dc088d80ff055' into pro

This commit is contained in:
kuaifan 2024-03-02 14:12:45 +08:00
commit 26adfa11bf
4 changed files with 26 additions and 21 deletions

View File

@ -446,6 +446,7 @@ class BotReceiveMsgTask extends AbstractTask
'gemini_key' => $setting['gemini_key'], 'gemini_key' => $setting['gemini_key'],
'gemini_model' => $setting['gemini_model'], 'gemini_model' => $setting['gemini_model'],
'gemini_agency' => $setting['gemini_agency'], 'gemini_agency' => $setting['gemini_agency'],
'gemini_timeout' => 20,
'server_url' => $serverUrl, 'server_url' => $serverUrl,
]; ];
if (empty($extras['gemini_key'])) { if (empty($extras['gemini_key'])) {
@ -470,7 +471,7 @@ class BotReceiveMsgTask extends AbstractTask
} }
// //
try { try {
$res = Ihttp::ihttp_post($webhookUrl, [ $data = [
'text' => $command, 'text' => $command,
'token' => User::generateToken($botUser), 'token' => User::generateToken($botUser),
'dialog_id' => $dialog->id, 'dialog_id' => $dialog->id,
@ -481,7 +482,8 @@ class BotReceiveMsgTask extends AbstractTask
'bot_uid' => $botUser->userid, 'bot_uid' => $botUser->userid,
'version' => Base::getVersion(), 'version' => Base::getVersion(),
'extras' => Base::array2json($extras) 'extras' => Base::array2json($extras)
], 10); ];
$res = Ihttp::ihttp_post($webhookUrl, $data, 10);
if ($userBot) { if ($userBot) {
$userBot->webhook_num++; $userBot->webhook_num++;
$userBot->save(); $userBot->save();

View File

@ -496,7 +496,6 @@ export default {
this.doneList.map(h => { h._active = false; }) this.doneList.map(h => { h._active = false; })
this.notifyList.map(h => { h._active = false; }) this.notifyList.map(h => { h._active = false; })
this.initiatedList.map(h => { h._active = false; }) this.initiatedList.map(h => { h._active = false; })
item._active = true;
// //
if (window.innerWidth < 426) { if (window.innerWidth < 426) {
this.goForward({ name: 'manage-approve-details', query: { id: item.id } }); this.goForward({ name: 'manage-approve-details', query: { id: item.id } });
@ -504,6 +503,8 @@ export default {
} }
if (window.innerWidth < 1010) { if (window.innerWidth < 1010) {
this.detailsShow = true; this.detailsShow = true;
} else {
item._active = true;
} }
this.details = {} this.details = {}
this.$nextTick(() => { this.$nextTick(() => {
@ -649,13 +650,14 @@ export default {
// //
updateData(key,data,type) { updateData(key,data,type) {
let listKey = key + 'List' let listKey = key + 'List'
let activeIndex = this[listKey].map((h, index) => h._active ? index : -1).filter(h => h > -1)[0] || 0
this[key + 'Total'] = data.total; this[key + 'Total'] = data.total;
type != 'scroll' ? (this[listKey] = data.rows) : data.rows.map(h => { type != 'scroll' ? (this[listKey] = data.rows) : data.rows.map(h => {
if (this[listKey].map(item => { return item.id }).indexOf(h.id) == -1) { if (this[listKey].map(item => { return item.id }).indexOf(h.id) == -1) {
this[listKey].push(h) this[listKey].push(h)
} }
}); });
if (window.innerWidth > 1010){
let activeIndex = this[listKey].map((h, index) => h._active ? index : -1).filter(h => h > -1)[0] || 0
if (this[listKey].length > 0){ if (this[listKey].length > 0){
this[listKey][activeIndex]._active = true; this[listKey][activeIndex]._active = true;
if (this.tabsValue == key) { if (this.tabsValue == key) {
@ -664,6 +666,7 @@ export default {
}) })
} }
} }
}
}, },
// //

View File

@ -83,7 +83,6 @@
<FormItem :label="$L('模型')" prop="gemini_model"> <FormItem :label="$L('模型')" prop="gemini_model">
<Select v-model="formData.gemini_model" placement="top"> <Select v-model="formData.gemini_model" placement="top">
<Option value="gemini-1.0-pro">gemini-1.0-pro</Option> <Option value="gemini-1.0-pro">gemini-1.0-pro</Option>
<!-- <Option value="gemini-pro-vision">gemini-pro-vision</Option> -->
</Select> </Select>
<div class="form-tip">{{$L('查看说明')}} <a href="https://ai.google.dev/models?hl=zh-cn" target="_blank">https://ai.google.dev/models?hl=zh-cn</a></div> <div class="form-tip">{{$L('查看说明')}} <a href="https://ai.google.dev/models?hl=zh-cn" target="_blank">https://ai.google.dev/models?hl=zh-cn</a></div>
</FormItem> </FormItem>

View File

@ -166,6 +166,9 @@
.approve-list-active { .approve-list-active {
border: 1px solid #8bcf70; border: 1px solid #8bcf70;
@media (max-width: 1010px) {
border: 1px solid #eeeeee;
}
} }
} }
@ -405,9 +408,7 @@
bottom: 1px; bottom: 1px;
display: flex; display: flex;
z-index: 9; z-index: 9;
// background: #ffffff;
background: #00000005; background: #00000005;
} }
.comment { .comment {