* Add indexer crate and files * POC searcher incomplete schema only indexes at startup * POC search component frontend * Demo of the frontend element * add Results and Args as text * minimal functionality * Make jump to scripts by name also flows and apps * Add button on sidebar to open search * Update lock on indexer after merge * Make arrow key navigation compatible with scrol * Show empty result screen and log as a coming feat * Add summary to script searchable items * Catch `parts is undefined` error (uFuzzy) * Index refreshing using tokio interval * Fix JobLoader workspace being wrongly defined * Fix click outside * Add debouncing for completed run search * Binary mode working + job index tracker * Warning for no license + fix height scrollbars on content search * Make it compile without EE files * remove panic to use errors * Move global search * Cleanup UI, no more tab switcher but clear placeholders and actions * Add tantivy feature flag for windmill-api * Rework indexer mode * Mac compatibility for shortcut * Update test for new run_server * Prepare sqlx * Mac compatibility * Fix openapi yaml * Fix frontend * Frontend api fix * Update docker-compose.yml and caddyfile With the (by default deactivated) container and reverse proxy to use the windmill indexer * fix feature flag for tests * fix feature falg for running tests * fix feature flag for running tests * Make content search use search modal instead * Add tantivy feature to ee build steps * Remove old Content search * change volume location for indexer * Update dependencies * Prepare sqlx * Uncomment line on docker compose * Add line between input and results * Update ee repo ref
71 lines
1.8 KiB
Svelte
71 lines
1.8 KiB
Svelte
<script lang="ts">
|
|
import { twMerge } from 'tailwind-merge'
|
|
import Popover from '../Popover.svelte'
|
|
import { createEventDispatcher } from 'svelte'
|
|
|
|
export let label: string | undefined = undefined
|
|
export let icon: any | undefined = undefined
|
|
export let isCollapsed: boolean
|
|
export let disabled: boolean = false
|
|
export let lightMode: boolean = false
|
|
export let stopPropagationOnClick: boolean = false
|
|
export let shortcut: string = ""
|
|
|
|
let dispatch = createEventDispatcher()
|
|
</script>
|
|
|
|
{#if !disabled}
|
|
<Popover appearTimeout={0} disappearTimeout={0} class="w-full" disablePopup={!isCollapsed}>
|
|
<button
|
|
on:click={(e) => {
|
|
if (stopPropagationOnClick) e.preventDefault()
|
|
dispatch('click')
|
|
}}
|
|
class={twMerge(
|
|
'group flex items-center px-2 py-2 font-light rounded-md h-8 gap-3 w-full',
|
|
lightMode
|
|
? 'text-primary hover:bg-surface-hover '
|
|
: ' hover:bg-[#2A3648] text-primary-inverse dark:text-primary',
|
|
'transition-all',
|
|
$$props.class
|
|
)}
|
|
title={label}
|
|
>
|
|
{#if icon}
|
|
<svelte:component
|
|
this={icon}
|
|
size={16}
|
|
class={twMerge(
|
|
'flex-shrink-0',
|
|
lightMode
|
|
? 'text-primary group-hover:text-secondary'
|
|
: 'text-primary-inverse group-hover:text-secondary-inverse dark:group-hover:text-secondary dark:text-primary',
|
|
'transition-all'
|
|
)}
|
|
/>
|
|
{/if}
|
|
|
|
{#if !isCollapsed && label}
|
|
<span
|
|
class={twMerge(
|
|
'whitespace-pre truncate',
|
|
lightMode ? 'text-primary' : 'text-primary-inverse dark:text-primary',
|
|
'transition-all',
|
|
$$props.class
|
|
)}
|
|
>
|
|
{label}
|
|
<span class="pl-2 text-xs dark:text-secondary light:text-secondary-inverse font-semibold">
|
|
{shortcut}
|
|
</span>
|
|
</span>
|
|
{/if}
|
|
</button>
|
|
<svelte:fragment slot="text">
|
|
{#if label}
|
|
{label}
|
|
{/if}
|
|
</svelte:fragment>
|
|
</Popover>
|
|
{/if}
|