@knoflows/engine 0.1.0-alpha.10 → 0.1.0-alpha.12
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/dist/engine.js +12 -12
- package/package.json +2 -2
- package/static/assets/i18n/en.json +34 -0
- package/static/assets/i18n/es.json +34 -0
- package/static/{chunk-CgqRVtSF.js → chunk--F2Y9kLC.js} +1 -1
- package/static/{chunk-jct1_zOr.js → chunk-A3t8CipM.js} +1 -1
- package/static/{chunk-2KSNHCgb.js → chunk-BAgwFLbm.js} +1 -1
- package/static/{chunk-B2hO-qT3.js → chunk-BLSuZA6j.js} +1 -1
- package/static/{chunk-W5GAgssE.js → chunk-Bc9kVhav.js} +1 -1
- package/static/{chunk-BUuwGTt7.js → chunk-BdrifDCS.js} +7 -7
- package/static/{chunk-CJDp11v5.js → chunk-BkJuaRUH.js} +1 -1
- package/static/chunk-BmP-Xct3.js +1 -0
- package/static/{chunk-XLpSkczx.js → chunk-BqB1I-vg.js} +1 -1
- package/static/{chunk-eSxb3-OU.js → chunk-BquoV7tV.js} +1 -1
- package/static/{chunk-BVw7xkK9.js → chunk-C3Ej8Ue9.js} +1 -1
- package/static/chunk-C5T1qa5G.js +1 -0
- package/static/{chunk-DNOjVPY0.js → chunk-CK-2DsDH.js} +1 -1
- package/static/{chunk-cHfOiAJm.js → chunk-CKFZoQzp.js} +1 -1
- package/static/{chunk-DblClAqu.js → chunk-CLNhyiRm.js} +1 -1
- package/static/{chunk-A4AkMf2s.js → chunk-CN5_Adst.js} +1 -1
- package/static/{chunk-DQnMulwi.js → chunk-COSsVdG3.js} +1 -1
- package/static/chunk-Cj-KtAk-.js +1 -0
- package/static/{chunk-3mppll1n.js → chunk-CrD5w72_.js} +1 -1
- package/static/chunk-D5Bqg3D5.js +7 -0
- package/static/chunk-DAfnL0eP.js +1 -0
- package/static/{chunk-Cd8F2jeN.js → chunk-Dc3mv2RT.js} +1 -1
- package/static/chunk-Dc7Nho4-.js +1 -0
- package/static/{chunk-BjZIiizu.js → chunk-Df_jRm7U.js} +1 -1
- package/static/{chunk-mzyds3TS.js → chunk-Dl9xoaKd.js} +1 -1
- package/static/{chunk-Ojn34cvU.js → chunk-DqECIHE5.js} +1 -1
- package/static/{chunk-B8MrNxxk.js → chunk-Dtfc5XNc.js} +1 -1
- package/static/chunk-DxtF2GQ1.js +1 -0
- package/static/{chunk-CJRNatUw.js → chunk-KhdCYqqN.js} +1 -1
- package/static/{chunk-BAc0DRm8.js → chunk-TkjFi8lV.js} +1 -1
- package/static/{chunk-DjibVmY7.js → chunk-UArWmYDU.js} +1 -1
- package/static/{chunk-CWbxWv5I.js → chunk-WGWZEfc0.js} +1 -1
- package/static/{chunk-CEcbtdnK.js → chunk-hEYSTlD1.js} +1 -1
- package/static/{chunk-Cf_xd8ER.js → chunk-jg6TAN9F.js} +1 -1
- package/static/{chunk-CDWIMt6y.js → chunk-mb666CWY.js} +1 -1
- package/static/{chunk-hZzW00VR.js → chunk-nXCKNQUo.js} +1 -1
- package/static/{chunk-wbdetocK.js → chunk-ndsN8K7Q.js} +3 -3
- package/static/{chunk-tYnBYi0l.js → chunk-tnTBlRRN.js} +1 -1
- package/static/index.html +1 -1
- package/static/{main-MNK6ZYDO.js → main-RRKPLQCF.js} +1 -1
- package/static/chunk-6BQlxALO.js +0 -1
- package/static/chunk-BFkZ796p.js +0 -7
- package/static/chunk-BNOYZq-b.js +0 -1
- package/static/chunk-BbcTWKT2.js +0 -1
- package/static/chunk-BhGgxvgu.js +0 -1
- package/static/chunk-D6YfO72h.js +0 -1
- package/static/chunk-DoXxOh8j.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {T}from'./chunk-
|
|
1
|
+
import {T}from'./chunk-C5T1qa5G.js';import {$ as $$1,B}from'./chunk-CN5_Adst.js';import {C as Cx,M as Mm,h as hy,$ as $y,b as M_}from'./chunk-BdrifDCS.js';import {a as ai,z}from'./chunk-WGWZEfc0.js';import {C,a as ae,T as Ie$1,ah as U,aj as $,b as at,V as Ve$1,aS as O$1,aT as de,al as Se$1,q as qo,H as Hw,u as ue,s,r,o,Q as QE,M as Mi,n as n8,am as S4,J as J6,k as k3,L as Ln,d as dd,z as zc,c as t7,Z as y7,X as Xb,e as V5,D as D5,K as Kt,f as _i,v as vw,g as Kc,R as Rw,h as gh,m as bD,p as gI,P as Ph,O as Ow,x as ch,w as nl,B as _D,E as VD,F as LD,j as oE,N as ND,y as sE,A as xD,S as SD,l as lh,G as Pu,I as Lu,a4 as Mh,a5 as ah,a6 as Nw}from'./main-RRKPLQCF.js';import {U as U$1}from'./chunk-jg6TAN9F.js';import'./chunk-hEYSTlD1.js';var be=()=>[],O=(t,a)=>a.id,Me=(t,a)=>a.name;function Ie(t,a){t&1&&(_i(0,"p",5),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function Ee(t,a){if(t&1&&(_i(0,"p",6),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.loadError());}}function Ve(t,a){if(t&1&&(_i(0,"li"),vw(1),Kc()),t&2){let e=a.$implicit;gI(),Ph(e);}}function ze(t,a){if(t&1&&(_i(0,"section",7)(1,"h2"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"ul"),ND(5,Ve,2,1,"li",null,SD),Kc()()),t&2){let e=VD(2);gI(2),Ph(Ow(3,1,"views.editor.validation")),gI(3),xD(e.validationErrors());}}function ke(t,a){if(t&1&&lh(0,"nz-option",11),t&2){let e=a.$implicit;ch("nzValue",e.id)("nzLabel",e.name);}}function Pe(t,a){t&1&&(_i(0,"p",13),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),nl(" ",Ow(2,1,"views.editor.noEligibleInstances")," "));}function Se(t,a){t&1&&(_i(0,"p",16),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),nl(" ",Ow(2,1,"views.editor.instanceNeeded")," "));}function Ne(t,a){if(t&1&&lh(0,"nz-option",11),t&2){let e=a.$implicit;ch("nzValue",e.id)("nzLabel",e.displayName);}}function qe(t,a){if(t&1){let e=LD();_i(0,"div",15),bD(1,Se,3,3,"p",16),_i(2,"span"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"nz-select",17),Rw(6,"transloco"),gh("ngModelChange",function(n){Pu(e);let s=VD(3);return Lu(s.onInstanceChange(n))}),ND(7,Ne,1,2,"nz-option",11,O),Kc(),oE(),Kc();}if(t&2){let e=VD(3);Mh("field-attention",e.needsInstanceAttention()),gI(),_D(e.needsInstanceAttention()?1:-1),gI(2),Ph(Ow(4,6,"views.editor.instance")),gI(2),ch("nzPlaceHolder",Ow(6,8,"views.editor.instancePlaceholder"))("ngModel",e.providerInstanceId()),sE(),gI(2),xD(e.eligibleInstances());}}function De(t,a){if(t&1&&bD(0,Pe,3,3,"p",13)(1,qe,9,10,"div",14),t&2){let e=VD(2);_D(e.eligibleInstances().length===0?0:1);}}function Ae(t,a){if(t&1){let e=LD();_i(0,"div",12)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"div",18)(5,"button",19),gh("click",function(){Pu(e);let n=VD(2);return Lu(n.setQueryMode("template"))}),vw(6),Rw(7,"transloco"),Kc(),_i(8,"button",20),gh("click",function(){Pu(e);let n=VD(2);return Lu(n.setQueryMode("raw"))}),vw(9),Rw(10,"transloco"),Kc()()();}if(t&2){let e=VD(2);gI(2),Ph(Ow(3,5,"views.editor.queryMode")),gI(3),ch("nzType",e.queryMode()==="template"?"primary":"default"),gI(),nl(" ",Ow(7,7,"views.editor.queryMode.template")," "),gI(2),ch("nzType",e.queryMode()==="raw"?"primary":"default"),gI(),nl(" ",Ow(10,9,"views.editor.queryMode.raw")," ");}}function Fe(t,a){if(t&1&&lh(0,"nz-option",11),t&2){let e=a.$implicit;ch("nzValue",e.id)("nzLabel",e.label);}}function je(t,a){t&1&&(_i(0,"span",22),vw(1,"*"),Kc());}function Oe(t,a){if(t&1&&lh(0,"nz-option",11),t&2){let e=a.$implicit;ch("nzValue",e)("nzLabel",e);}}function Be(t,a){if(t&1){let e=LD();_i(0,"nz-select",25),gh("ngModelChange",function(n){Pu(e);let s=VD().$implicit,g=VD(4);return Lu(g.setTemplateParam(s.name,n))}),ND(1,Oe,1,2,"nz-option",11,SD),Kc(),oE();}if(t&2){let e=VD().$implicit,i=VD(4);ch("ngModel",i.templateParamValue(e.name)),ah("data-testid","template-param-"+e.name),sE(),gI(),xD(e.options??Nw(2,be));}}function $e(t,a){if(t&1){let e=LD();_i(0,"input",26),gh("ngModelChange",function(n){Pu(e);let s=VD().$implicit,g=VD(4);return Lu(g.setTemplateParam(s.name,n))}),Kc(),oE();}if(t&2){let e=VD().$implicit,i=VD(4);ch("ngModel",i.templateParamValue(e.name)),ah("data-testid","template-param-"+e.name),sE();}}function Le(t,a){if(t&1&&(_i(0,"label",8)(1,"span"),vw(2),bD(3,je,2,0,"span",22),Kc(),bD(4,Be,3,3,"nz-select",23)(5,$e,1,2,"input",24),Kc()),t&2){let e=a.$implicit;gI(2),nl(" ",e.label," "),gI(),_D(e.required?3:-1),gI(),_D(e.type==="select"?4:5);}}function We(t,a){t&1&&ND(0,Le,6,3,"label",8,Me),t&2&&xD(a.params);}function Re(t,a){if(t&1){let e=LD();_i(0,"div",8)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"nz-select",21),gh("ngModelChange",function(n){Pu(e);let s=VD(2);return Lu(s.selectTemplate(n))}),ND(5,Fe,1,2,"nz-option",11,O),Kc(),oE(),Kc(),bD(7,We,2,0);}if(t&2){let e,i=VD(2);gI(2),Ph(Ow(3,3,"views.editor.template")),gI(2),ch("ngModel",i.selectedTemplateId()),sE(),gI(),xD(i.templates()),gI(2),_D((e=i.selectedTemplate())?7:-1,e);}}function Je(t,a){if(t&1){let e=LD();_i(0,"label",8)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"textarea",27),gh("ngModelChange",function(n){Pu(e);let s=VD(2);return Lu(s.queryText.set(n))}),Kc(),oE(),_i(5,"span",28),vw(6),Rw(7,"transloco"),Kc()();}if(t&2){let e=VD(2);gI(2),Ph(Ow(3,3,"views.editor.query")),gI(2),ch("ngModel",e.queryText()),sE(),gI(2),Ph(Ow(7,5,"views.editor.queryHint"));}}function Qe(t,a){if(t&1){let e=LD();bD(0,ze,7,3,"section",7),_i(1,"label",8)(2,"span"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"input",9),gh("ngModelChange",function(n){Pu(e);let s=VD();return Lu(s.name.set(n))}),Kc(),oE(),Kc(),_i(6,"div",8)(7,"span"),vw(8),Rw(9,"transloco"),Kc(),_i(10,"nz-select",10),gh("ngModelChange",function(n){Pu(e);let s=VD();return Lu(s.onWorkflowChange(n))}),ND(11,ke,1,2,"nz-option",11,O),Kc(),oE(),Kc(),bD(13,De,2,1),bD(14,Ae,11,11,"div",12),bD(15,Re,8,5)(16,Je,8,7,"label",8);}if(t&2){let e=VD();_D(e.validationErrors().length>0?0:-1),gI(3),Ph(Ow(4,8,"views.editor.name")),gI(2),ch("ngModel",e.name()),sE(),gI(3),Ph(Ow(9,10,"views.editor.workflow")),gI(2),ch("ngModel",e.workflowId()),sE(),gI(),xD(e.bindableWorkflows()),gI(2),_D(e.selectedWorkflow()&&e.settings()?13:-1),gI(),_D(e.hasTemplates()?14:-1),gI(),_D(e.queryMode()==="template"&&e.hasTemplates()?15:16);}}function Ue(t){let a=t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),e=crypto.randomUUID().slice(0,8);return a.length>0?`${a}-${e}`:`view-${e}`}function Te(t){let a={};for(let e of t.params)a[e.name]=e.type==="select"?e.options?.[0]??"":"";return a}function He(t){let a=t?.trim()??"";return a.length>0?a:null}var bt=(()=>{class t{constructor(){this.route=C(ae),this.router=C(Ie$1),this.viewsApi=C(U),this.workflowsApi=C(U$1),this.settingsApi=C($),this.providersApi=C($$1),this.message=C(Cx),this.destroyRef=C(at),this.transloco=C(Ve$1),this.language=C(O$1),this.routeId=de(this.route.paramMap.pipe(Se$1(e=>e.get("id"))),{initialValue:this.route.snapshot.paramMap.get("id")}),this.name=qo(""),this.workflowId=qo(""),this.providerInstanceId=qo(null),this.workflows=qo([]),this.subjectType=qo(null),this.queryText=qo(`{
|
|
2
2
|
|
|
3
|
-
}`),this.queryMode=qo("template"),this.templates=qo([]),this.selectedTemplateId=qo(null),this.templateParams=qo({}),this.settings=qo(null),this.loadError=qo(null),this.validationErrors=qo([]),this.saving=qo(false),this.loading=qo(true),this.bindableWorkflows=Hw(()=>this.workflows().filter(e=>e.appliesTo!=="none")),this.selectedWorkflow=Hw(()=>this.bindableWorkflows().find(e=>e.id===this.workflowId())??null),this.subjectTypeOptions=Hw(()=>
|
|
3
|
+
}`),this.queryMode=qo("template"),this.templates=qo([]),this.selectedTemplateId=qo(null),this.templateParams=qo({}),this.settings=qo(null),this.loadError=qo(null),this.validationErrors=qo([]),this.saving=qo(false),this.loading=qo(true),this.bindableWorkflows=Hw(()=>this.workflows().filter(e=>e.appliesTo!=="none")),this.selectedWorkflow=Hw(()=>this.bindableWorkflows().find(e=>e.id===this.workflowId())??null),this.subjectTypeOptions=Hw(()=>Mm(this.selectedWorkflow()?.appliesTo??"none")),this.eligibleInstances=Hw(()=>B(this.settings(),this.subjectTypeOptions())),this.selectedInstance=Hw(()=>this.eligibleInstances().find(e=>e.id===this.providerInstanceId())??null),this.needsInstanceAttention=Hw(()=>this.selectedWorkflow()!=null&&this.settings()!=null&&this.eligibleInstances().length>0&&this.selectedInstance()==null),this.isNew=Hw(()=>!this.routeId()),this.pageTitle=Hw(()=>(this.language.currentLang(),this.isNew()?this.transloco.translate("views.editor.titleNew"):this.transloco.translate("views.editor.titleEdit",{id:this.routeId()}))),this.selectedTemplate=Hw(()=>this.templates().find(e=>e.id===this.selectedTemplateId())??null),this.hasTemplates=Hw(()=>this.templates().length>0),this.workflowsApi.list().pipe(ue(this.destroyRef)).subscribe({next:e=>this.workflows.set(e),error:e=>{this.workflows.set([]),this.message.error(this.errorMessage(e,this.transloco.translate("views.editor.loadFailed")));}}),this.settingsApi.getSettings().pipe(ue(this.destroyRef)).subscribe({next:e=>{this.settings.set(e),this.refreshTemplates();},error:e=>{this.settings.set(hy),this.refreshTemplates(),this.message.error(this.errorMessage(e,this.transloco.translate("views.editor.loadFailed")));}}),this.route.paramMap.pipe(ue(this.destroyRef)).subscribe(e=>{let i=e.get("id");if(this.validationErrors.set([]),this.loadError.set(null),this.pendingProvenance=void 0,!i){this.name.set(""),this.workflowId.set(""),this.providerInstanceId.set(null),this.subjectType.set(null),this.queryText.set(`{
|
|
4
4
|
|
|
5
|
-
}`),this.queryMode.set("template"),this.selectedTemplateId.set(null),this.templateParams.set({}),this.loading.set(false),this.refreshTemplates();return}this.loading.set(true),this.viewsApi.get(i).subscribe({next:n=>{this.name.set(n.name),this.workflowId.set(n.workflowId),this.providerInstanceId.set(He(n.providerInstanceId)),this.subjectType.set(n.subjectType),this.queryText.set(JSON.stringify(n.query,null,2)),this.pendingProvenance=n.queryTemplate,this.queryMode.set(n.queryTemplate?"template":"raw"),this.loading.set(false),this.refreshTemplates();},error:n=>{this.loading.set(false),this.loadError.set(this.errorMessage(n,this.transloco.translate("views.editor.loadFailed")));}});});}subjectTypeKey(e){return `workflow-editor.subjectType.${e}`}onWorkflowChange(e){this.workflowId.set(e);let i=
|
|
5
|
+
}`),this.queryMode.set("template"),this.selectedTemplateId.set(null),this.templateParams.set({}),this.loading.set(false),this.refreshTemplates();return}this.loading.set(true),this.viewsApi.get(i).subscribe({next:n=>{this.name.set(n.name),this.workflowId.set(n.workflowId),this.providerInstanceId.set(He(n.providerInstanceId)),this.subjectType.set(n.subjectType),this.queryText.set(JSON.stringify(n.query,null,2)),this.pendingProvenance=n.queryTemplate,this.queryMode.set(n.queryTemplate?"template":"raw"),this.loading.set(false),this.refreshTemplates();},error:n=>{this.loading.set(false),this.loadError.set(this.errorMessage(n,this.transloco.translate("views.editor.loadFailed")));}});});}subjectTypeKey(e){return `workflow-editor.subjectType.${e}`}onWorkflowChange(e){this.workflowId.set(e);let i=Mm(this.bindableWorkflows().find(s=>s.id===e)?.appliesTo??"none");this.pendingProvenance=void 0,this.queryMode.set("template"),this.selectedTemplateId.set(null),this.templateParams.set({});let n=B(this.settings(),i);if(n.length===1)this.applyInstance(n[0]);else {let s=this.providerInstanceId(),g=n.find(S=>S.id===s);g?this.applyInstance(g):(this.providerInstanceId.set(null),this.subjectType.set(null));}this.refreshTemplates();}onInstanceChange(e){let i=this.eligibleInstances().find(n=>n.id===e);this.pendingProvenance=void 0,this.queryMode.set("template"),this.selectedTemplateId.set(null),this.templateParams.set({}),i&&this.applyInstance(i),this.refreshTemplates();}applyInstance(e){this.providerInstanceId.set(e.id),$y(e)&&this.subjectType.set(e.subjectType);}setQueryMode(e){this.queryMode.set(e),e==="template"&&!this.selectedTemplateId()&&this.templates()[0]&&this.selectTemplate(this.templates()[0].id);}selectTemplate(e){let i=this.templates().find(n=>n.id===e);this.selectedTemplateId.set(e),this.templateParams.set(i?Te(i):{});}templateParamValue(e){let i=this.templateParams()[e];return i==null?"":String(i)}setTemplateParam(e,i){this.templateParams.set(s(r({},this.templateParams()),{[e]:i}));}save(){if(!this.selectedInstance()){this.validationErrors.set([this.transloco.translate("views.editor.pickInstance")]);return}if(this.queryMode()==="template"&&this.hasTemplates()){this.saveFromTemplate();return}this.saveFromRawJson();}saveFromTemplate(){let e=this.selectedTemplate(),i=this.providerInstanceId();if(!e||!i){this.validationErrors.set([this.transloco.translate("views.editor.pickTemplate")]);return}let n=e.params.filter(s=>{if(!s.required)return false;let g=this.templateParams()[s.name];return g==null||String(g).trim()===""});if(n.length>0){this.validationErrors.set(n.map(s=>this.transloco.translate("views.editor.missingParam",{label:s.label})));return}this.validationErrors.set([]),this.saving.set(true),this.providersApi.resolveQueryTemplate(i,e.id,this.templateParams()).subscribe({next:s=>{this.persist({query:s.query,queryTemplate:{templateId:e.id,params:this.templateParams()}});},error:s=>{this.saving.set(false),this.message.error(this.errorMessage(s,this.transloco.translate("views.editor.resolveFailed")));}});}saveFromRawJson(){let e;try{e=JSON.parse(this.queryText());}catch(i){this.validationErrors.set([this.transloco.translate("views.editor.invalidJson")]);return}if(e===null||typeof e!="object"||Array.isArray(e)){this.validationErrors.set([this.transloco.translate("views.editor.invalidJson")]);return}this.persist({query:e});}persist(e){let i=this.routeId(),n=this.subjectType(),s=r({id:i??Ue(this.name()),name:this.name().trim(),subjectType:n??"",providerInstanceId:this.providerInstanceId()??"",workflowId:this.workflowId(),query:e.query},e.queryTemplate?{queryTemplate:e.queryTemplate}:{}),g=M_.safeParse(s);if(!g.success){this.saving.set(false),this.validationErrors.set(T(g.error));return}this.validationErrors.set([]),this.saving.set(true);let S=g.data;(this.isNew()||!i?this.viewsApi.create(S):this.viewsApi.update(i,S)).subscribe({next:q=>{this.saving.set(false),this.message.success(this.transloco.translate(this.isNew()?"views.editor.created":"views.editor.saved")),this.isNew()&&this.router.navigate(["/views",q.id,"edit"]);},error:q=>{this.saving.set(false),this.message.error(this.errorMessage(q,this.transloco.translate("views.editor.saveFailed")));}});}refreshTemplates(){let e=this.providerInstanceId();if(!e){this.templates.set([]),this.applyLoadedTemplates([]);return}this.providersApi.listQueryTemplates(e).subscribe({next:i=>{this.templates.set(i),this.applyLoadedTemplates(i);},error:()=>{this.templates.set([]),this.applyLoadedTemplates([]);}});}applyLoadedTemplates(e){let i=this.pendingProvenance;if(i){let n=e.find(s=>s.id===i.templateId);n?(this.queryMode.set("template"),this.selectedTemplateId.set(n.id),this.templateParams.set(r(r({},Te(n)),i.params))):(this.queryMode.set("raw"),this.selectedTemplateId.set(null)),this.pendingProvenance=void 0;return}if(this.queryMode()!=="raw"){if(e.length===0){this.queryMode.set("raw"),this.selectedTemplateId.set(null),this.templateParams.set({});return}e.some(n=>n.id===this.selectedTemplateId())||this.selectTemplate(e[0].id);}}errorMessage(e,i){return e instanceof o||e instanceof Error?e.message:i}static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-view-editor"]],decls:15,vars:10,consts:[["data-testid","view-editor",1,"editor"],[1,"header"],[1,"header-actions"],["routerLink","/views"],["nz-button","","nzType","primary","type","button","data-testid","save-button",3,"click","nzLoading","disabled"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","validation-errors",1,"errors"],[1,"field"],["nz-input","","data-testid","view-name",3,"ngModelChange","ngModel"],["data-testid","view-workflow",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],["data-testid","query-mode-toggle",1,"field"],["data-testid","view-instance-empty",1,"error"],["data-testid","view-instance-field",1,"field",3,"field-attention"],["data-testid","view-instance-field",1,"field"],["data-testid","view-instance-needed",1,"attention"],["data-testid","view-instance",3,"ngModelChange","nzPlaceHolder","ngModel"],[1,"mode-toggle"],["nz-button","","type","button","data-testid","query-mode-template",3,"click","nzType"],["nz-button","","type","button","data-testid","query-mode-raw",3,"click","nzType"],["data-testid","view-template",3,"ngModelChange","ngModel"],[1,"required"],[3,"ngModel"],["nz-input","",3,"ngModel"],[3,"ngModelChange","ngModel"],["nz-input","",3,"ngModelChange","ngModel"],["nz-input","","rows","8","data-testid","view-query",3,"ngModelChange","ngModel"],[1,"hint"]],template:function(i,n){i&1&&(_i(0,"main",0)(1,"header",1)(2,"div")(3,"h1"),vw(4),Kc()(),_i(5,"div",2)(6,"a",3),vw(7),Rw(8,"transloco"),Kc(),_i(9,"button",4),gh("click",function(){return n.save()}),vw(10),Rw(11,"transloco"),Kc()()(),bD(12,Ie,3,3,"p",5)(13,Ee,2,1,"p",6)(14,Qe,17,12),Kc()),i&2&&(gI(4),Ph(n.pageTitle()),gI(3),Ph(Ow(8,6,"views.editor.backToList")),gI(2),ch("nzLoading",n.saving())("disabled",n.loading()||!!n.loadError()),gI(),nl(" ",Ow(11,8,"common.save")," "),gI(2),_D(n.loading()?12:n.loadError()?13:14));},dependencies:[Mi,n8,S4,J6,k3,Ln,dd,zc,t7,y7,ai,z,Xb,V5,D5,Kt],styles:[".editor[_ngcontent-%COMP%]{max-width:40rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header-actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;align-items:center}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:.5rem 0}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.hint[_ngcontent-%COMP%]{font-size:.8rem;color:#78716c}.field-attention[_ngcontent-%COMP%]{border:1px solid #f59e0b;background:#fffbeb;padding:.75rem 1rem;border-radius:.35rem}.attention[_ngcontent-%COMP%]{margin:0;color:#b45309;font-size:.85rem}.mode-toggle[_ngcontent-%COMP%]{display:flex;gap:.5rem}.required[_ngcontent-%COMP%]{color:#9f1239}.errors[_ngcontent-%COMP%]{border:1px solid #fecdd3;background:#fff1f2;padding:.75rem 1rem}.errors[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .35rem;font-size:1rem}.error[_ngcontent-%COMP%]{color:#9f1239}textarea[_ngcontent-%COMP%]{font-family:ui-monospace,Consolas,monospace}"]});}}return t})();export{bt as ViewEditorComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {U}from'./chunk-Cf_xd8ER.js';import {B as Bt}from'./chunk-BjZIiizu.js';import'./chunk-DNOjVPY0.js';import {L as Lt,u as ut$1,D as Di,m as mn}from'./chunk-3mppll1n.js';import'./chunk-CEcbtdnK.js';import {C,$,a as ae,V as Ve,b as at$1,q as qo,H as Hw,u as ue,s,r,o,Q as QE,M as Mi,n as n8,J as J6,k as k3,L as Ln,d as dd,z as zc,c as t7,X as Xb,e as V5,D as D5,K as Kt,f as _i,v as vw,R as Rw,g as Kc,h as gh,j as oE,l as lh,N as ND,m as bD,S as SD,p as gI,P as Ph,O as Ow,w as nl,x as ch,y as sE,A as xD,B as _D,E as VD,F as LD,G as Pu,I as Lu}from'./main-MNK6ZYDO.js';import'./chunk-CxBYhrEj.js';var st=(e,d)=>d.id;function lt(e,d){if(e&1&&lh(0,"nz-option",10),e&2){let t=d.$implicit;ch("nzValue",t.id)("nzLabel",t.name+" ("+t.id+")");}}function at(e,d){e&1&&(_i(0,"p",11),vw(1),Rw(2,"transloco"),Kc()),e&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function dt(e,d){if(e&1&&(_i(0,"p",12),vw(1),Kc()),e&2){let t=VD();gI(),Ph(t.runningError());}}function pt(e,d){e&1&&(_i(0,"p",13),vw(1),Rw(2,"transloco"),Kc()),e&2&&(gI(),nl(" ",Ow(2,1,"jobs.list.runningEmpty")," "));}function ht(e,d){if(e&1&&lh(0,"app-job-status-table",14),e&2){let t=VD();ch("jobs",t.runningJobs());}}function gt(e,d){if(e&1&&(lh(0,"nz-option",10),Rw(1,"transloco"),Rw(2,"transloco")),e&2){let t=d.$implicit,s=VD();ch("nzValue",t)("nzLabel",t==="all"?Ow(1,2,"jobs.list.filterAll"):Ow(2,4,s.statusKey(t)));}}function mt(e,d){if(e&1&&lh(0,"nz-option",10),e&2){let t=d.$implicit;ch("nzValue",t.id)("nzLabel",t.name+" ("+t.id+")");}}function ct(e,d){e&1&&(_i(0,"p",18),vw(1),Rw(2,"transloco"),Kc()),e&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function ut(e,d){if(e&1&&(_i(0,"p",19),vw(1),Kc()),e&2){let t=VD();gI(),Ph(t.historyError());}}function ft(e,d){e&1&&(_i(0,"p",20),vw(1),Rw(2,"transloco"),Kc()),e&2&&(gI(),nl(" ",Ow(2,1,"jobs.list.historyEmpty")," "));}function yt(e,d){if(e&1){let t=LD();_i(0,"nz-pagination",22),gh("nzPageIndexChange",function(n){Pu(t);let c=VD(2);return Lu(c.setHistoryPage(n))}),Kc();}if(e&2){let t=VD(2);ch("nzPageIndex",t.historyPageIndex())("nzPageSize",t.pageSize)("nzTotal",t.historyTotal());}}function bt(e,d){if(e&1&&(lh(0,"app-job-status-table",14),bD(1,yt,1,3,"nz-pagination",21)),e&2){let t=VD();ch("jobs",t.historyJobs()),gI(),_D(t.historyTotal()>t.pageSize||t.historyPageIndex()>1?1:-1);}}var _t=20,Ct=50,xt=3e3,rt=["completed","failed","cancelled"],Vt=(()=>{class e{constructor(){this.jobsApi=C($),this.workflowsApi=C(U),this.route=C(ae),this.transloco=C(Ve),this.destroyRef=C(at$1),this.pageSize=_t,this.historyStatusOptions=["all",...rt],this.runningJobs=qo([]),this.historyJobs=qo([]),this.workflows=qo([]),this.runningLoading=qo(true),this.historyLoading=qo(true),this.runningError=qo(null),this.historyError=qo(null),this.runningWorkflowId=qo(""),this.historyWorkflowId=qo(""),this.historyStatusFilter=qo("all"),this.showChildJobs=qo(false),this.historyPageIndex=qo(1),this.polling=qo(false),this.historyTotal=Hw(()=>{let t=(this.historyPageIndex()-1)*this.pageSize,s=this.historyJobs().length;return s<this.pageSize?t+s:t+s+1}),this.pollHandle=null,this.onVisibility=()=>{if(document.hidden){this.stopPolling();return}this.loadRunning({silent:true}),this.loadHistory({silent:true}),this.startPolling();},this.destroyRef.onDestroy(()=>{this.stopPolling(),document.removeEventListener("visibilitychange",this.onVisibility);}),this.loadWorkflows(),this.route.queryParamMap.pipe(ue(this.destroyRef)).subscribe(t=>{let s=t.get("status");s&&rt.includes(s)?this.historyStatusFilter.set(s):this.historyStatusFilter.set("all"),this.historyPageIndex.set(1),this.loadRunning(),this.loadHistory();}),document.addEventListener("visibilitychange",this.onVisibility),this.startPolling();}statusKey(t){return `jobs.status.${t}`}isPolling(){return this.polling()}setHistoryStatusFilter(t){this.historyStatusFilter.set(t),this.historyPageIndex.set(1),this.loadHistory();}setRunningWorkflowId(t){this.runningWorkflowId.set(t),this.loadRunning();}setHistoryWorkflowId(t){this.historyWorkflowId.set(t),this.historyPageIndex.set(1),this.loadHistory();}setShowChildJobs(t){this.showChildJobs.set(t),this.historyPageIndex.set(1),this.loadRunning(),this.loadHistory();}setHistoryPage(t){this.historyPageIndex.set(t),this.loadHistory();}loadWorkflows(){this.workflowsApi.list().pipe(ue(this.destroyRef)).subscribe({next:t=>{this.workflows.set(t);},error:()=>{this.workflows.set([]);}});}loadRunning(t={}){let s$1=this.runningWorkflowId();t.silent||(this.runningLoading.set(true),this.runningError.set(null)),this.jobsApi.list(s(r({terminal:false,topLevelOnly:!this.showChildJobs()},s$1?{workflowId:s$1}:{}),{limit:Ct,offset:0})).pipe(ue(this.destroyRef)).subscribe({next:n=>{this.runningJobs.set(n),this.runningLoading.set(false);},error:n=>{this.runningLoading.set(false),!t.silent&&this.runningError.set(this.errorMessage(n,this.transloco.translate("jobs.list.loadFailed")));}});}loadHistory(t={}){let s$1=this.historyStatusFilter(),n=this.historyWorkflowId();t.silent||(this.historyLoading.set(true),this.historyError.set(null)),this.jobsApi.list(s(r(r({terminal:true,topLevelOnly:!this.showChildJobs()},s$1==="all"?{}:{status:s$1}),n?{workflowId:n}:{}),{limit:this.pageSize,offset:(this.historyPageIndex()-1)*this.pageSize})).pipe(ue(this.destroyRef)).subscribe({next:c=>{this.historyJobs.set(c),this.historyLoading.set(false);},error:c=>{this.historyLoading.set(false),!t.silent&&this.historyError.set(this.errorMessage(c,this.transloco.translate("jobs.list.loadFailed")));}});}startPolling(){this.pollHandle!=null||document.hidden||(this.pollHandle=setInterval(()=>{this.loadRunning({silent:true}),this.loadHistory({silent:true});},xt),this.polling.set(true));}stopPolling(){this.pollHandle!=null&&(clearInterval(this.pollHandle),this.pollHandle=null),this.polling.set(false);}errorMessage(t,s){return t instanceof o||t instanceof Error?t.message:s}static{this.\u0275fac=function(s){return new(s||e)};}static{this.\u0275cmp=QE({type:e,selectors:[["app-job-list"]],decls:56,vars:36,consts:[["data-testid","jobs-list",1,"list-page"],[1,"header"],["nz-button","","nzType","primary","routerLink","/jobs/new","data-testid","start-job"],["nz-checkbox","","data-testid","show-child-jobs",1,"child-toggle",3,"ngModelChange","ngModel"],["data-testid","jobs-running",1,"section"],[1,"section-header"],[1,"filters"],[1,"field"],["data-testid","running-workflow-filter",3,"ngModelChange","ngModel"],["nzValue","",3,"nzLabel"],[3,"nzValue","nzLabel"],["data-testid","running-loading"],["data-testid","running-error",1,"error"],["data-testid","running-empty",1,"section-empty"],[3,"jobs"],["data-testid","jobs-history",1,"section","section-history"],["data-testid","history-status-filter",3,"ngModelChange","ngModel"],["data-testid","history-workflow-filter",3,"ngModelChange","ngModel"],["data-testid","history-loading"],["data-testid","history-error",1,"error"],["data-testid","history-empty",1,"section-empty"],["data-testid","jobs-pagination",3,"nzPageIndex","nzPageSize","nzTotal"],["data-testid","jobs-pagination",3,"nzPageIndexChange","nzPageIndex","nzPageSize","nzTotal"]],template:function(s,n){s&1&&(_i(0,"main",0)(1,"header",1)(2,"h1"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"a",2),vw(6),Rw(7,"transloco"),Kc()(),_i(8,"label",3),gh("ngModelChange",function(y){return n.setShowChildJobs(y)}),vw(9),Rw(10,"transloco"),Kc(),oE(),_i(11,"section",4)(12,"header",5)(13,"h2"),vw(14),Rw(15,"transloco"),Kc()(),_i(16,"div",6)(17,"div",7)(18,"span"),vw(19),Rw(20,"transloco"),Kc(),_i(21,"nz-select",8),gh("ngModelChange",function(y){return n.setRunningWorkflowId(y)}),lh(22,"nz-option",9),Rw(23,"transloco"),ND(24,lt,1,2,"nz-option",10,st),Kc(),oE(),Kc()(),bD(26,at,3,3,"p",11)(27,dt,2,1,"p",12)(28,pt,3,3,"p",13)(29,ht,1,1,"app-job-status-table",14),Kc(),_i(30,"section",15)(31,"header",5)(32,"h2"),vw(33),Rw(34,"transloco"),Kc()(),_i(35,"div",6)(36,"div",7)(37,"span"),vw(38),Rw(39,"transloco"),Kc(),_i(40,"nz-select",16),gh("ngModelChange",function(y){return n.setHistoryStatusFilter(y)}),ND(41,gt,3,6,"nz-option",10,SD),Kc(),oE(),Kc(),_i(43,"div",7)(44,"span"),vw(45),Rw(46,"transloco"),Kc(),_i(47,"nz-select",17),gh("ngModelChange",function(y){return n.setHistoryWorkflowId(y)}),lh(48,"nz-option",9),Rw(49,"transloco"),ND(50,mt,1,2,"nz-option",10,st),Kc(),oE(),Kc()(),bD(52,ct,3,3,"p",18)(53,ut,2,1,"p",19)(54,ft,3,3,"p",20)(55,bt,2,2),Kc()()),s&2&&(gI(3),Ph(Ow(4,16,"jobs.list.title")),gI(3),nl(" ",Ow(7,18,"jobs.list.startButton")," "),gI(2),ch("ngModel",n.showChildJobs()),sE(),gI(),nl(" ",Ow(10,20,"jobs.list.showChildJobs")," "),gI(5),Ph(Ow(15,22,"jobs.list.running")),gI(5),Ph(Ow(20,24,"jobs.list.filterByWorkflow")),gI(2),ch("ngModel",n.runningWorkflowId()),sE(),gI(),ch("nzLabel",Ow(23,26,"jobs.list.filterAll")),gI(2),xD(n.workflows()),gI(2),_D(n.runningLoading()?26:n.runningError()?27:n.runningJobs().length===0?28:29),gI(7),Ph(Ow(34,28,"jobs.list.history")),gI(5),Ph(Ow(39,30,"jobs.list.filterByStatus")),gI(2),ch("ngModel",n.historyStatusFilter()),sE(),gI(),xD(n.historyStatusOptions),gI(4),Ph(Ow(46,32,"jobs.list.filterByWorkflow")),gI(2),ch("ngModel",n.historyWorkflowId()),sE(),gI(),ch("nzLabel",Ow(49,34,"jobs.list.filterAll")),gI(2),xD(n.workflows()),gI(2),_D(n.historyLoading()?52:n.historyError()?53:n.historyJobs().length===0?54:55));},dependencies:[Mi,n8,J6,k3,Ln,dd,zc,t7,Lt,ut$1,Di,mn,Xb,V5,D5,Bt,Kt],styles:[".list-page[_ngcontent-%COMP%]{max-width:72rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:0}.child-toggle[_ngcontent-%COMP%]{align-self:flex-start}.section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.section-history[_ngcontent-%COMP%]{padding-top:1.25rem;border-top:1px solid #e7e5e4}.section-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;font-size:1.1rem}.filters[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:1rem 1.25rem;align-items:flex-end}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;min-width:12rem;max-width:18rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.section-empty[_ngcontent-%COMP%]{margin:0;color:#57534e}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return e})();export{_t as JOB_LIST_PAGE_SIZE,Ct as JOB_RUNNING_LIMIT,xt as JOB_RUNNING_POLL_MS,Vt as JobListComponent,rt as TERMINAL_JOB_STATUSES};
|
|
1
|
+
import {U}from'./chunk-jg6TAN9F.js';import {B as Bt}from'./chunk-Df_jRm7U.js';import'./chunk-CK-2DsDH.js';import {L as Lt,u as ut$1,D as Di,m as mn}from'./chunk-CrD5w72_.js';import'./chunk-hEYSTlD1.js';import {C,$,a as ae,V as Ve,b as at$1,q as qo,H as Hw,u as ue,s,r,o,Q as QE,M as Mi,n as n8,J as J6,k as k3,L as Ln,d as dd,z as zc,c as t7,X as Xb,e as V5,D as D5,K as Kt,f as _i,v as vw,R as Rw,g as Kc,h as gh,j as oE,l as lh,N as ND,m as bD,S as SD,p as gI,P as Ph,O as Ow,w as nl,x as ch,y as sE,A as xD,B as _D,E as VD,F as LD,G as Pu,I as Lu}from'./main-RRKPLQCF.js';import'./chunk-CxBYhrEj.js';var st=(e,d)=>d.id;function lt(e,d){if(e&1&&lh(0,"nz-option",10),e&2){let t=d.$implicit;ch("nzValue",t.id)("nzLabel",t.name+" ("+t.id+")");}}function at(e,d){e&1&&(_i(0,"p",11),vw(1),Rw(2,"transloco"),Kc()),e&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function dt(e,d){if(e&1&&(_i(0,"p",12),vw(1),Kc()),e&2){let t=VD();gI(),Ph(t.runningError());}}function pt(e,d){e&1&&(_i(0,"p",13),vw(1),Rw(2,"transloco"),Kc()),e&2&&(gI(),nl(" ",Ow(2,1,"jobs.list.runningEmpty")," "));}function ht(e,d){if(e&1&&lh(0,"app-job-status-table",14),e&2){let t=VD();ch("jobs",t.runningJobs());}}function gt(e,d){if(e&1&&(lh(0,"nz-option",10),Rw(1,"transloco"),Rw(2,"transloco")),e&2){let t=d.$implicit,s=VD();ch("nzValue",t)("nzLabel",t==="all"?Ow(1,2,"jobs.list.filterAll"):Ow(2,4,s.statusKey(t)));}}function mt(e,d){if(e&1&&lh(0,"nz-option",10),e&2){let t=d.$implicit;ch("nzValue",t.id)("nzLabel",t.name+" ("+t.id+")");}}function ct(e,d){e&1&&(_i(0,"p",18),vw(1),Rw(2,"transloco"),Kc()),e&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function ut(e,d){if(e&1&&(_i(0,"p",19),vw(1),Kc()),e&2){let t=VD();gI(),Ph(t.historyError());}}function ft(e,d){e&1&&(_i(0,"p",20),vw(1),Rw(2,"transloco"),Kc()),e&2&&(gI(),nl(" ",Ow(2,1,"jobs.list.historyEmpty")," "));}function yt(e,d){if(e&1){let t=LD();_i(0,"nz-pagination",22),gh("nzPageIndexChange",function(n){Pu(t);let c=VD(2);return Lu(c.setHistoryPage(n))}),Kc();}if(e&2){let t=VD(2);ch("nzPageIndex",t.historyPageIndex())("nzPageSize",t.pageSize)("nzTotal",t.historyTotal());}}function bt(e,d){if(e&1&&(lh(0,"app-job-status-table",14),bD(1,yt,1,3,"nz-pagination",21)),e&2){let t=VD();ch("jobs",t.historyJobs()),gI(),_D(t.historyTotal()>t.pageSize||t.historyPageIndex()>1?1:-1);}}var _t=20,Ct=50,xt=3e3,rt=["completed","failed","cancelled"],Vt=(()=>{class e{constructor(){this.jobsApi=C($),this.workflowsApi=C(U),this.route=C(ae),this.transloco=C(Ve),this.destroyRef=C(at$1),this.pageSize=_t,this.historyStatusOptions=["all",...rt],this.runningJobs=qo([]),this.historyJobs=qo([]),this.workflows=qo([]),this.runningLoading=qo(true),this.historyLoading=qo(true),this.runningError=qo(null),this.historyError=qo(null),this.runningWorkflowId=qo(""),this.historyWorkflowId=qo(""),this.historyStatusFilter=qo("all"),this.showChildJobs=qo(false),this.historyPageIndex=qo(1),this.polling=qo(false),this.historyTotal=Hw(()=>{let t=(this.historyPageIndex()-1)*this.pageSize,s=this.historyJobs().length;return s<this.pageSize?t+s:t+s+1}),this.pollHandle=null,this.onVisibility=()=>{if(document.hidden){this.stopPolling();return}this.loadRunning({silent:true}),this.loadHistory({silent:true}),this.startPolling();},this.destroyRef.onDestroy(()=>{this.stopPolling(),document.removeEventListener("visibilitychange",this.onVisibility);}),this.loadWorkflows(),this.route.queryParamMap.pipe(ue(this.destroyRef)).subscribe(t=>{let s=t.get("status");s&&rt.includes(s)?this.historyStatusFilter.set(s):this.historyStatusFilter.set("all"),this.historyPageIndex.set(1),this.loadRunning(),this.loadHistory();}),document.addEventListener("visibilitychange",this.onVisibility),this.startPolling();}statusKey(t){return `jobs.status.${t}`}isPolling(){return this.polling()}setHistoryStatusFilter(t){this.historyStatusFilter.set(t),this.historyPageIndex.set(1),this.loadHistory();}setRunningWorkflowId(t){this.runningWorkflowId.set(t),this.loadRunning();}setHistoryWorkflowId(t){this.historyWorkflowId.set(t),this.historyPageIndex.set(1),this.loadHistory();}setShowChildJobs(t){this.showChildJobs.set(t),this.historyPageIndex.set(1),this.loadRunning(),this.loadHistory();}setHistoryPage(t){this.historyPageIndex.set(t),this.loadHistory();}loadWorkflows(){this.workflowsApi.list().pipe(ue(this.destroyRef)).subscribe({next:t=>{this.workflows.set(t);},error:()=>{this.workflows.set([]);}});}loadRunning(t={}){let s$1=this.runningWorkflowId();t.silent||(this.runningLoading.set(true),this.runningError.set(null)),this.jobsApi.list(s(r({terminal:false,topLevelOnly:!this.showChildJobs()},s$1?{workflowId:s$1}:{}),{limit:Ct,offset:0})).pipe(ue(this.destroyRef)).subscribe({next:n=>{this.runningJobs.set(n),this.runningLoading.set(false);},error:n=>{this.runningLoading.set(false),!t.silent&&this.runningError.set(this.errorMessage(n,this.transloco.translate("jobs.list.loadFailed")));}});}loadHistory(t={}){let s$1=this.historyStatusFilter(),n=this.historyWorkflowId();t.silent||(this.historyLoading.set(true),this.historyError.set(null)),this.jobsApi.list(s(r(r({terminal:true,topLevelOnly:!this.showChildJobs()},s$1==="all"?{}:{status:s$1}),n?{workflowId:n}:{}),{limit:this.pageSize,offset:(this.historyPageIndex()-1)*this.pageSize})).pipe(ue(this.destroyRef)).subscribe({next:c=>{this.historyJobs.set(c),this.historyLoading.set(false);},error:c=>{this.historyLoading.set(false),!t.silent&&this.historyError.set(this.errorMessage(c,this.transloco.translate("jobs.list.loadFailed")));}});}startPolling(){this.pollHandle!=null||document.hidden||(this.pollHandle=setInterval(()=>{this.loadRunning({silent:true}),this.loadHistory({silent:true});},xt),this.polling.set(true));}stopPolling(){this.pollHandle!=null&&(clearInterval(this.pollHandle),this.pollHandle=null),this.polling.set(false);}errorMessage(t,s){return t instanceof o||t instanceof Error?t.message:s}static{this.\u0275fac=function(s){return new(s||e)};}static{this.\u0275cmp=QE({type:e,selectors:[["app-job-list"]],decls:56,vars:36,consts:[["data-testid","jobs-list",1,"list-page"],[1,"header"],["nz-button","","nzType","primary","routerLink","/jobs/new","data-testid","start-job"],["nz-checkbox","","data-testid","show-child-jobs",1,"child-toggle",3,"ngModelChange","ngModel"],["data-testid","jobs-running",1,"section"],[1,"section-header"],[1,"filters"],[1,"field"],["data-testid","running-workflow-filter",3,"ngModelChange","ngModel"],["nzValue","",3,"nzLabel"],[3,"nzValue","nzLabel"],["data-testid","running-loading"],["data-testid","running-error",1,"error"],["data-testid","running-empty",1,"section-empty"],[3,"jobs"],["data-testid","jobs-history",1,"section","section-history"],["data-testid","history-status-filter",3,"ngModelChange","ngModel"],["data-testid","history-workflow-filter",3,"ngModelChange","ngModel"],["data-testid","history-loading"],["data-testid","history-error",1,"error"],["data-testid","history-empty",1,"section-empty"],["data-testid","jobs-pagination",3,"nzPageIndex","nzPageSize","nzTotal"],["data-testid","jobs-pagination",3,"nzPageIndexChange","nzPageIndex","nzPageSize","nzTotal"]],template:function(s,n){s&1&&(_i(0,"main",0)(1,"header",1)(2,"h1"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"a",2),vw(6),Rw(7,"transloco"),Kc()(),_i(8,"label",3),gh("ngModelChange",function(y){return n.setShowChildJobs(y)}),vw(9),Rw(10,"transloco"),Kc(),oE(),_i(11,"section",4)(12,"header",5)(13,"h2"),vw(14),Rw(15,"transloco"),Kc()(),_i(16,"div",6)(17,"div",7)(18,"span"),vw(19),Rw(20,"transloco"),Kc(),_i(21,"nz-select",8),gh("ngModelChange",function(y){return n.setRunningWorkflowId(y)}),lh(22,"nz-option",9),Rw(23,"transloco"),ND(24,lt,1,2,"nz-option",10,st),Kc(),oE(),Kc()(),bD(26,at,3,3,"p",11)(27,dt,2,1,"p",12)(28,pt,3,3,"p",13)(29,ht,1,1,"app-job-status-table",14),Kc(),_i(30,"section",15)(31,"header",5)(32,"h2"),vw(33),Rw(34,"transloco"),Kc()(),_i(35,"div",6)(36,"div",7)(37,"span"),vw(38),Rw(39,"transloco"),Kc(),_i(40,"nz-select",16),gh("ngModelChange",function(y){return n.setHistoryStatusFilter(y)}),ND(41,gt,3,6,"nz-option",10,SD),Kc(),oE(),Kc(),_i(43,"div",7)(44,"span"),vw(45),Rw(46,"transloco"),Kc(),_i(47,"nz-select",17),gh("ngModelChange",function(y){return n.setHistoryWorkflowId(y)}),lh(48,"nz-option",9),Rw(49,"transloco"),ND(50,mt,1,2,"nz-option",10,st),Kc(),oE(),Kc()(),bD(52,ct,3,3,"p",18)(53,ut,2,1,"p",19)(54,ft,3,3,"p",20)(55,bt,2,2),Kc()()),s&2&&(gI(3),Ph(Ow(4,16,"jobs.list.title")),gI(3),nl(" ",Ow(7,18,"jobs.list.startButton")," "),gI(2),ch("ngModel",n.showChildJobs()),sE(),gI(),nl(" ",Ow(10,20,"jobs.list.showChildJobs")," "),gI(5),Ph(Ow(15,22,"jobs.list.running")),gI(5),Ph(Ow(20,24,"jobs.list.filterByWorkflow")),gI(2),ch("ngModel",n.runningWorkflowId()),sE(),gI(),ch("nzLabel",Ow(23,26,"jobs.list.filterAll")),gI(2),xD(n.workflows()),gI(2),_D(n.runningLoading()?26:n.runningError()?27:n.runningJobs().length===0?28:29),gI(7),Ph(Ow(34,28,"jobs.list.history")),gI(5),Ph(Ow(39,30,"jobs.list.filterByStatus")),gI(2),ch("ngModel",n.historyStatusFilter()),sE(),gI(),xD(n.historyStatusOptions),gI(4),Ph(Ow(46,32,"jobs.list.filterByWorkflow")),gI(2),ch("ngModel",n.historyWorkflowId()),sE(),gI(),ch("nzLabel",Ow(49,34,"jobs.list.filterAll")),gI(2),xD(n.workflows()),gI(2),_D(n.historyLoading()?52:n.historyError()?53:n.historyJobs().length===0?54:55));},dependencies:[Mi,n8,J6,k3,Ln,dd,zc,t7,Lt,ut$1,Di,mn,Xb,V5,D5,Bt,Kt],styles:[".list-page[_ngcontent-%COMP%]{max-width:72rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:0}.child-toggle[_ngcontent-%COMP%]{align-self:flex-start}.section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.section-history[_ngcontent-%COMP%]{padding-top:1.25rem;border-top:1px solid #e7e5e4}.section-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;font-size:1.1rem}.filters[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:1rem 1.25rem;align-items:flex-end}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;min-width:12rem;max-width:18rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.section-empty[_ngcontent-%COMP%]{margin:0;color:#57534e}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return e})();export{_t as JOB_LIST_PAGE_SIZE,Ct as JOB_RUNNING_LIMIT,xt as JOB_RUNNING_POLL_MS,Vt as JobListComponent,rt as TERMINAL_JOB_STATUSES};
|
package/static/index.html
CHANGED
|
@@ -10,5 +10,5 @@
|
|
|
10
10
|
<style>body{font-family:Roboto,sans-serif}body,html{width:100%;height:100%}*,:after,:before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}body{margin:0;color:#000000d9;font-size:14px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-variant:tabular-nums;line-height:1.5715;background-color:#fff;font-feature-settings:"tnum"}html{--antd-wave-shadow-color:#1890ff;--scroll-bar:0}</style><link rel="stylesheet" href="styles-6MW3GE4V.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles-6MW3GE4V.css"></noscript></head>
|
|
11
11
|
<body>
|
|
12
12
|
<app-root></app-root>
|
|
13
|
-
<script src="polyfills-YMBILSHJ.js" type="module"></script><script src="main-
|
|
13
|
+
<script src="polyfills-YMBILSHJ.js" type="module"></script><script src="main-RRKPLQCF.js" type="module"></script></body>
|
|
14
14
|
</html>
|