Explorar o código

enh: optimize time display

EntropyYue hai 2 meses
pai
achega
3a2d964d39

+ 9 - 3
src/lib/components/common/Collapsible.svelte

@@ -74,9 +74,15 @@
 				<div class="">
 					{#if attributes?.type === 'reasoning'}
 						{#if attributes?.done === 'true' && attributes?.duration}
-							{$i18n.t('Thought for {{DURATION}}', {
-								DURATION: dayjs.duration(attributes.duration, 'seconds').humanize()
-							})}
+							{#if attributes.duration < 60}
+								{$i18n.t('Thought for {{DURATION}} seconds', {
+									DURATION: attributes.duration
+								})}
+							{:else}
+								{$i18n.t('Thought for {{DURATION}}', {
+									DURATION: dayjs.duration(attributes.duration, 'seconds').humanize()
+								})}
+							{/if}
 						{:else}
 							{$i18n.t('Thinking...')}
 						{/if}

+ 1 - 0
src/lib/i18n/locales/en-US/translation.json

@@ -944,6 +944,7 @@
 	"This will reset the knowledge base and sync all files. Do you wish to continue?": "",
 	"Thorough explanation": "",
 	"Thought for {{DURATION}}": "",
+	"Thought for {{DURATION}} seconds": "",
 	"Tika": "",
 	"Tika Server URL required.": "",
 	"Tiktoken": "",

+ 2 - 1
src/lib/i18n/locales/zh-CN/translation.json

@@ -943,7 +943,8 @@
 	"This will delete all models including custom models and cannot be undone.": "这将删除所有模型,包括自定义模型,且无法撤销。",
 	"This will reset the knowledge base and sync all files. Do you wish to continue?": "这将重置知识库并替换所有文件为目录下文件。确认继续?",
 	"Thorough explanation": "解释较为详细",
-	"Thought for {{DURATION}}": "思考时间 {{DURATION}}",
+	"Thought for {{DURATION}}": "已推理 持续 {{DURATION}}",
+	"Thought for {{DURATION}} seconds": "已推理 持续 {{DURATION}} 秒",
 	"Tika": "Tika",
 	"Tika Server URL required.": "请输入 Tika 服务器地址。",
 	"Tiktoken": "Tiktoken",