refactor(astrolabe): upgrade to @nextcloud/vue 9.3.3 API

- Replace NcCheckboxRadioSwitch :checked with :model-value
- Replace NcCheckboxRadioSwitch @update:checked with @update:model-value
- Replace NcButton type="primary|secondary|tertiary" with variant prop
- Bump @nextcloud/vue minimum version to ^9.3.3

These changes address deprecated APIs removed in @nextcloud/vue v9.0.0:
- :checked/:update:checked was replaced by v-model/modelValue pattern
- type prop for button variants was replaced by variant prop

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Chris Coutinho
2026-01-17 13:09:27 +01:00
parent fef13a6d3d
commit 303efeddf7
3 changed files with 15 additions and 15 deletions
+1 -1
View File
@@ -23,7 +23,7 @@
"@nextcloud/initial-state": "^3.0.0",
"@nextcloud/l10n": "^3.1.0",
"@nextcloud/router": "^3.0.1",
"@nextcloud/vue": "^9.0.0",
"@nextcloud/vue": "^9.3.3",
"markdown-it": "^14.1.0",
"pdfjs-dist": "^4.0.379",
"plotly.js-dist-min": "^2.35.3",
+9 -9
View File
@@ -62,7 +62,7 @@
@update:model-value="algorithm = $event ? $event.id : 'hybrid'" />
<NcButton
type="primary"
variant="primary"
:disabled="!query.trim() || loading"
@click="performSearch">
<template #icon>
@@ -74,7 +74,7 @@
<!-- Advanced Options Toggle -->
<NcButton
type="tertiary"
variant="tertiary"
class="mcp-advanced-toggle"
@click="showAdvanced = !showAdvanced">
<template #icon>
@@ -93,9 +93,9 @@
<NcCheckboxRadioSwitch
v-for="docType in docTypeOptions"
:key="docType.id"
:checked="selectedDocTypes.includes(docType.id)"
:model-value="selectedDocTypes.includes(docType.id)"
type="checkbox"
@update:checked="toggleDocType(docType.id, $event)">
@update:model-value="toggleDocType(docType.id, $event)">
{{ docType.label }}
</NcCheckboxRadioSwitch>
</div>
@@ -152,9 +152,9 @@
<div class="mcp-viz-header">
<h3>{{ t('astrolabe', 'Vector Space Visualization') }}</h3>
<NcCheckboxRadioSwitch
:checked="showQueryPoint"
:model-value="showQueryPoint"
type="switch"
@update:checked="showQueryPoint = $event; updatePlot()">
@update:model-value="showQueryPoint = $event; updatePlot()">
{{ t('astrolabe', 'Show query point') }}
</NcCheckboxRadioSwitch>
</div>
@@ -173,7 +173,7 @@
<span class="mcp-result-type">{{ result.doc_type || 'unknown' }}</span>
<div class="mcp-result-actions">
<NcButton
type="tertiary"
variant="tertiary"
:aria-label="t('astrolabe', 'Show Chunk')"
@click="viewChunk(result)">
<template #icon>
@@ -280,7 +280,7 @@
</div>
</div>
<NcButton type="secondary" :disabled="statusLoading" @click="loadVectorStatus">
<NcButton variant="secondary" :disabled="statusLoading" @click="loadVectorStatus">
<template #icon>
<Refresh :size="20" />
</template>
@@ -305,7 +305,7 @@
</a>
<span v-else>{{ viewerTitle }}</span>
</h3>
<NcButton type="tertiary" @click="closeViewer">
<NcButton variant="tertiary" @click="closeViewer">
<template #icon>
<Close :size="20" />
</template>
@@ -6,7 +6,7 @@
<p><strong>{{ t('astrolabe', 'Cannot connect to MCP server') }}</strong></p>
<p>{{ error }}</p>
<p class="help-text">{{ t('astrolabe', 'Ensure MCP server is running and accessible. Check config.php for correct mcp_server_url.') }}</p>
<NcButton type="primary" @click="retryConnection">
<NcButton variant="primary" @click="retryConnection">
<template #icon>
<Refresh :size="20" />
</template>
@@ -58,7 +58,7 @@
<div class="metric-value">{{ formatNumber(vectorSyncStatus.documents_per_second, 1) }} docs/sec</div>
</div>
</div>
<NcButton type="secondary" @click="refreshStatus">
<NcButton variant="secondary" @click="refreshStatus">
<template #icon>
<Refresh :size="20" />
</template>
@@ -85,7 +85,7 @@
</p>
<p v-else>{{ webhooksError }}</p>
<div class="webhook-auth-actions">
<NcButton type="primary" @click="openPersonalSettings">
<NcButton variant="primary" @click="openPersonalSettings">
{{ t('astrolabe', 'Go to Personal Settings') }}
</NcButton>
</div>
@@ -113,7 +113,7 @@
</div>
<div class="preset-actions">
<NcButton
:type="preset.enabled ? 'secondary' : 'primary'"
:variant="preset.enabled ? 'secondary' : 'primary'"
:disabled="preset.toggling"
@click="toggleWebhookPreset(preset)">
{{ preset.toggling ? t('astrolabe', 'Please wait...') : (preset.enabled ? t('astrolabe', 'Disable') : t('astrolabe', 'Enable')) }}
@@ -198,7 +198,7 @@
</p>
<div class="form-actions">
<NcButton type="primary" :disabled="saving" @click="saveSettings">
<NcButton variant="primary" :disabled="saving" @click="saveSettings">
{{ saving ? t('astrolabe', 'Saving...') : t('astrolabe', 'Save Settings') }}
</NcButton>
</div>