@kedem/okdb 1.0.1 → 1.0.4
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/bin/okdb.js +1 -1
- package/keys/public.pem +3 -0
- package/okdb.js +1 -1
- package/package.json +2 -2
- package/public/admin-app.js +1 -1
- package/public/components/admin-route-host.ok.js +1 -1
- package/public/components/env-picker.ok.js +1 -1
- package/public/components/field-path-input.ok.js +1 -1
- package/public/components/field.html +154 -2
- package/public/components/geo-map.ok.js +1 -1
- package/public/components/ok-cron-input.ok.js +1 -1
- package/public/components/ok-dropzone.ok.js +1 -1
- package/public/components/ok-js-input.ok.js +1 -1
- package/public/components/ok-json-input.ok.js +1 -1
- package/public/components/ok-text-monaco-input.ok.js +1 -1
- package/public/components/theme-toggle.ok.js +1 -1
- package/public/index.html +29 -2
- package/public/layouts/_default.ok.html +1 -1
- package/public/layouts/okdb-cube.ok.html +1 -1
- package/public/login-app.js +1 -1
- package/public/login.html +205 -1
- package/public/modules/ok.js +1 -1
- package/public/sections/api/index.ok.html +1 -1
- package/public/sections/api/parts/api-endpoint.ok.js +1 -1
- package/public/sections/auth/index.ok.html +1 -1
- package/public/sections/auth/modals/create-token-modal.ok.js +1 -1
- package/public/sections/auth/modals/edit-token-modal.ok.js +1 -1
- package/public/sections/auth/modals/perm-info-popover.ok.js +1 -1
- package/public/sections/auth/parts/token-detail.ok.js +1 -1
- package/public/sections/auth/parts/token-list.ok.js +1 -1
- package/public/sections/db/index.ok.html +1 -1
- package/public/sections/db/modals/add-item-modal.ok.js +1 -1
- package/public/sections/db/modals/create-env-modal.ok.js +1 -1
- package/public/sections/db/modals/create-fts-modal.ok.js +1 -1
- package/public/sections/db/modals/create-index-modal.ok.js +1 -1
- package/public/sections/db/modals/create-pipeline-modal.ok.js +1 -1
- package/public/sections/db/modals/demo-env-modal.ok.js +1 -1
- package/public/sections/db/modals/remove-env-modal.ok.js +1 -1
- package/public/sections/db/modals/schema-edit-modal.ok.js +1 -1
- package/public/sections/db/parts/db-overview.ok.js +1 -1
- package/public/sections/db/parts/db-pipelines-panel.ok.js +1 -1
- package/public/sections/db/parts/edit-row.ok.js +1 -1
- package/public/sections/db/parts/tm-timeline.ok.js +1 -1
- package/public/sections/db/parts/type-changelog.ok.js +1 -1
- package/public/sections/db/parts/type-list.ok.js +1 -1
- package/public/sections/db/parts/type-pipelines-tab.ok.js +1 -1
- package/public/sections/db/parts/type-schema-tab.ok.js +1 -1
- package/public/sections/db/parts/type-viewer.ok.js +1 -1
- package/public/sections/db/parts/type-violations-tab.ok.js +1 -1
- package/public/sections/docs/index.ok.html +1 -1
- package/public/sections/embeddings/index.ok.html +1 -1
- package/public/sections/embeddings/modals/register-model-modal.ok.js +1 -1
- package/public/sections/embeddings/parts/embed-create-panel.ok.js +1 -1
- package/public/sections/embeddings/parts/embed-embedder-panel.ok.js +1 -1
- package/public/sections/embeddings/parts/embed-engine-declaration-editor.ok.js +1 -1
- package/public/sections/embeddings/parts/embed-engine-list.ok.js +1 -1
- package/public/sections/embeddings/parts/embed-indexer-panel.ok.js +1 -1
- package/public/sections/embeddings/parts/embed-lifecycle-bar.ok.js +1 -1
- package/public/sections/embeddings/parts/embed-model-catalog.ok.js +1 -1
- package/public/sections/embeddings/parts/embed-overview.ok.js +1 -1
- package/public/sections/embeddings/parts/embed-search-panel.ok.js +1 -1
- package/public/sections/embeddings/parts/embed-worker-panel.ok.js +1 -1
- package/public/sections/embeddings/parts/embeddings-engine-panel.ok.js +1 -1
- package/public/sections/embeddings/parts/engines-overview.ok.js +1 -1
- package/public/sections/embeddings/parts/pipeline-create-panel.ok.js +1 -1
- package/public/sections/engines/engine-panel-shared-style.js +1 -1
- package/public/sections/engines/engine-ui-utils.js +1 -1
- package/public/sections/engines/index.ok.html +1 -1
- package/public/sections/engines/modals/engine-modal.ok.js +1 -1
- package/public/sections/engines/parts/engine-declaration-editor.ok.js +1 -1
- package/public/sections/engines/parts/engine-lifecycle-actions.ok.js +1 -1
- package/public/sections/engines/parts/engine-panel-shell.ok.js +1 -1
- package/public/sections/engines/parts/engine-resource-card.ok.js +1 -1
- package/public/sections/engines/parts/engine-row-item.ok.js +1 -1
- package/public/sections/engines/parts/generic-engine-panel.ok.js +1 -1
- package/public/sections/files/index.ok.html +1 -1
- package/public/sections/files/parts/files-blob-status.ok.js +1 -1
- package/public/sections/files/parts/files-collection-list.ok.js +1 -1
- package/public/sections/files/parts/files-collection-panel.ok.js +1 -1
- package/public/sections/files/parts/files-file-list.ok.js +1 -1
- package/public/sections/files/parts/files-overview.ok.js +1 -1
- package/public/sections/files/parts/files-path-browser.ok.js +1 -1
- package/public/sections/files/parts/files-upload-panel.ok.js +1 -1
- package/public/sections/functions/index.ok.html +1 -1
- package/public/sections/functions/modals/function-modal.ok.js +1 -1
- package/public/sections/functions/parts/function-detail.ok.js +1 -1
- package/public/sections/functions/parts/function-logs.ok.js +1 -1
- package/public/sections/functions/parts/function-runner.ok.js +1 -1
- package/public/sections/functions/parts/functions-list.ok.js +1 -1
- package/public/sections/license/index.ok.html +1 -1
- package/public/sections/license/parts/license-panel.ok.js +1 -1
- package/public/sections/processors/index.ok.html +1 -1
- package/public/sections/queue/index.ok.html +1 -1
- package/public/sections/queue/modals/create-bucket-modal.ok.js +1 -1
- package/public/sections/queue/modals/edit-bucket-modal.ok.js +1 -1
- package/public/sections/queue/modals/edit-job-modal.ok.js +1 -1
- package/public/sections/queue/modals/enqueue-job-modal.ok.js +1 -1
- package/public/sections/queue/modals/job-type-modal.ok.js +1 -1
- package/public/sections/queue/parts/ok-job-form.ok.js +1 -1
- package/public/sections/queue/parts/queue-buckets.ok.js +1 -1
- package/public/sections/queue/parts/queue-job-types.ok.js +1 -1
- package/public/sections/queue/parts/queue-jobs.ok.js +1 -1
- package/public/sections/queue/parts/queue-types.ok.js +1 -1
- package/public/sections/queue/parts/queue-workers.ok.js +1 -1
- package/public/sections/sync/index.ok.html +1 -1
- package/public/sections/sync/parts/sync-node-detail.ok.js +1 -1
- package/public/sections/sync/parts/sync-retention.ok.js +1 -1
- package/public/sections/sync/parts/sync-topology.ok.js +1 -1
- package/public/sections/system/index.ok.html +1 -1
- package/public/sections/system/modals/data-ops-modal.ok.js +1 -1
- package/public/sections/system/parts/system-api-panel.ok.js +1 -1
- package/public/sections/system/parts/system-auth-panel.ok.js +1 -1
- package/public/sections/system/parts/system-log-history.ok.js +1 -1
- package/public/sections/system/parts/system-log.ok.js +1 -1
- package/public/sections/system/parts/system-status.ok.js +1 -1
- package/public/sections/system/parts/system-sync-panel.ok.js +1 -1
- package/public/sections/views/index.ok.html +1 -1
- package/public/sections/views/modals/create-view-modal.ok.js +1 -1
- package/public/sections/views/parts/view-detail.ok.js +1 -1
- package/public/sections/views/parts/views-list.ok.js +1 -1
- package/public/sections/views/parts/views-overview.ok.js +1 -1
- package/public/setup-app.js +1 -1
- package/public/setup.html +189 -1
- package/public/stores/auth-store.js +1 -1
- package/public/stores/events-store.js +1 -1
- package/public/stores/functions-store.js +1 -1
- package/public/stores/okdb-store.js +1 -1
- package/public/stores/theme-store.js +1 -1
- package/public/test-cron-input.html +53 -3
- package/public/test-json-input.html +182 -3
- package/public/util/permissions.js +1 -1
- package/public/util/sift-schema.js +1 -1
- package/public/vendor/okjs/ok.esm.min.js +1 -2
- package/public/view-models/type-query-vm.js +1 -1
- package/okdb-data/default/data.mdb +0 -0
- package/okdb-data/default/lock.mdb +0 -0
- package/okdb-data/~log/data.mdb +0 -0
- package/okdb-data/~log/lock.mdb +0 -0
- package/okdb-data/~system/data.mdb +0 -0
- package/okdb-data/~system/lock.mdb +0 -0
- package/public/images/logo.png +0 -0
- package/public/images/logo.svg +0 -333
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x58c08b=_0x14c4;(function(_0x29bb7d,_0x4a50c4){const _0x3219ac=_0x14c4,_0x3c606d=_0x29bb7d();while(!![]){try{const _0x22022b=-parseInt(_0x3219ac(0x172))/0x1+parseInt(_0x3219ac(0xe9))/0x2+-parseInt(_0x3219ac(0x17b))/0x3*(parseInt(_0x3219ac(0xc4))/0x4)+-parseInt(_0x3219ac(0x139))/0x5+-parseInt(_0x3219ac(0x13d))/0x6+-parseInt(_0x3219ac(0x11a))/0x7+-parseInt(_0x3219ac(0x19f))/0x8*(-parseInt(_0x3219ac(0x19e))/0x9);if(_0x22022b===_0x4a50c4)break;else _0x3c606d['push'](_0x3c606d['shift']());}catch(_0x4e6eae){_0x3c606d['push'](_0x3c606d['shift']());}}}(_0x2ce6,0x7f0c4));export const EMBEDDINGS_ENGINE_TYPES=new Set([_0x58c08b(0xd0),_0x58c08b(0x1a9),'embed-worker',_0x58c08b(0xd5)]);function _0x2ce6(){const _0x4b34e5=['title','map','Run\x20log','Engine','deleted','Storage','3531080fsHovS','details','Failed\x20batches','done','1713786ECLKgZ','string','Type','color','message','isFinite','/type/','Queue\x20env','vector_count','Reason:\x20','processedChanges','Clear\x20target','Watches\x20','yes','object','stats','/pipelines','field','degraded','chunk','catch','Progress','Active','replace','danger','isArray','storeEnv','Running\x20batches','/pipelines/','/queue','headClock','Batch','Function\x20run\x20recording\x20policy','Searches\x20','Changes','inactive','store\x20text\x20','Indexed\x20documents\x20/\x20total\x20tracked\x20documents','env','vector\x20index','queue-worker','Dims','result','location','targetCount','\x20more)','pipelines','Done','\x20on\x20','target_env','\x20ms','Validation\x20failed:\x20','max','33800JWgMFs','Rows','Algorithm','is\x20invalid','algorithm_config','sourceType','mode','Clock','dims','2821683tsxYhK','Error','affinity','source_env','prepare','forEach','/env/','stringify','unhealthy','bootstrap','\x20overlap','\x20(+','ttl','embed-worker','Target\x20env','join','async','Indexer','Bootstrap','error','last_seen_clock','paused','/embeddings/engines/','select-pipeline','config','pipelineName','Chunk','\x20—\x20','overlap','enabled','Provider','model','isRunning','filter','round','666DVIHSH','371272gdOMYR','materializer','search','Prepare','strategy','trimEnd','lag','Handler','source','Affinity','indexer','building','key','target','processed','latency','\x20/\x20','head_clock','count','hash','TTL','function','$vars','test','Field','source\x20changes','find','Engine\x20is\x20disabled','code','selectedEnv','data','var(--okdb-app-fg-muted)','Origin','originMode','Ops','4ikexxd','value','batchSize','Job\x20type','okdb','running','toString','caught\x20up','set','appliedOps','targetSection','runtime','embedder','split','jobType','json','Runs\x20queued\x20embedding\x20jobs','vector-search','Pending','queue\x20jobs','Request\x20failed','algorithm','$router','$ok','storeText','success','status','job_type','in_flight','Status:\x20','idle','stopped','_search','workers','source_type','doc_counts','trim','104752hKLbjO','/engines','Mode','Uses\x20ƒ\x20','API','push','queue','parse','#/engines?','processor','Indexes\x20','neutral','\x20chars','/functions','Poll','var(--okdb-warning)','queue_env','default','concurrency','targetTab','type','reason','entries','recordRuns','Latency','storage_key','pollInterval','disabled','Concurrency','off','_uiEnv','slice','chunked','envName','total','var(--okdb-success)','Vectors','resolve','accent','healthy','target_type','Consumes\x20','handler','Queue\x20worker\x20handler','warning','length','provider','label','whole\x20record','7000322xtwqUw','Source\x20env','clock\x20','var(--okdb-info)','tone','lastClock','failedBatches','stores','name','Queue','Lag','Target','var(--okdb-danger)','failed','Model','/db','size','engines','Provider\x20health\x20check\x20failed','Source','runningBatches','state','get','Embedder','includes'];_0x2ce6=function(){return _0x4b34e5;};return _0x2ce6();}export function isEmbeddingsEngineType(_0x5b1a0b){return EMBEDDINGS_ENGINE_TYPES['has'](_0x5b1a0b);}export function isEmbeddingsEngine(_0x148023){return isEmbeddingsEngineType(_0x148023?.['type']);}export function cloneValue(_0x153fef,_0x1a4c66={}){const _0x1747c5=_0x58c08b;try{return JSON[_0x1747c5(0xf0)](JSON[_0x1747c5(0x182)](_0x153fef??_0x1a4c66));}catch{return JSON[_0x1747c5(0xf0)](JSON['stringify'](_0x1a4c66));}}export function parseTagList(_0x22f977){const _0x4f1f42=_0x58c08b,_0x12aa18=String(_0x22f977??'')[_0x4f1f42(0xd1)](',')['map'](_0x12b14a=>_0x12b14a[_0x4f1f42(0xe8)]())[_0x4f1f42(0x19c)](Boolean);return _0x12aa18[_0x4f1f42(0x116)]?[...new Set(_0x12aa18)]:null;}export function statusTone(_0x15f8cc=null){const _0x511295=_0x58c08b;return _0x15f8cc?.[_0x511295(0x19b)]?_0x511295(0x10c):'inactive'===_0x15f8cc?.['status']?_0x511295(0xf8):_0x511295(0x18e)===_0x15f8cc?.[_0x511295(0xde)]?'var(--okdb-danger)':'var(--okdb-app-fg-muted)';}export function readableReason(_0x3a0e7f){const _0x298d6c=_0x58c08b;return _0x3a0e7f?String(_0x3a0e7f)[_0x298d6c(0x154)](/_/g,'\x20'):null;}export function formatJsonValue(_0xb1d316){const _0x13323b=_0x58c08b;try{return JSON[_0x13323b(0x182)](_0xb1d316,null,0x2);}catch{return String(_0xb1d316??'');}}export function resolveEngineEnvName(_0xfc30bd=null,_0x1b8989=null){const _0x1ef8fe=_0x58c08b;return _0x1b8989??_0xfc30bd?.[_0x1ef8fe(0x163)]??_0xfc30bd?.[_0x1ef8fe(0x107)]??_0xfc30bd?.[_0x1ef8fe(0x157)]??_0xfc30bd?.[_0x1ef8fe(0x193)]?.[_0x1ef8fe(0x17e)]??null;}export function getEnginePipelineName(_0xb72c0=null){return _0xb72c0?.['meta']?.['pipeline']??null;}export function buildFunctionsRoute(_0x471265,_0x17bd01=null){const _0x185fb4=_0x58c08b,_0x939a0c=new URLSearchParams(),_0xc36d35=_0x471265?.[_0x185fb4(0xdb)]?.['stores']?.[_0x185fb4(0xc8)]?.[_0x185fb4(0xbe)]??null;_0xc36d35&&_0x939a0c['set'](_0x185fb4(0x163),_0xc36d35),_0x17bd01&&_0x939a0c[_0x185fb4(0xcc)](_0x185fb4(0x122),_0x17bd01);const _0x37743d=_0x939a0c['toString']();return _0x185fb4(0xf6)+(_0x37743d?'?'+_0x37743d:'');}export function openFunctionRoute(_0x2dd303,_0x485452,{beforeNavigate:_0x45fbc1}={}){const _0x3ec834=_0x58c08b;if(!_0x485452)return!0x1;const _0x52df19=_0x2dd303?.[_0x3ec834(0xb7)]?.[_0x3ec834(0xda)];if('function'==typeof _0x45fbc1&&_0x45fbc1(),_0x52df19?.[_0x3ec834(0xee)]){const _0x4dd988={..._0x52df19[_0x3ec834(0xe4)]||{}},_0x41ae46=_0x2dd303?.[_0x3ec834(0xdb)]?.[_0x3ec834(0x121)]?.[_0x3ec834(0xc8)]?.[_0x3ec834(0xbe)]??null;_0x41ae46?_0x4dd988[_0x3ec834(0x163)]=_0x41ae46:delete _0x4dd988[_0x3ec834(0x163)],_0x4dd988['name']=_0x485452;const _0x139f4b=_0x3ec834(0xb6)==typeof _0x52df19[_0x3ec834(0x10e)]?_0x52df19[_0x3ec834(0x10e)](_0x3ec834(0xf6),_0x4dd988):buildFunctionsRoute(_0x2dd303,_0x485452);return _0x52df19[_0x3ec834(0xee)](_0x139f4b),!0x0;}return!!globalThis[_0x3ec834(0x168)]&&(globalThis[_0x3ec834(0x168)][_0x3ec834(0xb4)]='#'+buildFunctionsRoute(_0x2dd303,_0x485452),!0x0);}export function dispatchEnginePipelineSelection(_0x1e365e,_0x326c14=null){const _0xc4e3bf=_0x58c08b,_0x1eae0b=getEnginePipelineName(_0x326c14);return!!_0x1eae0b&&(_0x1e365e['$dispatch'](_0xc4e3bf(0x192),_0x1eae0b),!0x0);}function matchesLinkedEngine(_0x391941=null,_0x5705f9=null){const _0x341c8b=_0x58c08b;return!!_0x5705f9&&(_0x391941?.[_0x341c8b(0x122)]===_0x5705f9||_0x391941?.[_0x341c8b(0x1ab)]===_0x5705f9);}function matchesLinkedFunction(_0x2254e3=null,_0xe6c397=null){const _0x401c49=_0x58c08b;return!!_0xe6c397&&(_0x2254e3?.['config']?.[_0x401c49(0x113)]?.[_0x401c49(0x122)]===_0xe6c397||_0x2254e3?.['runtime']?.[_0x401c49(0x113)]?.[_0x401c49(0x122)]===_0xe6c397);}function linkedMemberSourceType(_0x4ce97f=null){const _0x5928f7=_0x58c08b;return _0x4ce97f?.[_0x5928f7(0x193)]?.['source_type']??_0x4ce97f?.[_0x5928f7(0xcf)]?.['source_type']??null;}function linkedMemberJobType(_0x50709b=null){const _0x53ccce=_0x58c08b;return _0x50709b?.[_0x53ccce(0x193)]?.[_0x53ccce(0xdf)]??_0x50709b?.['runtime']?.[_0x53ccce(0xdf)]??null;}function linkedMemberQueueEnv(_0x31d932=null){const _0x3c21f3=_0x58c08b;return _0x31d932?.[_0x3c21f3(0x193)]?.[_0x3c21f3(0xf9)]??_0x31d932?.[_0x3c21f3(0xcf)]?.[_0x3c21f3(0xf9)]??null;}export async function resolveLinkedPipeline(_0x2621c8,{envName:_0xcfab45=null,pipelineName:_0x1354d1=null,ownerEngine:_0x460c22=null,functionName:_0x2c09cd=null}={}){const _0x55f3f8=_0x58c08b,_0xfa4703=_0xcfab45??_0x2621c8?.[_0x55f3f8(0xdb)]?.[_0x55f3f8(0x121)]?.[_0x55f3f8(0xc8)]?.[_0x55f3f8(0xbe)]??null;if(!_0xfa4703||!_0x1354d1&&!_0x460c22&&!_0x2c09cd)return null;let _0x588f07=[],_0x535c53=null,_0x36b435=null,_0x435da8=null,_0x43a0ed=_0x55f3f8(0x16b);try{const _0x79aa8=await fetch(__ENV__['API']+_0x55f3f8(0x181)+encodeURIComponent(_0xfa4703)+_0x55f3f8(0x14d));if(_0x79aa8['ok']){const _0x56d6de=await _0x79aa8[_0x55f3f8(0xd3)]()[_0x55f3f8(0x151)](()=>({}));_0x588f07=_0x56d6de?.[_0x55f3f8(0xbf)]??_0x56d6de?.[_0x55f3f8(0x167)]??[],_0x535c53=_0x588f07[_0x55f3f8(0xbb)](_0x50fb12=>!!_0x50fb12&&(!(!_0x1354d1||_0x50fb12[_0x55f3f8(0x122)]!==_0x1354d1)||(_0x50fb12['engines']??[])['some'](_0x47cc30=>matchesLinkedEngine(_0x47cc30,_0x460c22)||matchesLinkedFunction(_0x47cc30,_0x2c09cd))))??null,_0x36b435=(_0x535c53?.[_0x55f3f8(0x12b)]??[])[_0x55f3f8(0xbb)](_0x44d1b0=>matchesLinkedEngine(_0x44d1b0,_0x460c22))??(_0x535c53?.['engines']??[])[_0x55f3f8(0xbb)](_0x228b69=>matchesLinkedFunction(_0x228b69,_0x2c09cd))??(_0x535c53?.[_0x55f3f8(0x12b)]??[])['find'](_0x53ad4a=>linkedMemberSourceType(_0x53ad4a)&&[_0x55f3f8(0xf2),_0x55f3f8(0x1a0),_0x55f3f8(0x165)][_0x55f3f8(0x132)](_0x53ad4a?.['type']))??(_0x535c53?.[_0x55f3f8(0x12b)]??[])[_0x55f3f8(0xbb)](_0x37222e=>linkedMemberSourceType(_0x37222e))??(_0x535c53?.[_0x55f3f8(0x12b)]??[])[_0x55f3f8(0xbb)](_0x383a10=>_0x383a10?.[_0x55f3f8(0x193)]?.[_0x55f3f8(0xdf)])??null,['processor',_0x55f3f8(0x1a0),_0x55f3f8(0x165)][_0x55f3f8(0x132)](_0x36b435?.[_0x55f3f8(0xfd)])&&(_0x43a0ed='engines');}}catch{}if(!_0x36b435&&(_0x460c22||_0x2c09cd))try{const _0x144e43=await fetch(__ENV__[_0x55f3f8(0xed)]+_0x55f3f8(0x181)+encodeURIComponent(_0xfa4703)+'/engines');if(_0x144e43['ok']){const _0x5ce71d=await _0x144e43['json']()[_0x55f3f8(0x151)](()=>({})),_0x5b5bfe=_0x5ce71d?.['data']??_0x5ce71d?.[_0x55f3f8(0x167)]??[];_0x435da8=_0x5b5bfe[_0x55f3f8(0xbb)](_0x4c3953=>_0x4c3953?.['name']===_0x460c22||_0x4c3953?.['key']===_0x460c22)??_0x5b5bfe['find'](_0x22b309=>_0x22b309?.[_0x55f3f8(0x193)]?.[_0x55f3f8(0x113)]?.['name']===_0x2c09cd)??null,!_0x535c53&&_0x435da8&&(_0x535c53=_0x588f07[_0x55f3f8(0xbb)](_0x1c2767=>(_0x1c2767?.[_0x55f3f8(0x12b)]??[])['some'](_0x5f2b27=>matchesLinkedEngine(_0x5f2b27,_0x435da8?.[_0x55f3f8(0x122)])||matchesLinkedEngine(_0x5f2b27,_0x435da8?.[_0x55f3f8(0x1ab)])||matchesLinkedFunction(_0x5f2b27,_0x2c09cd)))??null),!_0x36b435&&_0x535c53&&(_0x36b435=(_0x535c53?.['engines']??[])[_0x55f3f8(0xbb)](_0x4c51c7=>matchesLinkedEngine(_0x4c51c7,_0x435da8?.[_0x55f3f8(0x122)]))??(_0x535c53?.['engines']??[])[_0x55f3f8(0xbb)](_0x57cf79=>matchesLinkedEngine(_0x57cf79,_0x435da8?.[_0x55f3f8(0x1ab)]))??(_0x535c53?.[_0x55f3f8(0x12b)]??[])[_0x55f3f8(0xbb)](_0x319124=>matchesLinkedFunction(_0x319124,_0x2c09cd))??null),[_0x55f3f8(0xf2),_0x55f3f8(0x1a0),_0x55f3f8(0x165)][_0x55f3f8(0x132)]((_0x36b435??_0x435da8)?.['type'])&&(_0x43a0ed=_0x55f3f8(0x12b));}}catch{}const _0x533f62=linkedMemberSourceType(_0x36b435)??_0x435da8?.[_0x55f3f8(0x193)]?.['source_type']??_0x435da8?.['runtime']?.[_0x55f3f8(0xe6)]??(_0x535c53?.[_0x55f3f8(0x12b)]??[])['map'](linkedMemberSourceType)[_0x55f3f8(0xbb)](Boolean)??null,_0x34418a=linkedMemberJobType(_0x36b435)??_0x435da8?.[_0x55f3f8(0x193)]?.[_0x55f3f8(0xdf)]??_0x435da8?.['runtime']?.[_0x55f3f8(0xdf)]??(_0x535c53?.[_0x55f3f8(0x12b)]??[])[_0x55f3f8(0x134)](linkedMemberJobType)[_0x55f3f8(0xbb)](Boolean)??null,_0x26409e=linkedMemberQueueEnv(_0x36b435)??_0x435da8?.['config']?.[_0x55f3f8(0xf9)]??_0x435da8?.[_0x55f3f8(0xcf)]?.[_0x55f3f8(0xf9)]??_0xfa4703;return'queue-worker'===(_0x36b435??_0x435da8)?.[_0x55f3f8(0xfd)]||_0x34418a?{'envName':_0x26409e,'pipelineName':_0x1354d1??_0x535c53?.[_0x55f3f8(0x122)]??null,'ownerEngine':_0x460c22??_0x36b435?.['name']??_0x36b435?.[_0x55f3f8(0x1ab)]??_0x435da8?.[_0x55f3f8(0x122)]??_0x435da8?.[_0x55f3f8(0x1ab)]??null,'sourceType':null,'jobType':_0x34418a,'targetTab':'workers','targetSection':_0x55f3f8(0xef)}:_0x533f62?{'envName':_0xfa4703,'pipelineName':_0x1354d1??_0x535c53?.[_0x55f3f8(0x122)]??null,'ownerEngine':_0x460c22??_0x36b435?.[_0x55f3f8(0x122)]??_0x36b435?.[_0x55f3f8(0x1ab)]??_0x435da8?.[_0x55f3f8(0x122)]??_0x435da8?.[_0x55f3f8(0x1ab)]??null,'sourceType':_0x533f62,'jobType':null,'targetTab':_0x43a0ed,'targetSection':'db'}:null;}export async function openLinkedPipelineRoute(_0x51ca89,{envName:_0x2957d1=null,pipelineName:_0x26c17f=null,ownerEngine:_0x2e5d72=null,functionName:_0x2e518e=null,beforeNavigate:_0x1f6343}={}){const _0x2037cb=_0x58c08b,_0x4ce6fa=_0x51ca89?.[_0x2037cb(0xb7)]?.[_0x2037cb(0xda)],_0x4ca16f=await resolveLinkedPipeline(_0x51ca89,{'envName':_0x2957d1,'pipelineName':_0x26c17f,'ownerEngine':_0x2e5d72,'functionName':_0x2e518e});if(!_0x4ca16f)return!0x1;if('function'==typeof _0x1f6343&&_0x1f6343(),_0x51ca89?.['$ok']?.[_0x2037cb(0x121)]?.['okdb']?.['selectedEnv']&&_0x51ca89[_0x2037cb(0xdb)]['stores'][_0x2037cb(0xc8)][_0x2037cb(0xbe)]!==_0x4ca16f['envName']&&_0x51ca89[_0x2037cb(0xdb)]['stores'][_0x2037cb(0xc8)]['selectEnv'](_0x4ca16f[_0x2037cb(0x10a)]),_0x4ce6fa?.[_0x2037cb(0xee)]&&_0x2037cb(0xb6)==typeof _0x4ce6fa['resolve']){if(_0x2037cb(0xef)===_0x4ca16f[_0x2037cb(0xce)]){const _0x4079dd={'env':_0x4ca16f['envName'],'view':_0x4ca16f[_0x2037cb(0xfc)]??'workers'};return _0x4ca16f[_0x2037cb(0xd2)]&&(_0x4079dd[_0x2037cb(0xfd)]=_0x4ca16f[_0x2037cb(0xd2)]),_0x4ce6fa['push'](_0x4ce6fa[_0x2037cb(0x10e)](_0x2037cb(0x15a),_0x4079dd)),!0x0;}if(_0x4ca16f[_0x2037cb(0x194)]){const _0x28552f={'env':_0x4ca16f[_0x2037cb(0x10a)],'pipeline':_0x4ca16f[_0x2037cb(0x194)]};return _0x4ca16f[_0x2037cb(0x177)]&&(_0x28552f[_0x2037cb(0x177)]=_0x4ca16f[_0x2037cb(0x177)]),_0x4ce6fa[_0x2037cb(0xee)](_0x4ce6fa[_0x2037cb(0x10e)](_0x2037cb(0xea),_0x28552f)),!0x0;}return!!_0x4ca16f[_0x2037cb(0x177)]&&(_0x4ce6fa['push'](_0x4ce6fa[_0x2037cb(0x10e)](_0x2037cb(0x129),{'env':_0x4ca16f[_0x2037cb(0x10a)],'type':_0x4ca16f[_0x2037cb(0x177)],'tab':_0x4ca16f[_0x2037cb(0xfc)]})),!0x0);}if(globalThis[_0x2037cb(0x168)]){if('queue'===_0x4ca16f[_0x2037cb(0xce)]){const _0x10c714=new URLSearchParams({'env':_0x4ca16f['envName'],'view':_0x4ca16f[_0x2037cb(0xfc)]??_0x2037cb(0xe5)});return _0x4ca16f[_0x2037cb(0xd2)]&&_0x10c714[_0x2037cb(0xcc)](_0x2037cb(0xfd),_0x4ca16f[_0x2037cb(0xd2)]),globalThis[_0x2037cb(0x168)][_0x2037cb(0xb4)]='#/queue?'+_0x10c714['toString'](),!0x0;}if(_0x4ca16f[_0x2037cb(0x194)]){const _0x365382=new URLSearchParams({'env':_0x4ca16f[_0x2037cb(0x10a)],'pipeline':_0x4ca16f['pipelineName']});return _0x4ca16f[_0x2037cb(0x177)]&&_0x365382[_0x2037cb(0xcc)](_0x2037cb(0x177),_0x4ca16f['sourceType']),globalThis[_0x2037cb(0x168)][_0x2037cb(0xb4)]=_0x2037cb(0xf1)+_0x365382[_0x2037cb(0xca)](),!0x0;}if(!_0x4ca16f['sourceType'])return!0x1;const _0x2424a3=new URLSearchParams({'env':_0x4ca16f[_0x2037cb(0x10a)],'type':_0x4ca16f[_0x2037cb(0x177)],'tab':_0x4ca16f[_0x2037cb(0xfc)]});return globalThis[_0x2037cb(0x168)][_0x2037cb(0xb4)]='#/db?'+_0x2424a3[_0x2037cb(0xca)](),!0x0;}return!0x1;}export function buildEmbeddingsPipelineUrl(_0x2c871c=null,_0x433411=null){const _0x167c09=_0x58c08b,_0x52630e=_0x2c871c?.[_0x167c09(0x193)]??{},_0x5440ae=encodeURIComponent(_0x52630e[_0x167c09(0x17e)]??_0x167c09(0xfa)),_0x48022c=encodeURIComponent(_0x52630e[_0x167c09(0xe6)]??''),_0x24fd41=encodeURIComponent(_0x52630e['storage_key']??_0x433411??_0x2c871c?.['name']??'');return __ENV__['API']+'/env/'+_0x5440ae+_0x167c09(0x143)+_0x48022c+_0x167c09(0x159)+_0x24fd41;}export function maskSensitiveConfig(_0x3989b2={}){const _0x37a255=_0x58c08b;if(Array[_0x37a255(0x156)](_0x3989b2))return _0x3989b2['map'](_0x1ca64f=>maskSensitiveConfig(_0x1ca64f));if(!_0x3989b2||_0x37a255(0x14b)!=typeof _0x3989b2)return _0x3989b2;const _0x42d1a6={};for(const [_0x4c2697,_0x1acf2e]of Object[_0x37a255(0xff)](_0x3989b2))_0x42d1a6[_0x4c2697]=/key|secret|pass|token/i['test'](_0x4c2697)?'***':maskSensitiveConfig(_0x1acf2e);return _0x42d1a6;}export function summarizeValidationDetails(_0x10907a=[]){const _0x5eae70=_0x58c08b;if(!Array['isArray'](_0x10907a)||0x0===_0x10907a[_0x5eae70(0x116)])return null;const _0x59d9ff=_0x10907a[_0x5eae70(0x108)](0x0,0x3)[_0x5eae70(0x134)]((_0x12fe3b={})=>(''+(_0x12fe3b[_0x5eae70(0x14e)]?_0x12fe3b[_0x5eae70(0x14e)]+'\x20':'')+(_0x12fe3b[_0x5eae70(0x141)]||_0x5eae70(0x175)))[_0x5eae70(0xe8)]())[_0x5eae70(0x18a)](';\x20');return _0x10907a[_0x5eae70(0x116)]>0x3?_0x59d9ff+_0x5eae70(0x186)+(_0x10907a[_0x5eae70(0x116)]-0x3)+_0x5eae70(0x16a):_0x59d9ff;}function _0x14c4(_0x1fcf18,_0x5a9144){_0x1fcf18=_0x1fcf18-0xae;const _0x2ce662=_0x2ce6();let _0x14c47a=_0x2ce662[_0x1fcf18];return _0x14c47a;}export function getApiErrorMessage(_0x1915f1=null,_0x2f976a=_0x58c08b(0xd8)){const _0x19a2f6=_0x58c08b,_0x56770b=_0x1915f1?.['error']??null,_0x448f04=summarizeValidationDetails(_0x56770b?.[_0x19a2f6(0x13a)]??_0x1915f1?.['details']??null);return _0x19a2f6(0x13e)==typeof _0x56770b?_0x1915f1?.['message']?_0x1915f1['message']:_0x448f04&&/^[A-Z0-9_]+$/[_0x19a2f6(0xb8)](_0x56770b)?_0x19a2f6(0x170)+_0x448f04:_0x56770b||_0x2f976a:_0x56770b?.[_0x19a2f6(0x141)]?_0x448f04&&'VALIDATION_ERROR'===_0x56770b[_0x19a2f6(0xbd)]&&!_0x56770b[_0x19a2f6(0x141)][_0x19a2f6(0x132)](_0x448f04)?_0x56770b['message']+_0x19a2f6(0x196)+_0x448f04:_0x56770b['message']:_0x1915f1?.[_0x19a2f6(0x141)]?_0x448f04&&!_0x1915f1['message']['includes'](_0x448f04)?_0x1915f1[_0x19a2f6(0x141)]+_0x19a2f6(0x196)+_0x448f04:_0x1915f1['message']:_0x448f04?'Validation\x20failed:\x20'+_0x448f04:_0x2f976a;}export function buildEngineBasePath(_0x4e1e61=null,_0x2e6afb=null){const _0x408a39=_0x58c08b;if(!_0x4e1e61)return null;if(isEmbeddingsEngine(_0x4e1e61))return _0x4e1e61[_0x408a39(0x1ab)]?__ENV__['API']+_0x408a39(0x191)+encodeURIComponent(_0x4e1e61['key']):null;const _0x21ec62=resolveEngineEnvName(_0x4e1e61,_0x2e6afb);return _0x21ec62&&_0x4e1e61[_0x408a39(0xfd)]&&_0x4e1e61[_0x408a39(0x122)]?__ENV__[_0x408a39(0xed)]+_0x408a39(0x181)+encodeURIComponent(_0x21ec62)+'/engines/'+encodeURIComponent(_0x4e1e61[_0x408a39(0xfd)])+'/'+encodeURIComponent(_0x4e1e61[_0x408a39(0x122)]):null;}function compactCount(_0x35a8a1){const _0x3be47d=_0x58c08b;if(null==_0x35a8a1||''===_0x35a8a1)return null;const _0x4fda87=Number(_0x35a8a1);return Number[_0x3be47d(0x142)](_0x4fda87)&&Number['isInteger'](_0x4fda87)?_0x4fda87['toLocaleString']():String(_0x35a8a1);}function firstDefined(..._0x9a5bc6){for(const _0x303328 of _0x9a5bc6)if(null!=_0x303328&&''!==_0x303328)return _0x303328;return null;}function pushBadge(_0x1329c0,_0x4bedd0,_0x528851=_0x58c08b(0xc0),_0x2ddab0=null){const _0x3eadec=_0x58c08b;null!=_0x4bedd0&&''!==_0x4bedd0&&_0x1329c0[_0x3eadec(0xee)]({'text':String(_0x4bedd0),'color':_0x528851,'title':_0x2ddab0??String(_0x4bedd0)});}function pushMetric(_0x492ce6,_0x1633d8,_0x29f149,_0x306998={}){const _0x13c712=_0x58c08b;null!=_0x1633d8&&''!==_0x1633d8&&null!=_0x29f149&&''!==_0x29f149&&'—'!==_0x29f149&&_0x492ce6[_0x13c712(0xee)]({'label':String(_0x1633d8),'value':String(_0x29f149),'tone':_0x306998[_0x13c712(0x11e)]??'neutral','title':_0x306998[_0x13c712(0x133)]??_0x1633d8+':\x20'+_0x29f149});}function buildStatusMeta(_0x5589c8,_0x231e83,_0x1ae59c=null){const _0x228d80=_0x58c08b;return{'label':_0x5589c8,'color':_0x231e83,'title':_0x1ae59c??_0x228d80(0xe1)+_0x5589c8};}function formatClockBadge(_0x411206,_0x32de0e){const _0x894d38=_0x58c08b,_0x23def4=compactCount(_0x411206),_0x25a106=compactCount(_0x32de0e);return null==_0x23def4&&null==_0x25a106?null:_0x894d38(0x11c)+(_0x23def4??'—')+_0x894d38(0xb1)+(_0x25a106??'—');}function inferLag(_0x38e48a,_0x16e7be,_0x5ad5e8){const _0x166380=_0x58c08b;if(null!=_0x38e48a&&''!==_0x38e48a)return _0x38e48a;const _0x510586=Number(_0x16e7be),_0x48b3cd=Number(_0x5ad5e8);return Number[_0x166380(0x142)](_0x510586)&&Number[_0x166380(0x142)](_0x48b3cd)?Math[_0x166380(0x171)](0x0,_0x48b3cd-_0x510586):null;}function formatBool(_0x32265c,_0x590c4b=_0x58c08b(0x14a),_0x4367fc='no'){return null==_0x32265c||''===_0x32265c?null:_0x32265c?_0x590c4b:_0x4367fc;}function formatChunkConfig(_0x42877f=null){const _0x30995e=_0x58c08b;if(!_0x42877f||_0x30995e(0x14b)!=typeof _0x42877f)return null;const _0x536ce4=[_0x42877f[_0x30995e(0x1a3)]??_0x42877f[_0x30995e(0xfd)]??_0x30995e(0x109)];return null!=_0x42877f[_0x30995e(0x12a)]&&_0x536ce4[_0x30995e(0xee)](compactCount(_0x42877f[_0x30995e(0x12a)])+_0x30995e(0xf5)),null!=_0x42877f[_0x30995e(0x197)]&&_0x536ce4[_0x30995e(0xee)](compactCount(_0x42877f['overlap'])+_0x30995e(0x185)),null!=_0x42877f[_0x30995e(0xdc)]&&_0x536ce4[_0x30995e(0xee)](_0x30995e(0x161)+formatBool(_0x42877f[_0x30995e(0xdc)],'on','off')),_0x536ce4['filter'](Boolean)[_0x30995e(0x18a)](_0x30995e(0xb1));}function formatIndexerProgress(_0xdc0cf8=null){const _0x584864=_0x58c08b;if(!_0xdc0cf8||_0x584864(0x14b)!=typeof _0xdc0cf8)return null;const _0x2f4f23=Number(_0xdc0cf8['done']??0x0),_0x2f938e=Number(_0xdc0cf8['pending']??0x0),_0x34b0ea=Number(_0xdc0cf8[_0x584864(0x127)]??0x0),_0x156098=Number(_0xdc0cf8[_0x584864(0x10b)]??_0x2f4f23+_0x2f938e+_0x34b0ea+Number(_0xdc0cf8[_0x584864(0x137)]??0x0));if(!Number[_0x584864(0x142)](_0x156098)||_0x156098<=0x0)return null;const _0x5ef6b3=Math['round'](Math[_0x584864(0x171)](0x0,_0x2f4f23)/_0x156098*0x64);return{'value':compactCount(_0x2f4f23)+'/'+compactCount(_0x156098)+'\x20('+_0x5ef6b3+'%)','tone':_0x34b0ea>0x0?'danger':_0x2f938e>0x0?_0x584864(0x115):_0x584864(0xdd)};}function formatClockProgress(_0x305d53,_0x139e24){const _0x16de4f=_0x58c08b,_0x3fcdf9=Number(_0x305d53),_0x25483a=Number(_0x139e24);if(!Number[_0x16de4f(0x142)](_0x3fcdf9)||!Number[_0x16de4f(0x142)](_0x25483a)||_0x25483a<=0x0)return null;const _0xed6f19=Math[_0x16de4f(0x171)](0x0,Math['min'](_0x3fcdf9,_0x25483a)),_0x26467d=Math[_0x16de4f(0x19d)](_0xed6f19/_0x25483a*0x64);return{'value':compactCount(_0xed6f19)+'/'+compactCount(_0x25483a)+'\x20('+_0x26467d+'%)','tone':_0xed6f19>=_0x25483a?_0x16de4f(0xdd):'warning'};}export function compactEngineErrorText(_0x333811=null,_0x3f2c65=0xa0){const _0x386565=_0x58c08b,_0x51d304=firstDefined(_0x333811?.[_0x386565(0x14c)]?.['error'],_0x333811?.['runtime']?.[_0x386565(0x18e)],_0x333811?.[_0x386565(0x18e)]);if(null==_0x51d304)return null;const _0x2e24c2=String(_0x51d304)[_0x386565(0x154)](/\s+/g,'\x20')[_0x386565(0xe8)]();return _0x2e24c2?_0x2e24c2[_0x386565(0x116)]>_0x3f2c65?_0x2e24c2[_0x386565(0x108)](0x0,Math[_0x386565(0x171)](0x0,_0x3f2c65-0x1))[_0x386565(0x1a4)]()+'…':_0x2e24c2:null;}export function compactEngineStatusMeta(_0x2842ff=null){const _0x24ba6f=_0x58c08b,_0x52ee2d=_0x2842ff?.[_0x24ba6f(0x14c)]??{},_0x20f299=_0x2842ff?.[_0x24ba6f(0xcf)]??{},_0x1111ec=firstDefined(_0x52ee2d?.[_0x24ba6f(0x12f)],_0x20f299?.['state'],_0x2842ff?.[_0x24ba6f(0x12f)],_0x2842ff?.['status']);return!0x0===firstDefined(_0x52ee2d?.['paused'],_0x20f299?.[_0x24ba6f(0x190)],_0x2842ff?.[_0x24ba6f(0x190)])?buildStatusMeta(_0x24ba6f(0x190),_0x24ba6f(0xf8)):'error'===_0x1111ec||_0x24ba6f(0x18e)===_0x2842ff?.[_0x24ba6f(0xde)]?buildStatusMeta(_0x24ba6f(0x18e),_0x24ba6f(0x126)):_0x24ba6f(0x160)===_0x1111ec||_0x24ba6f(0x160)===_0x2842ff?.['status']?buildStatusMeta(_0x24ba6f(0x160),_0x24ba6f(0xf8)):_0x24ba6f(0x1aa)===_0x1111ec?buildStatusMeta(_0x24ba6f(0x1aa),_0x24ba6f(0x11d)):_0x2842ff?.[_0x24ba6f(0x19b)]||'online'===_0x1111ec||'running'===_0x1111ec?buildStatusMeta(_0x24ba6f(0xc9),_0x24ba6f(0x10c)):'degraded'===_0x1111ec?buildStatusMeta(_0x24ba6f(0x14f),_0x24ba6f(0xf8)):buildStatusMeta('stopped'===_0x1111ec||_0x24ba6f(0xe2)===_0x1111ec?_0x24ba6f(0xe3):_0x1111ec?String(_0x1111ec):_0x24ba6f(0xe3),_0x24ba6f(0xc0));}export function compactEngineRowStatusBadges(_0x20e474=null){const _0x358d47=_0x58c08b,_0x172b39=_0x20e474?.[_0x358d47(0x14c)]??{},_0x367a7c=[],_0x581925=compactEngineStatusMeta(_0x20e474),_0x3d62c0=readableReason(_0x20e474?.[_0x358d47(0xfe)]);return pushBadge(_0x367a7c,_0x581925[_0x358d47(0x118)],_0x581925[_0x358d47(0x140)],_0x581925[_0x358d47(0x133)]),_0x358d47(0xd0)===_0x20e474?.[_0x358d47(0xfd)]&&(!0x0===_0x172b39?.['ok']&&pushBadge(_0x367a7c,_0x358d47(0x110),_0x358d47(0x10c),'Provider\x20health\x20check\x20is\x20healthy'),!0x1===_0x172b39?.['ok']&&pushBadge(_0x367a7c,_0x358d47(0x183),_0x358d47(0x126),_0x358d47(0x12c))),!0x1===_0x20e474?.[_0x358d47(0x198)]&&pushBadge(_0x367a7c,_0x358d47(0x104),_0x358d47(0xc0),_0x358d47(0xbc)),_0x3d62c0&&_0x3d62c0!==_0x581925[_0x358d47(0x118)]&&pushBadge(_0x367a7c,_0x3d62c0,'var(--okdb-app-fg-muted)',_0x358d47(0x146)+_0x3d62c0),_0x367a7c;}export function compactEngineRowSummary(_0x3ce228=null){const _0x2296ee=_0x58c08b,_0x289480=_0x3ce228?.['config']??{},_0x242780=_0x3ce228?.[_0x2296ee(0x14c)]??{},_0x35ce45=_0x242780?.[_0x2296ee(0x1a9)]??_0x242780??{},_0x45ab7a=_0x242780?.[_0x2296ee(0x1a1)]??_0x242780??{},_0x474ed5=_0x242780?.[_0x2296ee(0x113)]?.['name']??_0x289480?.[_0x2296ee(0x113)]?.[_0x2296ee(0x122)]??null;switch(_0x3ce228?.[_0x2296ee(0xfd)]){case'queue-worker':return _0x2296ee(0x112)+(_0x242780?.[_0x2296ee(0xdf)]??_0x289480?.['job_type']??_0x2296ee(0xd7));case _0x2296ee(0xf2):return _0x2296ee(0x149)+(_0x242780?.[_0x2296ee(0xe6)]??_0x289480?.[_0x2296ee(0xe6)]??_0x2296ee(0xba));case _0x2296ee(0x1a0):return(_0x242780?.[_0x2296ee(0xe6)]??_0x289480?.[_0x2296ee(0xe6)]??_0x2296ee(0x1a7))+'\x20→\x20'+(_0x242780?.[_0x2296ee(0x111)]??_0x289480?.[_0x2296ee(0x111)]??_0x2296ee(0xae));case _0x2296ee(0xd0):return(_0x242780?.[_0x2296ee(0x19a)]??_0x289480?.['model']??_0x3ce228?.['name']??_0x2296ee(0x131))+_0x2296ee(0x16d)+(_0x242780?.[_0x2296ee(0xfd)]??_0x289480?.[_0x2296ee(0xfd)]??_0x289480?.[_0x2296ee(0x117)]??_0x2296ee(0x117));case _0x2296ee(0x1a9):return _0x2296ee(0xf3)+(_0x35ce45?.['source_type']??_0x289480?.[_0x2296ee(0xe6)]??'source\x20docs');case _0x2296ee(0xd5):return _0x2296ee(0x15e)+(_0x45ab7a?.[_0x2296ee(0x102)]??_0x289480?.[_0x2296ee(0x102)]??_0x3ce228?.[_0x2296ee(0x122)]??_0x2296ee(0x164));case _0x2296ee(0x188):return _0x2296ee(0xd4)+(_0x242780?.[_0x2296ee(0x1a9)]??_0x289480?.[_0x2296ee(0x1a9)]?'\x20for\x20'+(_0x242780?.[_0x2296ee(0x1a9)]??_0x289480[_0x2296ee(0x1a9)]):'');default:return _0x474ed5?_0x2296ee(0xec)+_0x474ed5:_0x3ce228?.[_0x2296ee(0x122)]??_0x3ce228?.[_0x2296ee(0x1ab)]??_0x2296ee(0x136);}}export function compactEngineRowMetrics(_0x1611c3=null){const _0x5b201a=_0x58c08b,_0x437479=_0x1611c3?.[_0x5b201a(0x193)]??{},_0x326ce9=_0x1611c3?.[_0x5b201a(0x14c)]??{},_0x36b271=_0x326ce9?.[_0x5b201a(0x1a9)]??_0x326ce9??{},_0x3d88aa=_0x326ce9?.[_0x5b201a(0x1a1)]??_0x326ce9??{},_0x3de323=[],_0x307edb=firstDefined(_0x326ce9?.[_0x5b201a(0x11f)],_0x1611c3?.[_0x5b201a(0xcf)]?.[_0x5b201a(0x11f)],_0x1611c3?.[_0x5b201a(0x11f)],_0x36b271?.[_0x5b201a(0x18f)],_0x3d88aa?.[_0x5b201a(0x18f)]),_0x320185=firstDefined(_0x326ce9?.['headClock'],_0x1611c3?.[_0x5b201a(0xcf)]?.[_0x5b201a(0x15b)],_0x1611c3?.[_0x5b201a(0x15b)],_0x36b271?.[_0x5b201a(0xb2)],_0x3d88aa?.[_0x5b201a(0xb2)]),_0x44f3d0=inferLag(firstDefined(_0x326ce9?.[_0x5b201a(0x1a5)],_0x1611c3?.[_0x5b201a(0xcf)]?.[_0x5b201a(0x1a5)],_0x1611c3?.[_0x5b201a(0x1a5)],_0x36b271?.['lag'],_0x3d88aa?.['lag']),_0x307edb,_0x320185),_0x4107b6=formatClockBadge(_0x307edb,_0x320185);switch(_0x1611c3?.['type']){case _0x5b201a(0x165):pushMetric(_0x3de323,_0x5b201a(0x16c),compactCount(_0x326ce9?.[_0x5b201a(0xaf)]??0x0),{'tone':_0x5b201a(0xdd)}),pushMetric(_0x3de323,_0x5b201a(0x17c),compactCount(_0x326ce9?.[_0x5b201a(0x127)]??0x0),{'tone':(_0x326ce9?.[_0x5b201a(0x127)]??0x0)>0x0?_0x5b201a(0x155):_0x5b201a(0xf4)}),pushMetric(_0x3de323,_0x5b201a(0x123),_0x326ce9?.['queue_env']??_0x437479?.['queue_env']??_0x1611c3?.['env']??_0x5b201a(0xfa)),pushMetric(_0x3de323,'Handler',_0x326ce9?.['handler']?.[_0x5b201a(0x122)]??_0x437479?.[_0x5b201a(0x113)]?.[_0x5b201a(0x122)],{'title':_0x5b201a(0x114)});break;case'processor':null!=_0x326ce9?.[_0x5b201a(0x147)]&&pushMetric(_0x3de323,'Changes',compactCount(_0x326ce9[_0x5b201a(0x147)])),null!=_0x326ce9?.[_0x5b201a(0x120)]&&pushMetric(_0x3de323,_0x5b201a(0x17c),compactCount(_0x326ce9['failedBatches']),{'tone':(_0x326ce9?.['failedBatches']??0x0)>0x0?'danger':_0x5b201a(0xf4),'title':_0x5b201a(0x13b)}),null!=_0x326ce9?.[_0x5b201a(0x12e)]&&pushMetric(_0x3de323,_0x5b201a(0x153),compactCount(_0x326ce9['runningBatches']),{'tone':(_0x326ce9?.[_0x5b201a(0x12e)]??0x0)>0x0?_0x5b201a(0x10f):_0x5b201a(0xf4),'title':_0x5b201a(0x158)}),null!=_0x44f3d0&&pushMetric(_0x3de323,_0x5b201a(0x124),0x0===_0x44f3d0?_0x5b201a(0xcb):compactCount(_0x44f3d0),{'tone':Number(_0x44f3d0)>0x0?'warning':'success'}),_0x4107b6&&pushMetric(_0x3de323,_0x5b201a(0x179),_0x4107b6[_0x5b201a(0x154)](/^clock\s+/i,'')),pushMetric(_0x3de323,_0x5b201a(0xeb),_0x326ce9?.[_0x5b201a(0x178)]??_0x437479?.[_0x5b201a(0x178)]??_0x5b201a(0x18b));break;case'materializer':null!=_0x326ce9?.[_0x5b201a(0x169)]&&pushMetric(_0x3de323,'Rows',compactCount(_0x326ce9[_0x5b201a(0x169)]),{'tone':'success'}),null!=_0x326ce9?.[_0x5b201a(0xcd)]&&pushMetric(_0x3de323,_0x5b201a(0xc3),compactCount(_0x326ce9[_0x5b201a(0xcd)])),null!=_0x326ce9?.[_0x5b201a(0x120)]&&pushMetric(_0x3de323,'Error',compactCount(_0x326ce9['failedBatches']),{'tone':(_0x326ce9?.[_0x5b201a(0x120)]??0x0)>0x0?_0x5b201a(0x155):_0x5b201a(0xf4),'title':_0x5b201a(0x13b)}),null!=_0x326ce9?.[_0x5b201a(0x12e)]&&pushMetric(_0x3de323,_0x5b201a(0x153),compactCount(_0x326ce9[_0x5b201a(0x12e)]),{'tone':(_0x326ce9?.[_0x5b201a(0x12e)]??0x0)>0x0?'accent':_0x5b201a(0xf4),'title':_0x5b201a(0x158)}),null!=_0x44f3d0&&pushMetric(_0x3de323,_0x5b201a(0x124),0x0===_0x44f3d0?'caught\x20up':compactCount(_0x44f3d0),{'tone':Number(_0x44f3d0)>0x0?_0x5b201a(0x115):'success'}),_0x4107b6&&pushMetric(_0x3de323,_0x5b201a(0x179),_0x4107b6[_0x5b201a(0x154)](/^clock\s+/i,''));break;case'embedder':pushMetric(_0x3de323,_0x5b201a(0x199),_0x326ce9?.['type']??_0x437479?.[_0x5b201a(0xfd)]??_0x437479?.['provider']),pushMetric(_0x3de323,_0x5b201a(0x128),_0x326ce9?.['model']??_0x437479?.[_0x5b201a(0x19a)]),null!=_0x326ce9?.[_0x5b201a(0xb0)]&&pushMetric(_0x3de323,_0x5b201a(0x101),compactCount(_0x326ce9[_0x5b201a(0xb0)])+_0x5b201a(0x16f),{'tone':'accent'});break;case _0x5b201a(0x1a9):if(_0x36b271[_0x5b201a(0xe7)]&&pushMetric(_0x3de323,_0x5b201a(0x16c),compactCount(_0x36b271[_0x5b201a(0xe7)][_0x5b201a(0x13c)]??0x0),{'tone':_0x5b201a(0xdd)}),_0x36b271[_0x5b201a(0xe7)]){const _0x19d05d=formatIndexerProgress(_0x36b271[_0x5b201a(0xe7)]);_0x19d05d&&pushMetric(_0x3de323,_0x5b201a(0x152),_0x19d05d[_0x5b201a(0xc5)],{'tone':_0x19d05d[_0x5b201a(0x11e)],'title':_0x5b201a(0x162)});}else{const _0x5e117d=formatClockProgress(_0x307edb,_0x320185);_0x5e117d&&pushMetric(_0x3de323,_0x5b201a(0x152),_0x5e117d[_0x5b201a(0xc5)],{'tone':_0x5e117d['tone'],'title':'Indexer\x20cursor\x20/\x20source\x20head\x20clock'});}_0x36b271['doc_counts']&&pushMetric(_0x3de323,'Pending',compactCount(_0x36b271[_0x5b201a(0xe7)]['pending']??0x0),{'tone':(_0x36b271[_0x5b201a(0xe7)]['pending']??0x0)>0x0?_0x5b201a(0x115):_0x5b201a(0xf4)}),_0x36b271[_0x5b201a(0xe7)]&&pushMetric(_0x3de323,_0x5b201a(0x17c),compactCount(_0x36b271[_0x5b201a(0xe7)][_0x5b201a(0x127)]??0x0),{'tone':(_0x36b271[_0x5b201a(0xe7)][_0x5b201a(0x127)]??0x0)>0x0?_0x5b201a(0x155):_0x5b201a(0xf4)}),null!=_0x36b271?.['vector_count']&&pushMetric(_0x3de323,_0x5b201a(0x10d),compactCount(_0x36b271['vector_count']),{'tone':_0x5b201a(0xdd)}),_0x4107b6&&pushMetric(_0x3de323,_0x5b201a(0x179),_0x4107b6[_0x5b201a(0x154)](/^clock\s+/i,'')),null!=_0x44f3d0&&pushMetric(_0x3de323,'Lag',0x0===_0x44f3d0?_0x5b201a(0xcb):compactCount(_0x44f3d0),{'tone':Number(_0x44f3d0)>0x0?_0x5b201a(0x115):_0x5b201a(0xdd)}),pushMetric(_0x3de323,_0x5b201a(0xb9),_0x36b271[_0x5b201a(0x14e)]??_0x437479?.['field']??_0x5b201a(0x119)),pushMetric(_0x3de323,_0x5b201a(0xeb),_0x36b271[_0x5b201a(0x178)]??_0x437479?.[_0x5b201a(0x178)]),pushMetric(_0x3de323,_0x5b201a(0x1a2),_0x36b271['prepare']??_0x437479?.[_0x5b201a(0x17f)]),pushMetric(_0x3de323,_0x5b201a(0x195),formatChunkConfig(_0x36b271[_0x5b201a(0x150)]??_0x437479?.['chunk'])),pushMetric(_0x3de323,'Embedder',_0x36b271['embedder']??_0x437479?.['embedder']);break;case'vector-search':null==_0x3d88aa[_0x5b201a(0xb3)]&&null==_0x3d88aa[_0x5b201a(0x145)]||pushMetric(_0x3de323,'Vectors',compactCount(_0x3d88aa[_0x5b201a(0xb3)]??_0x3d88aa['vector_count']),{'tone':_0x5b201a(0xdd)}),null!=_0x3d88aa[_0x5b201a(0x17a)]&&pushMetric(_0x3de323,_0x5b201a(0x166),compactCount(_0x3d88aa[_0x5b201a(0x17a)])),pushMetric(_0x3de323,_0x5b201a(0x174),_0x3d88aa[_0x5b201a(0xd9)]??_0x437479?.['algorithm']);break;case'embed-worker':null!=_0x326ce9?.[_0x5b201a(0xaf)]&&pushMetric(_0x3de323,'Done',compactCount(_0x326ce9[_0x5b201a(0xaf)]),{'tone':_0x5b201a(0xdd)}),null!=_0x326ce9?.[_0x5b201a(0x127)]&&pushMetric(_0x3de323,_0x5b201a(0x17c),compactCount(_0x326ce9[_0x5b201a(0x127)]),{'tone':(_0x326ce9?.[_0x5b201a(0x127)]??0x0)>0x0?_0x5b201a(0x155):_0x5b201a(0xf4)}),null!=_0x326ce9?.[_0x5b201a(0xe0)]&&pushMetric(_0x3de323,_0x5b201a(0x153),compactCount(_0x326ce9[_0x5b201a(0xe0)]),{'tone':(_0x326ce9?.['in_flight']??0x0)>0x0?'accent':_0x5b201a(0xf4)}),null!=_0x326ce9?.[_0x5b201a(0xfb)]&&pushMetric(_0x3de323,'Workers',compactCount(_0x326ce9[_0x5b201a(0xfb)]),{'tone':_0x5b201a(0x10f)}),pushMetric(_0x3de323,_0x5b201a(0x18c),_0x326ce9?.['indexer']??_0x437479?.[_0x5b201a(0x1a9)]);break;default:null!=_0x44f3d0&&pushMetric(_0x3de323,_0x5b201a(0x124),0x0===_0x44f3d0?_0x5b201a(0xcb):compactCount(_0x44f3d0),{'tone':Number(_0x44f3d0)>0x0?_0x5b201a(0x115):_0x5b201a(0xdd)}),pushMetric(_0x3de323,_0x5b201a(0x13f),_0x437479?.[_0x5b201a(0xe6)]);}return Array[_0x5b201a(0x156)](_0x1611c3?.['affinity'])&&_0x1611c3[_0x5b201a(0x17d)][_0x5b201a(0x116)]&&pushMetric(_0x3de323,_0x5b201a(0x1a8),_0x1611c3['affinity'][_0x5b201a(0x18a)](',\x20')),_0x3de323;}export function compactEngineRowPreview(_0x2b3b00=null){const _0x49d0ae=_0x58c08b,_0x43d8af=compactEngineRowMetrics(_0x2b3b00),_0x461bc2=new Map(_0x43d8af[_0x49d0ae(0x134)](_0x189b6a=>[_0x189b6a['label'],_0x189b6a])),_0x554e32=[],_0x15301f=_0x2da9f4=>{const _0x528bea=_0x49d0ae,_0x3b6224=_0x461bc2[_0x528bea(0x130)](_0x2da9f4);_0x3b6224&&(_0x554e32[_0x528bea(0xee)](_0x3b6224),_0x461bc2['delete'](_0x2da9f4));};switch(_0x2b3b00?.['type']){case _0x49d0ae(0x1a9):[_0x49d0ae(0x152),_0x49d0ae(0x124),_0x49d0ae(0xd6),_0x49d0ae(0x17c),_0x49d0ae(0x10d),'Chunk'][_0x49d0ae(0x180)](_0x15301f);break;case _0x49d0ae(0x188):case _0x49d0ae(0x165):[_0x49d0ae(0x16c),_0x49d0ae(0x17c),_0x49d0ae(0x153),'Workers'][_0x49d0ae(0x180)](_0x15301f);break;case _0x49d0ae(0xf2):[_0x49d0ae(0x15f),'Error','Active',_0x49d0ae(0x124)]['forEach'](_0x15301f);break;case _0x49d0ae(0x1a0):[_0x49d0ae(0x173),'Ops','Error',_0x49d0ae(0x153),'Lag'][_0x49d0ae(0x180)](_0x15301f);break;case _0x49d0ae(0xd5):[_0x49d0ae(0x10d),_0x49d0ae(0x166),_0x49d0ae(0x174)][_0x49d0ae(0x180)](_0x15301f);break;case _0x49d0ae(0xd0):[_0x49d0ae(0x128),_0x49d0ae(0x199),_0x49d0ae(0x101)][_0x49d0ae(0x180)](_0x15301f);break;default:[_0x49d0ae(0x17c),'Lag',_0x49d0ae(0x13f)][_0x49d0ae(0x180)](_0x15301f);}return _0x554e32[_0x49d0ae(0x108)](0x0,0x3);}export function compactEngineConfigMetrics(_0xdec83e=null){const _0x3e0366=_0x58c08b,_0x47353f=_0xdec83e?.[_0x3e0366(0x193)]??{},_0x2b38ec=_0xdec83e?.[_0x3e0366(0x14c)]??{},_0x122710=_0xdec83e?.['runtime']??{},_0x39f7df=[],_0x2f7e2a=_0x47353f?.[_0x3e0366(0x113)]??_0x122710?.[_0x3e0366(0x113)]??_0x2b38ec?.['handler']??null;switch(_0xdec83e?.[_0x3e0366(0xfd)]){case _0x3e0366(0xf2):pushMetric(_0x39f7df,_0x3e0366(0x12d),_0x47353f?.['source_type']??_0x2b38ec?.[_0x3e0366(0xe6)]),pushMetric(_0x39f7df,'Source\x20env',_0x47353f?.[_0x3e0366(0x17e)]??_0x122710?.[_0x3e0366(0x17e)]),pushMetric(_0x39f7df,_0x3e0366(0xeb),_0x47353f?.[_0x3e0366(0x178)]??_0x2b38ec?.[_0x3e0366(0x178)]??'async'),pushMetric(_0x39f7df,_0x3e0366(0x18d),_0x47353f?.[_0x3e0366(0x184)]),pushMetric(_0x39f7df,_0x3e0366(0x15c),compactCount(_0x47353f?.[_0x3e0366(0xc6)])),pushMetric(_0x39f7df,_0x3e0366(0xc1),_0x47353f?.[_0x3e0366(0xc2)]);break;case'materializer':pushMetric(_0x39f7df,'Source',_0x47353f?.[_0x3e0366(0xe6)]??_0x2b38ec?.['source_type']),pushMetric(_0x39f7df,_0x3e0366(0x125),_0x47353f?.[_0x3e0366(0x111)]??_0x2b38ec?.['target_type']),pushMetric(_0x39f7df,'Source\x20env',_0x47353f?.['source_env']??_0x122710?.[_0x3e0366(0x17e)]),pushMetric(_0x39f7df,_0x3e0366(0x189),_0x47353f?.[_0x3e0366(0x16e)]??_0x122710?.['target_env']),pushMetric(_0x39f7df,_0x3e0366(0x18d),_0x47353f?.[_0x3e0366(0x184)]),pushMetric(_0x39f7df,'Batch',compactCount(_0x47353f?.[_0x3e0366(0xc6)])),pushMetric(_0x39f7df,_0x3e0366(0xc1),_0x47353f?.[_0x3e0366(0xc2)]),pushMetric(_0x39f7df,_0x3e0366(0x148),formatBool(_0x47353f?.['clearTargetOnRebuild'],'on',_0x3e0366(0x106)));break;case _0x3e0366(0x165):pushMetric(_0x39f7df,_0x3e0366(0xc7),_0x47353f?.[_0x3e0366(0xdf)]??_0x2b38ec?.[_0x3e0366(0xdf)]),pushMetric(_0x39f7df,_0x3e0366(0x144),_0x47353f?.[_0x3e0366(0xf9)]??_0x2b38ec?.[_0x3e0366(0xf9)]),pushMetric(_0x39f7df,_0x3e0366(0x105),compactCount(_0x47353f?.[_0x3e0366(0xfb)]??_0x2b38ec?.[_0x3e0366(0xfb)]));break;case _0x3e0366(0xd0):pushMetric(_0x39f7df,'Provider',_0x47353f?.['type']??_0x47353f?.[_0x3e0366(0x117)]??_0x2b38ec?.[_0x3e0366(0xfd)]),pushMetric(_0x39f7df,_0x3e0366(0x128),_0x47353f?.[_0x3e0366(0x19a)]??_0x2b38ec?.[_0x3e0366(0x19a)]),pushMetric(_0x39f7df,_0x3e0366(0x166),compactCount(_0x47353f?.[_0x3e0366(0x17a)]??_0x2b38ec?.[_0x3e0366(0x17a)]));break;case _0x3e0366(0x1a9):pushMetric(_0x39f7df,'Source',_0x47353f?.['source_type']??_0x2b38ec?.['source_type']),pushMetric(_0x39f7df,_0x3e0366(0x11b),_0x47353f?.['source_env']??_0x122710?.[_0x3e0366(0x17e)]),pushMetric(_0x39f7df,_0x3e0366(0xb9),_0x47353f?.[_0x3e0366(0x14e)]??_0x2b38ec?.[_0x3e0366(0x14e)]??'whole\x20record'),pushMetric(_0x39f7df,_0x3e0366(0xeb),_0x47353f?.[_0x3e0366(0x178)]??_0x2b38ec?.[_0x3e0366(0x178)]),pushMetric(_0x39f7df,'Storage',_0x47353f?.[_0x3e0366(0x102)]??_0x2b38ec?.[_0x3e0366(0x102)]),pushMetric(_0x39f7df,'Dims',compactCount(_0x47353f?.[_0x3e0366(0x17a)]??_0x2b38ec?.[_0x3e0366(0x17a)])),pushMetric(_0x39f7df,_0x3e0366(0x1a2),_0x47353f?.[_0x3e0366(0x17f)]??_0x2b38ec?.[_0x3e0366(0x17f)]),pushMetric(_0x39f7df,'Chunk',formatChunkConfig(_0x47353f?.[_0x3e0366(0x150)]??_0x2b38ec?.[_0x3e0366(0x150)])),pushMetric(_0x39f7df,'Embedder',_0x47353f?.[_0x3e0366(0xd0)]??_0x2b38ec?.[_0x3e0366(0xd0)]);break;case'vector-search':if(pushMetric(_0x39f7df,_0x3e0366(0x12d),_0x47353f?.['source_type']??_0x2b38ec?.['source_type']),pushMetric(_0x39f7df,_0x3e0366(0x11b),_0x47353f?.['source_env']??_0x122710?.[_0x3e0366(0x17e)]),pushMetric(_0x39f7df,_0x3e0366(0x138),_0x47353f?.[_0x3e0366(0x102)]??_0x2b38ec?.[_0x3e0366(0x102)]),pushMetric(_0x39f7df,_0x3e0366(0x166),compactCount(_0x47353f?.['dims']??_0x2b38ec?.['dims'])),pushMetric(_0x39f7df,'Algorithm',_0x47353f?.[_0x3e0366(0xd9)]??_0x2b38ec?.[_0x3e0366(0xd9)]??'flat'),_0x47353f?.[_0x3e0366(0x176)]&&'object'==typeof _0x47353f[_0x3e0366(0x176)]){for(const [_0x2b5232,_0x6ea360]of Object[_0x3e0366(0xff)](_0x47353f[_0x3e0366(0x176)]))pushMetric(_0x39f7df,_0x2b5232,compactCount(_0x6ea360));}pushMetric(_0x39f7df,_0x3e0366(0x131),_0x47353f?.[_0x3e0366(0xd0)]??_0x2b38ec?.[_0x3e0366(0xd0)]);break;case _0x3e0366(0x188):pushMetric(_0x39f7df,_0x3e0366(0xc7),_0x47353f?.[_0x3e0366(0xdf)]??_0x2b38ec?.[_0x3e0366(0xdf)]),pushMetric(_0x39f7df,_0x3e0366(0x18c),_0x47353f?.[_0x3e0366(0x1a9)]??_0x2b38ec?.[_0x3e0366(0x1a9)]),pushMetric(_0x39f7df,_0x3e0366(0x131),_0x47353f?.['embedder']??_0x2b38ec?.[_0x3e0366(0xd0)]),pushMetric(_0x39f7df,_0x3e0366(0x105),compactCount(_0x47353f?.['concurrency']??_0x2b38ec?.[_0x3e0366(0xfb)])),pushMetric(_0x39f7df,_0x3e0366(0xf7),null!=_0x47353f?.[_0x3e0366(0x103)]?compactCount(_0x47353f[_0x3e0366(0x103)])+'\x20ms':null),pushMetric(_0x39f7df,_0x3e0366(0xb5),null!=_0x47353f?.[_0x3e0366(0x187)]?compactCount(_0x47353f[_0x3e0366(0x187)])+'\x20ms':null);break;default:pushMetric(_0x39f7df,_0x3e0366(0x12d),_0x47353f?.[_0x3e0366(0xe6)]??_0x2b38ec?.[_0x3e0366(0xe6)]),pushMetric(_0x39f7df,_0x3e0366(0x125),_0x47353f?.[_0x3e0366(0x111)]??_0x2b38ec?.['target_type']),pushMetric(_0x39f7df,_0x3e0366(0xeb),_0x47353f?.['mode']??_0x2b38ec?.['mode']);}return _0x2f7e2a?.[_0x3e0366(0x122)]&&pushMetric(_0x39f7df,_0x3e0366(0x1a6),_0x2f7e2a['name'],{'title':'Configured\x20handler\x20function'}),_0x2f7e2a?.[_0x3e0366(0x100)]&&pushMetric(_0x39f7df,_0x3e0366(0x135),_0x2f7e2a[_0x3e0366(0x100)],{'title':_0x3e0366(0x15d)}),_0x39f7df;}
|
|
1
|
+
export const EMBEDDINGS_ENGINE_TYPES=new Set(["embedder","indexer","embed-worker","vector-search"]);export function isEmbeddingsEngineType(e){return EMBEDDINGS_ENGINE_TYPES.has(e)}export function isEmbeddingsEngine(e){return isEmbeddingsEngineType(e?.type)}export function cloneValue(e,n={}){try{return JSON.parse(JSON.stringify(e??n))}catch{return JSON.parse(JSON.stringify(n))}}export function parseTagList(e){const n=String(e??"").split(",").map(e=>e.trim()).filter(Boolean);return n.length?[...new Set(n)]:null}export function statusTone(e=null){return e?.isRunning?"var(--okdb-success)":"inactive"===e?.status?"var(--okdb-warning)":"error"===e?.status?"var(--okdb-danger)":"var(--okdb-app-fg-muted)"}export function readableReason(e){return e?String(e).replace(/_/g," "):null}export function formatJsonValue(e){try{return JSON.stringify(e,null,2)}catch{return String(e??"")}}export function resolveEngineEnvName(e=null,n=null){return n??e?.env??e?._uiEnv??e?.storeEnv??e?.config?.source_env??null}export function getEnginePipelineName(e=null){return e?.meta?.pipeline??null}export function buildFunctionsRoute(e,n=null){const t=new URLSearchParams,r=e?.$ok?.stores?.okdb?.selectedEnv??null;r&&t.set("env",r),n&&t.set("name",n);const o=t.toString();return"/functions"+(o?`?${o}`:"")}export function openFunctionRoute(e,n,{beforeNavigate:t}={}){if(!n)return!1;const r=e?.$vars?.$router;if("function"==typeof t&&t(),r?.push){const t={...r._search||{}},o=e?.$ok?.stores?.okdb?.selectedEnv??null;o?t.env=o:delete t.env,t.name=n;const u="function"==typeof r.resolve?r.resolve("/functions",t):buildFunctionsRoute(e,n);return r.push(u),!0}return!!globalThis.location&&(globalThis.location.hash=`#${buildFunctionsRoute(e,n)}`,!0)}export function dispatchEnginePipelineSelection(e,n=null){const t=getEnginePipelineName(n);return!!t&&(e.$dispatch("select-pipeline",t),!0)}function matchesLinkedEngine(e=null,n=null){return!!n&&(e?.name===n||e?.key===n)}function matchesLinkedFunction(e=null,n=null){return!!n&&(e?.config?.handler?.name===n||e?.runtime?.handler?.name===n)}function linkedMemberSourceType(e=null){return e?.config?.source_type??e?.runtime?.source_type??null}function linkedMemberJobType(e=null){return e?.config?.job_type??e?.runtime?.job_type??null}function linkedMemberQueueEnv(e=null){return e?.config?.queue_env??e?.runtime?.queue_env??null}export async function resolveLinkedPipeline(e,{envName:n=null,pipelineName:t=null,ownerEngine:r=null,functionName:o=null}={}){const u=n??e?.$ok?.stores?.okdb?.selectedEnv??null;if(!u||!t&&!r&&!o)return null;let c=[],i=null,s=null,a=null,l="pipelines";try{const e=await fetch(`${__ENV__.API}/env/${encodeURIComponent(u)}/pipelines`);if(e.ok){const n=await e.json().catch(()=>({}));c=n?.data??n?.result??[],i=c.find(e=>!!e&&(!(!t||e.name!==t)||(e.engines??[]).some(e=>matchesLinkedEngine(e,r)||matchesLinkedFunction(e,o))))??null,s=(i?.engines??[]).find(e=>matchesLinkedEngine(e,r))??(i?.engines??[]).find(e=>matchesLinkedFunction(e,o))??(i?.engines??[]).find(e=>linkedMemberSourceType(e)&&["processor","materializer","queue-worker"].includes(e?.type))??(i?.engines??[]).find(e=>linkedMemberSourceType(e))??(i?.engines??[]).find(e=>e?.config?.job_type)??null,["processor","materializer","queue-worker"].includes(s?.type)&&(l="engines")}}catch{}if(!s&&(r||o))try{const e=await fetch(`${__ENV__.API}/env/${encodeURIComponent(u)}/engines`);if(e.ok){const n=await e.json().catch(()=>({})),t=n?.data??n?.result??[];a=t.find(e=>e?.name===r||e?.key===r)??t.find(e=>e?.config?.handler?.name===o)??null,!i&&a&&(i=c.find(e=>(e?.engines??[]).some(e=>matchesLinkedEngine(e,a?.name)||matchesLinkedEngine(e,a?.key)||matchesLinkedFunction(e,o)))??null),!s&&i&&(s=(i?.engines??[]).find(e=>matchesLinkedEngine(e,a?.name))??(i?.engines??[]).find(e=>matchesLinkedEngine(e,a?.key))??(i?.engines??[]).find(e=>matchesLinkedFunction(e,o))??null),["processor","materializer","queue-worker"].includes((s??a)?.type)&&(l="engines")}}catch{}const p=linkedMemberSourceType(s)??a?.config?.source_type??a?.runtime?.source_type??(i?.engines??[]).map(linkedMemberSourceType).find(Boolean)??null,d=linkedMemberJobType(s)??a?.config?.job_type??a?.runtime?.job_type??(i?.engines??[]).map(linkedMemberJobType).find(Boolean)??null,m=linkedMemberQueueEnv(s)??a?.config?.queue_env??a?.runtime?.queue_env??u;return"queue-worker"===(s??a)?.type||d?{envName:m,pipelineName:t??i?.name??null,ownerEngine:r??s?.name??s?.key??a?.name??a?.key??null,sourceType:null,jobType:d,targetTab:"workers",targetSection:"queue"}:p?{envName:u,pipelineName:t??i?.name??null,ownerEngine:r??s?.name??s?.key??a?.name??a?.key??null,sourceType:p,jobType:null,targetTab:l,targetSection:"db"}:null}export async function openLinkedPipelineRoute(e,{envName:n=null,pipelineName:t=null,ownerEngine:r=null,functionName:o=null,beforeNavigate:u}={}){const c=e?.$vars?.$router,i=await resolveLinkedPipeline(e,{envName:n,pipelineName:t,ownerEngine:r,functionName:o});if(!i)return!1;if("function"==typeof u&&u(),e?.$ok?.stores?.okdb?.selectedEnv&&e.$ok.stores.okdb.selectedEnv!==i.envName&&e.$ok.stores.okdb.selectEnv(i.envName),c?.push&&"function"==typeof c.resolve){if("queue"===i.targetSection){const e={env:i.envName,view:i.targetTab??"workers"};return i.jobType&&(e.type=i.jobType),c.push(c.resolve("/queue",e)),!0}if(i.pipelineName){const e={env:i.envName,pipeline:i.pipelineName};return i.sourceType&&(e.sourceType=i.sourceType),c.push(c.resolve("/engines",e)),!0}return!!i.sourceType&&(c.push(c.resolve("/db",{env:i.envName,type:i.sourceType,tab:i.targetTab})),!0)}if(globalThis.location){if("queue"===i.targetSection){const e=new URLSearchParams({env:i.envName,view:i.targetTab??"workers"});return i.jobType&&e.set("type",i.jobType),globalThis.location.hash=`#/queue?${e.toString()}`,!0}if(i.pipelineName){const e=new URLSearchParams({env:i.envName,pipeline:i.pipelineName});return i.sourceType&&e.set("sourceType",i.sourceType),globalThis.location.hash=`#/engines?${e.toString()}`,!0}if(!i.sourceType)return!1;const e=new URLSearchParams({env:i.envName,type:i.sourceType,tab:i.targetTab});return globalThis.location.hash=`#/db?${e.toString()}`,!0}return!1}export function buildEmbeddingsPipelineUrl(e=null,n=null){const t=e?.config??{},r=encodeURIComponent(t.source_env??"default"),o=encodeURIComponent(t.source_type??""),u=encodeURIComponent(t.storage_key??n??e?.name??"");return`${__ENV__.API}/env/${r}/type/${o}/pipelines/${u}`}export function maskSensitiveConfig(e={}){if(Array.isArray(e))return e.map(e=>maskSensitiveConfig(e));if(!e||"object"!=typeof e)return e;const n={};for(const[t,r]of Object.entries(e))n[t]=/key|secret|pass|token/i.test(t)?"***":maskSensitiveConfig(r);return n}export function summarizeValidationDetails(e=[]){if(!Array.isArray(e)||0===e.length)return null;const n=e.slice(0,3).map((e={})=>`${e.field?`${e.field} `:""}${e.message||"is invalid"}`.trim()).join("; ");return e.length>3?`${n} (+${e.length-3} more)`:n}export function getApiErrorMessage(e=null,n="Request failed"){const t=e?.error??null,r=summarizeValidationDetails(t?.details??e?.details??null);return"string"==typeof t?e?.message?e.message:r&&/^[A-Z0-9_]+$/.test(t)?`Validation failed: ${r}`:t||n:t?.message?r&&"VALIDATION_ERROR"===t.code&&!t.message.includes(r)?`${t.message} — ${r}`:t.message:e?.message?r&&!e.message.includes(r)?`${e.message} — ${r}`:e.message:r?`Validation failed: ${r}`:n}export function buildEngineBasePath(e=null,n=null){if(!e)return null;if(isEmbeddingsEngine(e))return e.key?`${__ENV__.API}/embeddings/engines/${encodeURIComponent(e.key)}`:null;const t=resolveEngineEnvName(e,n);return t&&e.type&&e.name?`${__ENV__.API}/env/${encodeURIComponent(t)}/engines/${encodeURIComponent(e.type)}/${encodeURIComponent(e.name)}`:null}function compactCount(e){if(null==e||""===e)return null;const n=Number(e);return Number.isFinite(n)&&Number.isInteger(n)?n.toLocaleString():String(e)}function firstDefined(...e){for(const n of e)if(null!=n&&""!==n)return n;return null}function pushBadge(e,n,t="var(--okdb-app-fg-muted)",r=null){null!=n&&""!==n&&e.push({text:String(n),color:t,title:r??String(n)})}function pushMetric(e,n,t,r={}){null!=n&&""!==n&&null!=t&&""!==t&&"—"!==t&&e.push({label:String(n),value:String(t),tone:r.tone??"neutral",title:r.title??`${n}: ${t}`})}function buildStatusMeta(e,n,t=null){return{label:e,color:n,title:t??`Status: ${e}`}}function formatClockBadge(e,n){const t=compactCount(e),r=compactCount(n);return null==t&&null==r?null:`clock ${t??"—"} / ${r??"—"}`}function inferLag(e,n,t){if(null!=e&&""!==e)return e;const r=Number(n),o=Number(t);return Number.isFinite(r)&&Number.isFinite(o)?Math.max(0,o-r):null}function formatBool(e,n="yes",t="no"){return null==e||""===e?null:e?n:t}function formatChunkConfig(e=null){if(!e||"object"!=typeof e)return null;const n=[e.strategy??e.type??"chunked"];return null!=e.size&&n.push(`${compactCount(e.size)} chars`),null!=e.overlap&&n.push(`${compactCount(e.overlap)} overlap`),null!=e.storeText&&n.push(`store text ${formatBool(e.storeText,"on","off")}`),n.filter(Boolean).join(" / ")}function formatIndexerProgress(e=null){if(!e||"object"!=typeof e)return null;const n=Number(e.done??0),t=Number(e.pending??0),r=Number(e.failed??0),o=Number(e.total??n+t+r+Number(e.deleted??0));if(!Number.isFinite(o)||o<=0)return null;const u=Math.round(Math.max(0,n)/o*100);return{value:`${compactCount(n)}/${compactCount(o)} (${u}%)`,tone:r>0?"danger":t>0?"warning":"success"}}function formatClockProgress(e,n){const t=Number(e),r=Number(n);if(!Number.isFinite(t)||!Number.isFinite(r)||r<=0)return null;const o=Math.max(0,Math.min(t,r)),u=Math.round(o/r*100);return{value:`${compactCount(o)}/${compactCount(r)} (${u}%)`,tone:o>=r?"success":"warning"}}export function compactEngineErrorText(e=null,n=160){const t=firstDefined(e?.stats?.error,e?.runtime?.error,e?.error);if(null==t)return null;const r=String(t).replace(/\s+/g," ").trim();return r?r.length>n?`${r.slice(0,Math.max(0,n-1)).trimEnd()}…`:r:null}export function compactEngineStatusMeta(e=null){const n=e?.stats??{},t=e?.runtime??{},r=firstDefined(n?.state,t?.state,e?.state,e?.status);return!0===firstDefined(n?.paused,t?.paused,e?.paused)?buildStatusMeta("paused","var(--okdb-warning)"):"error"===r||"error"===e?.status?buildStatusMeta("error","var(--okdb-danger)"):"inactive"===r||"inactive"===e?.status?buildStatusMeta("inactive","var(--okdb-warning)"):"building"===r?buildStatusMeta("building","var(--okdb-info)"):e?.isRunning||"online"===r||"running"===r?buildStatusMeta("running","var(--okdb-success)"):"degraded"===r?buildStatusMeta("degraded","var(--okdb-warning)"):buildStatusMeta("stopped"===r||"idle"===r?"stopped":r?String(r):"stopped","var(--okdb-app-fg-muted)")}export function compactEngineRowStatusBadges(e=null){const n=e?.stats??{},t=[],r=compactEngineStatusMeta(e),o=readableReason(e?.reason);return pushBadge(t,r.label,r.color,r.title),"embedder"===e?.type&&(!0===n?.ok&&pushBadge(t,"healthy","var(--okdb-success)","Provider health check is healthy"),!1===n?.ok&&pushBadge(t,"unhealthy","var(--okdb-danger)","Provider health check failed")),!1===e?.enabled&&pushBadge(t,"disabled","var(--okdb-app-fg-muted)","Engine is disabled"),o&&o!==r.label&&pushBadge(t,o,"var(--okdb-app-fg-muted)",`Reason: ${o}`),t}export function compactEngineRowSummary(e=null){const n=e?.config??{},t=e?.stats??{},r=t?.indexer??t??{},o=t?.search??t??{},u=t?.handler?.name??n?.handler?.name??null;switch(e?.type){case"queue-worker":return`Consumes ${t?.job_type??n?.job_type??"queue jobs"}`;case"processor":return`Watches ${t?.source_type??n?.source_type??"source changes"}`;case"materializer":return`${t?.source_type??n?.source_type??"source"} → ${t?.target_type??n?.target_type??"target"}`;case"embedder":return`${t?.model??n?.model??e?.name??"Embedder"} on ${t?.type??n?.type??n?.provider??"provider"}`;case"indexer":return`Indexes ${r?.source_type??n?.source_type??"source docs"}`;case"vector-search":return`Searches ${o?.storage_key??n?.storage_key??e?.name??"vector index"}`;case"embed-worker":return"Runs queued embedding jobs"+(t?.indexer??n?.indexer?` for ${t?.indexer??n.indexer}`:"");default:return u?`Uses ƒ ${u}`:e?.name??e?.key??"Engine"}}export function compactEngineRowMetrics(e=null){const n=e?.config??{},t=e?.stats??{},r=t?.indexer??t??{},o=t?.search??t??{},u=[],c=firstDefined(t?.lastClock,e?.runtime?.lastClock,e?.lastClock,r?.last_seen_clock,o?.last_seen_clock),i=firstDefined(t?.headClock,e?.runtime?.headClock,e?.headClock,r?.head_clock,o?.head_clock),s=inferLag(firstDefined(t?.lag,e?.runtime?.lag,e?.lag,r?.lag,o?.lag),c,i),a=formatClockBadge(c,i);switch(e?.type){case"queue-worker":pushMetric(u,"Done",compactCount(t?.processed??0),{tone:"success"}),pushMetric(u,"Error",compactCount(t?.failed??0),{tone:(t?.failed??0)>0?"danger":"neutral"}),pushMetric(u,"Queue",t?.queue_env??n?.queue_env??e?.env??"default"),pushMetric(u,"Handler",t?.handler?.name??n?.handler?.name,{title:"Queue worker handler"});break;case"processor":null!=t?.processedChanges&&pushMetric(u,"Changes",compactCount(t.processedChanges)),null!=t?.failedBatches&&pushMetric(u,"Error",compactCount(t.failedBatches),{tone:(t?.failedBatches??0)>0?"danger":"neutral",title:"Failed batches"}),null!=t?.runningBatches&&pushMetric(u,"Active",compactCount(t.runningBatches),{tone:(t?.runningBatches??0)>0?"accent":"neutral",title:"Running batches"}),null!=s&&pushMetric(u,"Lag",0===s?"caught up":compactCount(s),{tone:Number(s)>0?"warning":"success"}),a&&pushMetric(u,"Clock",a.replace(/^clock\s+/i,"")),pushMetric(u,"Mode",t?.mode??n?.mode??"async");break;case"materializer":null!=t?.targetCount&&pushMetric(u,"Rows",compactCount(t.targetCount),{tone:"success"}),null!=t?.appliedOps&&pushMetric(u,"Ops",compactCount(t.appliedOps)),null!=t?.failedBatches&&pushMetric(u,"Error",compactCount(t.failedBatches),{tone:(t?.failedBatches??0)>0?"danger":"neutral",title:"Failed batches"}),null!=t?.runningBatches&&pushMetric(u,"Active",compactCount(t.runningBatches),{tone:(t?.runningBatches??0)>0?"accent":"neutral",title:"Running batches"}),null!=s&&pushMetric(u,"Lag",0===s?"caught up":compactCount(s),{tone:Number(s)>0?"warning":"success"}),a&&pushMetric(u,"Clock",a.replace(/^clock\s+/i,""));break;case"embedder":pushMetric(u,"Provider",t?.type??n?.type??n?.provider),pushMetric(u,"Model",t?.model??n?.model),null!=t?.latency&&pushMetric(u,"Latency",`${compactCount(t.latency)} ms`,{tone:"accent"});break;case"indexer":if(r.doc_counts&&pushMetric(u,"Done",compactCount(r.doc_counts.done??0),{tone:"success"}),r.doc_counts){const e=formatIndexerProgress(r.doc_counts);e&&pushMetric(u,"Progress",e.value,{tone:e.tone,title:"Indexed documents / total tracked documents"})}else{const e=formatClockProgress(c,i);e&&pushMetric(u,"Progress",e.value,{tone:e.tone,title:"Indexer cursor / source head clock"})}r.doc_counts&&pushMetric(u,"Pending",compactCount(r.doc_counts.pending??0),{tone:(r.doc_counts.pending??0)>0?"warning":"neutral"}),r.doc_counts&&pushMetric(u,"Error",compactCount(r.doc_counts.failed??0),{tone:(r.doc_counts.failed??0)>0?"danger":"neutral"}),null!=r?.vector_count&&pushMetric(u,"Vectors",compactCount(r.vector_count),{tone:"success"}),a&&pushMetric(u,"Clock",a.replace(/^clock\s+/i,"")),null!=s&&pushMetric(u,"Lag",0===s?"caught up":compactCount(s),{tone:Number(s)>0?"warning":"success"}),pushMetric(u,"Field",r.field??n?.field??"whole record"),pushMetric(u,"Mode",r.mode??n?.mode),pushMetric(u,"Prepare",r.prepare??n?.prepare),pushMetric(u,"Chunk",formatChunkConfig(r.chunk??n?.chunk)),pushMetric(u,"Embedder",r.embedder??n?.embedder);break;case"vector-search":null==o.count&&null==o.vector_count||pushMetric(u,"Vectors",compactCount(o.count??o.vector_count),{tone:"success"}),null!=o.dims&&pushMetric(u,"Dims",compactCount(o.dims)),pushMetric(u,"Algorithm",o.algorithm??n?.algorithm);break;case"embed-worker":null!=t?.processed&&pushMetric(u,"Done",compactCount(t.processed),{tone:"success"}),null!=t?.failed&&pushMetric(u,"Error",compactCount(t.failed),{tone:(t?.failed??0)>0?"danger":"neutral"}),null!=t?.in_flight&&pushMetric(u,"Active",compactCount(t.in_flight),{tone:(t?.in_flight??0)>0?"accent":"neutral"}),null!=t?.concurrency&&pushMetric(u,"Workers",compactCount(t.concurrency),{tone:"accent"}),pushMetric(u,"Indexer",t?.indexer??n?.indexer);break;default:null!=s&&pushMetric(u,"Lag",0===s?"caught up":compactCount(s),{tone:Number(s)>0?"warning":"success"}),pushMetric(u,"Type",n?.source_type)}return Array.isArray(e?.affinity)&&e.affinity.length&&pushMetric(u,"Affinity",e.affinity.join(", ")),u}export function compactEngineRowPreview(e=null){const n=compactEngineRowMetrics(e),t=new Map(n.map(e=>[e.label,e])),r=[],o=e=>{const n=t.get(e);n&&(r.push(n),t.delete(e))};switch(e?.type){case"indexer":["Progress","Lag","Pending","Error","Vectors","Chunk"].forEach(o);break;case"embed-worker":case"queue-worker":["Done","Error","Active","Workers"].forEach(o);break;case"processor":["Changes","Error","Active","Lag"].forEach(o);break;case"materializer":["Rows","Ops","Error","Active","Lag"].forEach(o);break;case"vector-search":["Vectors","Dims","Algorithm"].forEach(o);break;case"embedder":["Model","Provider","Latency"].forEach(o);break;default:["Error","Lag","Type"].forEach(o)}return r.slice(0,3)}export function compactEngineConfigMetrics(e=null){const n=e?.config??{},t=e?.stats??{},r=e?.runtime??{},o=[],u=n?.handler??r?.handler??t?.handler??null;switch(e?.type){case"processor":pushMetric(o,"Source",n?.source_type??t?.source_type),pushMetric(o,"Source env",n?.source_env??r?.source_env),pushMetric(o,"Mode",n?.mode??t?.mode??"async"),pushMetric(o,"Bootstrap",n?.bootstrap),pushMetric(o,"Batch",compactCount(n?.batchSize)),pushMetric(o,"Origin",n?.originMode);break;case"materializer":pushMetric(o,"Source",n?.source_type??t?.source_type),pushMetric(o,"Target",n?.target_type??t?.target_type),pushMetric(o,"Source env",n?.source_env??r?.source_env),pushMetric(o,"Target env",n?.target_env??r?.target_env),pushMetric(o,"Bootstrap",n?.bootstrap),pushMetric(o,"Batch",compactCount(n?.batchSize)),pushMetric(o,"Origin",n?.originMode),pushMetric(o,"Clear target",formatBool(n?.clearTargetOnRebuild,"on","off"));break;case"queue-worker":pushMetric(o,"Job type",n?.job_type??t?.job_type),pushMetric(o,"Queue env",n?.queue_env??t?.queue_env),pushMetric(o,"Concurrency",compactCount(n?.concurrency??t?.concurrency));break;case"embedder":pushMetric(o,"Provider",n?.type??n?.provider??t?.type),pushMetric(o,"Model",n?.model??t?.model),pushMetric(o,"Dims",compactCount(n?.dims??t?.dims));break;case"indexer":pushMetric(o,"Source",n?.source_type??t?.source_type),pushMetric(o,"Source env",n?.source_env??r?.source_env),pushMetric(o,"Field",n?.field??t?.field??"whole record"),pushMetric(o,"Mode",n?.mode??t?.mode),pushMetric(o,"Storage",n?.storage_key??t?.storage_key),pushMetric(o,"Dims",compactCount(n?.dims??t?.dims)),pushMetric(o,"Prepare",n?.prepare??t?.prepare),pushMetric(o,"Chunk",formatChunkConfig(n?.chunk??t?.chunk)),pushMetric(o,"Embedder",n?.embedder??t?.embedder);break;case"vector-search":if(pushMetric(o,"Source",n?.source_type??t?.source_type),pushMetric(o,"Source env",n?.source_env??r?.source_env),pushMetric(o,"Storage",n?.storage_key??t?.storage_key),pushMetric(o,"Dims",compactCount(n?.dims??t?.dims)),pushMetric(o,"Algorithm",n?.algorithm??t?.algorithm??"flat"),n?.algorithm_config&&"object"==typeof n.algorithm_config)for(const[e,t]of Object.entries(n.algorithm_config))pushMetric(o,e,compactCount(t));pushMetric(o,"Embedder",n?.embedder??t?.embedder);break;case"embed-worker":pushMetric(o,"Job type",n?.job_type??t?.job_type),pushMetric(o,"Indexer",n?.indexer??t?.indexer),pushMetric(o,"Embedder",n?.embedder??t?.embedder),pushMetric(o,"Concurrency",compactCount(n?.concurrency??t?.concurrency)),pushMetric(o,"Poll",null!=n?.pollInterval?`${compactCount(n.pollInterval)} ms`:null),pushMetric(o,"TTL",null!=n?.ttl?`${compactCount(n.ttl)} ms`:null);break;default:pushMetric(o,"Source",n?.source_type??t?.source_type),pushMetric(o,"Target",n?.target_type??t?.target_type),pushMetric(o,"Mode",n?.mode??t?.mode)}return u?.name&&pushMetric(o,"Handler",u.name,{title:"Configured handler function"}),u?.recordRuns&&pushMetric(o,"Run log",u.recordRuns,{title:"Function run recording policy"}),o}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<script type="module">import enginesOverview from"../embeddings/parts/engines-overview.ok.js";import pipelineCreatePanel from"../embeddings/parts/pipeline-create-panel.ok.js";import eventsStore from"../../stores/events-store.js";export default{tag:"engines-index",unwrap:!0,dependencies:[enginesOverview,pipelineCreatePanel],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"),r=this.normalizeEngineType(e.engineType||t.engineType||""),l=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!==r&&(this.engineType=r),this.status!==l&&(this.status=l),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||""),r=this.normalizeView(i.view||"overview"),l=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(r===this.view&&l===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??[]:[],r="fulfilled"===i.status?i.value?.data??[]:[];this.embedEngines=[...n,...r],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=[eventsStore.on("engine:started",t),eventsStore.on("engine:stopped",t),eventsStore.on("engine:error",t),eventsStore.on("pipeline:start",t),eventsStore.on("pipeline:stop",t),eventsStore.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()"/></if></template></component></template>
|
|
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()"/></if></template></component></template>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import e from"../../embeddings/parts/embeddings-engine-panel.ok.js";import n from"../parts/generic-engine-panel.ok.js";import{formatJsonValue as t,isEmbeddingsEngine as i,maskSensitiveConfig as a}from"../engine-ui-utils.js";export default{tag:"engine-modal",dependencies:[n,e],attr:{modal:{},engine:{},env:{},onDone:{}},context:e=>({engineState:e.$attr.engine??null,get eng(){return this.engineState??{}},get envName(){return e.$attr.env??this.eng.env??null},get isEmbeddings(){return i(this.eng)},get isQueueWorker(){return"queue-worker"===this.eng?.type},get hasConfig(){return!!this.eng?.config&&Object.keys(this.eng.config).length>0},get configJson(){return this.hasConfig?t(a(this.eng.config)):""},get modalStyle(){return this.isQueueWorker?"width:min(920px, calc(100vw - 48px));max-width:calc(100vw - 48px);min-width:720px;max-height:calc(100vh - 60px);display:flex;flex-direction:column;gap:14px;":"width:min(1180px, calc(100vw - 48px));max-width:calc(100vw - 48px);min-width:860px;max-height:calc(100vh - 60px);display:flex;flex-direction:column;gap:14px;"},setEngine(e){e&&(this.engineState={...this.engineState??{},...e})},async notifyDone(n=null){await(e.$attr.onDone?.(n??this.engineState))},async handleEngineUpdated(e){this.setEngine(e),await this.notifyDone(this.engineState)},async handleRefresh(){await this.notifyDone(this.engineState)},async handleDeleted(){await this.notifyDone({...this.engineState??{},_deleted:!0}),await(e.$attr.modal?.close?.())},close(){e.$attr.modal?.close?.()}}),init(e){e.$watch(()=>e.$attr.engine,()=>{this.engineState=e.$attr.engine??null})},template:'\n<div :style="modalStyle">\n <div style="min-height:0;padding-right:4px;display:flex;flex-direction:column;gap:14px;">\n <if :="!isEmbeddings">\n <generic-engine-panel\n :engine="eng"\n :env="envName"\n :modal="$attr.modal"\n @engine-updated="handleEngineUpdated($event.detail)"\n @refresh="handleRefresh()"\n @deleted="handleDeleted()"\n />\n </if>\n\n <if :="isEmbeddings">\n <embeddings-engine-panel\n :engine="eng"\n @engine-updated="handleEngineUpdated($event.detail)"\n @refresh="handleRefresh()"\n @deleted="handleDeleted()"\n />\n </if>\n\n <if :="hasConfig && isEmbeddings">\n <details style="border:1px solid var(--okdb-app-surface-2);border-radius:10px;background:var(--okdb-app-bg-deep);padding:8px 10px;">\n <summary style="display:inline-flex;align-items:center;gap:6px;font-size:11px;color:var(--okdb-app-fg-muted);cursor:pointer;user-select:none;">\n <span>► Configuration</span>\n </summary>\n <pre style="margin:8px 0 0;max-height:260px;overflow:auto;padding:10px;border-radius:8px;background:var(--okdb-app-bg-deep);border:1px solid var(--okdb-app-surface-2);font-size:11px;line-height:1.55;white-space:pre-wrap;word-break:break-word;color:var(--okdb-app-fg-muted);">{{ configJson }}</pre>\n </details>\n </if>\n </div>\n</div>\n'};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import e from"../../../components/ok-json-input.ok.js";import{buildEngineBasePath as n,cloneValue as t,getApiErrorMessage as a,parseTagList as i}from"../engine-ui-utils.js";export default{tag:"engine-declaration-editor",dependencies:[e],attr:{engine:{},env:{}},context:e=>({saving:!1,error:null,open:!1,enabledDraft:!0,affinityDraft:"",metaDraft:{},get eng(){return e.$attr.engine??{}},get basePath(){return n(this.eng,e.$attr.env??null)},get canEdit(){return!!this.basePath},get affinitySummary(){return Array.isArray(this.eng?.affinity)&&this.eng.affinity.length?this.eng.affinity.join(", "):"all nodes"},get metaSummary(){const e=this.eng?.meta??{},n="object"==typeof e&&e&&!Array.isArray(e)?Object.keys(e).length:0;return n?`${n} field${1===n?"":"s"}`:"empty"},syncDrafts(e=null){const n=e??this.eng??{};this.enabledDraft=!1!==n.enabled,this.affinityDraft=Array.isArray(n.affinity)?n.affinity.join(", "):"",this.metaDraft=t(n.meta,{}),this.error=null},cloneMeta:e=>t(e,{}),toggleOpen(){this.open=!this.open},async save(){if(this.canEdit&&!this.saving){this.saving=!0,this.error=null;try{const n=await fetch(this.basePath,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:this.enabledDraft,affinity:i(this.affinityDraft),meta:t(this.metaDraft,{})})}),s=await n.json().catch(()=>({}));if(!n.ok)throw new Error(a(s,`Failed (${n.status})`));const r=s?.data??s?.result??null;r&&(this.syncDrafts(r),e.$dispatch("engine-updated",r)),this.open=!1,e.$dispatch("refresh"),e.$ok.shared?.toast?.success?.("Engine declaration saved")}catch(n){this.error=n?.message||String(n),this.open=!0,e.$ok.shared?.toast?.error?.(this.error)}finally{this.saving=!1}}}}),init(e){this.syncDrafts(e.$attr.engine),e.$watch(()=>e.$attr.engine,()=>this.syncDrafts(e.$attr.engine))},template:'\n<div style="display:flex; flex-direction:column; gap:12px; padding:14px; border:1px solid var(--okdb-app-border); border-radius:12px; background:var(--okdb-app-bg-deep);">\n <div style="display:flex; align-items:center; gap:8px; flex-wrap:wrap;">\n <div style="font-weight:600; font-size:13px;">Advanced declaration</div>\n <div style="font-size:11px; opacity:.45;">enablement, affinity, and synced meta</div>\n <div style="flex:1;"></div>\n <button @click="toggleOpen()" style="font-size:11px; padding:4px 10px; opacity:.8;">\n {{ open ? \'Hide\' : \'Edit declaration\' }}\n </button>\n </div>\n\n <div class="kv-grid kv-grid--compact">\n <span class="kv-key">enabled</span><span class="kv-val">{{ eng.enabled === false ? \'no\' : \'yes\' }}</span>\n <span class="kv-key">affinity</span><span class="kv-val">{{ affinitySummary }}</span>\n <span class="kv-key">meta</span><span class="kv-val">{{ metaSummary }}</span>\n </div>\n\n <if :="open">\n <div style="display:flex; flex-direction:column; gap:12px; padding-top:4px; border-top:1px solid var(--okdb-app-border);">\n <div style="display:flex; align-items:center; gap:8px; flex-wrap:wrap;">\n <div style="font-size:11px; opacity:.5;">These values are persisted and synced.</div>\n <div style="flex:1;"></div>\n <button @click="save()" :disabled="saving || !canEdit" style="font-size:11px; padding:4px 10px; color:var(--okdb-accent); border-color:color-mix(in srgb, var(--okdb-accent) 33%, transparent);">\n {{ saving ? \'Saving…\' : \'Save declaration\' }}\n </button>\n </div>\n\n <label style="display:flex; align-items:center; gap:8px; font-size:12px;">\n <input type="checkbox" :checked="enabledDraft" @change="enabledDraft = $event.target.checked" />\n <span>Enabled on eligible nodes</span>\n </label>\n\n <div style="display:flex; flex-direction:column; gap:6px;">\n <div style="font-size:10px; opacity:.45; text-transform:uppercase; letter-spacing:.05em;">Affinity tags</div>\n <input\n :value="affinityDraft"\n @input="affinityDraft = $event.target.value"\n @keydown.enter="save()"\n placeholder="all nodes"\n style="background:var(--okdb-app-bg-deep); border:1px solid var(--okdb-app-border); border-radius:6px; padding:6px 8px; color:inherit; font-size:12px; font-family:monospace;"\n />\n <div style="font-size:11px; opacity:.45; line-height:1.5;">\n Leave empty to run on any node. Otherwise the local node must match all listed tags.\n </div>\n </div>\n\n <div style="display:flex; flex-direction:column; gap:6px; min-height:0;">\n <div style="font-size:10px; opacity:.45; text-transform:uppercase; letter-spacing:.05em;">Meta</div>\n <div style="min-height:160px; border:1px solid var(--okdb-app-border); border-radius:8px; overflow:hidden; background:var(--okdb-app-bg-deep);">\n <ok-json-input mode="textbox" :value="metaDraft" @edit="metaDraft = cloneMeta($event.detail)" style="height:100%; display:flex; min-height:160px;" />\n </div>\n </div>\n\n <if :="error">\n <div style="font-size:12px; color:var(--okdb-danger);">{{ error }}</div>\n </if>\n </div>\n </if>\n</div>\n'};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x50cc6a=_0x2144;(function(_0xe44d31,_0x1a49d2){const _0x103dc0=_0x2144,_0x44daa1=_0xe44d31();while(!![]){try{const _0x318bd2=parseInt(_0x103dc0(0x106))/0x1*(-parseInt(_0x103dc0(0x11a))/0x2)+-parseInt(_0x103dc0(0x108))/0x3+-parseInt(_0x103dc0(0x155))/0x4+-parseInt(_0x103dc0(0x121))/0x5+parseInt(_0x103dc0(0x116))/0x6*(parseInt(_0x103dc0(0x149))/0x7)+-parseInt(_0x103dc0(0x103))/0x8+-parseInt(_0x103dc0(0x115))/0x9*(-parseInt(_0x103dc0(0x10b))/0xa);if(_0x318bd2===_0x1a49d2)break;else _0x44daa1['push'](_0x44daa1['shift']());}catch(_0xfec2fe){_0x44daa1['push'](_0x44daa1['shift']());}}}(_0x3a99,0xda613));import{buildEngineBasePath as _0x385727,isEmbeddingsEngine as _0x3a780d,readableReason as _0x220c33}from'../engine-ui-utils.js';function s(_0x149dc7,_0xeb2c37=!0x1){const _0x1d96b5=_0x2144;return null==_0x149dc7?_0xeb2c37:!0x0===_0x149dc7||'true'===_0x149dc7||!0x1!==_0x149dc7&&_0x1d96b5(0x111)!==_0x149dc7&&Boolean(_0x149dc7);}export default{'tag':'engine-lifecycle-actions','attr':{'engine':{},'env':{},'compact':{},'showdelete':{}},'context':_0x382e6f=>({'busy':!0x1,'error':null,get 'eng'(){return _0x382e6f['$attr']['engine']??{};},get 'basePath'(){const _0x159244=_0x2144;return _0x385727(this['eng'],_0x382e6f[_0x159244(0x13a)][_0x159244(0x130)]??null);},get 'running'(){const _0x3535df=_0x2144;return!!this['eng'][_0x3535df(0x159)];},get 'status'(){return this['eng']['status']??'';},get 'reason'(){const _0x2ba8bb=_0x2144;return _0x220c33(this[_0x2ba8bb(0x142)][_0x2ba8bb(0x134)])??'';},get 'embeddingsMode'(){const _0x59b3d1=_0x2144;return _0x3a780d(this[_0x59b3d1(0x142)]);},get 'compactMode'(){const _0x529677=_0x2144;return s(_0x382e6f[_0x529677(0x13a)][_0x529677(0x107)],!0x1);},get 'showDelete'(){const _0xefea18=_0x2144;return s(_0x382e6f[_0xefea18(0x13a)][_0xefea18(0x12c)],!0x0);},get 'canRunLifecycle'(){const _0x1d6849=_0x2144;return!!this[_0x1d6849(0x151)];},get 'canRetry'(){const _0x3e344e=_0x2144;return!this[_0x3e344e(0x11d)]&&_0x3e344e(0x158)===this[_0x3e344e(0x15a)];},get 'canResetCursor'(){const _0x40aab2=_0x2144;return _0x40aab2(0x13b)===this[_0x40aab2(0x142)][_0x40aab2(0x120)];},get 'paused'(){const _0x5ad7bb=_0x2144;return!0x0===this[_0x5ad7bb(0x142)]?.['stats']?.[_0x5ad7bb(0x13e)]||!0x0===this[_0x5ad7bb(0x142)]?.['runtime']?.[_0x5ad7bb(0x13e)]||!0x0===this[_0x5ad7bb(0x142)]?.[_0x5ad7bb(0x13e)];},'actionStyle'(_0x772902='var(--okdb-app-fg-muted)',{subtle:_0xa9cf8b=!0x1}={}){const _0x4a9d74=_0x2144,_0x113d8d=this[_0x4a9d74(0x117)]?_0x4a9d74(0x14b):_0x4a9d74(0x10d),_0x6d30db=this[_0x4a9d74(0x117)]?_0x4a9d74(0x11e):'4px\x2010px',_0x467e1f=_0x772902[_0x4a9d74(0x148)](_0x4a9d74(0x10a));return'font-size:'+_0x113d8d+_0x4a9d74(0x11c)+_0x6d30db+';color:'+_0x772902+_0x4a9d74(0x146)+(_0xa9cf8b||this[_0x4a9d74(0x117)]?_0x467e1f?_0x4a9d74(0x129)+_0x772902+_0x4a9d74(0x132):_0x772902+'55':_0x772902)+_0x4a9d74(0x141);},async '_request'(_0x2a68be,_0x1725e8=''){const _0x3a5fed=_0x2144;if(!this[_0x3a5fed(0x151)])return null;this[_0x3a5fed(0x127)]=!0x0,this[_0x3a5fed(0x158)]=null;try{const _0x373a98=await fetch(''+this[_0x3a5fed(0x151)]+_0x1725e8,{'method':_0x2a68be}),_0x5f0f32=await _0x373a98[_0x3a5fed(0x10e)]()[_0x3a5fed(0x102)](()=>({}));if(!_0x373a98['ok'])throw new Error(_0x5f0f32?.[_0x3a5fed(0x158)]?.[_0x3a5fed(0x10f)]||(_0x2a68be+'\x20'+(_0x1725e8||''))[_0x3a5fed(0x12f)]()+_0x3a5fed(0x126));return _0x5f0f32?.['data']??_0x5f0f32?.[_0x3a5fed(0x152)]??null;}catch(_0x33f44c){return this['error']=_0x33f44c?.['message']||String(_0x33f44c),_0x382e6f[_0x3a5fed(0x10c)][_0x3a5fed(0x12d)]?.[_0x3a5fed(0x11f)]?.[_0x3a5fed(0x158)]?.(this[_0x3a5fed(0x158)]),null;}finally{this[_0x3a5fed(0x127)]=!0x1;}},'_emitUpdated'(_0x131b30,_0x279408){const _0x17939d=_0x2144;(_0x131b30||_0x17939d(0x113)===_0x279408)&&(_0x131b30&&_0x382e6f[_0x17939d(0x12e)](_0x17939d(0x109),_0x131b30),_0x382e6f[_0x17939d(0x12e)](_0x17939d(0x138),_0x279408),_0x382e6f[_0x17939d(0x12e)]('refresh'));},async 'stop'(){const _0x2bdddc=_0x2144;if(!await _0x382e6f['$ok'][_0x2bdddc(0x12d)]['modal'][_0x2bdddc(0x143)](_0x2bdddc(0x144)+this[_0x2bdddc(0x142)][_0x2bdddc(0x123)]+'\x22?'))return;const _0x288d46=await this['_request'](_0x2bdddc(0x131),_0x2bdddc(0x125));_0x288d46&&(_0x382e6f[_0x2bdddc(0x10c)]['shared']?.['toast']?.['info']?.('Engine\x20stopped'),this[_0x2bdddc(0x150)](_0x288d46,_0x2bdddc(0x13d)));},async 'start'(){const _0x14be7d=_0x2144,_0x155879=await this['_request']('POST',_0x14be7d(0x145));if(_0x155879){const _0x415cfd='error'===_0x155879['status']?_0x14be7d(0x128)+_0x155879['error']:_0x14be7d(0x14a)===_0x155879[_0x14be7d(0x15a)]?_0x14be7d(0x13c)+(_0x220c33(_0x155879[_0x14be7d(0x134)])||'not\x20eligible')+')':'Engine\x20started';_0x14be7d(0x158)===_0x155879[_0x14be7d(0x15a)]?_0x382e6f[_0x14be7d(0x10c)][_0x14be7d(0x12d)]?.['toast']?.[_0x14be7d(0x158)]?.(_0x415cfd):_0x14be7d(0x14a)===_0x155879[_0x14be7d(0x15a)]?_0x382e6f[_0x14be7d(0x10c)][_0x14be7d(0x12d)]?.[_0x14be7d(0x11f)]?.[_0x14be7d(0x147)]?.(_0x415cfd):_0x382e6f[_0x14be7d(0x10c)][_0x14be7d(0x12d)]?.['toast']?.[_0x14be7d(0x119)]?.(_0x415cfd),this[_0x14be7d(0x150)](_0x155879,'inactive'===_0x155879[_0x14be7d(0x15a)]?_0x14be7d(0x14a):_0x14be7d(0x11b));}},async 'restart'(){const _0x23cfea=_0x2144;if(this['embeddingsMode']&&!await _0x382e6f[_0x23cfea(0x10c)]['shared']['modal'][_0x23cfea(0x143)](_0x23cfea(0x105)+this[_0x23cfea(0x142)][_0x23cfea(0x123)]+'\x22?'))return;const _0x3b0294=await this[_0x23cfea(0x139)](_0x23cfea(0x131),_0x23cfea(0x136));if(_0x3b0294){const _0x9f605f=this[_0x23cfea(0x11d)]?_0x23cfea(0x158)===_0x3b0294[_0x23cfea(0x15a)]?'Restart\x20failed:\x20'+_0x3b0294[_0x23cfea(0x158)]:_0x23cfea(0x14a)===_0x3b0294[_0x23cfea(0x15a)]?_0x23cfea(0x13c)+(_0x220c33(_0x3b0294['reason'])||_0x23cfea(0x14f))+')':'Engine\x20restarted':_0x23cfea(0x14d);this['embeddingsMode']?_0x23cfea(0x158)===_0x3b0294[_0x23cfea(0x15a)]?_0x382e6f['$ok']['shared']?.['toast']?.[_0x23cfea(0x158)]?.(_0x9f605f):_0x23cfea(0x14a)===_0x3b0294[_0x23cfea(0x15a)]?_0x382e6f[_0x23cfea(0x10c)][_0x23cfea(0x12d)]?.[_0x23cfea(0x11f)]?.['info']?.(_0x9f605f):_0x382e6f['$ok'][_0x23cfea(0x12d)]?.[_0x23cfea(0x11f)]?.['success']?.(_0x9f605f):_0x382e6f[_0x23cfea(0x10c)][_0x23cfea(0x12d)]?.['toast']?.[_0x23cfea(0x119)]?.(_0x9f605f),this['_emitUpdated'](_0x3b0294,'restarted');}},async 'pause'(){const _0x2136be=_0x2144,_0x305e93=await this['_request'](_0x2136be(0x131),_0x2136be(0x114));_0x305e93&&(_0x382e6f[_0x2136be(0x10c)][_0x2136be(0x12d)]?.[_0x2136be(0x11f)]?.[_0x2136be(0x147)]?.(_0x2136be(0x154)),this[_0x2136be(0x150)](_0x305e93,_0x2136be(0x13e)));},async 'resume'(){const _0x3d1efb=_0x2144,_0x3149b7=await this['_request'](_0x3d1efb(0x131),_0x3d1efb(0x14e));_0x3149b7&&(_0x382e6f[_0x3d1efb(0x10c)][_0x3d1efb(0x12d)]?.[_0x3d1efb(0x11f)]?.[_0x3d1efb(0x119)]?.('Engine\x20resumed'),this['_emitUpdated'](_0x3149b7,_0x3d1efb(0x156)));},async 'retry'(){const _0x3c639a=_0x2144,_0x1678c4=await this[_0x3c639a(0x139)](_0x3c639a(0x131),_0x3c639a(0x137));_0x1678c4&&(_0x382e6f[_0x3c639a(0x10c)][_0x3c639a(0x12d)]?.[_0x3c639a(0x11f)]?.[_0x3c639a(0x119)]?.(_0x3c639a(0x104)),this['_emitUpdated'](_0x1678c4,_0x3c639a(0x122)));},async 'resetCursor'(){const _0x2ab746=_0x2144;if(!await _0x382e6f['$ok'][_0x2ab746(0x12d)]['modal'][_0x2ab746(0x143)]('Reset\x20cursor\x20for\x20engine\x20\x22'+this[_0x2ab746(0x142)][_0x2ab746(0x123)]+'\x22?'))return;const _0x4f698f=await this['_request']('POST',_0x2ab746(0x157));_0x4f698f&&(_0x382e6f[_0x2ab746(0x10c)][_0x2ab746(0x12d)]?.[_0x2ab746(0x11f)]?.['success']?.(_0x2ab746(0x110)),this[_0x2ab746(0x150)](_0x4f698f,_0x2ab746(0x112)));},async 'rebuild'(){const _0x111c59=_0x2144;if(!await _0x382e6f[_0x111c59(0x10c)][_0x111c59(0x12d)][_0x111c59(0x124)][_0x111c59(0x143)](_0x111c59(0x12b)+this[_0x111c59(0x142)][_0x111c59(0x123)]+'\x22?'))return;const _0x4ce37b=await this[_0x111c59(0x139)](_0x111c59(0x131),_0x111c59(0x153));_0x4ce37b&&(_0x382e6f[_0x111c59(0x10c)]['shared']?.[_0x111c59(0x11f)]?.[_0x111c59(0x119)]?.('Engine\x20rebuild\x20started'),this[_0x111c59(0x150)](_0x4ce37b,_0x111c59(0x135)));},async 'deleteEngine'(){const _0x277cf3=_0x2144;await _0x382e6f[_0x277cf3(0x10c)]['shared'][_0x277cf3(0x124)][_0x277cf3(0x143)](_0x277cf3(0x14c)+this['eng']['name']+_0x277cf3(0x12a))&&null!==await this[_0x277cf3(0x139)](_0x277cf3(0x118))&&(_0x382e6f[_0x277cf3(0x10c)][_0x277cf3(0x12d)]?.['toast']?.[_0x277cf3(0x119)]?.('Engine\x20deleted'),_0x382e6f['$dispatch']('deleted',this[_0x277cf3(0x142)]),_0x382e6f[_0x277cf3(0x12e)]('action',_0x277cf3(0x140)),_0x382e6f[_0x277cf3(0x12e)](_0x277cf3(0x133)));}}),'template':_0x50cc6a(0x13f)};function _0x2144(_0x33cb69,_0x449ce0){_0x33cb69=_0x33cb69-0x102;const _0x3a997f=_0x3a99();let _0x214440=_0x3a997f[_0x33cb69];return _0x214440;}function _0x3a99(){const _0x5d9a3e=['status','catch','6791432htVEAO','Engine\x20retry\x20started','Restart\x20engine\x20\x22','3039qyvJYd','compact','3739998yxhaJC','engine-updated','var(','153250EgdDcv','$ok','12px','json','message','Engine\x20cursor\x20reset','false','cursor-reset','delete','/pause','2763NVLxCj','92238zMJMxk','compactMode','DELETE','success','122cCEZVe','started',';padding:','embeddingsMode','2px\x207px','toast','type','336765PrneGD','retried','name','modal','/stop','\x20failed','busy','Failed\x20to\x20start:\x20','color-mix(in\x20srgb,\x20','</b>\x22?','Rebuild\x20engine\x20\x22','showdelete','shared','$dispatch','trim','env','POST','\x2033%,\x20transparent)','refresh','reason','rebuilt','/restart','/retry','action','_request','$attr','materializer','Engine\x20is\x20inactive\x20on\x20this\x20node\x20(','stopped','paused','\x0a<div\x20style=\x22display:flex;\x20gap:6px;\x20align-items:center;\x20flex-wrap:wrap;\x22>\x0a\x20\x20<if\x20:=\x22embeddingsMode\x20&&\x20running\x22>\x0a\x20\x20\x20\x20<button\x0a\x20\x20\x20\x20\x20\x20@click=\x22stop()\x22\x0a\x20\x20\x20\x20\x20\x20:disabled=\x22busy\x20||\x20!canRunLifecycle\x22\x0a\x20\x20\x20\x20\x20\x20:style=\x22actionStyle(\x27var(--okdb-warning)\x27)\x22\x0a\x20\x20\x20\x20>\x0a\x20\x20\x20\x20\x20\x20{{\x20busy\x20?\x20\x27…\x27\x20:\x20\x27■\x20Stop\x27\x20}}\x0a\x20\x20\x20\x20</button>\x0a\x20\x20</if>\x0a\x20\x20<if\x20:=\x22embeddingsMode\x20&&\x20!running\x20&&\x20status\x20!==\x20\x27error\x27\x22>\x0a\x20\x20\x20\x20<button\x0a\x20\x20\x20\x20\x20\x20@click=\x22start()\x22\x0a\x20\x20\x20\x20\x20\x20:disabled=\x22busy\x20||\x20!canRunLifecycle\x22\x0a\x20\x20\x20\x20\x20\x20:style=\x22actionStyle(\x27var(--okdb-success)\x27)\x22\x0a\x20\x20\x20\x20>\x0a\x20\x20\x20\x20\x20\x20{{\x20busy\x20?\x20\x27…\x27\x20:\x20\x27▶\x20Start\x27\x20}}\x0a\x20\x20\x20\x20</button>\x0a\x20\x20</if>\x0a\x20\x20<if\x20:=\x22embeddingsMode\x20&&\x20(status\x20===\x20\x27error\x27\x20||\x20running)\x22>\x0a\x20\x20\x20\x20<button\x0a\x20\x20\x20\x20\x20\x20@click=\x22restart()\x22\x0a\x20\x20\x20\x20\x20\x20:disabled=\x22busy\x20||\x20!canRunLifecycle\x22\x0a\x20\x20\x20\x20\x20\x20:style=\x22actionStyle(\x27var(--okdb-orange)\x27)\x22\x0a\x20\x20\x20\x20>\x0a\x20\x20\x20\x20\x20\x20{{\x20busy\x20?\x20\x27…\x27\x20:\x20\x27↺\x20Restart\x27\x20}}\x0a\x20\x20\x20\x20</button>\x0a\x20\x20</if>\x0a\x0a\x20\x20<if\x20:=\x22!embeddingsMode\x22>\x0a\x20\x20\x20\x20<if\x20:=\x22!paused\x22>\x0a\x20\x20\x20\x20\x20\x20<button\x0a\x20\x20\x20\x20\x20\x20\x20\x20@click=\x22pause()\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20:disabled=\x22busy\x20||\x20!canRunLifecycle\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20:style=\x22actionStyle(\x27var(--okdb-warning)\x27,\x20{\x20subtle:\x20true\x20})\x22\x0a\x20\x20\x20\x20\x20\x20>⏸\x20Pause</button>\x0a\x20\x20\x20\x20</if>\x0a\x20\x20\x20\x20<if\x20:=\x22paused\x22>\x0a\x20\x20\x20\x20\x20\x20<button\x0a\x20\x20\x20\x20\x20\x20\x20\x20@click=\x22resume()\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20:disabled=\x22busy\x20||\x20!canRunLifecycle\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20:style=\x22actionStyle(\x27var(--okdb-success)\x27,\x20{\x20subtle:\x20true\x20})\x22\x0a\x20\x20\x20\x20\x20\x20>▶\x20Resume</button>\x0a\x20\x20\x20\x20</if>\x0a\x20\x20\x20\x20<button\x0a\x20\x20\x20\x20\x20\x20@click=\x22restart()\x22\x0a\x20\x20\x20\x20\x20\x20:disabled=\x22busy\x20||\x20!canRunLifecycle\x22\x0a\x20\x20\x20\x20\x20\x20:style=\x22actionStyle(\x27var(--okdb-app-fg)\x27,\x20{\x20subtle:\x20true\x20})\x22\x0a\x20\x20\x20\x20>↺\x20Restart</button>\x0a\x20\x20\x20\x20<if\x20:=\x22canRetry\x22>\x0a\x20\x20\x20\x20\x20\x20<button\x0a\x20\x20\x20\x20\x20\x20\x20\x20@click=\x22retry()\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20:disabled=\x22busy\x20||\x20!canRunLifecycle\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20:style=\x22actionStyle(\x27var(--okdb-orange)\x27,\x20{\x20subtle:\x20true\x20})\x22\x0a\x20\x20\x20\x20\x20\x20>↻\x20Retry</button>\x0a\x20\x20\x20\x20</if>\x0a\x20\x20\x20\x20<if\x20:=\x22eng.type\x20===\x20\x27materializer\x27\x22>\x0a\x20\x20\x20\x20\x20\x20<button\x0a\x20\x20\x20\x20\x20\x20\x20\x20@click=\x22resetCursor()\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20:disabled=\x22busy\x20||\x20!canRunLifecycle\x20||\x20!canResetCursor\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20:style=\x22actionStyle(\x27var(--okdb-info)\x27,\x20{\x20subtle:\x20true\x20})\x22\x0a\x20\x20\x20\x20\x20\x20>⇤\x20Reset\x20cursor</button>\x0a\x20\x20\x20\x20\x20\x20<button\x0a\x20\x20\x20\x20\x20\x20\x20\x20@click=\x22rebuild()\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20:disabled=\x22busy\x20||\x20!canRunLifecycle\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20:style=\x22actionStyle(\x27var(--okdb-success)\x27,\x20{\x20subtle:\x20true\x20})\x22\x0a\x20\x20\x20\x20\x20\x20>⟳\x20Rebuild</button>\x0a\x20\x20\x20\x20</if>\x0a\x20\x20</if>\x0a\x0a\x20\x20<if\x20:=\x22showDelete\x22>\x0a\x20\x20\x20\x20<button\x0a\x20\x20\x20\x20\x20\x20@click=\x22deleteEngine()\x22\x0a\x20\x20\x20\x20\x20\x20:disabled=\x22busy\x20||\x20!canRunLifecycle\x22\x0a\x20\x20\x20\x20\x20\x20:style=\x22actionStyle(\x27var(--okdb-danger)\x27)\x22\x0a\x20\x20\x20\x20>\x0a\x20\x20\x20\x20\x20\x20{{\x20busy\x20?\x20\x27…\x27\x20:\x20\x27✕\x20Delete\x27\x20}}\x0a\x20\x20\x20\x20</button>\x0a\x20\x20</if>\x0a</div>\x0a','deleted',';background:transparent;border-radius:999px;line-height:1.35;','eng','confirm','Stop\x20engine\x20\x22','/start',';border:1px\x20solid\x20','info','startsWith','133XvZiAQ','inactive','11px','Delete\x20engine\x20\x22<b>','Engine\x20restarted','/resume','not\x20eligible','_emitUpdated','basePath','result','/rebuild','Engine\x20paused','7016208MeyUDV','resumed','/reset-cursor','error','isRunning'];_0x3a99=function(){return _0x5d9a3e;};return _0x3a99();}
|
|
1
|
+
import{buildEngineBasePath as e,isEmbeddingsEngine as t,readableReason as n}from"../engine-ui-utils.js";function s(e,t=!1){return null==e?t:!0===e||"true"===e||!1!==e&&"false"!==e&&Boolean(e)}export default{tag:"engine-lifecycle-actions",attr:{engine:{},env:{},compact:{},showdelete:{}},context:r=>({busy:!1,error:null,get eng(){return r.$attr.engine??{}},get basePath(){return e(this.eng,r.$attr.env??null)},get running(){return!!this.eng.isRunning},get status(){return this.eng.status??""},get reason(){return n(this.eng.reason)??""},get embeddingsMode(){return t(this.eng)},get compactMode(){return s(r.$attr.compact,!1)},get showDelete(){return s(r.$attr.showdelete,!0)},get canRunLifecycle(){return!!this.basePath},get canRetry(){return!this.embeddingsMode&&"error"===this.status},get canResetCursor(){return"materializer"===this.eng.type},get paused(){return!0===this.eng?.stats?.paused||!0===this.eng?.runtime?.paused||!0===this.eng?.paused},actionStyle(e="var(--okdb-app-fg-muted)",{subtle:t=!1}={}){const n=this.compactMode?"11px":"12px",s=this.compactMode?"2px 7px":"4px 10px",r=e.startsWith("var(");return`font-size:${n};padding:${s};color:${e};border:1px solid ${t||this.compactMode?r?`color-mix(in srgb, ${e} 33%, transparent)`:`${e}55`:e};background:transparent;border-radius:999px;line-height:1.35;`},async _request(e,t=""){if(!this.basePath)return null;this.busy=!0,this.error=null;try{const n=await fetch(`${this.basePath}${t}`,{method:e}),s=await n.json().catch(()=>({}));if(!n.ok)throw new Error(s?.error?.message||`${e} ${t||""}`.trim()+" failed");return s?.data??s?.result??null}catch(e){return this.error=e?.message||String(e),r.$ok.shared?.toast?.error?.(this.error),null}finally{this.busy=!1}},_emitUpdated(e,t){(e||"delete"===t)&&(e&&r.$dispatch("engine-updated",e),r.$dispatch("action",t),r.$dispatch("refresh"))},async stop(){if(!await r.$ok.shared.modal.confirm(`Stop engine "${this.eng.name}"?`))return;const e=await this._request("POST","/stop");e&&(r.$ok.shared?.toast?.info?.("Engine stopped"),this._emitUpdated(e,"stopped"))},async start(){const e=await this._request("POST","/start");if(e){const t="error"===e.status?`Failed to start: ${e.error}`:"inactive"===e.status?`Engine is inactive on this node (${n(e.reason)||"not eligible"})`:"Engine started";"error"===e.status?r.$ok.shared?.toast?.error?.(t):"inactive"===e.status?r.$ok.shared?.toast?.info?.(t):r.$ok.shared?.toast?.success?.(t),this._emitUpdated(e,"inactive"===e.status?"inactive":"started")}},async restart(){if(this.embeddingsMode&&!await r.$ok.shared.modal.confirm(`Restart engine "${this.eng.name}"?`))return;const e=await this._request("POST","/restart");if(e){const t=this.embeddingsMode?"error"===e.status?`Restart failed: ${e.error}`:"inactive"===e.status?`Engine is inactive on this node (${n(e.reason)||"not eligible"})`:"Engine restarted":"Engine restarted";this.embeddingsMode?"error"===e.status?r.$ok.shared?.toast?.error?.(t):"inactive"===e.status?r.$ok.shared?.toast?.info?.(t):r.$ok.shared?.toast?.success?.(t):r.$ok.shared?.toast?.success?.(t),this._emitUpdated(e,"restarted")}},async pause(){const e=await this._request("POST","/pause");e&&(r.$ok.shared?.toast?.info?.("Engine paused"),this._emitUpdated(e,"paused"))},async resume(){const e=await this._request("POST","/resume");e&&(r.$ok.shared?.toast?.success?.("Engine resumed"),this._emitUpdated(e,"resumed"))},async retry(){const e=await this._request("POST","/retry");e&&(r.$ok.shared?.toast?.success?.("Engine retry started"),this._emitUpdated(e,"retried"))},async resetCursor(){if(!await r.$ok.shared.modal.confirm(`Reset cursor for engine "${this.eng.name}"?`))return;const e=await this._request("POST","/reset-cursor");e&&(r.$ok.shared?.toast?.success?.("Engine cursor reset"),this._emitUpdated(e,"cursor-reset"))},async rebuild(){if(!await r.$ok.shared.modal.confirm(`Rebuild engine "${this.eng.name}"?`))return;const e=await this._request("POST","/rebuild");e&&(r.$ok.shared?.toast?.success?.("Engine rebuild started"),this._emitUpdated(e,"rebuilt"))},async deleteEngine(){await r.$ok.shared.modal.confirm(`Delete engine "<b>${this.eng.name}</b>"?`)&&null!==await this._request("DELETE")&&(r.$ok.shared?.toast?.success?.("Engine deleted"),r.$dispatch("deleted",this.eng),r.$dispatch("action","deleted"),r.$dispatch("refresh"))}}),template:'\n<div style="display:flex; gap:6px; align-items:center; flex-wrap:wrap;">\n <if :="embeddingsMode && running">\n <button\n @click="stop()"\n :disabled="busy || !canRunLifecycle"\n :style="actionStyle(\'var(--okdb-warning)\')"\n >\n {{ busy ? \'…\' : \'■ Stop\' }}\n </button>\n </if>\n <if :="embeddingsMode && !running && status !== \'error\'">\n <button\n @click="start()"\n :disabled="busy || !canRunLifecycle"\n :style="actionStyle(\'var(--okdb-success)\')"\n >\n {{ busy ? \'…\' : \'▶ Start\' }}\n </button>\n </if>\n <if :="embeddingsMode && (status === \'error\' || running)">\n <button\n @click="restart()"\n :disabled="busy || !canRunLifecycle"\n :style="actionStyle(\'var(--okdb-orange)\')"\n >\n {{ busy ? \'…\' : \'↺ Restart\' }}\n </button>\n </if>\n\n <if :="!embeddingsMode">\n <if :="!paused">\n <button\n @click="pause()"\n :disabled="busy || !canRunLifecycle"\n :style="actionStyle(\'var(--okdb-warning)\', { subtle: true })"\n >⏸ Pause</button>\n </if>\n <if :="paused">\n <button\n @click="resume()"\n :disabled="busy || !canRunLifecycle"\n :style="actionStyle(\'var(--okdb-success)\', { subtle: true })"\n >▶ Resume</button>\n </if>\n <button\n @click="restart()"\n :disabled="busy || !canRunLifecycle"\n :style="actionStyle(\'var(--okdb-app-fg)\', { subtle: true })"\n >↺ Restart</button>\n <if :="canRetry">\n <button\n @click="retry()"\n :disabled="busy || !canRunLifecycle"\n :style="actionStyle(\'var(--okdb-orange)\', { subtle: true })"\n >↻ Retry</button>\n </if>\n <if :="eng.type === \'materializer\'">\n <button\n @click="resetCursor()"\n :disabled="busy || !canRunLifecycle || !canResetCursor"\n :style="actionStyle(\'var(--okdb-info)\', { subtle: true })"\n >⇤ Reset cursor</button>\n <button\n @click="rebuild()"\n :disabled="busy || !canRunLifecycle"\n :style="actionStyle(\'var(--okdb-success)\', { subtle: true })"\n >⟳ Rebuild</button>\n </if>\n </if>\n\n <if :="showDelete">\n <button\n @click="deleteEngine()"\n :disabled="busy || !canRunLifecycle"\n :style="actionStyle(\'var(--okdb-danger)\')"\n >\n {{ busy ? \'…\' : \'✕ Delete\' }}\n </button>\n </if>\n</div>\n'};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x5184f1=_0x3fc0;function _0x4522(){const _0x403ec5=['1735920nIqEBH','refreshDisabled','\x0a<div\x20:style=\x22rootStyle\x22>\x0a\x20\x20<div\x20style=\x22display:flex;align-items:flex-start;gap:12px;justify-content:space-between;flex-wrap:wrap;\x22>\x0a\x20\x20\x20\x20<div\x20style=\x22display:flex;flex-direction:column;gap:6px;min-width:0;flex:1;\x22>\x0a\x20\x20\x20\x20\x20\x20<div\x20style=\x22display:flex;align-items:center;gap:10px;flex-wrap:wrap;min-width:0;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<span\x20:style=\x22\x27width:10px;height:10px;border-radius:50%;background:\x27\x20+\x20tone\x20+\x20\x27;flex-shrink:0;\x27\x22></span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<span\x20style=\x22font-size:18px;font-weight:700;color:var(--okdb-app-fg);word-break:break-word;min-width:0;\x22>{{\x20titleLabel\x20}}</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<span\x20:style=\x22\x27padding:2px\x208px;border-radius:999px;border:1px\x20solid\x20\x27\x20+\x20alpha(typeColorValue,27)\x20+\x20\x27;color:\x27\x20+\x20typeColorValue\x20+\x20\x27;text-transform:uppercase;letter-spacing:.05em;font-size:11px;\x27\x22>{{\x20typeLabelValue\x20}}</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<if\x20:=\x22showStatusBadge\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20:style=\x22\x27padding:2px\x208px;border-radius:999px;border:1px\x20solid\x20\x27\x20+\x20alpha(tone,33)\x20+\x20\x27;color:\x27\x20+\x20tone\x20+\x20\x27;font-size:11px;\x27\x22>{{\x20statusLabel\x20}}</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</if>\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x0a\x20\x20\x20\x20\x20\x20<div\x20style=\x22display:flex;gap:6px;flex-wrap:wrap;align-items:center;font-size:12px;color:#8aa7bc;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<if\x20:=\x22showReasonBadge\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20style=\x22padding:2px\x208px;border-radius:999px;border:1px\x20solid\x20color-mix(in\x20srgb,\x20var(--okdb-app-fg-subtle)\x2033%,\x20transparent);color:var(--okdb-app-fg-muted);\x22>{{\x20reasonLabel\x20}}</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</if>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<if\x20:=\x22envName\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20style=\x22padding:2px\x208px;border-radius:999px;border:1px\x20solid\x20var(--okdb-app-border);color:var(--okdb-app-fg-muted);\x22>env:\x20{{\x20envName\x20}}</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</if>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<if\x20:=\x22canOpenPipeline\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20@click=\x22openPipeline()\x22\x20:title=\x22pipelineTitleValue\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20style=\x22font-size:11px;padding:2px\x208px;border-radius:999px;border:1px\x20solid\x20color-mix(in\x20srgb,\x20var(--okdb-accent-2)\x2033%,\x20transparent);color:var(--okdb-accent-2);background:color-mix(in\x20srgb,\x20var(--okdb-accent-2)\x207%,\x20transparent);cursor:pointer;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20↗\x20{{\x20pipelineText\x20}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</if>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<each\x20:of=\x22extraBadges\x22\x20let:item=\x22badge\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20:style=\x22badgeStyle(badge)\x22\x20:title=\x22badge.title\x20||\x20badge.text\x20||\x20badge.label\x22>{{\x20badge.text\x20||\x20badge.label\x20}}</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</each>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<if\x20:=\x22eng.key\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20style=\x22font-size:11px;color:var(--okdb-app-fg-subtle);font-family:monospace;word-break:break-all;\x22>{{\x20eng.key\x20}}</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</if>\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20</div>\x0a\x0a\x20\x20\x20\x20<div\x20style=\x22display:flex;gap:8px;align-items:center;flex-wrap:wrap;justify-content:flex-end;\x22>\x0a\x20\x20\x20\x20\x20\x20<if\x20:=\x22showRefreshAction\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<button\x20@click=\x22clickRefresh()\x22\x20:disabled=\x22refreshBusyValue\x20||\x20refreshDisabledValue\x22\x20style=\x22opacity:.8;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{\x20refreshBusyValue\x20?\x20\x27…\x27\x20:\x20refreshLabelValue\x20}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20</button>\x0a\x20\x20\x20\x20\x20\x20</if>\x0a\x0a\x20\x20\x20\x20\x20\x20<if\x20:=\x22showLifecycleActions\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<engine-lifecycle-actions\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:engine=\x22eng\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:env=\x22envName\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20@engine-updated=\x22handleEngineUpdated($event.detail)\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20@refresh=\x22handleRefresh()\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20@deleted=\x22handleDeleted($event.detail)\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20/>\x0a\x20\x20\x20\x20\x20\x20</if>\x0a\x20\x20\x20\x20</div>\x0a\x20\x20</div>\x0a\x0a\x20\x20<if\x20:=\x22showErrorCard\x20&&\x20eng.error\x22>\x0a\x20\x20\x20\x20<div\x20class=\x22alert\x20alert--error\x22>\x0a\x20\x20\x20\x20\x20\x20<div\x20style=\x22font-weight:600;margin-bottom:4px;\x22>Engine\x20error</div>\x0a\x20\x20\x20\x20\x20\x20<div>{{\x20eng.error\x20}}</div>\x0a\x20\x20\x20\x20</div>\x0a\x20\x20</if>\x0a\x0a\x20\x20<slot\x20/>\x0a\x0a\x20\x20<if\x20:=\x22showDeclarationEditor\x22>\x0a\x20\x20\x20\x20<engine-declaration-editor\x0a\x20\x20\x20\x20\x20\x20:engine=\x22eng\x22\x0a\x20\x20\x20\x20\x20\x20:env=\x22envName\x22\x0a\x20\x20\x20\x20\x20\x20@engine-updated=\x22handleEngineUpdated($event.detail)\x22\x0a\x20\x20\x20\x20\x20\x20@refresh=\x22handleRefresh()\x22\x0a\x20\x20\x20\x20/>\x0a\x20\x20</if>\x0a</div>\x0a','function','engine-updated','engine','1960644oOWXXF','badges','var(--okdb-accent)','$attr','statusLabel','onRefresh','var(--okdb-app-fg-muted)','32PsPhMH','meta','showDeclaration','isRunning','reason','error','24BuLGvW',';color:','online','padStart','flex-direction:column','refresh','height:100%','gap:16px','inactive','pipelineLabel','toString','typeLabel','↻\x20Refresh','isArray','26488dEylKJ','filter','View\x20pipeline','color-mix(in\x20srgb,\x20','background','refreshDisabledValue','showLifecycle','false','engine-panel-shell','var(','type','startsWith','showRefresh','pipeline','View\x20pipeline:\x20','onPipeline','refreshBusy','showRefreshAction','alpha','min-width:0','status','3075793peEBUx','pipelineText','3356200XuQzjZ','eng','reasonLabel','true','round','$dispatch','stopped','pipelineTitle','display:flex','showError','90264pVRKSk','840710AnpJme'];_0x4522=function(){return _0x403ec5;};return _0x4522();}(function(_0x55265f,_0x54e956){const _0x1c2489=_0x3fc0,_0x13656b=_0x55265f();while(!![]){try{const _0x2e7155=parseInt(_0x1c2489(0x19b))/0x1*(parseInt(_0x1c2489(0x187))/0x2)+parseInt(_0x1c2489(0x178))/0x3*(-parseInt(_0x1c2489(0x18d))/0x4)+-parseInt(_0x1c2489(0x179))/0x5+parseInt(_0x1c2489(0x180))/0x6+parseInt(_0x1c2489(0x16c))/0x7+-parseInt(_0x1c2489(0x16e))/0x8+-parseInt(_0x1c2489(0x17a))/0x9;if(_0x2e7155===_0x54e956)break;else _0x13656b['push'](_0x13656b['shift']());}catch(_0x3201ee){_0x13656b['push'](_0x13656b['shift']());}}}(_0x4522,0x37e2a));import _0x1e59e0 from'./engine-declaration-editor.ok.js';import _0x51155e from'./engine-lifecycle-actions.ok.js';function _0x3fc0(_0x26b036,_0x22b2a4){_0x26b036=_0x26b036-0x163;const _0x452242=_0x4522();let _0x3fc0b6=_0x452242[_0x26b036];return _0x3fc0b6;}import{readableReason as _0xd2a7c0,resolveEngineEnvName as _0x2e3e2d,statusTone as _0x19cc5e}from'../engine-ui-utils.js';function i(_0x108a32,_0x2f3656=!0x1){const _0x5b0004=_0x3fc0;return null==_0x108a32?_0x2f3656:!0x0===_0x108a32||_0x5b0004(0x171)===_0x108a32||!0x1!==_0x108a32&&_0x5b0004(0x1a2)!==_0x108a32&&Boolean(_0x108a32);}export default{'tag':_0x5184f1(0x1a3),'dependencies':[_0x1e59e0,_0x51155e],'attr':{'engine':{},'env':{},'title':{},'typeLabel':{},'typeColor':{},'badges':{},'showRefresh':{},'refreshLabel':{},'refreshBusy':{},'refreshDisabled':{},'onRefresh':{},'onPipeline':{},'pipelineLabel':{},'pipelineTitle':{},'showDeclaration':{},'showLifecycle':{},'showError':{},'fill':{}},'context':_0x5c4fe9=>({get 'eng'(){const _0x32b4db=_0x5184f1;return _0x5c4fe9[_0x32b4db(0x183)][_0x32b4db(0x17f)]??{};},get 'envName'(){const _0x4918a0=_0x5184f1;return _0x2e3e2d(this[_0x4918a0(0x16f)],_0x5c4fe9[_0x4918a0(0x183)]['env']??null);},get 'titleLabel'(){const _0x266218=_0x5184f1;return _0x5c4fe9['$attr']['title']??this[_0x266218(0x16f)]['name']??this[_0x266218(0x16f)]['key']??'Engine';},get 'typeLabelValue'(){const _0x3d4a83=_0x5184f1;return _0x5c4fe9[_0x3d4a83(0x183)][_0x3d4a83(0x198)]??this[_0x3d4a83(0x16f)][_0x3d4a83(0x1a5)]??'engine';},get 'typeColorValue'(){const _0x71b854=_0x5184f1;return _0x5c4fe9['$attr']['typeColor']??_0x71b854(0x182);},'alpha':(_0x259de0,_0x378e91)=>_0x259de0[_0x5184f1(0x1a6)](_0x5184f1(0x1a4))?_0x5184f1(0x19e)+_0x259de0+'\x20'+_0x378e91+'%,\x20transparent)':''+_0x259de0+Math[_0x5184f1(0x172)](2.55*_0x378e91)[_0x5184f1(0x197)](0x10)[_0x5184f1(0x190)](0x2,'0'),get 'tone'(){const _0x3d10fa=_0x5184f1;return _0x19cc5e(this[_0x3d10fa(0x16f)]);},get 'statusLabel'(){const _0x1b1458=_0x5184f1;return _0x1b1458(0x18c)===this[_0x1b1458(0x16f)][_0x1b1458(0x16b)]?'error':_0x1b1458(0x195)===this[_0x1b1458(0x16f)][_0x1b1458(0x16b)]?'inactive':this['eng'][_0x1b1458(0x18a)]||_0x1b1458(0x18f)===this['eng'][_0x1b1458(0x16b)]?'running':this[_0x1b1458(0x16f)][_0x1b1458(0x16b)]||_0x1b1458(0x174);},get 'showStatusBadge'(){const _0x572e1f=_0x5184f1;return!(this[_0x572e1f(0x16f)]['isRunning']||_0x572e1f(0x18f)===this[_0x572e1f(0x16f)]['status']);},get 'reasonLabel'(){const _0x73b104=_0x5184f1;return _0xd2a7c0(this['eng'][_0x73b104(0x18b)]);},get 'showReasonBadge'(){const _0x5afc96=_0x5184f1;return!!this[_0x5afc96(0x170)]&&this[_0x5afc96(0x170)]!==this[_0x5afc96(0x184)];},get 'extraBadges'(){const _0x5c5c87=_0x5184f1;return Array[_0x5c5c87(0x19a)](_0x5c4fe9['$attr']['badges'])?_0x5c4fe9[_0x5c5c87(0x183)][_0x5c5c87(0x181)][_0x5c5c87(0x19c)](Boolean):[];},get 'showRefreshAction'(){const _0x2f263a=_0x5184f1;return i(_0x5c4fe9[_0x2f263a(0x183)][_0x2f263a(0x163)],!0x1)&&_0x2f263a(0x17d)==typeof _0x5c4fe9[_0x2f263a(0x183)][_0x2f263a(0x185)];},get 'refreshLabelValue'(){const _0x1db158=_0x5184f1;return _0x5c4fe9['$attr']['refreshLabel']??_0x1db158(0x199);},get 'refreshBusyValue'(){const _0x37090e=_0x5184f1;return i(_0x5c4fe9[_0x37090e(0x183)][_0x37090e(0x167)],!0x1);},get 'refreshDisabledValue'(){const _0xa0723f=_0x5184f1;return i(_0x5c4fe9['$attr'][_0xa0723f(0x17b)],!0x1);},get 'showDeclarationEditor'(){const _0x5cf8fb=_0x5184f1;return i(_0x5c4fe9[_0x5cf8fb(0x183)][_0x5cf8fb(0x189)],!0x0);},get 'showLifecycleActions'(){const _0x1f4fb5=_0x5184f1;return i(_0x5c4fe9[_0x1f4fb5(0x183)][_0x1f4fb5(0x1a1)],!0x0);},get 'showErrorCard'(){const _0x2cc131=_0x5184f1;return i(_0x5c4fe9[_0x2cc131(0x183)][_0x2cc131(0x177)],!0x0);},get 'pipelineText'(){const _0x1e6910=_0x5184f1;return _0x5c4fe9[_0x1e6910(0x183)][_0x1e6910(0x196)]??this['eng'][_0x1e6910(0x188)]?.[_0x1e6910(0x164)]??null;},get 'canOpenPipeline'(){const _0x1488e6=_0x5184f1;return!!this[_0x1488e6(0x16d)]&&_0x1488e6(0x17d)==typeof _0x5c4fe9[_0x1488e6(0x183)][_0x1488e6(0x166)];},get 'pipelineTitleValue'(){const _0xf0eedc=_0x5184f1;return _0x5c4fe9[_0xf0eedc(0x183)][_0xf0eedc(0x175)]??(this[_0xf0eedc(0x16d)]?_0xf0eedc(0x165)+this[_0xf0eedc(0x16d)]:_0xf0eedc(0x19d));},get 'rootStyle'(){const _0x569851=_0x5184f1,_0x311ce1=i(_0x5c4fe9[_0x569851(0x183)]['fill'],!0x1);return[_0x569851(0x176),_0x569851(0x191),_0x569851(0x194),_0x569851(0x16a),_0x311ce1?_0x569851(0x193):'',_0x311ce1?'min-height:0':''][_0x569851(0x19c)](Boolean)['join'](';')+';';},'badgeStyle'(_0x3be42f=null){const _0x3110b2=_0x5184f1;if(!_0x3be42f)return'';const _0x4d8985=_0x3be42f['color']??_0x3110b2(0x186);return'padding:2px\x208px;border-radius:999px;font-size:11px;border:1px\x20solid\x20'+(_0x3be42f['borderColor']??this[_0x3110b2(0x169)](_0x4d8985,0x21))+_0x3110b2(0x18e)+_0x4d8985+';background:'+(_0x3be42f[_0x3110b2(0x19f)]??this['alpha'](_0x4d8985,0x7))+';';},async 'clickRefresh'(){const _0x31bdf9=_0x5184f1;!this[_0x31bdf9(0x168)]||this['refreshBusyValue']||this[_0x31bdf9(0x1a0)]||(await _0x5c4fe9[_0x31bdf9(0x183)][_0x31bdf9(0x185)]?.(),_0x5c4fe9['$dispatch']('refresh'));},async 'handleRefresh'(){const _0x27c7ee=_0x5184f1;await _0x5c4fe9[_0x27c7ee(0x183)][_0x27c7ee(0x185)]?.(),_0x5c4fe9['$dispatch'](_0x27c7ee(0x192));},'handleEngineUpdated'(_0x3f4221){const _0x3e4eaf=_0x5184f1;_0x5c4fe9[_0x3e4eaf(0x173)](_0x3e4eaf(0x17e),_0x3f4221);},'handleDeleted'(_0x29da19){const _0x171726=_0x5184f1;_0x5c4fe9[_0x171726(0x173)]('deleted',_0x29da19);},'openPipeline'(){const _0x24f12d=_0x5184f1;_0x5c4fe9[_0x24f12d(0x183)][_0x24f12d(0x166)]?.(this[_0x24f12d(0x16d)]);}}),'template':_0x5184f1(0x17c)};
|
|
1
|
+
import e from"./engine-declaration-editor.ok.js";import n from"./engine-lifecycle-actions.ok.js";import{readableReason as t,resolveEngineEnvName as r,statusTone as a}from"../engine-ui-utils.js";function i(e,n=!1){return null==e?n:!0===e||"true"===e||!1!==e&&"false"!==e&&Boolean(e)}export default{tag:"engine-panel-shell",dependencies:[e,n],attr:{engine:{},env:{},title:{},typeLabel:{},typeColor:{},badges:{},showRefresh:{},refreshLabel:{},refreshBusy:{},refreshDisabled:{},onRefresh:{},onPipeline:{},pipelineLabel:{},pipelineTitle:{},showDeclaration:{},showLifecycle:{},showError:{},fill:{}},context:e=>({get eng(){return e.$attr.engine??{}},get envName(){return r(this.eng,e.$attr.env??null)},get titleLabel(){return e.$attr.title??this.eng.name??this.eng.key??"Engine"},get typeLabelValue(){return e.$attr.typeLabel??this.eng.type??"engine"},get typeColorValue(){return e.$attr.typeColor??"var(--okdb-accent)"},alpha:(e,n)=>e.startsWith("var(")?`color-mix(in srgb, ${e} ${n}%, transparent)`:`${e}${Math.round(2.55*n).toString(16).padStart(2,"0")}`,get tone(){return a(this.eng)},get statusLabel(){return"error"===this.eng.status?"error":"inactive"===this.eng.status?"inactive":this.eng.isRunning||"online"===this.eng.status?"running":this.eng.status||"stopped"},get showStatusBadge(){return!(this.eng.isRunning||"online"===this.eng.status)},get reasonLabel(){return t(this.eng.reason)},get showReasonBadge(){return!!this.reasonLabel&&this.reasonLabel!==this.statusLabel},get extraBadges(){return Array.isArray(e.$attr.badges)?e.$attr.badges.filter(Boolean):[]},get showRefreshAction(){return i(e.$attr.showRefresh,!1)&&"function"==typeof e.$attr.onRefresh},get refreshLabelValue(){return e.$attr.refreshLabel??"↻ Refresh"},get refreshBusyValue(){return i(e.$attr.refreshBusy,!1)},get refreshDisabledValue(){return i(e.$attr.refreshDisabled,!1)},get showDeclarationEditor(){return i(e.$attr.showDeclaration,!0)},get showLifecycleActions(){return i(e.$attr.showLifecycle,!0)},get showErrorCard(){return i(e.$attr.showError,!0)},get pipelineText(){return e.$attr.pipelineLabel??this.eng.meta?.pipeline??null},get canOpenPipeline(){return!!this.pipelineText&&"function"==typeof e.$attr.onPipeline},get pipelineTitleValue(){return e.$attr.pipelineTitle??(this.pipelineText?`View pipeline: ${this.pipelineText}`:"View pipeline")},get rootStyle(){const n=i(e.$attr.fill,!1);return["display:flex","flex-direction:column","gap:16px","min-width:0",n?"height:100%":"",n?"min-height:0":""].filter(Boolean).join(";")+";"},badgeStyle(e=null){if(!e)return"";const n=e.color??"var(--okdb-app-fg-muted)";return`padding:2px 8px;border-radius:999px;font-size:11px;border:1px solid ${e.borderColor??this.alpha(n,33)};color:${n};background:${e.background??this.alpha(n,7)};`},async clickRefresh(){!this.showRefreshAction||this.refreshBusyValue||this.refreshDisabledValue||(await(e.$attr.onRefresh?.()),e.$dispatch("refresh"))},async handleRefresh(){await(e.$attr.onRefresh?.()),e.$dispatch("refresh")},handleEngineUpdated(n){e.$dispatch("engine-updated",n)},handleDeleted(n){e.$dispatch("deleted",n)},openPipeline(){e.$attr.onPipeline?.(this.pipelineText)}}),template:'\n<div :style="rootStyle">\n <div style="display:flex;align-items:flex-start;gap:12px;justify-content:space-between;flex-wrap:wrap;">\n <div style="display:flex;flex-direction:column;gap:6px;min-width:0;flex:1;">\n <div style="display:flex;align-items:center;gap:10px;flex-wrap:wrap;min-width:0;">\n <span :style="\'width:10px;height:10px;border-radius:50%;background:\' + tone + \';flex-shrink:0;\'"></span>\n <span style="font-size:18px;font-weight:700;color:var(--okdb-app-fg);word-break:break-word;min-width:0;">{{ titleLabel }}</span>\n <span :style="\'padding:2px 8px;border-radius:999px;border:1px solid \' + alpha(typeColorValue,27) + \';color:\' + typeColorValue + \';text-transform:uppercase;letter-spacing:.05em;font-size:11px;\'">{{ typeLabelValue }}</span>\n <if :="showStatusBadge">\n <span :style="\'padding:2px 8px;border-radius:999px;border:1px solid \' + alpha(tone,33) + \';color:\' + tone + \';font-size:11px;\'">{{ statusLabel }}</span>\n </if>\n </div>\n\n <div style="display:flex;gap:6px;flex-wrap:wrap;align-items:center;font-size:12px;color:#8aa7bc;">\n <if :="showReasonBadge">\n <span style="padding:2px 8px;border-radius:999px;border:1px solid color-mix(in srgb, var(--okdb-app-fg-subtle) 33%, transparent);color:var(--okdb-app-fg-muted);">{{ reasonLabel }}</span>\n </if>\n <if :="envName">\n <span style="padding:2px 8px;border-radius:999px;border:1px solid var(--okdb-app-border);color:var(--okdb-app-fg-muted);">env: {{ envName }}</span>\n </if>\n <if :="canOpenPipeline">\n <button @click="openPipeline()" :title="pipelineTitleValue"\n style="font-size:11px;padding:2px 8px;border-radius:999px;border:1px solid color-mix(in srgb, var(--okdb-accent-2) 33%, transparent);color:var(--okdb-accent-2);background:color-mix(in srgb, var(--okdb-accent-2) 7%, transparent);cursor:pointer;">\n ↗ {{ pipelineText }}\n </button>\n </if>\n <each :of="extraBadges" let:item="badge">\n <span :style="badgeStyle(badge)" :title="badge.title || badge.text || badge.label">{{ badge.text || badge.label }}</span>\n </each>\n <if :="eng.key">\n <span style="font-size:11px;color:var(--okdb-app-fg-subtle);font-family:monospace;word-break:break-all;">{{ eng.key }}</span>\n </if>\n </div>\n </div>\n\n <div style="display:flex;gap:8px;align-items:center;flex-wrap:wrap;justify-content:flex-end;">\n <if :="showRefreshAction">\n <button @click="clickRefresh()" :disabled="refreshBusyValue || refreshDisabledValue" style="opacity:.8;">\n {{ refreshBusyValue ? \'…\' : refreshLabelValue }}\n </button>\n </if>\n\n <if :="showLifecycleActions">\n <engine-lifecycle-actions\n :engine="eng"\n :env="envName"\n @engine-updated="handleEngineUpdated($event.detail)"\n @refresh="handleRefresh()"\n @deleted="handleDeleted($event.detail)"\n />\n </if>\n </div>\n </div>\n\n <if :="showErrorCard && eng.error">\n <div class="alert alert--error">\n <div style="font-weight:600;margin-bottom:4px;">Engine error</div>\n <div>{{ eng.error }}</div>\n </div>\n </if>\n\n <slot />\n\n <if :="showDeclarationEditor">\n <engine-declaration-editor\n :engine="eng"\n :env="envName"\n @engine-updated="handleEngineUpdated($event.detail)"\n @refresh="handleRefresh()"\n />\n </if>\n</div>\n'};
|