|
94 | 94 | <template v-slot:append-inner>
|
95 | 95 | <v-btn
|
96 | 96 | flat
|
97 |
| - v-bind="props" |
98 | 97 | size="x-small"
|
99 | 98 | icon="mdi-help"
|
100 | 99 | style="background-color: inherit"
|
101 |
| - @click="isShowTemplateGuideDialog = !isShowTemplateGuideTooltip" |
| 100 | + @click=" |
| 101 | + isShowTemplateParametersDialog = !isShowTemplateGuideTooltip |
| 102 | + " |
102 | 103 | >
|
103 | 104 | </v-btn>
|
104 | 105 | </template>
|
|
138 | 139 | </v-dialog>
|
139 | 140 | <v-dialog
|
140 | 141 | width="auto"
|
141 |
| - :model-value="isShowTemplateGuideDialog" |
142 |
| - v-on:after-leave="isShowTemplateGuideDialog = false" |
| 142 | + :model-value="isShowTemplateParametersDialog" |
| 143 | + v-on:after-leave="isShowTemplateParametersDialog = false" |
143 | 144 | >
|
144 | 145 | <v-card>
|
145 |
| - <v-md-preview class="pa-4" :text="$t('chat.actionTemplateGuide')" /> |
| 146 | + <v-md-preview class="pa-4" :text="templateParametersInfo" /> |
146 | 147 | </v-card>
|
147 | 148 | </v-dialog>
|
148 | 149 | <ConfirmModal ref="confirmModal" />
|
@@ -170,7 +171,13 @@ const prefix = ref("");
|
170 | 171 | const template = ref("");
|
171 | 172 | const suffix = ref("");
|
172 | 173 | const previewRef = ref("");
|
173 |
| -const isShowTemplateGuideDialog = ref(false); |
| 174 | +const templateParametersInfo = ` |
| 175 | +#### ${i18n.global.t("chat.templateParameters")}: |
| 176 | +| ${i18n.global.t("chat.parameter")}|${i18n.global.t("chat.description")}| |
| 177 | +|-|-| |
| 178 | +|{botName}|${i18n.global.t("chat.botNameDesc")}| |
| 179 | +|{botResponse}|${i18n.global.t("chat.botResponseDesc")}|`; |
| 180 | +const isShowTemplateParametersDialog = ref(false); |
174 | 181 | const store = useStore();
|
175 | 182 | const userActions = computed(() => {
|
176 | 183 | return store.state.actions.filter((p) => !p.hide);
|
@@ -308,12 +315,16 @@ function edit(item) {
|
308 | 315 | }
|
309 | 316 |
|
310 | 317 | async function onInputTemplate() {
|
311 |
| - previewRef.value = await preview( |
312 |
| - prefix.value, |
313 |
| - template.value, |
314 |
| - suffix.value, |
315 |
| - previewSampleData, |
316 |
| - ); |
| 318 | + try { |
| 319 | + previewRef.value = await preview( |
| 320 | + prefix.value, |
| 321 | + template.value, |
| 322 | + suffix.value, |
| 323 | + previewSampleData, |
| 324 | + ); |
| 325 | + } catch (error) { |
| 326 | + previewRef.value = `Error:\n${error.message}`; |
| 327 | + } |
317 | 328 | }
|
318 | 329 |
|
319 | 330 | async function addEditAction() {
|
|
0 commit comments