Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Wiki
Manage
Activity
Members
Labels
Plan
Issues
53
Issue boards
Milestones
Wiki
Code
Merge requests
6
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MDM Lab
Wiki
Commits
d3f526a7
Commit
d3f526a7
authored
1 year ago
by
Remi PLANEL
Browse files
Options
Downloads
Patches
Plain Diff
make some request client side
parent
92ce1fe5
No related branches found
No related tags found
No related merge requests found
Pipeline
#125949
waiting for manual action with stages
in 8 minutes and 54 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
components/ServerDbTable.vue
+5
-24
5 additions, 24 deletions
components/ServerDbTable.vue
components/content/StructureDb.vue
+13
-0
13 additions, 0 deletions
components/content/StructureDb.vue
components/content/SystemDb.vue
+14
-0
14 additions, 0 deletions
components/content/SystemDb.vue
with
32 additions
and
24 deletions
components/ServerDbTable.vue
+
5
−
24
View file @
d3f526a7
...
...
@@ -7,7 +7,6 @@ import { useDisplay } from "vuetify";
import
{
useThrottleFn
}
from
'
@vueuse/core
'
import
type
{
FacetInputItem
,
FilterItem
}
from
'
@/components/AutocompleteMeiliFacets.vue
'
import
{
useMeiliSearch
}
from
"
#imports
"
import
type
{
Filter
}
from
"
meilisearch
"
;
// import { saveAs } from "file-saver";
export
interface
SortItem
{
key
:
string
,
...
...
@@ -25,9 +24,6 @@ export interface NumericalFilterModel extends NumericalFilter {
}
export
interface
AutocompleteMeiliFacetProps
{
db
:
string
facets
:
FacetInputItem
[]
|
undefined
...
...
@@ -58,12 +54,6 @@ const props = withDefaults(defineProps<Props>(), {
}
}
});
// const facetDistribution: Ref
<
Record
<
string
,
Record
<
string
,
number
>>
|
undefined
>
=
useState
(
`refseqFacetDistribution`
)
const
slots
=
useSlots
()
const
sortByRef
=
toRef
(
props
.
sortBy
)
const
emit
=
defineEmits
([
"
refresh:search
"
])
...
...
@@ -73,7 +63,6 @@ const filterOrSearch: Ref<FilterItem[] | null> = ref(null)
const
hitsPerPage
:
Ref
<
number
>
=
ref
(
25
)
const
itemsPerPage
:
Ref
<
number
[]
>
=
ref
([
25
,
50
,
100
])
const
filterError
:
Ref
<
string
|
null
>
=
ref
(
null
)
// const msFilter: Ref
<
string
|
undefined
>
=
ref
(
undefined
)
const
page
=
ref
(
1
)
let
loading
=
ref
(
false
)
const
expanded
=
ref
([])
...
...
@@ -85,7 +74,6 @@ const computedTableHeight = computed(() => {
})
const
pendingDownloadData
=
ref
(
false
)
const
toRefNumericalFilters
=
toRef
(
props
.
numericalFilters
)
// const meiliFilters = ref
<
string
|
undefined
>
(
undefined
)
...
...
@@ -130,13 +118,9 @@ watch([paginationParams, msSortBy, page], ([newParams, newSort, newPage]) => {
}
})
onBeforeMount
(
async
()
=>
{
searchOrFilter
()
emitRefreshRes
()
})
const
msFilterCompo
=
ref
<
FilterItem
[]
|
undefined
>
(
undefined
)
...
...
@@ -181,7 +165,6 @@ const { arrayFilters: computedFilter } = useMeiliFilters(msFilterCompo, computed
watch
(
computedFilter
,
()
=>
{
console
.
log
(
toValue
(
computedFilter
))
if
(
toValue
(
isValidFilters
)
&&
(
toValue
(
computedFilter
)
!==
undefined
||
toValue
(
filterInputValues
)
===
null
))
{
searchOrFilter
()
emitRefreshRes
()
...
...
@@ -311,25 +294,23 @@ function focusedOrBlur(isFocused: boolean) {
<v-card
variant=
"flat"
color=
"transparent"
>
<v-card-text
class=
"d-flex flex-row"
>
<v-badge
:content=
"totalHits"
color=
"primary"
class=
"me-auto"
>
<v-btn
prepend-icon=
"md:download"
:loading=
"pendingDownloadData"
variant=
"text"
color=
"primary"
@
click=
"downloadData()"
>
{{
props
.
title
}}
<v-btn
prepend-icon=
"md:download"
:loading=
"pendingDownloadData"
variant=
"text"
color=
"primary"
@
click=
"downloadData()"
>
{{
props
.
title
}}
</v-btn>
</v-badge>
<slot
name=
"toolbar-items"
></slot>
</v-card-text>
<v-card-text>
<v-text-field
v-model=
"search"
label=
"Search..."
hide-details=
"auto"
:disabled=
"pendingDownloadData"
prepend-inner-icon=
"mdi-magnify"
single-line
clearable
<v-text-field
v-model=
"search"
label=
"Search..."
hide-details=
"auto"
:disabled=
"pendingDownloadData"
prepend-inner-icon=
"mdi-magnify"
single-line
clearable
@
update:focused=
"focusedOrBlur"
></v-text-field>
</v-card-text>
<v-card-text>
<AutocompleteMeiliFacets
v-model=
"msFilterCompo"
v-bind=
"props.autocompleteMeiliFacetsProps"
:is-valid-filters=
"isValidFilters"
>
</AutocompleteMeiliFacets>
</v-card-text>
...
...
This diff is collapsed.
Click to expand it.
components/content/StructureDb.vue
+
13
−
0
View file @
d3f526a7
...
...
@@ -31,6 +31,19 @@ onBeforeMount(async () => {
})
onMounted
(
async
()
=>
{
const
{
data
}
=
await
useAsyncMeiliSearch
({
index
:
toValue
(
dbName
),
query
:
""
,
params
:
{
facets
:
[
"
*
"
],
filter
:
[],
page
:
1
,
hitsPerPage
:
25
,
}
})
autocompleteMeiliFacetsProps
.
value
.
facetDistribution
=
toValue
(
data
)?.
facetDistribution
})
const
autocompleteMeiliFacetsProps
=
ref
<
AutocompleteMeiliFacetProps
>
({
db
:
toValue
(
dbName
),
facets
:
[
...
...
This diff is collapsed.
Click to expand it.
components/content/SystemDb.vue
+
14
−
0
View file @
d3f526a7
...
...
@@ -18,6 +18,20 @@ onBeforeMount(async () => {
autocompleteMeiliFacetsProps
.
value
.
facetDistribution
=
toValue
(
data
)?.
facetDistribution
})
onMounted
(
async
()
=>
{
const
{
data
}
=
await
useAsyncMeiliSearch
({
index
:
toValue
(
dbName
),
query
:
""
,
params
:
{
facets
:
[
"
*
"
],
filter
:
[],
page
:
1
,
hitsPerPage
:
25
,
}
})
autocompleteMeiliFacetsProps
.
value
.
facetDistribution
=
toValue
(
data
)?.
facetDistribution
})
const
autocompleteMeiliFacetsProps
=
ref
<
AutocompleteMeiliFacetProps
>
({
db
:
toValue
(
dbName
),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment