db7cef5f17
Replace all user-visible hardcoded Chinese strings in Vue/TS source files
with proper i18n function calls and add corresponding translation keys
to all 4 locale files (zh-CN, en-US, ko-KR, ru-RU).
Changes:
- Replace 80+ hardcoded Chinese strings across 30+ source files
- Add ~450 new translation keys per locale file
- Cover components, views, utils, hooks, and API modules
- Remove Chinese fallback patterns (|| '中文') from existing t() calls
- Add mermaid toolbar and ollama date format translations
Intentionally preserved (backend API values / backward compatibility):
- FAQ CSV column headers and parsing constants
- RelevanceLevel type and Record key mappings
- Graph database engine status comparison ('未启用')
- Language name labels ('简体中文')
127 lines
2.8 KiB
Vue
127 lines
2.8 KiB
Vue
<template>
|
|
<div class="grep-results">
|
|
<div v-if="results.length" class="results-list">
|
|
<div
|
|
v-for="(result, index) in results"
|
|
:key="result.knowledge_id"
|
|
class="result-row"
|
|
>
|
|
<div class="result-row__index">#{{ index + 1 }}</div>
|
|
<div class="result-row__title">{{ result.knowledge_title || 'Untitled' }}</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div v-else class="empty-state">
|
|
{{ $t('chat.noMatchFound') }}
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { computed } from 'vue';
|
|
import { useI18n } from 'vue-i18n';
|
|
import type { GrepResultsData } from '@/types/tool-results';
|
|
|
|
const { t } = useI18n();
|
|
|
|
const props = defineProps<{
|
|
data: GrepResultsData;
|
|
}>();
|
|
|
|
const patterns = computed(() => props.data.patterns ?? []);
|
|
const results = computed(() => props.data.knowledge_results ?? []);
|
|
|
|
const resultCount = computed(() => props.data.result_count ?? results.value.length);
|
|
const totalMatches = computed(() => props.data.total_matches ?? results.value.length);
|
|
const maxResults = computed(() => props.data.max_results ?? results.value.length);
|
|
const hasMoreResults = computed(() => totalMatches.value > resultCount.value);
|
|
|
|
// Compact view, no per-pattern stats
|
|
</script>
|
|
|
|
<style lang="less" scoped>
|
|
@import './tool-results.less';
|
|
|
|
.grep-results {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 8px;
|
|
}
|
|
|
|
.summary-inline {
|
|
font-size: 12px;
|
|
color: var(--td-text-color-secondary);
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
|
|
&__divider {
|
|
color: var(--td-text-color-disabled);
|
|
}
|
|
|
|
&__truncated {
|
|
color: var(--td-warning-color);
|
|
}
|
|
}
|
|
|
|
.results-list {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 4px;
|
|
padding: 10px 12px 10px 12px;
|
|
}
|
|
|
|
.result-row {
|
|
display: grid;
|
|
grid-template-columns: 40px minmax(120px, 1fr) auto;
|
|
align-items: center;
|
|
gap: 8px;
|
|
padding: 4px 10px;
|
|
border-radius: 4px;
|
|
background: var(--td-bg-color-secondarycontainer);
|
|
border: 1px solid var(--td-component-stroke);
|
|
font-size: 12px;
|
|
line-height: 1.4;
|
|
}
|
|
|
|
.result-row__index {
|
|
font-weight: 600;
|
|
color: var(--td-text-color-placeholder);
|
|
}
|
|
|
|
.result-row__title {
|
|
color: var(--td-text-color-primary);
|
|
font-weight: 500;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.result-row__meta {
|
|
display: flex;
|
|
gap: 6px;
|
|
flex-wrap: wrap;
|
|
justify-content: flex-end;
|
|
}
|
|
|
|
.meta-pill {
|
|
font-size: 11px;
|
|
color: var(--td-text-color-secondary);
|
|
background: var(--td-bg-color-container);
|
|
border: 1px solid var(--td-component-stroke);
|
|
border-radius: 999px;
|
|
padding: 2px 8px;
|
|
}
|
|
|
|
.empty-state {
|
|
padding: 20px;
|
|
text-align: center;
|
|
color: var(--td-text-color-placeholder);
|
|
font-size: 12px;
|
|
font-style: italic;
|
|
background: var(--td-bg-color-secondarycontainer);
|
|
border-radius: 6px;
|
|
border: 1px dashed var(--td-component-stroke);
|
|
}
|
|
</style>
|