Skip to content

Commit

Permalink
Merge pull request #1605 from slntopp/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
SazukinPavel authored Mar 26, 2024
2 parents e117afa + 5217774 commit 2a2953d
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 15 deletions.
29 changes: 18 additions & 11 deletions admin-ui/src/components/accounts_table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,10 @@ const props = defineProps({
type: Boolean,
default: false,
},
notFiltered: { type: Boolean, default: false },
noSearch: { type: Boolean, default: false },
customSearchParam: { type: String, default: "" },
});
const { value, singleSelect } = toRefs(props);
const { value, singleSelect, customSearchParam, noSearch } = toRefs(props);
const emit = defineEmits(["input"]);
Expand Down Expand Up @@ -200,14 +201,17 @@ const accounts = computed(() => {
const total = computed(() => store.getters["accounts/total"]);
const requestOptions = computed(() => ({
filters: {
...filter.value,
balance: filter.value?.balance && {
from: filter.value?.balance.from && +filter.value?.balance.from,
to: filter.value?.balance.to && +filter.value?.balance.to,
},
search_param: searchParam.value || filter.value.search_param || undefined,
},
filters: !noSearch.value
? {
...filter.value,
balance: filter.value?.balance && {
from: filter.value?.balance.from && +filter.value?.balance.from,
to: filter.value?.balance.to && +filter.value?.balance.to,
},
search_param:
searchParam.value || filter.value.search_param || undefined,
}
: { search_param: customSearchParam.value || undefined },
page: options.value.page,
limit: options.value.itemsPerPage,
field: options.value.sortBy[0],
Expand Down Expand Up @@ -319,7 +323,9 @@ watch(accounts, () => {
});
watch(searchFields, () => {
store.commit("appSearch/setFields", searchFields.value);
if (!noSearch.value) {
store.commit("appSearch/setFields", searchFields.value);
}
});
watch(value, () => {
Expand All @@ -328,6 +334,7 @@ watch(value, () => {
watch(filter, fetchAccountsDebounce, { deep: true });
watch(options, fetchAccountsDebounce);
watch(customSearchParam, fetchAccountsDebounce);
</script>
<script>
Expand Down
4 changes: 2 additions & 2 deletions admin-ui/src/components/widgets/chats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
}"
>
{{
chat.topic.length > 15
chat.topic.length > 27
? chat.topic.slice(0, 30) + "..."
: chat.topic
}}
Expand Down Expand Up @@ -138,7 +138,7 @@ const lastActivityChats = computed(() => {
(Number(a.meta?.lastMessage?.sent || a.created) || 0)
);
return sorted.slice(0, 5);
return sorted.slice(0, 3);
});
const countForPeriod = computed(() => {
Expand Down
5 changes: 5 additions & 0 deletions admin-ui/src/components/widgets/instances.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@
}"
>
{{ instance.title }}
{{
instance.title.length > 20
? instance.title.slice(0, 17) + "..."
: instance.title
}}
</router-link>
<instance-state small :template="instance" />
</div>
Expand Down
14 changes: 12 additions & 2 deletions admin-ui/src/views/Namespaces.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@
<v-card-title class=""> Select Accounts (join) </v-card-title>

<v-card-text style="max-height: 60vh">
<v-text-field v-model="joinAccount.search" label="search..." />
<accounts-table
not-filtered
no-search
v-model="joinAccount.selected"
single-select
:custom-search-param="joinAccount.search"
/>
</v-card-text>
<v-row class="pa-5">
Expand Down Expand Up @@ -112,7 +114,13 @@
<v-card-title class=""> Select Accounts (link) </v-card-title>

<v-card-text style="max-height: 60vh">
<accounts-table not-filtered v-model="linkAccount.selected">
<v-text-field v-model="linkAccount.search" label="search..." />

<accounts-table
no-search
:custom-search-param="linkAccount.search"
v-model="linkAccount.selected"
>
</accounts-table>
</v-card-text>

Expand Down Expand Up @@ -187,6 +195,7 @@ export default {
access: 0,
role: "default",
},
search: "",
},
accessLevels: [
Expand All @@ -205,6 +214,7 @@ export default {
access: 0,
role: "default",
},
search: "",
},
};
},
Expand Down

0 comments on commit 2a2953d

Please sign in to comment.