-
Notifications
You must be signed in to change notification settings - Fork 662
Expand file tree
/
Copy pathLogCustomPrompt.vue
More file actions
88 lines (82 loc) · 1.9 KB
/
LogCustomPrompt.vue
File metadata and controls
88 lines (82 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<script setup lang="ts">
import BaseContent from './BaseContent.vue'
import { type ChatLogHistoryItem } from '@/api/chat.ts'
import { computed } from 'vue'
import { useI18n } from 'vue-i18n'
const props = withDefaults(
defineProps<{
item?: ChatLogHistoryItem
error?: string
}>(),
{
item: undefined,
error: '',
}
)
const { t } = useI18n()
const list = computed(() => {
return (props.item?.message as Array<any>) ?? []
})
const title = computed(() => {
return t('chat.find_custom_prompt_title', [list.value.length])
})
</script>
<template>
<BaseContent class="base-container">
<template v-if="item.error">
{{ error }}
</template>
<template v-else>
<div class="inner-title">{{ title }}</div>
<div v-if="list.length > 0" style="margin-top: 8px" class="item-list">
<div v-for="(ele, index) in list" :key="index" class="inner-item">
<div v-dompurify-html="ele" class="inner-item-description" />
</div>
</div>
</template>
</BaseContent>
</template>
<style scoped lang="less">
.inner-title {
color: #646a73;
font-size: 12px;
line-height: 20px;
font-weight: 500;
vertical-align: middle;
white-space: pre-wrap;
word-break: break-all;
}
.item-list {
display: flex;
flex-direction: column;
gap: 8px;
align-items: stretch;
flex-wrap: nowrap;
.inner-item {
border: 1px solid #dee0e3;
display: flex;
flex-direction: column;
gap: 8px;
border-radius: 12px;
padding: 16px;
background: #ffffff;
.inner-item-title {
color: #1f2329;
font-weight: 500;
line-height: 22px;
font-size: 14px;
vertical-align: middle;
}
.inner-item-description {
//color: #646a73;
color: #1f2329;
font-weight: 400;
line-height: 22px;
font-size: 14px;
vertical-align: middle;
white-space: pre-wrap;
word-break: break-all;
}
}
}
</style>