Skip to content

Commit

Permalink
feat: enable search box for ace editor #412
Browse files Browse the repository at this point in the history
  • Loading branch information
0xJacky committed Jun 7, 2024
1 parent c8502ad commit 43709a6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
5 changes: 5 additions & 0 deletions app/src/components/CodeEditor/CodeEditor.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<script setup lang="ts">
import { VAceEditor } from 'vue3-ace-editor'
import 'ace-builds/src-noconflict/mode-nginx'
import ace from 'ace-builds'
import 'ace-builds/src-noconflict/theme-monokai'
import extSearchboxUrl from 'ace-builds/src-noconflict/ext-searchbox?url'
import { computed } from 'vue'
const props = defineProps<{
Expand All @@ -21,10 +23,13 @@ const value = computed({
emit('update:content', v)
},
})
ace.config.setModuleUrl('ace/ext/searchbox', extSearchboxUrl)
</script>

<template>
<VAceEditor
ref="aceRef"

Check failure on line 32 in app/src/components/CodeEditor/CodeEditor.vue

View workflow job for this annotation

GitHub Actions / build_app

'aceRef' is defined as ref, but never used
v-model:value="value"
lang="nginx"
theme="monokai"
Expand Down
16 changes: 15 additions & 1 deletion app/src/components/StdDesign/StdDataDisplay/StdTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,26 @@ watch(route, () => {
params.trash = route.query.trash === 'true'
})
const filterParams = reactive({})
watch(filterParams, () => {
Object.assign(params, {
...filterParams,
page: 1,
})
})
onMounted(() => {
if (!props.disableQueryParams) {
Object.assign(params, {
...route.query,
trash: route.query.trash === 'true',
})
Object.assign(filterParams, {
...route.query,
trash: route.query.trash === 'true',
})
}
get_list()
Expand Down Expand Up @@ -429,7 +443,7 @@ const paginationSize = computed(() => {
v-if="!disableSearch && searchColumns.length"
:key="updateFilter"
:data-list="searchColumns"
:data-source="params"
:data-source="filterParams"
type="search"
layout="inline"
>
Expand Down

0 comments on commit 43709a6

Please sign in to comment.