mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-12 19:05:55 +02:00
feat: enable search box for ace editor #412
This commit is contained in:
parent
c8502ad7bf
commit
020a9ba2f2
2 changed files with 19 additions and 1 deletions
|
@ -1,7 +1,9 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { VAceEditor } from 'vue3-ace-editor'
|
import { VAceEditor } from 'vue3-ace-editor'
|
||||||
import 'ace-builds/src-noconflict/mode-nginx'
|
import 'ace-builds/src-noconflict/mode-nginx'
|
||||||
|
import ace from 'ace-builds'
|
||||||
import 'ace-builds/src-noconflict/theme-monokai'
|
import 'ace-builds/src-noconflict/theme-monokai'
|
||||||
|
import extSearchboxUrl from 'ace-builds/src-noconflict/ext-searchbox?url'
|
||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
|
@ -21,6 +23,8 @@ const value = computed({
|
||||||
emit('update:content', v)
|
emit('update:content', v)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
ace.config.setModuleUrl('ace/ext/searchbox', extSearchboxUrl)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
|
@ -141,12 +141,26 @@ watch(route, () => {
|
||||||
params.trash = route.query.trash === 'true'
|
params.trash = route.query.trash === 'true'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const filterParams = reactive({})
|
||||||
|
|
||||||
|
watch(filterParams, () => {
|
||||||
|
Object.assign(params, {
|
||||||
|
...filterParams,
|
||||||
|
page: 1,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (!props.disableQueryParams) {
|
if (!props.disableQueryParams) {
|
||||||
Object.assign(params, {
|
Object.assign(params, {
|
||||||
...route.query,
|
...route.query,
|
||||||
trash: route.query.trash === 'true',
|
trash: route.query.trash === 'true',
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Object.assign(filterParams, {
|
||||||
|
...route.query,
|
||||||
|
trash: route.query.trash === 'true',
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
get_list()
|
get_list()
|
||||||
|
@ -429,7 +443,7 @@ const paginationSize = computed(() => {
|
||||||
v-if="!disableSearch && searchColumns.length"
|
v-if="!disableSearch && searchColumns.length"
|
||||||
:key="updateFilter"
|
:key="updateFilter"
|
||||||
:data-list="searchColumns"
|
:data-list="searchColumns"
|
||||||
:data-source="params"
|
:data-source="filterParams"
|
||||||
type="search"
|
type="search"
|
||||||
layout="inline"
|
layout="inline"
|
||||||
>
|
>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue