fix: 修正MeiliSearch配置页面的显示问题
This commit is contained in:
@ -14,7 +14,7 @@
|
|||||||
<section>
|
<section>
|
||||||
<v-form collection="meili_search_config" v-model="formData" ref="form">
|
<v-form collection="meili_search_config" v-model="formData" ref="form">
|
||||||
<v-text-field v-model="formData.host" label="MeiliSearch Host" required />
|
<v-text-field v-model="formData.host" label="MeiliSearch Host" required />
|
||||||
<v-text-field v-model="formData.apiKey" label="API Key" required />
|
<v-text-field v-model="formData.api_key" label="API Key" required />
|
||||||
</v-form>
|
</v-form>
|
||||||
<div class="button-group">
|
<div class="button-group">
|
||||||
<v-button v-if="!pending" color="secondary" @click="testConnection">
|
<v-button v-if="!pending" color="secondary" @click="testConnection">
|
||||||
@ -51,16 +51,16 @@ const pending = ref(false);
|
|||||||
|
|
||||||
let configExists = false;
|
let configExists = false;
|
||||||
|
|
||||||
const formData = ref<{ host: string; apiKey: string }>({
|
const formData = ref<{ host: string; api_key: string }>({
|
||||||
host: '',
|
host: '',
|
||||||
apiKey: '',
|
api_key: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
const fetchConfig = async () => {
|
const fetchConfig = async () => {
|
||||||
const resp = await api.get('/items/meili_search_config?limit=1');
|
const resp = await api.get('/items/meili_search_config?limit=1');
|
||||||
if (resp.data.data) {
|
if (resp.data.data) {
|
||||||
formData.value.host = resp.data.data.host;
|
formData.value.host = resp.data.data.host;
|
||||||
formData.value.apiKey = resp.data.data.apiKey;
|
formData.value.api_key = resp.data.data.api_key;
|
||||||
configExists = true;
|
configExists = true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -69,7 +69,7 @@ const testConnection = async () => {
|
|||||||
statusMessage.value = '';
|
statusMessage.value = '';
|
||||||
try {
|
try {
|
||||||
pending.value = true;
|
pending.value = true;
|
||||||
const resp = await api.post('/meilisearch/connection-test', { host: formData.value.host, apiKey: formData.value.apiKey });
|
const resp = await api.post('/meilisearch/connection-test', { host: formData.value.host, apiKey: formData.value.api_key });
|
||||||
if (resp.data.success) {
|
if (resp.data.success) {
|
||||||
statusSuccess.value = true;
|
statusSuccess.value = true;
|
||||||
statusMessage.value = '连接成功!';
|
statusMessage.value = '连接成功!';
|
||||||
|
|||||||
Reference in New Issue
Block a user