-
Notifications
You must be signed in to change notification settings - Fork 678
/
Copy pathOpenaiWebPluginDetailCard.vue
39 lines (34 loc) · 1.28 KB
/
OpenaiWebPluginDetailCard.vue
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
<template>
<n-card class="w-145 max-h-160 overflow-y-scroll whitespace-pre-line" :content-style="{ padding: 0 }">
<div class="flex flex-col m-2 space-y-4">
<div v-for="(item, i) of pluginInfo" :key="i" class="flex flex-row space-x-4">
<div class="min-w-45">
<strong>{{ item.label }}</strong>
</div>
<n-ellipsis class="max-w-100" :line-clamp="4" expand-trigger="click" :tooltip="false">
{{ item.value }}
</n-ellipsis>
</div>
</div>
</n-card>
</template>
<script setup lang="ts">
import { computed } from 'vue';
import { i18n } from '@/i18n';
import { OpenaiChatPlugin } from '@/types/schema';
const t = i18n.global.t as any;
const props = defineProps<{
plugin: OpenaiChatPlugin;
}>();
const pluginInfo = computed(() => {
const result = [];
result.push({ label: 'id', value: props.plugin.id });
result.push({ label: 'namespace', value: props.plugin.namespace });
result.push({ label: 'domain', value: props.plugin.domain });
if (!props.plugin.manifest) return result;
for (const label of ['name_for_human', 'name_for_model', 'description_for_human', 'description_for_model']) {
result.push({ label, value: props.plugin.manifest[label as keyof typeof props.plugin.manifest] });
}
return result;
});
</script>