mirror of
https://github.com/open-webui/open-webui
synced 2025-06-04 03:37:35 +00:00
enh: sort functions list by type
This commit is contained in:
parent
9cdd66ca59
commit
f5f2215348
@ -50,12 +50,14 @@
|
|||||||
let showDeleteConfirm = false;
|
let showDeleteConfirm = false;
|
||||||
|
|
||||||
let filteredItems = [];
|
let filteredItems = [];
|
||||||
$: filteredItems = $functions.filter(
|
$: filteredItems = $functions
|
||||||
|
.filter(
|
||||||
(f) =>
|
(f) =>
|
||||||
query === '' ||
|
query === '' ||
|
||||||
f.name.toLowerCase().includes(query.toLowerCase()) ||
|
f.name.toLowerCase().includes(query.toLowerCase()) ||
|
||||||
f.id.toLowerCase().includes(query.toLowerCase())
|
f.id.toLowerCase().includes(query.toLowerCase())
|
||||||
);
|
)
|
||||||
|
.sort((a, b) => a.type.localeCompare(b.type) || a.name.localeCompare(b.name));
|
||||||
|
|
||||||
const shareHandler = async (func) => {
|
const shareHandler = async (func) => {
|
||||||
const item = await getFunctionById(localStorage.token, func.id).catch((error) => {
|
const item = await getFunctionById(localStorage.token, func.id).catch((error) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user