feat: action function

This commit is contained in:
Timothy J. Baek
2024-07-11 18:41:00 -07:00
parent 90c3d68f00
commit eb10001eb7
7 changed files with 211 additions and 4 deletions

View File

@@ -122,12 +122,17 @@
if (res) {
if (func.is_global) {
toast.success($i18n.t('Filter is now globally enabled'));
func.type === 'filter'
? toast.success($i18n.t('Filter is now globally enabled'))
: toast.success($i18n.t('Function is now globally enabled'));
} else {
toast.success($i18n.t('Filter is now globally disabled'));
func.type === 'filter'
? toast.success($i18n.t('Filter is now globally disabled'))
: toast.success($i18n.t('Function is now globally disabled'));
}
functions.set(await getFunctions(localStorage.token));
models.set(await getModels(localStorage.token));
}
};
</script>
@@ -294,7 +299,7 @@
showDeleteConfirm = true;
}}
toggleGlobalHandler={() => {
if (func.type === 'filter') {
if (['filter', 'action'].includes(func.type)) {
toggleGlobalHandler(func);
}
}}

View File

@@ -48,7 +48,7 @@
align="start"
transition={flyAndScale}
>
{#if func.type === 'filter'}
{#if ['filter', 'action'].includes(func.type)}
<div
class="flex gap-2 justify-between items-center px-3 py-2 text-sm font-medium cursor-pointerrounded-md"
>