Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(copilot): update the retain msg prompt #1531

Merged
merged 3 commits into from
Dec 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/components/Copilot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
class="chat-msg-input"
v-model="currentPublishMsg"
:placeholder="$t('common.copiltePubMsgPlacehoder')"
@keyup.enter="sendMessage()"
@keydown.native.enter="handleEnterKey"
@focus="showPresetPrompt = true"
@input="showPresetPrompt = false"
></el-input>
Expand Down Expand Up @@ -317,6 +317,17 @@ export default class Copilot extends Vue {
this.showPresetPrompt = false
}

private handleEnterKey(event: KeyboardEvent) {
if (this.isSending || this.isResponseStream) {
event.preventDefault()
return
}
if (!event.shiftKey && event.code === 'Enter') {
event.preventDefault()
this.sendMessage()
}
}

private created() {
this.loadMessages({ reset: true })
}
Expand Down
20 changes: 10 additions & 10 deletions src/lang/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,18 +385,18 @@ export default {
hu: 'Mi az MQTT QoS? Hogyan válasszam ki? Kérjük, adjon meg néhány valós világ szcenárió esetet a megkülönböztetéshez',
},
mqttRetain: {
zh: 'MQTT Retain 是什么',
en: 'What is MQTT Retain',
tr: 'MQTT Retain Nedir',
ja: 'MQTT Retainとは何ですか',
hu: 'Mi az MQTT Retain',
zh: 'MQTT 保留消息是什么',
en: "What's the Retain Message",
tr: 'Retain Mesajı Nedir',
ja: 'レテインメッセージとは何ですか',
hu: 'Mi a Retain Üzenet',
},
mqttRetainDesc: {
zh: 'MQTT Retain 是什么?我该如何使用,请提供一些真实场景案例,并且告知如何使用 MQTTX 来清除保留消息呢?',
en: 'What is MQTT Retain? How do I use it? Please provide some real-world scenario cases and tell me how to use MQTTX to clear retained messages?',
tr: "MQTT Retain Nedir? Nasıl kullanılır? Lütfen bazı gerçek dünya senaryo durumları sağlayın ve MQTTX'i kalıcı mesajları temizlemek için nasıl kullanacağımı söyleyin?",
ja: 'MQTT Retainとは何ですか?どうやって使うのですか?いくつかの実世界のシナリオケースを提供してください。MQTTXを使用して保持されたメッセージをクリアする方法を教えてください。',
hu: 'Mi az MQTT Retain? Hogyan használjam? Kérjük, adjon meg néhány valós világ szcenárió esetet, és mondja el, hogyan használhatom az MQTTX-et a megőrzött üzenetek törléséhez?',
zh: 'MQTT 保留消息是什么?我该如何使用,请提供一些真实场景案例,并且告知如何使用 MQTTX 来清除保留消息呢?',
en: "What's the MQTT Retain Message? How do I use it? Please provide some real-world scenario cases and tell me how to use MQTTX to clear retained messages?",
tr: "MQTT Retain Mesajı Nedir? Nasıl kullanılır? Lütfen bazı gerçek dünya senaryo durumları sağlayın ve MQTTX'i kullanarak kalıcı mesajları nasıl temizleyeceğimi söyleyin?",
ja: 'MQTT レテインメッセージとは何ですか?どうやって使うのですか?実際のシナリオケースをいくつか提供し、MQTTXを使用して保持されたメッセージをクリアする方法を教えてください。',
hu: 'Mi az MQTT Retain Üzenet? Hogyan használjam? Kérjük, adjon meg néhány valós világ szcenárió esetet, és mondja el, hogyan használhatom az MQTTX-et a megőrzött üzenetek törléséhez?',
},
installEMQX: {
zh: '如何安装 EMQX',
Expand Down
3 changes: 2 additions & 1 deletion src/views/connections/ConnectionsDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,8 @@ import useServices from '@/database/useServices'
import { getMessageId, getSubscriptionId } from '@/utils/idGenerator'
import getContextmenuPosition from '@/utils/getContextmenuPosition'
import { deserializeBufferToProtobuf, printObjectAsString, serializeProtobufToBuffer } from '@/utils/protobuf'
import { jsonParse, jsonStringify } from '@/utils/jsonUtils'
import { jsonStringify } from '@/utils/jsonUtils'

type CommandType =
| 'searchContent'
| 'clearHistory'
Expand Down