optimize marketplace search to manual trigger and title-only query

This commit is contained in:
jingrow 2025-11-21 19:00:41 +08:00
parent a2d3094495
commit 026b2a5f50
6 changed files with 9 additions and 14 deletions

View File

@ -388,8 +388,8 @@ onMounted(() => {
})
})
//
watch([searchQuery, sortBy], () => {
//
watch([sortBy], () => {
page.value = 1 //
loadAgents()
}, { deep: true })

View File

@ -417,8 +417,8 @@ onMounted(() => {
})
})
//
watch([searchQuery, sortBy], () => {
//
watch([sortBy], () => {
page.value = 1 //
loadApps()
}, { deep: true })

View File

@ -400,8 +400,8 @@ onMounted(() => {
})
})
//
watch([searchQuery, sortBy], () => {
//
watch([sortBy], () => {
page.value = 1 //
loadNodes()
}, { deep: true })

View File

@ -155,7 +155,7 @@
<script setup lang="ts">
import { ref, onMounted, computed, watch } from 'vue'
import { useRouter } from 'vue-router'
import { NInput, NButton, NIcon, NSpin, NEmpty, NSelect, NPagination, useMessage, useDialog } from 'naive-ui'
import { NInput, NButton, NIcon, NSpin, NEmpty, NSelect, NPagination, useMessage } from 'naive-ui'
import { Icon } from '@iconify/vue'
import axios from 'axios'
import { t } from '@/shared/i18n'
@ -164,7 +164,6 @@ import { useToolsStore } from '@/shared/stores/tools'
import InstallProgressModal from './InstallProgressModal.vue'
const message = useMessage()
const dialog = useDialog()
const router = useRouter()
const toolsStore = useToolsStore()
@ -419,8 +418,8 @@ onMounted(() => {
})
})
//
watch([searchQuery, sortBy], () => {
//
watch([sortBy], () => {
page.value = 1 //
loadTools()
}, { deep: true })

View File

@ -254,7 +254,6 @@ async def get_node_marketplace(
filters = {"public": 1}
if search:
filters["title"] = ["like", f"%{search}%"]
filters["node_type"] = ["like", f"%{search}%"]
# 1. 先获取总数(不分页)
total_params = {
@ -797,7 +796,6 @@ async def get_agent_marketplace(
# 构建过滤条件
filters = {"public": 1}
if search:
filters["agent_name"] = ["like", f"%{search}%"]
filters["title"] = ["like", f"%{search}%"]
# 1. 先获取总数(不分页)

View File

@ -55,9 +55,7 @@ async def get_tool_marketplace(
# 构建过滤条件
filters = {"public": 1}
if search:
filters["name"] = ["like", f"%{search}%"]
filters["title"] = ["like", f"%{search}%"]
filters["description"] = ["like", f"%{search}%"]
# 1. 先获取总数(不分页)
total_params = {