Merge pull request #480 from cbcoutinho/fix/astrolabe-vue3-bindings
fix(astrolabe): update Vue component bindings for Vue 3 compatibility
This commit is contained in:
Vendored
+6
-8
@@ -48,19 +48,18 @@
|
|||||||
<div class="mcp-search-card">
|
<div class="mcp-search-card">
|
||||||
<div class="mcp-search-row">
|
<div class="mcp-search-row">
|
||||||
<NcTextField
|
<NcTextField
|
||||||
:value="query"
|
v-model="query"
|
||||||
:label="t('astrolabe', 'Search query')"
|
:label="t('astrolabe', 'Search query')"
|
||||||
:placeholder="t('astrolabe', 'Enter your search query...')"
|
:placeholder="t('astrolabe', 'Enter your search query...')"
|
||||||
class="mcp-search-input"
|
class="mcp-search-input"
|
||||||
@update:value="query = $event"
|
|
||||||
@keyup.enter="performSearch" />
|
@keyup.enter="performSearch" />
|
||||||
|
|
||||||
<NcSelect
|
<NcSelect
|
||||||
v-model="selectedAlgorithmOption"
|
:model-value="selectedAlgorithmOption"
|
||||||
:options="algorithmOptions"
|
:options="algorithmOptions"
|
||||||
:placeholder="t('astrolabe', 'Algorithm')"
|
:placeholder="t('astrolabe', 'Algorithm')"
|
||||||
class="mcp-algorithm-select"
|
class="mcp-algorithm-select"
|
||||||
@input="algorithm = $event ? $event.id : 'hybrid'" />
|
@update:model-value="algorithm = $event ? $event.id : 'hybrid'" />
|
||||||
|
|
||||||
<NcButton
|
<NcButton
|
||||||
type="primary"
|
type="primary"
|
||||||
@@ -105,11 +104,10 @@
|
|||||||
<div class="mcp-option-group">
|
<div class="mcp-option-group">
|
||||||
<label>{{ t('astrolabe', 'Result Limit') }}</label>
|
<label>{{ t('astrolabe', 'Result Limit') }}</label>
|
||||||
<NcTextField
|
<NcTextField
|
||||||
:value="limit"
|
v-model="limit"
|
||||||
type="number"
|
type="number"
|
||||||
:min="1"
|
:min="1"
|
||||||
:max="100"
|
:max="100" />
|
||||||
@update:value="limit = Number($event)" />
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mcp-option-group">
|
<div class="mcp-option-group">
|
||||||
@@ -445,7 +443,7 @@ export default {
|
|||||||
algorithm: 'hybrid',
|
algorithm: 'hybrid',
|
||||||
showAdvanced: false,
|
showAdvanced: false,
|
||||||
selectedDocTypes: [],
|
selectedDocTypes: [],
|
||||||
limit: '20',
|
limit: 20,
|
||||||
scoreThreshold: 0,
|
scoreThreshold: 0,
|
||||||
loading: false,
|
loading: false,
|
||||||
error: null,
|
error: null,
|
||||||
|
|||||||
@@ -152,19 +152,21 @@
|
|||||||
|
|
||||||
<div class="settings-form">
|
<div class="settings-form">
|
||||||
<NcSelect
|
<NcSelect
|
||||||
v-model="settings.algorithm"
|
:model-value="selectedAlgorithmOption"
|
||||||
:options="algorithmOptions"
|
:options="algorithmOptions"
|
||||||
:label="t('astrolabe', 'Search Algorithm')"
|
:label="t('astrolabe', 'Search Algorithm')"
|
||||||
class="form-field" />
|
class="form-field"
|
||||||
|
@update:model-value="settings.algorithm = $event ? $event.id : 'hybrid'" />
|
||||||
<p class="help-text">
|
<p class="help-text">
|
||||||
{{ t('astrolabe', 'Hybrid combines semantic understanding with keyword matching. Semantic finds conceptually similar content. BM25 matches exact keywords.') }}
|
{{ t('astrolabe', 'Hybrid combines semantic understanding with keyword matching. Semantic finds conceptually similar content. BM25 matches exact keywords.') }}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<NcSelect
|
<NcSelect
|
||||||
v-model="settings.fusion"
|
:model-value="selectedFusionOption"
|
||||||
:options="fusionOptions"
|
:options="fusionOptions"
|
||||||
:label="t('astrolabe', 'Fusion Method')"
|
:label="t('astrolabe', 'Fusion Method')"
|
||||||
class="form-field" />
|
class="form-field"
|
||||||
|
@update:model-value="settings.fusion = $event ? $event.id : 'rrf'" />
|
||||||
<p class="help-text">
|
<p class="help-text">
|
||||||
{{ t('astrolabe', 'Only applies to hybrid search. RRF balances results well for most queries. DBSF may work better when keyword matches are over/under-weighted.') }}
|
{{ t('astrolabe', 'Only applies to hybrid search. RRF balances results well for most queries. DBSF may work better when keyword matches are over/under-weighted.') }}
|
||||||
</p>
|
</p>
|
||||||
@@ -184,14 +186,13 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<NcTextField
|
<NcTextField
|
||||||
:value="settings.limit"
|
v-model="settings.limit"
|
||||||
:label="t('astrolabe', 'Maximum Results')"
|
:label="t('astrolabe', 'Maximum Results')"
|
||||||
type="number"
|
type="number"
|
||||||
:min="5"
|
:min="5"
|
||||||
:max="100"
|
:max="100"
|
||||||
:step="5"
|
:step="5"
|
||||||
class="form-field"
|
class="form-field" />
|
||||||
@update:value="settings.limit = Number($event)" />
|
|
||||||
<p class="help-text">
|
<p class="help-text">
|
||||||
{{ t('astrolabe', 'Maximum number of results to return per search query (5-100).') }}
|
{{ t('astrolabe', 'Maximum number of results to return per search query (5-100).') }}
|
||||||
</p>
|
</p>
|
||||||
@@ -276,6 +277,15 @@ const fusionOptions = computed(() => [
|
|||||||
{ id: 'dbsf', label: t('astrolabe', 'DBSF - Distribution-Based Score Fusion') },
|
{ id: 'dbsf', label: t('astrolabe', 'DBSF - Distribution-Based Score Fusion') },
|
||||||
])
|
])
|
||||||
|
|
||||||
|
// Computed properties for NcSelect (converts between stored ID and option object)
|
||||||
|
const selectedAlgorithmOption = computed(() =>
|
||||||
|
algorithmOptions.value.find(opt => opt.id === settings.value.algorithm) || algorithmOptions.value[0],
|
||||||
|
)
|
||||||
|
|
||||||
|
const selectedFusionOption = computed(() =>
|
||||||
|
fusionOptions.value.find(opt => opt.id === settings.value.fusion) || fusionOptions.value[0],
|
||||||
|
)
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
async function loadServerStatus() {
|
async function loadServerStatus() {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
|
|||||||
Reference in New Issue
Block a user