@kedem/okdb 2.1.0 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/algorithm-worker-thread.js +1 -1
- package/bin/okdb.js +1 -1
- package/okdb-functions-sandbox-worker.js +1 -1
- package/okdb-http-worker-child.js +1 -1
- package/okdb-views-bootstrap-worker.js +1 -1
- package/okdb.js +1 -1
- package/package.json +1 -1
- package/public/sections/embeddings/parts/embed-indexer-panel.ok.js +1 -1
- package/public/sections/embeddings/parts/engines-overview.ok.js +1 -1
- package/public/sections/embeddings/parts/pipeline-flow-strip.ok.js +1 -1
- package/public/sections/engines/engine-ui-utils.js +1 -1
- package/public/sections/engines/index.ok.html +1 -1
- package/public/vendor/okjs/ok.esm.min.js +1 -1
- package/public/vendor/okjs/toolkit/core/virtualized.ok.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
<script type="module">import e from"../embeddings/parts/engines-overview.ok.js";import t from"../embeddings/parts/pipeline-create-panel.ok.js";import i from"../../stores/events-store.js";export default{tag:"engines-index",unwrap:!0,dependencies:[e,t],context:e=>({embedEngines:[],embedPipelines:[],fileEngines:{},view:"overview",mode:"pipelines",pipelineType:"all",engineType:"",status:"all",search:"",sourceTypeFilter:"",selectedPipelineName:"",createKind:"",busy:!1,_unsubs:[],get selectedEnv(){return e.$ok.stores.okdb.selectedEnv||"default"},normalizeView:e=>["overview","create"].includes(e)?e:"overview",normalizeMode:e=>["pipelines","engines"].includes(e)?e:"pipelines",normalizePipelineType:e=>["all","embedding","file"].includes(e)?e:"all",normalizeEngineType:e=>String(e||"").trim(),legacyFilterState(e){switch(e){case"pipelines":default:return{mode:"pipelines",pipelineType:"all",engineType:""};case"standalone":case"runtime":return{mode:"engines",pipelineType:"all",engineType:""};case"embedding":return{mode:"pipelines",pipelineType:"embedding",engineType:""};case"file":return{mode:"pipelines",pipelineType:"file",engineType:""}}},normalizeStatus:e=>["all","running","attention","stopped"].includes(e)?e:"all",normalizeCreateKind:e=>["processor","materializer","queue-worker","embedding"].includes(e)?e:"",setView(e){const t=this.normalizeView(e);this.view!==t&&(this.view=t,this.syncRouteState())},setModeFilter(e){const t=this.normalizeMode(e);this.mode!==t&&(this.mode=t,"pipelines"===t&&(this.engineType=""),"engines"===t&&(this.pipelineType="all",this.selectedPipelineName=""),this.syncRouteState())},setPipelineTypeFilter(e){const t=this.normalizePipelineType(e);this.pipelineType!==t&&(this.pipelineType=t,this.syncRouteState())},setEngineTypeFilter(e){const t=this.normalizeEngineType(e);this.engineType!==t&&(this.engineType=t,this.syncRouteState())},setSourceTypeFilter(e){const t=String(e??"");this.sourceTypeFilter!==t&&(this.sourceTypeFilter=t,this.syncRouteState())},get availableSourceTypes(){const e=new Set;for(const t of this.embedEngines??[])t?.config?.source_type&&e.add(t.config.source_type),t?.runtime?.source_type&&e.add(t.runtime.source_type),t?.stats?.source_type&&e.add(t.stats.source_type),t?.stats?.indexer?.source_type&&e.add(t.stats.indexer.source_type),t?.config?.target_type&&e.add(t.config.target_type);const t=this.fileEngines??{};for(const i of[...t.extractors??[],...t.collections??[],...t.workers??[]])i?.config?.source_type&&e.add(i.config.source_type);return[...e].sort()},get availableEngineTypes(){const e=new Set;for(const t of this.embedEngines??[])t?.type&&e.add(t.type);const t=this.fileEngines??{};for(const i of[...t.extractors??[],...t.collections??[],...t.workers??[]])i?.type&&e.add(i.type);return[...e].sort()},get workspaceCount(){const e=this.fileEngines??{},t=(this.embedEngines??[]).length+(e.extractors??[]).length+(e.collections??[]).length+(e.workers??[]).length,i=(this.embedPipelines??[]).length+(e.collections??[]).length;return"engines"===this.mode?t:i},get searchPlaceholder(){return"engines"===this.mode?"Search engines…":"Search pipelines…"},get routeSearch(){return e.$vars?.$route?.search??e.$vars?.$router?._search??{}},applyRouteState(){const e=this.routeSearch,t=this.legacyFilterState(e.family||""),i=this.normalizeView(e.view||"overview"),s=this.normalizeMode(e.mode||t.mode||"pipelines"),n=this.normalizePipelineType(e.pipelineType||t.pipelineType||"all"),l=this.normalizeEngineType(e.engineType||t.engineType||""),r=this.normalizeStatus(e.status||"all"),o=String(e.search||""),a=String(e.sourceType||""),p=String(e.pipeline||""),h=this.normalizeCreateKind(e.kind||"");this.view!==i&&(this.view=i),this.mode!==s&&(this.mode=s),this.pipelineType!==n&&(this.pipelineType=n),this.engineType!==l&&(this.engineType=l),this.status!==r&&(this.status=r),this.search!==o&&(this.search=o),this.sourceTypeFilter!==a&&(this.sourceTypeFilter=a),this.selectedPipelineName!==p&&(this.selectedPipelineName=p),this.createKind!==h&&(this.createKind=h)},syncRouteState(){const t=e.$vars?.$router;if(!t?.resolve||!t?.replace)return;const i=this.routeSearch,s={...i};this.view&&"overview"!==this.view?s.view=this.view:delete s.view,this.mode&&"pipelines"!==this.mode?s.mode=this.mode:delete s.mode,this.pipelineType&&"all"!==this.pipelineType?s.pipelineType=this.pipelineType:delete s.pipelineType,this.engineType?s.engineType=this.engineType:delete s.engineType,this.status&&"all"!==this.status?s.status=this.status:delete s.status,this.search?.trim()?s.search=this.search.trim():delete s.search,this.sourceTypeFilter?.trim()?s.sourceType=this.sourceTypeFilter.trim():delete s.sourceType,this.selectedPipelineName?.trim()?s.pipeline=this.selectedPipelineName.trim():delete s.pipeline,"create"===this.view&&this.createKind?s.kind=this.createKind:delete s.kind,delete s.family;const n=this.legacyFilterState(i.family||""),l=this.normalizeView(i.view||"overview"),r=this.normalizeMode(i.mode||n.mode||"pipelines"),o=this.normalizePipelineType(i.pipelineType||n.pipelineType||"all"),a=this.normalizeEngineType(i.engineType||n.engineType||""),p=this.normalizeStatus(i.status||"all"),h=String(i.search||""),c=String(i.sourceType||""),d=String(i.pipeline||""),u=this.normalizeCreateKind(i.kind||"");if(l===this.view&&r===this.mode&&o===this.pipelineType&&a===this.engineType&&p===this.status&&h===(this.search||"")&&c===(this.sourceTypeFilter||"")&&d===(this.selectedPipelineName||"")&&u===(this.createKind||""))return;const y=e.$vars?.$route?.location||t._path||"/engines";t.replace(t.resolve(y,s,t._anchor||""))},clearFilters(){("all"!==this.pipelineType||this.engineType||"all"!==this.status||this.search||this.sourceTypeFilter)&&(this.pipelineType="all",this.engineType="",this.status="all",this.search="",this.sourceTypeFilter="",this.syncRouteState())},setSearchTerm(e){const t=String(e??"");this.search!==t&&(this.search=t,this.syncRouteState())},setStatusFilter(e){const t=this.normalizeStatus(e);this.status!==t&&(this.status=t,this.syncRouteState())},clearSourceTypeFilter(){this.sourceTypeFilter&&(this.sourceTypeFilter="",this.syncRouteState())},onPipelineSelected(e){const t=e?.name??"";this.selectedPipelineName!==t&&(this.selectedPipelineName=t,this.syncRouteState())},async load(){this.busy=!0;const e=this.selectedEnv;try{const[t,i,s]=await Promise.allSettled([fetch(`${__ENV__.API}/env/${encodeURIComponent(e)}/engines`).then(e=>e.json()),fetch(`${__ENV__.API}/embeddings/embedders`).then(e=>e.json()),fetch(`${__ENV__.API}/env/${encodeURIComponent(e)}/pipelines`).then(e=>e.json())]),n="fulfilled"===t.status?t.value?.data??[]:[],l="fulfilled"===i.status?i.value?.data??[]:[];this.embedEngines=[...n,...l],this.embedPipelines="fulfilled"===s.status?s.value?.data??(Array.isArray(s.value)?s.value:[]):[],this.fileEngines={extractors:n.filter(e=>"file-extractor"===e.type),collections:n.filter(e=>"file-collection"===e.type),workers:n.filter(e=>"file-extractor-worker"===e.type)}}catch{}finally{this.busy=!1}},async onCreated(){this.view="overview",this.syncRouteState(),await this.load()}}),async init(e){this.applyRouteState(),await this.load();const t=()=>this.load();this._unsubs=[i.on("engine:started",t),i.on("engine:stopped",t),i.on("engine:error",t),i.on("pipeline:start",t),i.on("pipeline:stop",t),i.on("pipeline:delete",t)],e.$watch(()=>e.$ok.stores.okdb.selectedEnv,()=>this.load()),e.$watch(()=>JSON.stringify(this.routeSearch),()=>this.applyRouteState())},unmount(){for(const e of this._unsubs)e();this._unsubs=[]}};</script><style>.eng-nav-row{display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:6px 10px;border-radius:6px;border:1px solid transparent;background:0 0;color:var(--okdb-app-fg-muted);font-size:12px;cursor:pointer;transition:background .12s,border-color .12s,color .12s}.eng-nav-row:hover{background:var(--okdb-app-surface);border-color:var(--okdb-app-border);color:var(--okdb-app-fg-strong)}.eng-nav-row--on{background:var(--okdb-app-surface);border-color:var(--okdb-accent);color:var(--okdb-app-fg-strong)}.eng-nav-sep{font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:var(--okdb-app-fg-subtle);padding:6px 10px 2px}.eng-filter-card{display:flex;flex-direction:column;gap:10px;padding:10px;border:1px solid var(--okdb-app-border);border-radius:10px;background:var(--okdb-app-bg-deep);min-width:0}.eng-field{display:flex;flex-direction:column;gap:4px;min-width:0}.eng-field__label{font-size:11px;color:var(--okdb-app-fg-muted)}.eng-control{width:100%;min-width:0;box-sizing:border-box;font-size:12px}.eng-segment{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;width:100%}.eng-segment__btn{min-width:0;width:100%;padding:6px 10px;border-radius:8px;border:1px solid var(--okdb-app-border);background:var(--okdb-app-bg-deep);color:var(--okdb-app-fg-muted);font-size:11px;font-weight:600;cursor:pointer;transition:background .12s,border-color .12s,color .12s,box-shadow .12s}.eng-segment__btn:hover{background:var(--okdb-app-surface);border-color:var(--okdb-app-border);color:var(--okdb-app-fg-strong)}.eng-segment__btn--active{border-color:var(--okdb-accent);background:color-mix(in srgb,var(--okdb-accent) 7%,transparent);color:var(--okdb-accent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--okdb-accent) 13%,transparent)}.eng-filter-actions{display:flex;justify-content:flex-end}.eng-clear-btn{font-size:11px;padding:5px 10px;border-radius:999px;border:1px solid var(--okdb-app-border);color:var(--okdb-app-fg-muted);background:var(--okdb-app-bg-deep);cursor:pointer}.eng-clear-btn:hover{border-color:var(--okdb-app-border-strong);color:var(--okdb-app-fg-strong);background:var(--okdb-app-surface)}</style><template><component import="../../layouts/_default.ok.html"><template name="sidebar"><div style="display:flex;flex-direction:column;gap:8px;height:100%;min-height:0;overflow-y:auto"><button :class="view === 'create' ? 'eng-nav-row eng-nav-row--on' : 'eng-nav-row'" @click="setView('create')" title="Create a pipeline, which provisions and wires together one or more engines."><span style="width:14px;text-align:center;flex-shrink:0;opacity:.9;color:var(--okdb-accent)">+</span> <span style="color:var(--okdb-accent)">New Pipeline</span></button><div class="eng-nav-sep">Engines</div><button :class="view === 'overview' ? 'eng-nav-row eng-nav-row--on' : 'eng-nav-row'" @click="setView('overview')"><span style="width:14px;text-align:center;flex-shrink:0;opacity:.7">⊛</span> <span>Workspace</span> <span style="margin-left:auto;font-size:10px;opacity:.4">{{ workspaceCount }}</span></button><if :="view === 'overview'"><div style="height:1px;background:var(--okdb-app-border);margin:2px 0"></div><div class="eng-nav-sep" style="padding-top:4px">Filters</div><div class="eng-filter-card"><label class="eng-field"><span class="eng-field__label" title="Search by name, type, handler, env, pipeline, or source type">Search</span> <input class="eng-control" :value="search" @input:debounce.250="setSearchTerm($event.target.value)" :placeholder="searchPlaceholder"/></label><div class="eng-field"><span class="eng-field__label" title="Switch between the grouped pipeline view and the flat engine inventory.">Mode</span><div class="eng-segment"><button @click="setModeFilter('pipelines')" :class="mode === 'pipelines' ? 'eng-segment__btn eng-segment__btn--active' : 'eng-segment__btn'" title="Show grouped pipelines">Pipelines</button> <button @click="setModeFilter('engines')" :class="mode === 'engines' ? 'eng-segment__btn eng-segment__btn--active' : 'eng-segment__btn'" title="Show individual engines">Engines</button></div></div><if :="mode === 'pipelines'"><label class="eng-field"><span class="eng-field__label" title="Filter grouped pipelines by pipeline type.">Pipeline Type</span> <select class="eng-control" @change="setPipelineTypeFilter($event.target.value)"><option value="all" :selected="pipelineType === 'all'">All pipelines</option><option value="embedding" :selected="pipelineType === 'embedding'">Env</option><option value="file" :selected="pipelineType === 'file'">Files</option></select></label></if><if :="mode === 'engines'"><label class="eng-field"><span class="eng-field__label" title="Filter the flat engine list by engine type.">Engine Type</span> <select class="eng-control" @change="setEngineTypeFilter($event.target.value)"><option value="" :selected="!engineType">All engines</option><each :of="availableEngineTypes" let:item="t"><option :value="t" :selected="engineType === t">{{ t }}</option></each></select></label></if><label class="eng-field"><span class="eng-field__label">Status</span> <select class="eng-control" @change="setStatusFilter($event.target.value)"><option value="all" :selected="status === 'all'">Any</option><option value="running" :selected="status === 'running'">Running</option><option value="attention" :selected="status === 'attention'">Needs attention</option><option value="stopped" :selected="status === 'stopped'">Stopped</option></select></label><if :="availableSourceTypes.length > 0"><label class="eng-field" title="Filter by the data type engines process or index"><span class="eng-field__label">Source Type</span> <select class="eng-control" @change="setSourceTypeFilter($event.target.value)"><option value="" :selected="!sourceTypeFilter">All types</option><each :of="availableSourceTypes" let:item="st"><option :value="st" :selected="sourceTypeFilter === st">{{ st }}</option></each></select></label></if><if :="pipelineType !== 'all' || engineType || status !== 'all' || search || sourceTypeFilter"><div class="eng-filter-actions"><button @click="clearFilters()" class="eng-clear-btn">Clear filters</button></div></if></div></if></div></template><template name="default"><if :="view === 'create'"><pipeline-create-panel :locktype="sourceTypeFilter" :lockenv="selectedEnv" :initialkind="createKind" @created="onCreated()"/></if><if :="view === 'overview'"><engines-overview :embed-engines="embedEngines" :embed-pipelines="embedPipelines" :file-engines="fileEngines" :mode="mode" :pipelinetype="pipelineType" :enginetype="engineType" :status="status" :search="search" :sourcetype="sourceTypeFilter" :selectedpipeline="selectedPipelineName" @select="onPipelineSelected($event.detail)" @refresh="load()" @create-pipeline="setView('create')"/></if></template></component></template>
|
|
1
|
+
<script type="module">import e from"../embeddings/parts/engines-overview.ok.js";import i from"../embeddings/parts/pipeline-create-panel.ok.js";import t from"../../stores/events-store.js";export default{tag:"engines-index",unwrap:!0,dependencies:[e,i],context:e=>({embedEngines:[],embedPipelines:[],fileEngines:{},view:"overview",mode:"pipelines",pipelineType:"all",engineType:"",status:"all",search:"",sourceTypeFilter:"",selectedPipelineName:"",createKind:"",busy:!1,_unsubs:[],_pollTimer:null,get selectedEnv(){return e.$ok.stores.okdb.selectedEnv||"default"},normalizeView:e=>["overview","create"].includes(e)?e:"overview",normalizeMode:e=>["pipelines","engines"].includes(e)?e:"pipelines",normalizePipelineType:e=>["all","embedding","file"].includes(e)?e:"all",normalizeEngineType:e=>String(e||"").trim(),legacyFilterState(e){switch(e){case"pipelines":default:return{mode:"pipelines",pipelineType:"all",engineType:""};case"standalone":case"runtime":return{mode:"engines",pipelineType:"all",engineType:""};case"embedding":return{mode:"pipelines",pipelineType:"embedding",engineType:""};case"file":return{mode:"pipelines",pipelineType:"file",engineType:""}}},normalizeStatus:e=>["all","running","attention","stopped"].includes(e)?e:"all",normalizeCreateKind:e=>["processor","materializer","queue-worker","embedding"].includes(e)?e:"",setView(e){const i=this.normalizeView(e);this.view!==i&&(this.view=i,this.syncRouteState())},setModeFilter(e){const i=this.normalizeMode(e);this.mode!==i&&(this.mode=i,"pipelines"===i&&(this.engineType=""),"engines"===i&&(this.pipelineType="all",this.selectedPipelineName=""),this.syncRouteState())},setPipelineTypeFilter(e){const i=this.normalizePipelineType(e);this.pipelineType!==i&&(this.pipelineType=i,this.syncRouteState())},setEngineTypeFilter(e){const i=this.normalizeEngineType(e);this.engineType!==i&&(this.engineType=i,this.syncRouteState())},setSourceTypeFilter(e){const i=String(e??"");this.sourceTypeFilter!==i&&(this.sourceTypeFilter=i,this.syncRouteState())},get availableSourceTypes(){const e=new Set;for(const i of this.embedEngines??[])i?.config?.source_type&&e.add(i.config.source_type),i?.runtime?.source_type&&e.add(i.runtime.source_type),i?.stats?.source_type&&e.add(i.stats.source_type),i?.stats?.indexer?.source_type&&e.add(i.stats.indexer.source_type),i?.config?.target_type&&e.add(i.config.target_type);const i=this.fileEngines??{};for(const t of[...i.extractors??[],...i.collections??[],...i.workers??[]])t?.config?.source_type&&e.add(t.config.source_type);return[...e].sort()},get availableEngineTypes(){const e=new Set;for(const i of this.embedEngines??[])i?.type&&e.add(i.type);const i=this.fileEngines??{};for(const t of[...i.extractors??[],...i.collections??[],...i.workers??[]])t?.type&&e.add(t.type);return[...e].sort()},get workspaceCount(){const e=this.fileEngines??{},i=(this.embedEngines??[]).length+(e.extractors??[]).length+(e.collections??[]).length+(e.workers??[]).length,t=(this.embedPipelines??[]).length+(e.collections??[]).length;return"engines"===this.mode?i:t},get searchPlaceholder(){return"engines"===this.mode?"Search engines…":"Search pipelines…"},get routeSearch(){return e.$vars?.$route?.search??e.$vars?.$router?._search??{}},applyRouteState(){const e=this.routeSearch,i=this.legacyFilterState(e.family||""),t=this.normalizeView(e.view||"overview"),s=this.normalizeMode(e.mode||i.mode||"pipelines"),n=this.normalizePipelineType(e.pipelineType||i.pipelineType||"all"),l=this.normalizeEngineType(e.engineType||i.engineType||""),r=this.normalizeStatus(e.status||"all"),o=String(e.search||""),a=String(e.sourceType||""),p=String(e.pipeline||""),h=this.normalizeCreateKind(e.kind||"");this.view!==t&&(this.view=t),this.mode!==s&&(this.mode=s),this.pipelineType!==n&&(this.pipelineType=n),this.engineType!==l&&(this.engineType=l),this.status!==r&&(this.status=r),this.search!==o&&(this.search=o),this.sourceTypeFilter!==a&&(this.sourceTypeFilter=a),this.selectedPipelineName!==p&&(this.selectedPipelineName=p),this.createKind!==h&&(this.createKind=h)},syncRouteState(){const i=e.$vars?.$router;if(!i?.resolve||!i?.replace)return;const t=this.routeSearch,s={...t};this.view&&"overview"!==this.view?s.view=this.view:delete s.view,this.mode&&"pipelines"!==this.mode?s.mode=this.mode:delete s.mode,this.pipelineType&&"all"!==this.pipelineType?s.pipelineType=this.pipelineType:delete s.pipelineType,this.engineType?s.engineType=this.engineType:delete s.engineType,this.status&&"all"!==this.status?s.status=this.status:delete s.status,this.search?.trim()?s.search=this.search.trim():delete s.search,this.sourceTypeFilter?.trim()?s.sourceType=this.sourceTypeFilter.trim():delete s.sourceType,this.selectedPipelineName?.trim()?s.pipeline=this.selectedPipelineName.trim():delete s.pipeline,"create"===this.view&&this.createKind?s.kind=this.createKind:delete s.kind,delete s.family;const n=this.legacyFilterState(t.family||""),l=this.normalizeView(t.view||"overview"),r=this.normalizeMode(t.mode||n.mode||"pipelines"),o=this.normalizePipelineType(t.pipelineType||n.pipelineType||"all"),a=this.normalizeEngineType(t.engineType||n.engineType||""),p=this.normalizeStatus(t.status||"all"),h=String(t.search||""),c=String(t.sourceType||""),d=String(t.pipeline||""),u=this.normalizeCreateKind(t.kind||"");if(l===this.view&&r===this.mode&&o===this.pipelineType&&a===this.engineType&&p===this.status&&h===(this.search||"")&&c===(this.sourceTypeFilter||"")&&d===(this.selectedPipelineName||"")&&u===(this.createKind||""))return;const y=e.$vars?.$route?.location||i._path||"/engines";i.replace(i.resolve(y,s,i._anchor||""))},clearFilters(){("all"!==this.pipelineType||this.engineType||"all"!==this.status||this.search||this.sourceTypeFilter)&&(this.pipelineType="all",this.engineType="",this.status="all",this.search="",this.sourceTypeFilter="",this.syncRouteState())},setSearchTerm(e){const i=String(e??"");this.search!==i&&(this.search=i,this.syncRouteState())},setStatusFilter(e){const i=this.normalizeStatus(e);this.status!==i&&(this.status=i,this.syncRouteState())},clearSourceTypeFilter(){this.sourceTypeFilter&&(this.sourceTypeFilter="",this.syncRouteState())},onPipelineSelected(e){const i=e?.name??"";this.selectedPipelineName!==i&&(this.selectedPipelineName=i,this.syncRouteState())},async load(){this.busy=!0;const e=this.selectedEnv;try{const[i,t,s]=await Promise.allSettled([fetch(`${__ENV__.API}/env/${encodeURIComponent(e)}/engines`).then(e=>e.json()),fetch(`${__ENV__.API}/embeddings/embedders`).then(e=>e.json()),fetch(`${__ENV__.API}/env/${encodeURIComponent(e)}/pipelines`).then(e=>e.json())]),n="fulfilled"===i.status?i.value?.data??[]:[],l="fulfilled"===t.status?t.value?.data??[]:[];this.embedEngines=[...n,...l],this.embedPipelines="fulfilled"===s.status?s.value?.data??(Array.isArray(s.value)?s.value:[]):[],this.fileEngines={extractors:n.filter(e=>"file-extractor"===e.type),collections:n.filter(e=>"file-collection"===e.type),workers:n.filter(e=>"file-extractor-worker"===e.type)}}catch{}finally{this.busy=!1,this._scheduleProgressPoll()}},anyPipelineFlowing(){return(this.embedPipelines||[]).some(e=>{const i=(e.engines||[]).find(e=>"indexer"===e?.type||"indexer"===e?.role),t=i?.stats?.doc_counts??i?.runtime?.doc_counts??null;return(t?.pending??0)>0})},_scheduleProgressPoll(){this._pollTimer||this.anyPipelineFlowing()&&(this._pollTimer=setTimeout(async()=>{this._pollTimer=null,await this.load()},2e3))},async onCreated(){this.view="overview",this.syncRouteState(),await this.load()}}),async init(e){this.applyRouteState(),await this.load();const i=()=>this.load();this._unsubs=[t.on("engine:started",i),t.on("engine:stopped",i),t.on("engine:error",i),t.on("pipeline:start",i),t.on("pipeline:stop",i),t.on("pipeline:delete",i)],e.$watch(()=>e.$ok.stores.okdb.selectedEnv,()=>this.load()),e.$watch(()=>JSON.stringify(this.routeSearch),()=>this.applyRouteState())},unmount(){for(const e of this._unsubs)e();this._unsubs=[],this._pollTimer&&clearTimeout(this._pollTimer),this._pollTimer=null}};</script><style>.eng-nav-row{display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:6px 10px;border-radius:6px;border:1px solid transparent;background:0 0;color:var(--okdb-app-fg-muted);font-size:12px;cursor:pointer;transition:background .12s,border-color .12s,color .12s}.eng-nav-row:hover{background:var(--okdb-app-surface);border-color:var(--okdb-app-border);color:var(--okdb-app-fg-strong)}.eng-nav-row--on{background:var(--okdb-app-surface);border-color:var(--okdb-accent);color:var(--okdb-app-fg-strong)}.eng-nav-sep{font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:var(--okdb-app-fg-subtle);padding:6px 10px 2px}.eng-filter-card{display:flex;flex-direction:column;gap:10px;padding:10px;border:1px solid var(--okdb-app-border);border-radius:10px;background:var(--okdb-app-bg-deep);min-width:0}.eng-field{display:flex;flex-direction:column;gap:4px;min-width:0}.eng-field__label{font-size:11px;color:var(--okdb-app-fg-muted)}.eng-control{width:100%;min-width:0;box-sizing:border-box;font-size:12px}.eng-segment{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;width:100%}.eng-segment__btn{min-width:0;width:100%;padding:6px 10px;border-radius:8px;border:1px solid var(--okdb-app-border);background:var(--okdb-app-bg-deep);color:var(--okdb-app-fg-muted);font-size:11px;font-weight:600;cursor:pointer;transition:background .12s,border-color .12s,color .12s,box-shadow .12s}.eng-segment__btn:hover{background:var(--okdb-app-surface);border-color:var(--okdb-app-border);color:var(--okdb-app-fg-strong)}.eng-segment__btn--active{border-color:var(--okdb-accent);background:color-mix(in srgb,var(--okdb-accent) 7%,transparent);color:var(--okdb-accent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--okdb-accent) 13%,transparent)}.eng-filter-actions{display:flex;justify-content:flex-end}.eng-clear-btn{font-size:11px;padding:5px 10px;border-radius:999px;border:1px solid var(--okdb-app-border);color:var(--okdb-app-fg-muted);background:var(--okdb-app-bg-deep);cursor:pointer}.eng-clear-btn:hover{border-color:var(--okdb-app-border-strong);color:var(--okdb-app-fg-strong);background:var(--okdb-app-surface)}</style><template><component import="../../layouts/_default.ok.html"><template name="sidebar"><div style="display:flex;flex-direction:column;gap:8px;height:100%;min-height:0;overflow-y:auto"><button :class="view === 'create' ? 'eng-nav-row eng-nav-row--on' : 'eng-nav-row'" @click="setView('create')" title="Create a pipeline, which provisions and wires together one or more engines."><span style="width:14px;text-align:center;flex-shrink:0;opacity:.9;color:var(--okdb-accent)">+</span> <span style="color:var(--okdb-accent)">New Pipeline</span></button><div class="eng-nav-sep">Engines</div><button :class="view === 'overview' ? 'eng-nav-row eng-nav-row--on' : 'eng-nav-row'" @click="setView('overview')"><span style="width:14px;text-align:center;flex-shrink:0;opacity:.7">⊛</span> <span>Workspace</span> <span style="margin-left:auto;font-size:10px;opacity:.4">{{ workspaceCount }}</span></button><if :="view === 'overview'"><div style="height:1px;background:var(--okdb-app-border);margin:2px 0"></div><div class="eng-nav-sep" style="padding-top:4px">Filters</div><div class="eng-filter-card"><label class="eng-field"><span class="eng-field__label" title="Search by name, type, handler, env, pipeline, or source type">Search</span> <input class="eng-control" :value="search" @input:debounce.250="setSearchTerm($event.target.value)" :placeholder="searchPlaceholder"/></label><div class="eng-field"><span class="eng-field__label" title="Switch between the grouped pipeline view and the flat engine inventory.">Mode</span><div class="eng-segment"><button @click="setModeFilter('pipelines')" :class="mode === 'pipelines' ? 'eng-segment__btn eng-segment__btn--active' : 'eng-segment__btn'" title="Show grouped pipelines">Pipelines</button> <button @click="setModeFilter('engines')" :class="mode === 'engines' ? 'eng-segment__btn eng-segment__btn--active' : 'eng-segment__btn'" title="Show individual engines">Engines</button></div></div><if :="mode === 'pipelines'"><label class="eng-field"><span class="eng-field__label" title="Filter grouped pipelines by pipeline type.">Pipeline Type</span> <select class="eng-control" @change="setPipelineTypeFilter($event.target.value)"><option value="all" :selected="pipelineType === 'all'">All pipelines</option><option value="embedding" :selected="pipelineType === 'embedding'">Env</option><option value="file" :selected="pipelineType === 'file'">Files</option></select></label></if><if :="mode === 'engines'"><label class="eng-field"><span class="eng-field__label" title="Filter the flat engine list by engine type.">Engine Type</span> <select class="eng-control" @change="setEngineTypeFilter($event.target.value)"><option value="" :selected="!engineType">All engines</option><each :of="availableEngineTypes" let:item="t"><option :value="t" :selected="engineType === t">{{ t }}</option></each></select></label></if><label class="eng-field"><span class="eng-field__label">Status</span> <select class="eng-control" @change="setStatusFilter($event.target.value)"><option value="all" :selected="status === 'all'">Any</option><option value="running" :selected="status === 'running'">Running</option><option value="attention" :selected="status === 'attention'">Needs attention</option><option value="stopped" :selected="status === 'stopped'">Stopped</option></select></label><if :="availableSourceTypes.length > 0"><label class="eng-field" title="Filter by the data type engines process or index"><span class="eng-field__label">Source Type</span> <select class="eng-control" @change="setSourceTypeFilter($event.target.value)"><option value="" :selected="!sourceTypeFilter">All types</option><each :of="availableSourceTypes" let:item="st"><option :value="st" :selected="sourceTypeFilter === st">{{ st }}</option></each></select></label></if><if :="pipelineType !== 'all' || engineType || status !== 'all' || search || sourceTypeFilter"><div class="eng-filter-actions"><button @click="clearFilters()" class="eng-clear-btn">Clear filters</button></div></if></div></if></div></template><template name="default"><if :="view === 'create'"><pipeline-create-panel :locktype="sourceTypeFilter" :lockenv="selectedEnv" :initialkind="createKind" @created="onCreated()"/></if><if :="view === 'overview'"><engines-overview :embed-engines="embedEngines" :embed-pipelines="embedPipelines" :file-engines="fileEngines" :mode="mode" :pipelinetype="pipelineType" :enginetype="engineType" :status="status" :search="search" :sourcetype="sourceTypeFilter" :selectedpipeline="selectedPipelineName" @select="onPipelineSelected($event.detail)" @refresh="load()" @create-pipeline="setView('create')"/></if></template></component></template>
|