@ngocsangairvds/vsaf 5.1.13 → 5.1.15
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/package.json +1 -1
- package/packages/cli/dist/commands/run.d.ts +24 -5
- package/packages/cli/dist/commands/run.d.ts.map +1 -1
- package/packages/cli/dist/commands/run.js +70 -18
- package/packages/cli/dist/commands/run.js.map +1 -1
- package/packages/cli/dist/commands/status.d.ts +3 -3
- package/packages/cli/dist/commands/status.d.ts.map +1 -1
- package/packages/cli/dist/commands/status.js +6 -3
- package/packages/cli/dist/commands/status.js.map +1 -1
- package/packages/cli/dist/index.js +15 -5
- package/packages/cli/dist/index.js.map +1 -1
- package/packages/cli/dist/server/app.d.ts +9 -0
- package/packages/cli/dist/server/app.d.ts.map +1 -1
- package/packages/cli/dist/server/app.js +24 -9
- package/packages/cli/dist/server/app.js.map +1 -1
- package/packages/cli/dist/server/routes/projects.d.ts +6 -0
- package/packages/cli/dist/server/routes/projects.d.ts.map +1 -0
- package/packages/cli/dist/server/routes/projects.js +27 -0
- package/packages/cli/dist/server/routes/projects.js.map +1 -0
- package/packages/cli/dist/server/routes/providers.d.ts +3 -0
- package/packages/cli/dist/server/routes/providers.d.ts.map +1 -0
- package/packages/cli/dist/server/routes/providers.js +21 -0
- package/packages/cli/dist/server/routes/providers.js.map +1 -0
- package/packages/cli/dist/server/routes/runs.d.ts +2 -5
- package/packages/cli/dist/server/routes/runs.d.ts.map +1 -1
- package/packages/cli/dist/server/routes/runs.js +76 -40
- package/packages/cli/dist/server/routes/runs.js.map +1 -1
- package/packages/cli/dist/server/routes/workflows.d.ts +2 -1
- package/packages/cli/dist/server/routes/workflows.d.ts.map +1 -1
- package/packages/cli/dist/server/routes/workflows.js +14 -9
- package/packages/cli/dist/server/routes/workflows.js.map +1 -1
- package/packages/cli/dist/server/services/execution-manager.d.ts.map +1 -1
- package/packages/cli/dist/server/services/execution-manager.js +22 -3
- package/packages/cli/dist/server/services/execution-manager.js.map +1 -1
- package/packages/cli/dist/server/services/project-registry.d.ts +27 -0
- package/packages/cli/dist/server/services/project-registry.d.ts.map +1 -0
- package/packages/cli/dist/server/services/project-registry.js +103 -0
- package/packages/cli/dist/server/services/project-registry.js.map +1 -0
- package/packages/core/dist/engine/dag-parser.d.ts.map +1 -1
- package/packages/core/dist/engine/dag-parser.js +1 -0
- package/packages/core/dist/engine/dag-parser.js.map +1 -1
- package/packages/core/dist/schema/workflow-schema.d.ts +3 -0
- package/packages/core/dist/schema/workflow-schema.d.ts.map +1 -1
- package/packages/core/dist/schema/workflow-schema.js +1 -0
- package/packages/core/dist/schema/workflow-schema.js.map +1 -1
- package/packages/core/dist/store/recovery.d.ts.map +1 -1
- package/packages/core/dist/store/recovery.js +16 -1
- package/packages/core/dist/store/recovery.js.map +1 -1
- package/packages/core/dist/store/run-store.d.ts +3 -1
- package/packages/core/dist/store/run-store.d.ts.map +1 -1
- package/packages/core/dist/store/run-store.js +49 -1
- package/packages/core/dist/store/run-store.js.map +1 -1
- package/packages/core/dist/store/types.d.ts +16 -0
- package/packages/core/dist/store/types.d.ts.map +1 -1
- package/packages/core/dist/store/types.js.map +1 -1
- package/packages/core/dist/types/dag.d.ts +1 -0
- package/packages/core/dist/types/dag.d.ts.map +1 -1
- package/packages/core/dist/types/workflow.d.ts +1 -0
- package/packages/core/dist/types/workflow.d.ts.map +1 -1
- package/packages/web/dist/web/browser/chunk-5WD7R336.js +1 -0
- package/packages/web/dist/web/browser/chunk-FXYDTGOX.js +1 -0
- package/packages/web/dist/web/browser/chunk-K4DHLOOA.js +1 -0
- package/packages/web/dist/web/browser/chunk-V2CDNNWN.js +1 -0
- package/packages/web/dist/web/browser/chunk-WJT4QH2P.js +4 -0
- package/packages/web/dist/web/browser/chunk-WMJLW2L6.js +5 -0
- package/packages/web/dist/web/browser/chunk-XHOL7AER.js +1 -0
- package/packages/web/dist/web/browser/chunk-YBYFKZWR.js +1 -0
- package/packages/web/dist/web/browser/index.html +1 -1
- package/packages/web/dist/web/browser/main-SYHKSBNJ.js +1 -0
- package/packages/web/dist/web/browser/chunk-4YPNNQ2T.js +0 -4
- package/packages/web/dist/web/browser/chunk-E227ZHPJ.js +0 -1
- package/packages/web/dist/web/browser/chunk-JFBK3MNW.js +0 -1
- package/packages/web/dist/web/browser/chunk-L2VOQBBI.js +0 -1
- package/packages/web/dist/web/browser/chunk-OJJM5VOH.js +0 -1
- package/packages/web/dist/web/browser/chunk-U2H3QYAG.js +0 -5
- package/packages/web/dist/web/browser/chunk-VA7KFQOR.js +0 -1
- package/packages/web/dist/web/browser/chunk-WV3C6DNH.js +0 -1
- package/packages/web/dist/web/browser/main-THGFWXYL.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as b,C as he,D as A,E as s,G as X,H as l,I as h,K as fe,L as ge,_ as M,a as u,b as d,ca as Y,d as se,e as ae,g as le,h as ue,k as P,l as p,la as _,n as Z,o as m,p as R,ra as f,sa as F,u as de,ua as K,v as V,va as pe,wa as J,x as D,y as ce,z as k}from"./chunk-WMJLW2L6.js";var Ae=(()=>{class n{_renderer;_elementRef;onChange=e=>{};onTouched=()=>{};constructor(e,i){this._renderer=e,this._elementRef=i}setProperty(e,i){this._renderer.setProperty(this._elementRef.nativeElement,e,i)}registerOnTouched(e){this.onTouched=e}registerOnChange(e){this.onChange=e}setDisabledState(e){this.setProperty("disabled",e)}static \u0275fac=function(i){return new(i||n)(s(A),s(b))};static \u0275dir=l({type:n})}return n})(),te=(()=>{class n extends Ae{static \u0275fac=(()=>{let e;return function(r){return(e||(e=k(n)))(r||n)}})();static \u0275dir=l({type:n,features:[h]})}return n})(),W=new m("");var Ue={provide:W,useExisting:p(()=>Me),multi:!0};function He(){let n=J()?J().getUserAgent():"";return/android (\d+)/.test(n.toLowerCase())}var Le=new m(""),Me=(()=>{class n extends Ae{_compositionMode;_composing=!1;constructor(e,i,r){super(e,i),this._compositionMode=r,this._compositionMode==null&&(this._compositionMode=!He())}writeValue(e){let i=e??"";this.setProperty("value",i)}_handleInput(e){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(e)}_compositionStart(){this._composing=!0}_compositionEnd(e){this._composing=!1,this._compositionMode&&this.onChange(e)}static \u0275fac=function(i){return new(i||n)(s(A),s(b),s(Le,8))};static \u0275dir=l({type:n,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(i,r){i&1&&M("input",function(a){return r._handleInput(a.target.value)})("blur",function(){return r.onTouched()})("compositionstart",function(){return r._compositionStart()})("compositionend",function(a){return r._compositionEnd(a.target.value)})},standalone:!1,features:[_([Ue]),h]})}return n})();var Fe=new m(""),Ee=new m("");function we(n){return n!=null}function Ie(n){return fe(n)?ae(n):n}function Se(n){let t={};return n.forEach(e=>{t=e!=null?u(u({},t),e):t}),Object.keys(t).length===0?null:t}function Ne(n,t){return t.map(e=>e(n))}function $e(n){return!n.validate}function Oe(n){return n.map(t=>$e(t)?t:e=>t.validate(e))}function We(n){if(!n)return null;let t=n.filter(we);return t.length==0?null:function(e){return Se(Ne(e,t))}}function ne(n){return n!=null?We(Oe(n)):null}function qe(n){if(!n)return null;let t=n.filter(we);return t.length==0?null:function(e){let i=Ne(e,t).map(Ie);return ue(i).pipe(le(Se))}}function ie(n){return n!=null?qe(Oe(n)):null}function me(n,t){return n===null?[t]:Array.isArray(n)?[...n,t]:[n,t]}function ze(n){return n._rawValidators}function Ze(n){return n._rawAsyncValidators}function Q(n){return n?Array.isArray(n)?n:[n]:[]}function G(n,t){return Array.isArray(n)?n.includes(t):n===t}function _e(n,t){let e=Q(t);return Q(n).forEach(r=>{G(e,r)||e.push(r)}),e}function ve(n,t){return Q(t).filter(e=>!G(n,e))}var T=class{get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators=[];_rawAsyncValidators=[];_setValidators(t){this._rawValidators=t||[],this._composedValidatorFn=ne(this._rawValidators)}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=ie(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_onDestroyCallbacks=[];_registerOnDestroy(t){this._onDestroyCallbacks.push(t)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(t=>t()),this._onDestroyCallbacks=[]}reset(t=void 0){this.control?.reset(t)}hasError(t,e){return this.control?this.control.hasError(t,e):!1}getError(t,e){return this.control?this.control.getError(t,e):null}},C=class extends T{name;get formDirective(){return null}get path(){return null}},O=class extends T{_parent=null;name=null;valueAccessor=null},B=class{_cd;constructor(t){this._cd=t}get isTouched(){return this._cd?.control?._touched?.(),!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return this._cd?.control?._pristine?.(),!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return this._cd?.control?._status?.(),!!this._cd?.control?.valid}get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return this._cd?._submitted?.(),!!this._cd?.submitted}};var Tt=(()=>{class n extends B{constructor(e){super(e)}static \u0275fac=function(i){return new(i||n)(s(O,2))};static \u0275dir=l({type:n,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(i,r){i&2&&Y("ng-untouched",r.isUntouched)("ng-touched",r.isTouched)("ng-pristine",r.isPristine)("ng-dirty",r.isDirty)("ng-valid",r.isValid)("ng-invalid",r.isInvalid)("ng-pending",r.isPending)},standalone:!1,features:[h]})}return n})(),Bt=(()=>{class n extends B{constructor(e){super(e)}static \u0275fac=function(i){return new(i||n)(s(C,10))};static \u0275dir=l({type:n,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["","formArray",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(i,r){i&2&&Y("ng-untouched",r.isUntouched)("ng-touched",r.isTouched)("ng-pristine",r.isPristine)("ng-dirty",r.isDirty)("ng-valid",r.isValid)("ng-invalid",r.isInvalid)("ng-pending",r.isPending)("ng-submitted",r.isSubmitted)},standalone:!1,features:[h]})}return n})();var E="VALID",j="INVALID",v="PENDING",w="DISABLED",g=class{},U=class extends g{value;source;constructor(t,e){super(),this.value=t,this.source=e}},S=class extends g{pristine;source;constructor(t,e){super(),this.pristine=t,this.source=e}},N=class extends g{touched;source;constructor(t,e){super(),this.touched=t,this.source=e}},y=class extends g{status;source;constructor(t,e){super(),this.status=t,this.source=e}},ee=class extends g{source;constructor(t){super(),this.source=t}},H=class extends g{source;constructor(t){super(),this.source=t}};function xe(n){return(q(n)?n.validators:n)||null}function Xe(n){return Array.isArray(n)?ne(n):n||null}function Pe(n,t){return(q(t)?t.asyncValidators:n)||null}function Ye(n){return Array.isArray(n)?ie(n):n||null}function q(n){return n!=null&&!Array.isArray(n)&&typeof n=="object"}function Ke(n,t,e){let i=n.controls;if(!(t?Object.keys(i):i).length)throw new P(1e3,"");if(!i[e])throw new P(1001,"")}function Je(n,t,e){n._forEachChild((i,r)=>{if(e[r]===void 0)throw new P(-1002,"")})}var L=class{_pendingDirty=!1;_hasOwnPendingAsyncValidator=null;_pendingTouched=!1;_onCollectionChange=()=>{};_updateOn;_parent=null;_asyncValidationSubscription;_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators;_rawAsyncValidators;value;constructor(t,e){this._assignValidators(t),this._assignAsyncValidators(e)}get validator(){return this._composedValidatorFn}set validator(t){this._rawValidators=this._composedValidatorFn=t}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(t){this._rawAsyncValidators=this._composedAsyncValidatorFn=t}get parent(){return this._parent}get status(){return f(this.statusReactive)}set status(t){f(()=>this.statusReactive.set(t))}_status=F(()=>this.statusReactive());statusReactive=D(void 0);get valid(){return this.status===E}get invalid(){return this.status===j}get pending(){return this.status===v}get disabled(){return this.status===w}get enabled(){return this.status!==w}errors;get pristine(){return f(this.pristineReactive)}set pristine(t){f(()=>this.pristineReactive.set(t))}_pristine=F(()=>this.pristineReactive());pristineReactive=D(!0);get dirty(){return!this.pristine}get touched(){return f(this.touchedReactive)}set touched(t){f(()=>this.touchedReactive.set(t))}_touched=F(()=>this.touchedReactive());touchedReactive=D(!1);get untouched(){return!this.touched}_events=new se;events=this._events.asObservable();valueChanges;statusChanges;get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(t){this._assignValidators(t)}setAsyncValidators(t){this._assignAsyncValidators(t)}addValidators(t){this.setValidators(_e(t,this._rawValidators))}addAsyncValidators(t){this.setAsyncValidators(_e(t,this._rawAsyncValidators))}removeValidators(t){this.setValidators(ve(t,this._rawValidators))}removeAsyncValidators(t){this.setAsyncValidators(ve(t,this._rawAsyncValidators))}hasValidator(t){return G(this._rawValidators,t)}hasAsyncValidator(t){return G(this._rawAsyncValidators,t)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(t={}){let e=this.touched===!1;this.touched=!0;let i=t.sourceControl??this;t.onlySelf||this._parent?.markAsTouched(d(u({},t),{sourceControl:i})),e&&t.emitEvent!==!1&&this._events.next(new N(!0,i))}markAllAsDirty(t={}){this.markAsDirty({onlySelf:!0,emitEvent:t.emitEvent,sourceControl:this}),this._forEachChild(e=>e.markAllAsDirty(t))}markAllAsTouched(t={}){this.markAsTouched({onlySelf:!0,emitEvent:t.emitEvent,sourceControl:this}),this._forEachChild(e=>e.markAllAsTouched(t))}markAsUntouched(t={}){let e=this.touched===!0;this.touched=!1,this._pendingTouched=!1;let i=t.sourceControl??this;this._forEachChild(r=>{r.markAsUntouched({onlySelf:!0,emitEvent:t.emitEvent,sourceControl:i})}),t.onlySelf||this._parent?._updateTouched(t,i),e&&t.emitEvent!==!1&&this._events.next(new N(!1,i))}markAsDirty(t={}){let e=this.pristine===!0;this.pristine=!1;let i=t.sourceControl??this;t.onlySelf||this._parent?.markAsDirty(d(u({},t),{sourceControl:i})),e&&t.emitEvent!==!1&&this._events.next(new S(!1,i))}markAsPristine(t={}){let e=this.pristine===!1;this.pristine=!0,this._pendingDirty=!1;let i=t.sourceControl??this;this._forEachChild(r=>{r.markAsPristine({onlySelf:!0,emitEvent:t.emitEvent})}),t.onlySelf||this._parent?._updatePristine(t,i),e&&t.emitEvent!==!1&&this._events.next(new S(!0,i))}markAsPending(t={}){this.status=v;let e=t.sourceControl??this;t.emitEvent!==!1&&(this._events.next(new y(this.status,e)),this.statusChanges.emit(this.status)),t.onlySelf||this._parent?.markAsPending(d(u({},t),{sourceControl:e}))}disable(t={}){let e=this._parentMarkedDirty(t.onlySelf);this.status=w,this.errors=null,this._forEachChild(r=>{r.disable(d(u({},t),{onlySelf:!0}))}),this._updateValue();let i=t.sourceControl??this;t.emitEvent!==!1&&(this._events.next(new U(this.value,i)),this._events.next(new y(this.status,i)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(d(u({},t),{skipPristineCheck:e}),this),this._onDisabledChange.forEach(r=>r(!0))}enable(t={}){let e=this._parentMarkedDirty(t.onlySelf);this.status=E,this._forEachChild(i=>{i.enable(d(u({},t),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent}),this._updateAncestors(d(u({},t),{skipPristineCheck:e}),this),this._onDisabledChange.forEach(i=>i(!1))}_updateAncestors(t,e){t.onlySelf||(this._parent?.updateValueAndValidity(t),t.skipPristineCheck||this._parent?._updatePristine({},e),this._parent?._updateTouched({},e))}setParent(t){this._parent=t}getRawValue(){return this.value}updateValueAndValidity(t={}){if(this._setInitialStatus(),this._updateValue(),this.enabled){let i=this._cancelExistingSubscription();this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===E||this.status===v)&&this._runAsyncValidator(i,t.emitEvent)}let e=t.sourceControl??this;t.emitEvent!==!1&&(this._events.next(new U(this.value,e)),this._events.next(new y(this.status,e)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),t.onlySelf||this._parent?.updateValueAndValidity(d(u({},t),{sourceControl:e}))}_updateTreeValidity(t={emitEvent:!0}){this._forEachChild(e=>e._updateTreeValidity(t)),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?w:E}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(t,e){if(this.asyncValidator){this.status=v,this._hasOwnPendingAsyncValidator={emitEvent:e!==!1,shouldHaveEmitted:t!==!1};let i=Ie(this.asyncValidator(this));this._asyncValidationSubscription=i.subscribe(r=>{this._hasOwnPendingAsyncValidator=null,this.setErrors(r,{emitEvent:e,shouldHaveEmitted:t})})}}_cancelExistingSubscription(){if(this._asyncValidationSubscription){this._asyncValidationSubscription.unsubscribe();let t=(this._hasOwnPendingAsyncValidator?.emitEvent||this._hasOwnPendingAsyncValidator?.shouldHaveEmitted)??!1;return this._hasOwnPendingAsyncValidator=null,t}return!1}setErrors(t,e={}){this.errors=t,this._updateControlsErrors(e.emitEvent!==!1,this,e.shouldHaveEmitted)}get(t){let e=t;return e==null||(Array.isArray(e)||(e=e.split(".")),e.length===0)?null:e.reduce((i,r)=>i&&i._find(r),this)}getError(t,e){let i=e?this.get(e):this;return i?.errors?i.errors[t]:null}hasError(t,e){return!!this.getError(t,e)}get root(){let t=this;for(;t._parent;)t=t._parent;return t}_updateControlsErrors(t,e,i){this.status=this._calculateStatus(),t&&this.statusChanges.emit(this.status),(t||i)&&this._events.next(new y(this.status,e)),this._parent&&this._parent._updateControlsErrors(t,e,i)}_initObservables(){this.valueChanges=new V,this.statusChanges=new V}_calculateStatus(){return this._allControlsDisabled()?w:this.errors?j:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(v)?v:this._anyControlsHaveStatus(j)?j:E}_anyControlsHaveStatus(t){return this._anyControls(e=>e.status===t)}_anyControlsDirty(){return this._anyControls(t=>t.dirty)}_anyControlsTouched(){return this._anyControls(t=>t.touched)}_updatePristine(t,e){let i=!this._anyControlsDirty(),r=this.pristine!==i;this.pristine=i,t.onlySelf||this._parent?._updatePristine(t,e),r&&this._events.next(new S(this.pristine,e))}_updateTouched(t={},e){this.touched=this._anyControlsTouched(),this._events.next(new N(this.touched,e)),t.onlySelf||this._parent?._updateTouched(t,e)}_onDisabledChange=[];_registerOnCollectionChange(t){this._onCollectionChange=t}_setUpdateStrategy(t){q(t)&&t.updateOn!=null&&(this._updateOn=t.updateOn)}_parentMarkedDirty(t){return!t&&!!this._parent?.dirty&&!this._parent._anyControlsDirty()}_find(t){return null}_assignValidators(t){this._rawValidators=Array.isArray(t)?t.slice():t,this._composedValidatorFn=Xe(this._rawValidators)}_assignAsyncValidators(t){this._rawAsyncValidators=Array.isArray(t)?t.slice():t,this._composedAsyncValidatorFn=Ye(this._rawAsyncValidators)}},$=class extends L{constructor(t,e,i){super(xe(e),Pe(i,e)),this.controls=t,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}controls;registerControl(t,e){return this.controls[t]?this.controls[t]:(this.controls[t]=e,e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange),e)}addControl(t,e,i={}){this.registerControl(t,e),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}removeControl(t,e={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],this.updateValueAndValidity({emitEvent:e.emitEvent}),this._onCollectionChange()}setControl(t,e,i={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],e&&this.registerControl(t,e),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}contains(t){return this.controls.hasOwnProperty(t)&&this.controls[t].enabled}setValue(t,e={}){Je(this,!0,t),Object.keys(t).forEach(i=>{Ke(this,!0,i),this.controls[i].setValue(t[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(t,e={}){t!=null&&(Object.keys(t).forEach(i=>{let r=this.controls[i];r&&r.patchValue(t[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e))}reset(t={},e={}){this._forEachChild((i,r)=>{i.reset(t?t[r]:null,d(u({},e),{onlySelf:!0}))}),this._updatePristine(e,this),this._updateTouched(e,this),this.updateValueAndValidity(e),e?.emitEvent!==!1&&this._events.next(new H(this))}getRawValue(){return this._reduceChildren({},(t,e,i)=>(t[i]=e.getRawValue(),t))}_syncPendingControls(){let t=this._reduceChildren(!1,(e,i)=>i._syncPendingControls()?!0:e);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_forEachChild(t){Object.keys(this.controls).forEach(e=>{let i=this.controls[e];i&&t(i,e)})}_setUpControls(){this._forEachChild(t=>{t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(t){for(let[e,i]of Object.entries(this.controls))if(this.contains(e)&&t(i))return!0;return!1}_reduceValue(){let t={};return this._reduceChildren(t,(e,i,r)=>((i.enabled||this.disabled)&&(e[r]=i.value),e))}_reduceChildren(t,e){let i=t;return this._forEachChild((r,o)=>{i=e(i,r,o)}),i}_allControlsDisabled(){for(let t of Object.keys(this.controls))if(this.controls[t].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_find(t){return this.controls.hasOwnProperty(t)?this.controls[t]:null}};var re=new m("",{factory:()=>oe}),oe="always";function Qe(n,t){return[...t.path,n]}function Re(n,t,e=oe){ke(n,t),t.valueAccessor.writeValue(n.value),(n.disabled||e==="always")&&t.valueAccessor.setDisabledState?.(n.disabled),tt(n,t),it(n,t),nt(n,t),et(n,t)}function ye(n,t){n.forEach(e=>{e.registerOnValidatorChange&&e.registerOnValidatorChange(t)})}function et(n,t){if(t.valueAccessor.setDisabledState){let e=i=>{t.valueAccessor.setDisabledState(i)};n.registerOnDisabledChange(e),t._registerOnDestroy(()=>{n._unregisterOnDisabledChange(e)})}}function ke(n,t){let e=ze(n);t.validator!==null?n.setValidators(me(e,t.validator)):typeof e=="function"&&n.setValidators([e]);let i=Ze(n);t.asyncValidator!==null?n.setAsyncValidators(me(i,t.asyncValidator)):typeof i=="function"&&n.setAsyncValidators([i]);let r=()=>n.updateValueAndValidity();ye(t._rawValidators,r),ye(t._rawAsyncValidators,r)}function tt(n,t){t.valueAccessor.registerOnChange(e=>{n._pendingValue=e,n._pendingChange=!0,n._pendingDirty=!0,n.updateOn==="change"&&je(n,t)})}function nt(n,t){t.valueAccessor.registerOnTouched(()=>{n._pendingTouched=!0,n.updateOn==="blur"&&n._pendingChange&&je(n,t),n.updateOn!=="submit"&&n.markAsTouched()})}function je(n,t){n._pendingDirty&&n.markAsDirty(),n.setValue(n._pendingValue,{emitModelToViewChange:!1}),t.viewToModelUpdate(n._pendingValue),n._pendingChange=!1}function it(n,t){let e=(i,r)=>{t.valueAccessor.writeValue(i),r&&t.viewToModelUpdate(i)};n.registerOnChange(e),t._registerOnDestroy(()=>{n._unregisterOnChange(e)})}function rt(n,t){n==null,ke(n,t)}function ot(n,t){if(!n.hasOwnProperty("model"))return!1;let e=n.model;return e.isFirstChange()?!0:!Object.is(t,e.currentValue)}function st(n){return Object.getPrototypeOf(n.constructor)===te}function at(n,t){n._syncPendingControls(),t.forEach(e=>{let i=e.control;i.updateOn==="submit"&&i._pendingChange&&(e.viewToModelUpdate(i._pendingValue),i._pendingChange=!1)})}function lt(n,t){if(!t)return null;Array.isArray(t);let e,i,r;return t.forEach(o=>{o.constructor===Me?e=o:st(o)?i=o:r=o}),r||i||e||null}var ut={provide:C,useExisting:p(()=>dt)},I=Promise.resolve(),dt=(()=>{class n extends C{callSetDisabledState;get submitted(){return f(this.submittedReactive)}_submitted=F(()=>this.submittedReactive());submittedReactive=D(!1);_directives=new Set;form;ngSubmit=new V;options;constructor(e,i,r){super(),this.callSetDisabledState=r,this.form=new $({},ne(e),ie(i))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(e){I.then(()=>{let i=this._findContainer(e.path);e.control=i.registerControl(e.name,e.control),Re(e.control,e,this.callSetDisabledState),e.control.updateValueAndValidity({emitEvent:!1}),this._directives.add(e)})}getControl(e){return this.form.get(e.path)}removeControl(e){I.then(()=>{this._findContainer(e.path)?.removeControl(e.name),this._directives.delete(e)})}addFormGroup(e){I.then(()=>{let i=this._findContainer(e.path),r=new $({});rt(r,e),i.registerControl(e.name,r),r.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(e){I.then(()=>{this._findContainer(e.path)?.removeControl?.(e.name)})}getFormGroup(e){return this.form.get(e.path)}updateModel(e,i){I.then(()=>{this.form.get(e.path).setValue(i)})}setValue(e){this.control.setValue(e)}onSubmit(e){return this.submittedReactive.set(!0),at(this.form,this._directives),this.ngSubmit.emit(e),this.form._events.next(new ee(this.control)),e?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(e=void 0){this.form.reset(e),this.submittedReactive.set(!1)}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.form._updateOn=this.options.updateOn)}_findContainer(e){return e.pop(),e.length?this.form.get(e):this.form}static \u0275fac=function(i){return new(i||n)(s(Fe,10),s(Ee,10),s(re,8))};static \u0275dir=l({type:n,selectors:[["form",3,"ngNoForm","",3,"formGroup","",3,"formArray",""],["ng-form"],["","ngForm",""]],hostBindings:function(i,r){i&1&&M("submit",function(a){return r.onSubmit(a)})("reset",function(){return r.onReset()})},inputs:{options:[0,"ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[_([ut]),h]})}return n})();function Ce(n,t){let e=n.indexOf(t);e>-1&&n.splice(e,1)}function Ve(n){return typeof n=="object"&&n!==null&&Object.keys(n).length===2&&"value"in n&&"disabled"in n}var ct=class extends L{defaultValue=null;_onChange=[];_pendingValue;_pendingChange=!1;constructor(t=null,e,i){super(xe(e),Pe(i,e)),this._applyFormState(t),this._setUpdateStrategy(e),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),q(e)&&(e.nonNullable||e.initialValueIsDefault)&&(Ve(t)?this.defaultValue=t.value:this.defaultValue=t)}setValue(t,e={}){this.value=this._pendingValue=t,this._onChange.length&&e.emitModelToViewChange!==!1&&this._onChange.forEach(i=>i(this.value,e.emitViewToModelChange!==!1)),this.updateValueAndValidity(e)}patchValue(t,e={}){this.setValue(t,e)}reset(t=this.defaultValue,e={}){this._applyFormState(t),this.markAsPristine(e),this.markAsUntouched(e),this.setValue(this.value,e),e.overwriteDefaultValue&&(this.defaultValue=this.value),this._pendingChange=!1,e?.emitEvent!==!1&&this._events.next(new H(this))}_updateValue(){}_anyControls(t){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(t){this._onChange.push(t)}_unregisterOnChange(t){Ce(this._onChange,t)}registerOnDisabledChange(t){this._onDisabledChange.push(t)}_unregisterOnDisabledChange(t){Ce(this._onDisabledChange,t)}_forEachChild(t){}_syncPendingControls(){return this.updateOn==="submit"&&(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),this._pendingChange)?(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),!0):!1}_applyFormState(t){Ve(t)?(this.value=this._pendingValue=t.value,t.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=t}};var ht={provide:O,useExisting:p(()=>ft)},De=Promise.resolve(),ft=(()=>{class n extends O{_changeDetectorRef;callSetDisabledState;control=new ct;static ngAcceptInputType_isDisabled;_registered=!1;viewModel;name="";isDisabled;model;options;update=new V;constructor(e,i,r,o,a,c){super(),this._changeDetectorRef=a,this.callSetDisabledState=c,this._parent=e,this._setValidators(i),this._setAsyncValidators(r),this.valueAccessor=lt(this,o)}ngOnChanges(e){if(this._checkForErrors(),!this._registered||"name"in e){if(this._registered&&(this._checkName(),this.formDirective)){let i=e.name.previousValue;this.formDirective.removeControl({name:i,path:this._getPath(i)})}this._setUpControl()}"isDisabled"in e&&this._updateDisabled(e),ot(e,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective?.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!!(this.options&&this.options.standalone)}_setUpStandalone(){Re(this.control,this,this.callSetDisabledState),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._checkName()}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),!this._isStandalone()&&this.name}_updateValue(e){De.then(()=>{this.control.setValue(e,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(e){let i=e.isDisabled.currentValue,r=i!==0&&pe(i);De.then(()=>{r&&!this.control.disabled?this.control.disable():!r&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(e){return this._parent?Qe(e,this._parent):[e]}static \u0275fac=function(i){return new(i||n)(s(C,9),s(Fe,10),s(Ee,10),s(W,10),s(K,8),s(re,8))};static \u0275dir=l({type:n,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"],options:[0,"ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],standalone:!1,features:[_([ht]),h,ce]})}return n})();var Ht=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275dir=l({type:n,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""],standalone:!1})}return n})();var gt={provide:W,useExisting:p(()=>Te),multi:!0};function Ge(n,t){return n==null?`${t}`:(t&&typeof t=="object"&&(t="Object"),`${n}: ${t}`.slice(0,50))}function pt(n){return n.split(":")[0]}var Te=(()=>{class n extends te{value;_optionMap=new Map;_idCounter=0;set compareWith(e){this._compareWith=e}_compareWith=Object.is;appRefInjector=R(ge).injector;destroyRef=R(de);cdr=R(K);_queuedWrite=!1;_writeValueAfterRender(){this._queuedWrite||this.appRefInjector.destroyed||(this._queuedWrite=!0,he({write:()=>{this.destroyRef.destroyed||(this._queuedWrite=!1,this.writeValue(this.value))}},{injector:this.appRefInjector}))}writeValue(e){this.cdr.markForCheck(),this.value=e;let i=this._getOptionId(e),r=Ge(i,e);this.setProperty("value",r)}registerOnChange(e){this.onChange=i=>{this.value=this._getOptionValue(i),e(this.value)}}_registerOption(){return(this._idCounter++).toString()}_getOptionId(e){for(let i of this._optionMap.keys())if(this._compareWith(this._optionMap.get(i),e))return i;return null}_getOptionValue(e){let i=pt(e);return this._optionMap.has(i)?this._optionMap.get(i):e}static \u0275fac=(()=>{let e;return function(r){return(e||(e=k(n)))(r||n)}})();static \u0275dir=l({type:n,selectors:[["select","formControlName","",3,"multiple",""],["select","formControl","",3,"multiple",""],["select","ngModel","",3,"multiple",""]],hostBindings:function(i,r){i&1&&M("change",function(a){return r.onChange(a.target.value)})("blur",function(){return r.onTouched()})},inputs:{compareWith:"compareWith"},standalone:!1,features:[_([gt]),h]})}return n})(),Lt=(()=>{class n{_element;_renderer;_select;id;constructor(e,i,r){this._element=e,this._renderer=i,this._select=r,this._select&&(this.id=this._select._registerOption())}set ngValue(e){this._select!=null&&(this._select._optionMap.set(this.id,e),this._setElementValue(Ge(this.id,e)),this._select._writeValueAfterRender())}set value(e){this._setElementValue(e),this._select?._writeValueAfterRender()}_setElementValue(e){this._renderer.setProperty(this._element.nativeElement,"value",e)}ngOnDestroy(){this._select?._optionMap.delete(this.id),this._select?._writeValueAfterRender()}static \u0275fac=function(i){return new(i||n)(s(b),s(A),s(Te,9))};static \u0275dir=l({type:n,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"},standalone:!1})}return n})(),mt={provide:W,useExisting:p(()=>Be),multi:!0};function be(n,t){return n==null?`${t}`:(typeof t=="string"&&(t=`'${t}'`),t&&typeof t=="object"&&(t="Object"),`${n}: ${t}`.slice(0,50))}function _t(n){return n.split(":")[0]}var Be=(()=>{class n extends te{value;_optionMap=new Map;_idCounter=0;set compareWith(e){this._compareWith=e}_compareWith=Object.is;writeValue(e){this.value=e;let i;if(Array.isArray(e)){let r=e.map(o=>this._getOptionId(o));i=(o,a)=>{o._setSelected(r.indexOf(a)>-1)}}else i=r=>{r._setSelected(!1)};this._optionMap.forEach(i)}registerOnChange(e){this.onChange=i=>{let r=[],o=i.selectedOptions;if(o!==void 0){let a=o;for(let c=0;c<a.length;c++){let x=a[c],z=this._getOptionValue(x.value);r.push(z)}}else{let a=i.options;for(let c=0;c<a.length;c++){let x=a[c];if(x.selected){let z=this._getOptionValue(x.value);r.push(z)}}}this.value=r,e(r)}}_registerOption(e){let i=(this._idCounter++).toString();return this._optionMap.set(i,e),i}_getOptionId(e){for(let i of this._optionMap.keys())if(this._compareWith(this._optionMap.get(i)._value,e))return i;return null}_getOptionValue(e){let i=_t(e);return this._optionMap.has(i)?this._optionMap.get(i)._value:e}static \u0275fac=(()=>{let e;return function(r){return(e||(e=k(n)))(r||n)}})();static \u0275dir=l({type:n,selectors:[["select","multiple","","formControlName",""],["select","multiple","","formControl",""],["select","multiple","","ngModel",""]],hostBindings:function(i,r){i&1&&M("change",function(a){return r.onChange(a.target)})("blur",function(){return r.onTouched()})},inputs:{compareWith:"compareWith"},standalone:!1,features:[_([mt]),h]})}return n})(),$t=(()=>{class n{_element;_renderer;_select;id;_value;constructor(e,i,r){this._element=e,this._renderer=i,this._select=r,this._select&&(this.id=this._select._registerOption(this))}set ngValue(e){this._select!=null&&(this._value=e,this._setElementValue(be(this.id,e)),this._select.writeValue(this._select.value))}set value(e){this._select?(this._value=e,this._setElementValue(be(this.id,e)),this._select.writeValue(this._select.value)):this._setElementValue(e)}_setElementValue(e){this._renderer.setProperty(this._element.nativeElement,"value",e)}_setSelected(e){this._renderer.setProperty(this._element.nativeElement,"selected",e)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}static \u0275fac=function(i){return new(i||n)(s(b),s(A),s(Be,9))};static \u0275dir=l({type:n,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"},standalone:!1})}return n})();var vt=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=X({type:n});static \u0275inj=Z({})}return n})();var Wt=(()=>{class n{static withConfig(e){return{ngModule:n,providers:[{provide:re,useValue:e.callSetDisabledState??oe}]}}static \u0275fac=function(i){return new(i||n)};static \u0275mod=X({type:n});static \u0275inj=Z({imports:[vt]})}return n})();export{Me as a,Tt as b,Bt as c,dt as d,ft as e,Ht as f,Te as g,Lt as h,$t as i,Wt as j};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as V}from"./chunk-V2CDNNWN.js";import{$ as l,B as a,Ca as h,F as g,Ga as j,Ja as L,Ma as B,N as u,O as p,Q as O,R as A,S as f,T as r,U as o,Z as $,_,c as T,ca as P,ea as s,fa as m,ga as v,ha as I,m as N,p as x,q as M,r as k,v as D,w as F,xa as C}from"./chunk-WMJLW2L6.js";var b=class i{zone=x(F);projectService=x(B);connect(t){return new T(e=>{let n=this.projectService.currentId,d=n?`?project=${encodeURIComponent(n)}`:"",c=new EventSource(`/api/runs/${t}/events${d}`),E=["node:start","node:complete","node:skip","node:fail","run:complete","run:state"];for(let R of E)c.addEventListener(R,G=>{this.zone.run(()=>{e.next({type:R,data:JSON.parse(G.data)})})});return c.onerror=()=>{this.zone.run(()=>{e.complete()}),c.close()},()=>{c.close()}})}static \u0275fac=function(e){return new(e||i)};static \u0275prov=N({token:i,factory:i.\u0275fac,providedIn:"root"})};function Q(i,t){if(i&1&&(r(0,"span",1),s(1),o()),i&2){let e=l();a(),m(e.expanded?"\u25BE":"\u25B8")}}function W(i,t){if(i&1&&(r(0,"span",4),s(1),o()),i&2){let e=l();a(),m(e.providerBadge)}}function X(i,t){if(i&1&&(r(0,"span",5),s(1),o()),i&2){let e=l();f("ngClass",e.typeBadgeClass),a(),m(e.type)}}function Y(i,t){if(i&1&&(r(0,"span",6),s(1),o()),i&2){let e=l();a(),v("",(e.durationMs/1e3).toFixed(1),"s")}}function ee(i,t){i&1&&(r(0,"span",7),s(1,"running..."),o())}function te(i,t){i&1&&(r(0,"span",8),s(1,"skipped"),o())}function ne(i,t){i&1&&(r(0,"span",9),s(1,"FAILED"),o())}var S=class i{nodeId="";status="pending";type;durationMs;provider;model;expandable=!1;expanded=!1;toggled=new D;onRowClick(){this.expandable&&this.toggled.emit()}get providerBadge(){return this.provider?this.model?`${this.provider}/${this.model}`:this.provider:""}get statusIcon(){switch(this.status){case"completed":return"\u2713";case"running":return"\u25CF";case"failed":return"\u2717";case"skipped":return"\u2298";default:return"\u25CB"}}get statusIconClass(){switch(this.status){case"completed":return"text-green-400";case"running":return"text-blue-400 animate-pulse";case"failed":return"text-red-400";case"skipped":return"text-slate-500";default:return"text-slate-600"}}get statusTextClass(){switch(this.status){case"pending":return"text-slate-500";case"skipped":return"text-slate-500";default:return"text-slate-100"}}get typeBadgeClass(){switch(this.type){case"prompt":return"bg-purple-500/10 text-purple-400";case"bash":return"bg-amber-500/10 text-amber-400";case"command":return"bg-cyan-500/10 text-cyan-400";default:return"bg-slate-700 text-slate-400"}}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=g({type:i,selectors:[["app-node-status-row"]],inputs:{nodeId:"nodeId",status:"status",type:"type",durationMs:"durationMs",provider:"provider",model:"model",expandable:"expandable",expanded:"expanded"},outputs:{toggled:"toggled"},decls:12,vars:15,consts:[[1,"flex","items-center","py-2.5","border-b","border-slate-800",3,"click"],[1,"mr-2","text-xs","text-slate-500","w-3","inline-block"],[1,"mr-3","text-sm",3,"ngClass"],[1,"flex-1",3,"ngClass"],[1,"text-xs","px-1.5","py-0.5","rounded","mr-2","bg-indigo-500/10","text-indigo-300","font-mono"],[1,"text-xs","px-1.5","py-0.5","rounded","mr-2",3,"ngClass"],[1,"font-mono","text-xs","text-slate-400"],[1,"font-mono","text-xs","text-blue-400","animate-pulse"],[1,"text-xs","text-slate-500"],[1,"text-xs","text-red-400"]],template:function(e,n){e&1&&(r(0,"div",0),_("click",function(){return n.onRowClick()}),u(1,Q,2,1,"span",1),r(2,"span",2),s(3),o(),r(4,"span",3),s(5),o(),u(6,W,2,1,"span",4),u(7,X,2,2,"span",5),u(8,Y,2,1,"span",6),u(9,ee,2,0,"span",7),u(10,te,2,0,"span",8),u(11,ne,2,0,"span",9),o()),e&2&&(P("cursor-pointer",n.expandable)("select-none",n.expandable),a(),p(n.expandable?1:-1),a(),f("ngClass",n.statusIconClass),a(),m(n.statusIcon),a(),f("ngClass",n.statusTextClass),a(),m(n.nodeId),a(),p(n.provider?6:-1),a(),p(n.type?7:-1),a(),p(n.status==="completed"&&n.durationMs!==void 0?8:-1),a(),p(n.status==="running"?9:-1),a(),p(n.status==="skipped"?10:-1),a(),p(n.status==="failed"?11:-1))},dependencies:[h,C],encapsulation:2})};var ie=new Set(["completed","failed","cancelled"]);function w(i){return i!==void 0&&ie.has(i)}function U(i,t=new Date().toISOString()){w(i.status)&&!i.completedAt&&(i.completedAt=t)}function q(i,t=Date.now()){let e=new Date(i.startedAt).getTime(),n=i.completedAt?new Date(i.completedAt).getTime():t;return Math.max(0,n-e)}function J(i){let t=Math.floor(i/1e3),e=Math.floor(t/60),n=t%60;return e>0?`${e}m ${n}s`:`${n}s`}var y=class{entries=new Map;toggle(t,e){let n=this.entry(t);return n.expanded=!n.expanded,!n.expanded||n.fetchedStatus===e&&(n.phase==="loaded"||n.phase==="loading")?!1:(n.phase="loading",n.fetchedStatus=e,n.error=void 0,!0)}statusChanged(t,e){let n=this.entries.get(t);return!n||n.fetchedStatus===void 0||n.fetchedStatus===e?!1:n.expanded?(n.phase="loading",n.fetchedStatus=e,n.error=void 0,!0):(n.phase="idle",n.data=void 0,n.error=void 0,n.fetchedStatus=void 0,!1)}resolve(t,e,n){let d=this.entries.get(t);!d||d.fetchedStatus!==e||(d.phase="loaded",d.data=n,d.error=void 0)}fail(t,e,n){let d=this.entries.get(t);!d||d.fetchedStatus!==e||(d.phase="error",d.error=n,d.data=void 0)}isExpanded(t){return this.entries.get(t)?.expanded??!1}phase(t){let e=this.entries.get(t);return!e||!e.expanded?"collapsed":e.phase==="idle"?"loading":e.phase}data(t){return this.entries.get(t)?.data}errorMessage(t){return this.entries.get(t)?.error}entry(t){let e=this.entries.get(t);return e||(e={expanded:!1,phase:"idle"},this.entries.set(t,e)),e}};var ae=(i,t)=>t.id;function oe(i,t){if(i&1&&(r(0,"span",6),s(1),o()),i&2){let e=l();f("ngClass",e.statusClass(e.run.status)),a(),I(" ",e.statusIcon(e.run.status)," ",e.run.status," ")}}function re(i,t){i&1&&(r(0,"div",11),s(1,"Loading output\u2026"),o())}function se(i,t){if(i&1&&(r(0,"div",12),s(1),o()),i&2){let e=l(2).$implicit,n=l();a(),m(n.panels.errorMessage(e.id))}}function de(i,t){if(i&1&&(r(0,"span",14),s(1),o()),i&2){let e=l();a(),I(" ",e.provider,"",e.model?"/"+e.model:""," ")}}function le(i,t){if(i&1&&(r(0,"span",15),s(1),o()),i&2){let e=l();a(),v("",(e.durationMs/1e3).toFixed(1),"s")}}function ue(i,t){if(i&1&&(r(0,"pre",16),s(1),o()),i&2){let e=l();a(),m(e.error)}}function pe(i,t){if(i&1&&(r(0,"pre",17),s(1),o()),i&2){let e=l();a(),m(e.output)}}function ce(i,t){i&1&&(r(0,"div",18),s(1,"No output"),o())}function me(i,t){if(i&1&&(r(0,"div",13),u(1,de,2,2,"span",14),u(2,le,2,1,"span",15),o(),u(3,ue,2,1,"pre",16),u(4,pe,2,1,"pre",17)(5,ce,2,0,"div",18)),i&2){let e=t;a(),p(e.provider?1:-1),a(),p(e.durationMs!==null?2:-1),a(),p(e.error?3:-1),a(),p(e.output?4:e.error?-1:5)}}function xe(i,t){if(i&1&&u(0,me,6,4),i&2){let e,n=l(2).$implicit,d=l();p((e=d.panels.data(n.id))?0:-1,e)}}function fe(i,t){if(i&1&&(r(0,"div",10),u(1,re,2,0,"div",11)(2,se,2,1,"div",12)(3,xe,1,1),o()),i&2){let e,n=l().$implicit,d=l();a(),p((e=d.panels.phase(n.id))==="loading"?1:e==="error"?2:e==="loaded"?3:-1)}}function ge(i,t){if(i&1){let e=$();r(0,"app-node-status-row",9),_("toggled",function(){let d=M(e).$implicit,c=l();return k(c.togglePanel(d))}),o(),u(1,fe,4,1,"div",10)}if(i&2){let e=t.$implicit,n=l();f("nodeId",e.id)("status",e.status)("durationMs",e.durationMs)("provider",e.provider)("model",e.model)("expandable",!0)("expanded",n.panels.isExpanded(e.id)),a(),p(n.panels.isExpanded(e.id)?1:-1)}}function _e(i,t){if(i&1&&(r(0,"div",8)(1,"span",19),s(2,"Elapsed: "),r(3,"span",20),s(4),o()(),r(5,"span",21),s(6,"Nodes: "),r(7,"span",22),s(8),o(),s(9,"/"),r(10,"span",23),s(11),o(),s(12," completed "),o()()),i&2){let e=l();a(4),m(e.elapsedDisplay),a(4),m(e.completedCount),a(3),m(e.nodes.length)}}var Z=class i{route=x(j);api=x(V);sse=x(b);run;nodes=[];panels=new y;runId="";sseSub;timerInterval;ngOnInit(){this.runId=this.route.snapshot.paramMap.get("runId"),this.api.getRun(this.runId).subscribe(t=>{this.run=t,this.rebuildNodeList(),this.stopTimerIfFinished()}),this.sseSub=this.sse.connect(this.runId).subscribe(t=>{this.handleSseEvent(t)}),this.timerInterval=setInterval(()=>{},1e3)}ngOnDestroy(){this.sseSub?.unsubscribe(),this.timerInterval&&clearInterval(this.timerInterval)}togglePanel(t){this.panels.toggle(t.id,t.status)&&this.fetchOutput(t.id,t.status)}fetchOutput(t,e){this.api.getNodeOutput(this.runId,t).subscribe({next:n=>this.panels.resolve(t,e,n),error:n=>this.panels.fail(t,e,n?.error?.error??"Failed to load node output.")})}handleSseEvent(t){let e=t.data,n=e.nodeId;switch(t.type){case"run:state":this.run=e,this.rebuildNodeList(),this.stopTimerIfFinished();break;case"node:start":this.updateNodeStatus(n,"running",void 0,{provider:e.provider,model:e.model});break;case"node:complete":this.updateNodeStatus(n,"completed",e.durationMs);break;case"node:skip":this.updateNodeStatus(n,"skipped");break;case"node:fail":this.updateNodeStatus(n,"failed");break;case"run:complete":this.run&&(this.run.status=e.success?"completed":"failed"),this.stopTimerIfFinished();break}}rebuildNodeList(){if(!this.run)return;let t=new Map(this.nodes.map(e=>[e.id,e]));this.nodes=Object.entries(this.run.nodes).map(([e,n])=>({id:e,status:n.status,durationMs:n.durationMs,provider:t.get(e)?.provider,model:t.get(e)?.model}));for(let e of this.nodes)this.noteStatus(e)}updateNodeStatus(t,e,n,d){let c=this.nodes.find(E=>E.id===t);c?(c.status=e,n!==void 0&&(c.durationMs=n)):(c={id:t,status:e,durationMs:n},this.nodes.push(c)),d?.provider&&(c.provider=d.provider),d?.model&&(c.model=d.model),this.noteStatus(c)}noteStatus(t){this.panels.statusChanged(t.id,t.status)&&this.fetchOutput(t.id,t.status)}get completedCount(){return this.nodes.filter(t=>t.status==="completed").length}get elapsedDisplay(){return this.run?J(q(this.run)):"0s"}stopTimerIfFinished(){!this.run||!w(this.run.status)||(U(this.run),this.timerInterval&&(clearInterval(this.timerInterval),this.timerInterval=void 0))}statusClass(t){switch(t){case"completed":return"bg-green-500/10 text-green-400";case"failed":return"bg-red-500/10 text-red-400";case"running":return"bg-blue-500/10 text-blue-400";default:return"bg-slate-700 text-slate-400"}}statusIcon(t){switch(t){case"completed":return"\u2713";case"failed":return"\u2717";case"running":return"\u25CF";default:return"\u25CB"}}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=g({type:i,selectors:[["app-run-execution"]],decls:17,vars:4,consts:[[1,"max-w-3xl","mx-auto"],[1,"flex","items-center","mb-6","gap-2","text-sm"],["routerLink","/",1,"text-slate-500","hover:text-slate-300"],[1,"text-slate-600"],[1,"text-slate-300"],[1,"font-mono","text-slate-100"],[1,"text-xs","px-2","py-0.5","rounded","ml-2",3,"ngClass"],[1,"mb-6"],[1,"bg-slate-800","rounded-lg","px-4","py-3","flex","items-center","text-sm"],[3,"toggled","nodeId","status","durationMs","provider","model","expandable","expanded"],[1,"border-b","border-slate-800","bg-slate-900/40","px-4","py-3"],[1,"text-xs","text-slate-500","animate-pulse"],[1,"text-xs","text-red-400"],[1,"flex","items-center","gap-3","mb-2","text-xs"],[1,"px-1.5","py-0.5","rounded","bg-indigo-500/10","text-indigo-300","font-mono"],[1,"font-mono","text-slate-400"],[1,"font-mono","text-xs","text-red-300","bg-red-500/10","border","border-red-500/30","rounded","p-3","mb-2","max-h-80","overflow-auto","whitespace-pre-wrap","break-words"],[1,"font-mono","text-xs","text-slate-300","bg-slate-950","border","border-slate-800","rounded","p-3","max-h-80","overflow-auto","whitespace-pre-wrap","break-words"],[1,"text-xs","text-slate-500","italic"],[1,"text-slate-400"],[1,"text-slate-100","font-mono"],[1,"ml-6","text-slate-400"],[1,"text-green-400"],[1,"text-slate-100"]],template:function(e,n){e&1&&(r(0,"div",0)(1,"div",1)(2,"a",2),s(3,"Dashboard"),o(),r(4,"span",3),s(5,"\u203A"),o(),r(6,"span",4),s(7),o(),r(8,"span",3),s(9,"\u203A"),o(),r(10,"span",5),s(11),o(),u(12,oe,2,3,"span",6),o(),r(13,"div",7),O(14,ge,2,8,null,null,ae),o(),u(16,_e,13,3,"div",8),o()),e&2&&(a(7),m(n.run==null?null:n.run.workflow),a(4),m(n.run==null?null:n.run.runId),a(),p(n.run?12:-1),a(2),A(n.nodes),a(2),p(n.run?16:-1))},dependencies:[h,C,L,S],encapsulation:2})};export{Z as RunExecutionComponent};
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
<style>@layer theme,base,components,utilities;@layer theme{@theme default}@theme default inline reference{--blur:8px;--shadow:0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--shadow-inner:inset 0 2px 4px 0 rgb(0 0 0 / .05);--drop-shadow:0 1px 2px rgb(0 0 0 / .1), 0 1px 1px rgb(0 0 0 / .06);--radius:.25rem;--max-width-prose:65ch}}@layer base{*,:after,:before{box-sizing:border-box;margin:0;padding:0;border:0 solid}html{line-height:1.5;-webkit-text-size-adjust:100%;tab-size:4;font-family:--theme(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:--theme(--default-font-feature-settings,normal);font-variation-settings:--theme(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}@layer utilities{}:root{--background:oklch(.14 .005 260);--surface:oklch(.18 .008 260);--surface-elevated:oklch(.22 .01 260);--border:oklch(.28 .01 260);--border-bright:oklch(.35 .015 260);--text-primary:oklch(.93 .005 260);--text-secondary:oklch(.65 .01 260);--text-tertiary:oklch(.45 .01 260);--primary:oklch(.65 .18 250);--primary-foreground:oklch(.98 .005 260);--success:oklch(.65 .17 155);--warning:oklch(.75 .15 75);--error:oklch(.6 .2 25)}@theme inline{--color-background:var(--background);--color-surface:var(--surface);--color-surface-elevated:var(--surface-elevated);--color-border:var(--border);--color-border-bright:var(--border-bright);--color-text-primary:var(--text-primary);--color-text-secondary:var(--text-secondary);--color-text-tertiary:var(--text-tertiary);--color-primary:var(--primary);--color-primary-foreground:var(--primary-foreground);--color-success:var(--success);--color-warning:var(--warning);--color-error:var(--error);--font-sans:Inter, ui-sans-serif, system-ui, sans-serif;--font-mono:"JetBrains Mono", ui-monospace, monospace}html,body{min-height:100%;background:var(--background);color:var(--text-primary);font-family:Inter,ui-sans-serif,system-ui,sans-serif}</style><link rel="stylesheet" href="styles-PWTTI45T.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles-PWTTI45T.css"></noscript></head>
|
|
10
10
|
<body>
|
|
11
11
|
<app-root></app-root>
|
|
12
|
-
<link rel="modulepreload" href="chunk-
|
|
12
|
+
<link rel="modulepreload" href="chunk-WMJLW2L6.js"><script src="polyfills-YMBILSHJ.js" type="module"></script><script src="main-SYHKSBNJ.js" type="module"></script></body>
|
|
13
13
|
</html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as c,B as a,Da as j,F as g,Fa as P,Ha as M,Ja as O,Ka as S,La as A,Ma as E,N as x,O as u,Q as h,R as C,S as d,T as n,U as o,V as b,Z as v,_,ea as r,fa as k,ma as y,p as s,q as m,r as f,ta as w}from"./chunk-WMJLW2L6.js";var L=[{path:"",loadComponent:()=>import("./chunk-FXYDTGOX.js").then(e=>e.DashboardComponent)},{path:"workflows",loadComponent:()=>import("./chunk-5WD7R336.js").then(e=>e.WorkflowsComponent)},{path:"workflows/builder",loadComponent:()=>import("./chunk-WJT4QH2P.js").then(e=>e.WorkflowBuilderComponent)},{path:"workflows/detail",loadComponent:()=>import("./chunk-K4DHLOOA.js").then(e=>e.WorkflowDetailComponent)},{path:"runs/:runId",loadComponent:()=>import("./chunk-YBYFKZWR.js").then(e=>e.RunExecutionComponent)}];var z={providers:[w({eventCoalescing:!0}),A(L),P()]};var R=()=>({exact:!0}),T=(e,i)=>i.id;function V(e,i){if(e&1&&(n(0,"option",12),r(1),o()),e&2){let t=i.$implicit,p=c(2);d("value",t.id)("selected",t.id===p.selectedId()),a(),k(t.name)}}function F(e,i){if(e&1){let t=v();n(0,"select",11),_("change",function(D){m(t);let I=c();return f(I.onProjectChange(D))}),h(1,V,2,3,"option",12,T),o()}if(e&2){let t=c();a(),C(t.projects())}}var l=class e{projectService=s(E);projects=this.projectService.projects;selectedId=this.projectService.selectedId;constructor(){this.projectService.load()}onProjectChange(i){let t=i.target.value;!t||t===this.selectedId()||(this.projectService.select(t),document.location.reload())}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=g({type:e,selectors:[["app-root"]],decls:17,vars:3,consts:[[1,"app-shell"],[1,"app-nav"],["routerLink","/",1,"brand-link"],[1,"brand-icon"],[1,"brand-name"],["routerLink","/","routerLinkActive","border-primary text-primary",1,"nav-link",3,"routerLinkActiveOptions"],["routerLink","/workflows","routerLinkActive","border-primary text-primary",1,"nav-link"],[1,"nav-spacer"],["aria-label","Project","title","Switch project",1,"project-select"],[1,"version-pill"],[1,"app-main"],["aria-label","Project","title","Switch project",1,"project-select",3,"change"],[3,"value","selected"]],template:function(t,p){t&1&&(n(0,"div",0)(1,"nav",1)(2,"a",2)(3,"span",3),r(4,"V"),o(),n(5,"span",4),r(6,"VSAF"),o()(),n(7,"a",5),r(8," Dashboard "),o(),n(9,"a",6),r(10," Workflows "),o(),n(11,"div",7),x(12,F,3,0,"select",8),n(13,"span",9),r(14,"v0.2.0"),o()()(),n(15,"main",10),b(16,"router-outlet"),o()()),t&2&&(a(7),d("routerLinkActiveOptions",y(2,R)),a(5),u(p.projects().length>1?12:-1))},dependencies:[M,O,S],styles:["[_nghost-%COMP%]{display:block;min-height:100vh;background:#101114;color:#e7e7ea}.app-shell[_ngcontent-%COMP%]{min-height:100vh;background:#101114;color:#e7e7ea}.app-nav[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;height:56px;border-bottom:1px solid #2b2d33;background:#17181d;padding:0 16px;box-sizing:border-box}.brand-link[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:9px;margin-right:18px;color:#f4f4f5;text-decoration:none}.brand-link[_ngcontent-%COMP%]:hover{opacity:.82}.brand-icon[_ngcontent-%COMP%]{display:grid;place-items:center;width:30px;height:30px;border-radius:7px;background:#6366f1;color:#fff;font-size:14px;font-weight:800}.brand-name[_ngcontent-%COMP%]{font-size:14px;font-weight:800}.nav-link[_ngcontent-%COMP%]{display:inline-flex;align-items:center;height:56px;border-bottom:2px solid transparent;padding:0 13px;color:#a1a1aa;font-size:14px;font-weight:650;text-decoration:none;box-sizing:border-box}.nav-link[_ngcontent-%COMP%]:hover{color:#f4f4f5}.nav-link.border-primary[_ngcontent-%COMP%], .nav-link.text-primary[_ngcontent-%COMP%]{border-bottom-color:#6366f1;color:#a5b4fc}.nav-spacer[_ngcontent-%COMP%]{margin-left:auto;display:flex;align-items:center;gap:12px}.project-select[_ngcontent-%COMP%]{border:1px solid #2b2d33;border-radius:7px;background:#20222a;color:#e7e7ea;padding:5px 8px;font:inherit;font-size:12px;max-width:220px;cursor:pointer}.project-select[_ngcontent-%COMP%]:focus{outline:none;border-color:#6366f1}.version-pill[_ngcontent-%COMP%]{border:1px solid #2b2d33;border-radius:7px;background:#20222a;color:#a1a1aa;padding:5px 8px;font-size:12px}.app-main[_ngcontent-%COMP%]{min-height:calc(100vh - 56px);overflow:auto;background:#101114}"]})};j(l,z).catch(e=>console.error(e));
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{a as X,b as K,e as Q,g as Z,h as ee,i as te,j as ne}from"./chunk-L2VOQBBI.js";import{a as oe}from"./chunk-OJJM5VOH.js";import{$ as S,D as I,Da as H,Fa as J,Ga as U,H as w,K as V,P as u,Q as i,R as r,S as P,T as D,U as F,W as h,X as f,Y as p,Z as $,_ as z,a as E,aa as R,b as B,ba as d,ca as _,da as k,ea as Y,fa as x,ga as b,ha as C,ka as L,n as v,na as A,o as m,p as g,q as O,r as T,va as j,wa as q,z as s,za as G}from"./chunk-U2H3QYAG.js";var ae=l=>["/runs",l];function le(l,n){if(l&1){let e=h();i(0,"button",39),f("dragstart",function(o){let a=m(e).$implicit,c=p();return g(c.onPaletteDragStart(o,a.type))})("click",function(){let o=m(e).$implicit,a=p();return g(a.addNode(o.type))}),i(1,"span",40),d(2),r(),i(3,"span")(4,"strong"),d(5),r(),i(6,"small"),d(7),r()()()}if(l&2){let e=n.$implicit,t=p();s(2),_(t.iconFor(e.type)),s(3),_(e.label),s(2),_(e.description)}}function de(l,n){if(l&1){let e=h();i(0,"button",41),f("click",function(){let o=m(e).$implicit,a=p();return g(a.loadWorkflow(o.id))}),i(1,"span"),d(2),r(),i(3,"small"),d(4),r()()}if(l&2){let e=n.$implicit;s(2),_(e.name),s(2),k("",e.nodeCount," nodes")}}function se(l,n){if(l&1&&(i(0,"div",42),d(1),r()),l&2){let e=p();S("error",e.saveState==="error"),s(),k(" ",e.statusMessage," ")}}function ce(l,n){l&1&&(i(0,"div",43)(1,"h2"),d(2,"Drop nodes here"),r(),i(3,"p"),d(4,"Build a DAG by adding Bash, Command, and Prompt nodes."),r()())}function pe(l,n){if(l&1&&(O(),P(0,"line")),l&2){let e=n.$implicit;V("x1",e.x1)("y1",e.y1)("x2",e.x2)("y2",e.y2)}}function me(l,n){if(l&1){let e=h();i(0,"button",44),f("click",function(){let o=m(e).$implicit,a=p();return g(a.selectNode(o))})("dragstart",function(o){let a=m(e).$implicit,c=p();return g(c.onNodeDragStart(o,a))}),i(1,"span",45),d(2),r(),i(3,"span",46)(4,"strong"),d(5),r(),i(6,"small"),d(7),r()()()}if(l&2){let e=n.$implicit,t=p();z("left",e.x,"px")("top",e.y,"px"),S("selected",(t.selectedNode==null?null:t.selectedNode.id)===e.id),s(2),_(t.iconFor(e.type)),s(3),_(e.id),s(2),Y("",e.type," \xB7 ",e.dependsOn.length||0," deps")}}function ge(l,n){if(l&1){let e=h();i(0,"label",59)(1,"input",60),f("change",function(o){let a=m(e).$implicit,c=p(2);return g(c.toggleDependency(a.id,o))}),r(),i(2,"span"),d(3),r()()}if(l&2){let e=n.$implicit,t=p(2);s(),u("checked",t.selectedNode.dependsOn.includes(e.id)),s(2),_(e.id)}}function ue(l,n){if(l&1){let e=h();D(0),i(1,"div",34),d(2,"Inspector"),r(),i(3,"label",47),d(4,"Node ID"),r(),i(5,"input",48),f("ngModelChange",function(o){m(e);let a=p();return g(a.renameSelectedNode(o))}),r(),i(6,"label",49),d(7,"Type"),r(),i(8,"select",50),C("ngModelChange",function(o){m(e);let a=p();return b(a.selectedNode.type,o)||(a.selectedNode.type=o),g(o)}),f("ngModelChange",function(){m(e);let o=p();return g(o.refreshYaml())}),i(9,"option",51),d(10,"bash"),r(),i(11,"option",52),d(12,"command"),r(),i(13,"option",53),d(14,"prompt"),r()(),i(15,"label",54),d(16,"Content"),r(),i(17,"textarea",55),C("ngModelChange",function(o){m(e);let a=p();return b(a.selectedNode.content,o)||(a.selectedNode.content=o),g(o)}),f("ngModelChange",function(){m(e);let o=p();return g(o.refreshYaml())}),r(),i(18,"label",56),d(19,"Depends on"),r(),w(20,ge,4,2,"label",57),i(21,"button",58),f("click",function(){m(e);let o=p();return g(o.deleteSelectedNode())}),d(22,"Delete Node"),r(),F()}if(l&2){let e=p();s(5),u("ngModel",e.selectedNode.id),s(3),x("ngModel",e.selectedNode.type),s(9),x("ngModel",e.selectedNode.content),s(3),u("ngForOf",e.dependencyCandidates)}}function fe(l,n){l&1&&(i(0,"div",34),d(1,"Inspector"),r(),i(2,"p",61),d(3,"Select a node to edit its ID, type, command body, and dependencies."),r())}function _e(l,n){if(l&1&&(i(0,"a",62)(1,"span")(2,"strong"),d(3),r(),i(4,"small"),d(5),r()(),i(6,"em"),d(7),r()()),l&2){let e=n.$implicit,t=p();u("routerLink",L(6,ae,e.runId)),s(3),_(e.workflow),s(2),_(e.runId),s(),R(t.statusClass(e.status)),s(),_(e.status)}}function we(l,n){l&1&&(i(0,"p",61),d(1,"No runs yet."),r())}var ie=class l{api=v(oe);router=v(J);route=v(H);palette=[{type:"bash",label:"Bash",description:"Run a shell step"},{type:"command",label:"Command",description:"Use a .vsaf command"},{type:"prompt",label:"Prompt",description:"Call an AI provider"}];workflowName="new-workflow";workflowFolder="";description="Draft workflow";nodes=[];selectedNode;workflows=[];runs=[];yamlPreview="";saveState="idle";statusMessage="";draggingType;draggingNodeId;ngOnInit(){this.workflowFolder=N(this.route.snapshot.queryParamMap.get("folder")??""),this.refreshData(),this.resetBuilder();let n=this.route.snapshot.queryParamMap.get("edit");n&&this.loadWorkflow(n)}refreshData(){this.api.getWorkflows().subscribe(n=>this.workflows=n),this.api.getRuns().subscribe(n=>this.runs=n.slice().reverse().slice(0,8))}resetBuilder(){this.workflowName="new-workflow",this.description="Draft workflow",this.nodes=[this.makeNode("bash",80,100,"setup"),this.makeNode("command",330,170,"review")],this.nodes[1].dependsOn=[this.nodes[0].id],this.selectedNode=this.nodes[0],this.setStatus(""),this.refreshYaml()}get workflowId(){let n=N(this.workflowFolder),e=y(this.workflowName);return n?`${n}/${e}`:e}onPaletteDragStart(n,e){this.draggingType=e,n.dataTransfer?.setData("application/x-vsaf-node-type",e),n.dataTransfer?.setData("text/plain",e)}onNodeDragStart(n,e){this.draggingNodeId=e.id,n.dataTransfer?.setData("application/x-vsaf-node-id",e.id)}onCanvasDragOver(n){n.preventDefault()}onCanvasDrop(n){n.preventDefault();let e=n.currentTarget.getBoundingClientRect(),t=Math.max(18,n.clientX-e.left-95),o=Math.max(18,n.clientY-e.top-24),a=n.dataTransfer?.getData("application/x-vsaf-node-id")||this.draggingNodeId;if(a){let M=this.nodes.find(re=>re.id===a);M&&(M.x=t,M.y=o,this.selectNode(M),this.refreshYaml()),this.draggingNodeId=void 0;return}let c=n.dataTransfer?.getData("application/x-vsaf-node-type")||this.draggingType;c&&this.addNode(c,t,o),this.draggingType=void 0}addNode(n,e=90+this.nodes.length*34,t=90+this.nodes.length*42){let o=this.makeNode(n,e,t);this.nodes=[...this.nodes,o],this.selectNode(o),this.refreshYaml()}selectNode(n){this.selectedNode=n}renameSelectedNode(n){if(!this.selectedNode)return;let e=y(n);if(!e)return;let t=this.selectedNode.id;if(t!==e){if(this.nodes.some(o=>o.id===e)){this.setStatus(`Node ID already exists: ${e}`,"error");return}this.selectedNode.id=e;for(let o of this.nodes)o.dependsOn=o.dependsOn.map(a=>a===t?e:a);this.refreshYaml()}}toggleDependency(n,e){if(!this.selectedNode)return;e.target.checked?this.selectedNode.dependsOn=[...new Set([...this.selectedNode.dependsOn,n])]:this.selectedNode.dependsOn=this.selectedNode.dependsOn.filter(o=>o!==n),this.refreshYaml()}deleteSelectedNode(){if(!this.selectedNode)return;let n=this.selectedNode.id;this.nodes=this.nodes.filter(e=>e.id!==n).map(e=>B(E({},e),{dependsOn:e.dependsOn.filter(t=>t!==n)})),this.selectedNode=this.nodes[0],this.refreshYaml()}loadWorkflow(n){this.api.getWorkflow(n).subscribe(e=>{let t=e.id.lastIndexOf("/");this.workflowFolder=t>=0?e.id.slice(0,t):"",this.workflowName=t>=0?e.id.slice(t+1):e.id,this.description=e.description||"Workflow loaded from disk",this.nodes=e.nodes.map((o,a)=>({id:o.id,type:o.type,title:o.id,content:o.content,dependsOn:o.dependsOn,x:80+a%3*250,y:80+Math.floor(a/3)*120})),this.selectedNode=this.nodes[0],this.setStatus(`Loaded ${e.name}`),this.refreshYaml()})}saveWorkflow(){this.saveCurrentWorkflow()}runWorkflow(){this.saveCurrentWorkflow(n=>{this.api.startRun(n,"").subscribe({next:e=>this.router.navigate(["/runs",e.runId]),error:e=>this.setStatus(e?.error?.error??e?.message??"Run failed","error")})})}refreshYaml(){this.yamlPreview=xe(this.workflowName,this.description,this.nodes),this.saveState==="saved"&&(this.saveState="idle")}get dependencyCandidates(){return this.selectedNode?this.nodes.filter(n=>n.id!==this.selectedNode.id):[]}get edges(){let n=new Map(this.nodes.map(t=>[t.id,t])),e=[];for(let t of this.nodes)for(let o of t.dependsOn){let a=n.get(o);a&&e.push({x1:a.x+190,y1:a.y+28,x2:t.x,y2:t.y+28})}return e}iconFor(n){switch(n){case"bash":return"$";case"command":return"/";case"prompt":return"AI"}}statusClass(n){switch(n){case"completed":return"status-completed";case"failed":return"status-failed";case"running":return"status-running";default:return"status-default"}}saveCurrentWorkflow(n){let e=y(this.workflowName),t=N(this.workflowFolder),o=t?`${t}/${e}`:e;if(!e||this.nodes.length===0){this.setStatus("Workflow name and at least one node are required.","error");return}this.workflowName=e,this.refreshYaml(),this.saveState="saving",this.api.saveWorkflow(o,this.yamlPreview).subscribe({next:()=>{this.saveState="saved",this.setStatus(`Saved ${o}`),this.refreshData(),n?.(o)},error:a=>{this.saveState="error",this.setStatus(a?.error?.error??a?.message??"Save failed","error")}})}makeNode(n,e,t,o=n){let a=be(this.nodes.map(c=>c.id),`${n}-${o}`);return{id:a,type:n,title:a,content:he(n,a),dependsOn:[],x:e,y:t}}setStatus(n,e="idle"){this.statusMessage=n,this.saveState=e}static \u0275fac=function(e){return new(e||l)};static \u0275cmp=I({type:l,selectors:[["app-workflow-builder"]],decls:63,vars:19,consts:[["noSelection",""],[1,"builder-shell"],[1,"sidebar"],[1,"brand-row"],[1,"brand-mark"],[1,"brand-title"],[1,"brand-subtitle"],["for","workflow-folder",1,"field-label"],["id","workflow-folder","placeholder","e.g. sdlc/release",1,"text-input",3,"ngModelChange","ngModel"],["for","workflow-name",1,"field-label"],["id","workflow-name",1,"text-input",3,"ngModelChange","ngModel"],["for","workflow-description",1,"field-label"],["id","workflow-description","rows","3",1,"text-area",3,"ngModelChange","ngModel"],[1,"section-title"],["type","button","class","palette-item","draggable","true",3,"dragstart","click",4,"ngFor","ngForOf"],["type","button","class","workflow-link",3,"click",4,"ngFor","ngForOf"],[1,"workspace"],[1,"toolbar"],[1,"toolbar-actions"],["type","button",1,"ghost-button",3,"click"],["type","button",1,"primary-button",3,"click","disabled"],["type","button",1,"run-button",3,"click","disabled"],["class","status-row",3,"error",4,"ngIf"],[1,"builder-grid"],[1,"canvas",3,"dragover","drop"],[1,"canvas-grid"],["class","empty-state",4,"ngIf"],["aria-hidden","true",1,"edges"],[4,"ngFor","ngForOf"],["type","button","class","node-card","draggable","true",3,"selected","left","top","click","dragstart",4,"ngFor","ngForOf"],[1,"inspector"],[4,"ngIf","ngIfElse"],[1,"bottom-grid"],[1,"yaml-panel"],[1,"panel-title"],[1,"yaml-editor",3,"ngModelChange","ngModel"],[1,"runs-panel"],["class","run-row",3,"routerLink",4,"ngFor","ngForOf"],["class","muted",4,"ngIf"],["type","button","draggable","true",1,"palette-item",3,"dragstart","click"],[1,"palette-icon"],["type","button",1,"workflow-link",3,"click"],[1,"status-row"],[1,"empty-state"],["type","button","draggable","true",1,"node-card",3,"click","dragstart"],[1,"node-kind"],[1,"node-copy"],["for","node-id",1,"field-label"],["id","node-id",1,"text-input",3,"ngModelChange","ngModel"],["for","node-type",1,"field-label"],["id","node-type",1,"text-input",3,"ngModelChange","ngModel"],["value","bash"],["value","command"],["value","prompt"],["for","node-content",1,"field-label"],["id","node-content","rows","7",1,"text-area","mono",3,"ngModelChange","ngModel"],[1,"field-label"],["class","check-row",4,"ngFor","ngForOf"],["type","button",1,"danger-button",3,"click"],[1,"check-row"],["type","checkbox",3,"change","checked"],[1,"muted"],[1,"run-row",3,"routerLink"]],template:function(e,t){if(e&1){let o=h();i(0,"section",1)(1,"aside",2)(2,"div",3)(3,"div",4),d(4,"V"),r(),i(5,"div")(6,"div",5),d(7,"VSAF Builder"),r(),i(8,"div",6),d(9,"Workflow canvas"),r()()(),i(10,"label",7),d(11,"Folder"),r(),i(12,"input",8),C("ngModelChange",function(c){return m(o),b(t.workflowFolder,c)||(t.workflowFolder=c),g(c)}),r(),i(13,"label",9),d(14,"Workflow name"),r(),i(15,"input",10),C("ngModelChange",function(c){return m(o),b(t.workflowName,c)||(t.workflowName=c),g(c)}),f("ngModelChange",function(){return t.refreshYaml()}),r(),i(16,"label",11),d(17,"Description"),r(),i(18,"textarea",12),C("ngModelChange",function(c){return m(o),b(t.description,c)||(t.description=c),g(c)}),f("ngModelChange",function(){return t.refreshYaml()}),r(),i(19,"div",13),d(20,"Node Palette"),r(),w(21,le,8,3,"button",14),i(22,"div",13),d(23,"Existing"),r(),w(24,de,5,2,"button",15),r(),i(25,"main",16)(26,"header",17)(27,"div")(28,"h1"),d(29),r(),i(30,"p"),d(31),r()(),i(32,"div",18)(33,"button",19),f("click",function(){return t.resetBuilder()}),d(34,"New"),r(),i(35,"button",19),f("click",function(){return t.refreshData()}),d(36,"Reload"),r(),i(37,"button",20),f("click",function(){return t.saveWorkflow()}),d(38),r(),i(39,"button",21),f("click",function(){return t.runWorkflow()}),d(40,"Run"),r()()(),w(41,se,2,3,"div",22),i(42,"div",23)(43,"section",24),f("dragover",function(c){return t.onCanvasDragOver(c)})("drop",function(c){return t.onCanvasDrop(c)}),P(44,"div",25),w(45,ce,5,0,"div",26),O(),i(46,"svg",27),w(47,pe,1,4,"line",28),r(),w(48,me,8,10,"button",29),r(),T(),i(49,"aside",30),w(50,ue,23,4,"ng-container",31)(51,fe,4,0,"ng-template",null,0,A),r()(),i(53,"section",32)(54,"div",33)(55,"div",34),d(56,"Workflow YAML"),r(),i(57,"textarea",35),C("ngModelChange",function(c){return m(o),b(t.yamlPreview,c)||(t.yamlPreview=c),g(c)}),r()(),i(58,"div",36)(59,"div",34),d(60,"Recent Runs"),r(),w(61,_e,8,8,"a",37)(62,we,2,0,"p",38),r()()()()}if(e&2){let o=$(52);s(12),x("ngModel",t.workflowFolder),s(3),x("ngModel",t.workflowName),s(3),x("ngModel",t.description),s(3),u("ngForOf",t.palette),s(3),u("ngForOf",t.workflows),s(5),_(t.workflowId||"untitled-workflow"),s(2),k("",t.nodes.length," nodes \xB7 drag from palette or click a node to edit"),s(6),u("disabled",t.saveState==="saving"),s(),k(" ",t.saveState==="saving"?"Saving...":"Save Workflow"," "),s(),u("disabled",t.nodes.length===0),s(2),u("ngIf",t.statusMessage),s(4),u("ngIf",t.nodes.length===0),s(2),u("ngForOf",t.edges),s(),u("ngForOf",t.nodes),s(2),u("ngIf",t.selectedNode)("ngIfElse",o),s(7),x("ngModel",t.yamlPreview),s(4),u("ngForOf",t.runs),s(),u("ngIf",t.runs.length===0)}},dependencies:[G,j,q,ne,ee,te,X,Z,K,Q,U],styles:["[_nghost-%COMP%]{display:block;min-height:calc(100vh - 56px);background:#101114;color:#e7e7ea}button[_ngcontent-%COMP%], input[_ngcontent-%COMP%], textarea[_ngcontent-%COMP%], select[_ngcontent-%COMP%]{font:inherit}.builder-shell[_ngcontent-%COMP%]{display:grid;grid-template-columns:280px minmax(0,1fr);min-height:calc(100vh - 56px)}.sidebar[_ngcontent-%COMP%]{border-right:1px solid #2b2d33;background:#17181d;padding:16px;overflow:auto}.brand-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;margin-bottom:22px}.brand-mark[_ngcontent-%COMP%]{display:grid;place-items:center;width:34px;height:34px;border-radius:8px;background:#6366f1;color:#fff;font-weight:700}.brand-title[_ngcontent-%COMP%]{font-size:15px;font-weight:700}.brand-subtitle[_ngcontent-%COMP%], .muted[_ngcontent-%COMP%], small[_ngcontent-%COMP%]{color:#9ca3af}.field-label[_ngcontent-%COMP%], .section-title[_ngcontent-%COMP%]{display:block;margin:14px 0 7px;color:#a1a1aa;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.08em}.text-input[_ngcontent-%COMP%], .text-area[_ngcontent-%COMP%]{width:100%;box-sizing:border-box;border:1px solid #333640;border-radius:7px;background:#101114;color:#f4f4f5;padding:9px 10px;outline:none}.text-input[_ngcontent-%COMP%]:focus, .text-area[_ngcontent-%COMP%]:focus, .yaml-editor[_ngcontent-%COMP%]:focus{border-color:#6366f1;box-shadow:0 0 0 2px #6366f12e}.text-area[_ngcontent-%COMP%]{resize:vertical}.mono[_ngcontent-%COMP%], .yaml-editor[_ngcontent-%COMP%]{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.palette-item[_ngcontent-%COMP%], .workflow-link[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;width:100%;border:1px solid #2b2d33;border-radius:8px;background:#1f2128;color:#e7e7ea;padding:10px;margin-bottom:8px;text-align:left;cursor:grab}.palette-item[_ngcontent-%COMP%]:hover, .workflow-link[_ngcontent-%COMP%]:hover{border-color:#4f46e5;background:#242633}.palette-icon[_ngcontent-%COMP%]{display:grid;place-items:center;width:28px;height:28px;border-radius:7px;background:#111827;color:#a5b4fc}.palette-item[_ngcontent-%COMP%] strong[_ngcontent-%COMP%], .workflow-link[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;font-size:13px}.palette-item[_ngcontent-%COMP%] small[_ngcontent-%COMP%], .workflow-link[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{display:block;font-size:11px;margin-top:2px}.workflow-link[_ngcontent-%COMP%]{justify-content:space-between;cursor:pointer}.workspace[_ngcontent-%COMP%]{min-width:0;padding:18px;overflow:auto}.toolbar[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:16px;align-items:center;margin-bottom:12px}.toolbar[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:0;font-size:20px}.toolbar[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:4px 0 0;color:#9ca3af;font-size:13px}.toolbar-actions[_ngcontent-%COMP%]{display:flex;gap:8px;flex-wrap:wrap}.ghost-button[_ngcontent-%COMP%], .primary-button[_ngcontent-%COMP%], .run-button[_ngcontent-%COMP%], .danger-button[_ngcontent-%COMP%]{border:1px solid #333640;border-radius:7px;padding:8px 12px;color:#f4f4f5;background:#20222a;cursor:pointer}.primary-button[_ngcontent-%COMP%]{background:#4f46e5;border-color:#4f46e5}.run-button[_ngcontent-%COMP%]{background:#059669;border-color:#059669}.danger-button[_ngcontent-%COMP%]{width:100%;margin-top:14px;background:#3f1d24;border-color:#7f1d1d;color:#fecaca}.primary-button[_ngcontent-%COMP%]:disabled, .run-button[_ngcontent-%COMP%]:disabled{opacity:.55;cursor:not-allowed}.status-row[_ngcontent-%COMP%]{border:1px solid #1f5f45;border-radius:8px;background:#092d22;color:#a7f3d0;padding:10px 12px;margin-bottom:12px;font-size:13px}.status-row.error[_ngcontent-%COMP%]{border-color:#7f1d1d;background:#2a1217;color:#fecaca}.builder-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(520px,1fr) 320px;gap:14px;min-height:470px}.canvas[_ngcontent-%COMP%]{position:relative;overflow:hidden;min-height:470px;border:1px solid #2b2d33;border-radius:8px;background:#15161b}.canvas-grid[_ngcontent-%COMP%]{position:absolute;inset:0;background-image:linear-gradient(#24262e 1px,transparent 1px),linear-gradient(90deg,#24262e 1px,transparent 1px);background-size:28px 28px;opacity:.45}.empty-state[_ngcontent-%COMP%]{position:absolute;inset:0;display:grid;place-content:center;text-align:center;color:#9ca3af;pointer-events:none}.empty-state[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 6px;color:#e7e7ea}.edges[_ngcontent-%COMP%]{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}.edges[_ngcontent-%COMP%] line[_ngcontent-%COMP%]{stroke:#6366f1;stroke-width:2;stroke-dasharray:5 5;opacity:.8}.node-card[_ngcontent-%COMP%]{position:absolute;z-index:2;display:flex;align-items:center;gap:10px;width:190px;border:1px solid #3f4250;border-radius:8px;background:#20222a;color:#f4f4f5;padding:11px;cursor:move;text-align:left;box-shadow:0 12px 28px #00000038}.node-card.selected[_ngcontent-%COMP%]{border-color:#818cf8;box-shadow:0 0 0 2px #6366f147,0 12px 28px #00000038}.node-kind[_ngcontent-%COMP%]{display:grid;place-items:center;width:30px;height:30px;border-radius:7px;background:#111827;color:#a5b4fc}.node-copy[_ngcontent-%COMP%] strong[_ngcontent-%COMP%], .node-copy[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.node-copy[_ngcontent-%COMP%]{min-width:0}.inspector[_ngcontent-%COMP%], .yaml-panel[_ngcontent-%COMP%], .runs-panel[_ngcontent-%COMP%]{border:1px solid #2b2d33;border-radius:8px;background:#17181d;padding:14px}.panel-title[_ngcontent-%COMP%]{margin-bottom:12px;font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.08em;color:#d4d4d8}.check-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin:8px 0;color:#d4d4d8;font-size:13px}.bottom-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:14px;margin-top:14px}.yaml-editor[_ngcontent-%COMP%]{width:100%;min-height:260px;box-sizing:border-box;border:1px solid #333640;border-radius:7px;background:#0f1014;color:#d4d4d8;padding:12px;resize:vertical}.run-row[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:12px;padding:10px 0;color:#e7e7ea;text-decoration:none;border-bottom:1px solid #252730}.run-row[_ngcontent-%COMP%] strong[_ngcontent-%COMP%], .run-row[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{display:block}.run-row[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px}.status-completed[_ngcontent-%COMP%]{color:#34d399}.status-failed[_ngcontent-%COMP%]{color:#f87171}.status-running[_ngcontent-%COMP%]{color:#60a5fa}.status-default[_ngcontent-%COMP%]{color:#a1a1aa}@media(max-width:980px){.builder-shell[_ngcontent-%COMP%], .builder-grid[_ngcontent-%COMP%], .bottom-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}.sidebar[_ngcontent-%COMP%]{border-right:0;border-bottom:1px solid #2b2d33}.toolbar[_ngcontent-%COMP%]{align-items:flex-start;flex-direction:column}}"]})};function he(l,n){switch(l){case"bash":return`echo "${n}"`;case"command":return n;case"prompt":return`Complete ${n} and summarize the result.`}}function xe(l,n,e){let t=[`name: ${y(l)||"new-workflow"}`,`description: ${W(n||"Draft workflow")}`,"provider: claude","model: sonnet","nodes:"];for(let o of e)if(t.push(` - id: ${o.id}`),o.dependsOn.length>0&&t.push(` depends_on: [${o.dependsOn.join(", ")}]`),o.type==="bash")t.push(` bash: ${W(o.content||"echo ok")}`);else if(o.type==="command")t.push(` command: ${W(o.content||o.id)}`);else{t.push(" prompt: |");for(let a of(o.content||`Complete ${o.id}`).split(`
|
|
2
|
-
`))t.push(` ${a}`)}return`${t.join(`
|
|
3
|
-
`)}
|
|
4
|
-
`}function y(l){return l.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")}function N(l){return l.split("/").map(y).filter(Boolean).join("/")}function be(l,n){let e=y(n)||"node";if(!l.includes(e))return e;let t=2;for(;l.includes(`${e}-${t}`);)t++;return`${e}-${t}`}function W(l){return JSON.stringify(l)}export{ie as WorkflowBuilderComponent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as M}from"./chunk-OJJM5VOH.js";import{D as g,Da as D,Ga as k,L as u,M as l,N as E,O as w,P as p,Q as r,R as i,S as N,Y as m,ba as o,c as y,ca as d,da as _,ea as R,k as S,n as c,u as I,ua as v,z as s,za as b}from"./chunk-U2H3QYAG.js";var C=class a{zone=c(I);connect(t){return new y(e=>{let n=new EventSource(`/api/runs/${t}/events`),x=["node:start","node:complete","node:skip","node:fail","run:complete","run:state"];for(let f of x)n.addEventListener(f,A=>{this.zone.run(()=>{e.next({type:f,data:JSON.parse(A.data)})})});return n.onerror=()=>{this.zone.run(()=>{e.complete()}),n.close()},()=>{n.close()}})}static \u0275fac=function(e){return new(e||a)};static \u0275prov=S({token:a,factory:a.\u0275fac,providedIn:"root"})};function $(a,t){if(a&1&&(r(0,"span",3),o(1),i()),a&2){let e=m();p("ngClass",e.typeBadgeClass),s(),d(e.type)}}function j(a,t){if(a&1&&(r(0,"span",4),o(1),i()),a&2){let e=m();s(),_("",(e.durationMs/1e3).toFixed(1),"s")}}function z(a,t){a&1&&(r(0,"span",5),o(1,"running..."),i())}function B(a,t){a&1&&(r(0,"span",6),o(1,"skipped"),i())}function P(a,t){a&1&&(r(0,"span",7),o(1,"FAILED"),i())}var h=class a{nodeId="";status="pending";type;durationMs;get statusIcon(){switch(this.status){case"completed":return"\u2713";case"running":return"\u25CF";case"failed":return"\u2717";case"skipped":return"\u2298";default:return"\u25CB"}}get statusIconClass(){switch(this.status){case"completed":return"text-green-400";case"running":return"text-blue-400 animate-pulse";case"failed":return"text-red-400";case"skipped":return"text-slate-500";default:return"text-slate-600"}}get statusTextClass(){switch(this.status){case"pending":return"text-slate-500";case"skipped":return"text-slate-500";default:return"text-slate-100"}}get typeBadgeClass(){switch(this.type){case"prompt":return"bg-purple-500/10 text-purple-400";case"bash":return"bg-amber-500/10 text-amber-400";case"command":return"bg-cyan-500/10 text-cyan-400";default:return"bg-slate-700 text-slate-400"}}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=g({type:a,selectors:[["app-node-status-row"]],inputs:{nodeId:"nodeId",status:"status",type:"type",durationMs:"durationMs"},decls:10,vars:9,consts:[[1,"flex","items-center","py-2.5","border-b","border-slate-800"],[1,"mr-3","text-sm",3,"ngClass"],[1,"flex-1",3,"ngClass"],[1,"text-xs","px-1.5","py-0.5","rounded","mr-2",3,"ngClass"],[1,"font-mono","text-xs","text-slate-400"],[1,"font-mono","text-xs","text-blue-400","animate-pulse"],[1,"text-xs","text-slate-500"],[1,"text-xs","text-red-400"]],template:function(e,n){e&1&&(r(0,"div",0)(1,"span",1),o(2),i(),r(3,"span",2),o(4),i(),u(5,$,2,2,"span",3),u(6,j,2,1,"span",4),u(7,z,2,0,"span",5),u(8,B,2,0,"span",6),u(9,P,2,0,"span",7),i()),e&2&&(s(),p("ngClass",n.statusIconClass),s(),d(n.statusIcon),s(),p("ngClass",n.statusTextClass),s(),d(n.nodeId),s(),l(n.type?5:-1),s(),l(n.status==="completed"&&n.durationMs!==void 0?6:-1),s(),l(n.status==="running"?7:-1),s(),l(n.status==="skipped"?8:-1),s(),l(n.status==="failed"?9:-1))},dependencies:[b,v],encapsulation:2})};var J=(a,t)=>t.id;function Z(a,t){if(a&1&&(r(0,"span",6),o(1),i()),a&2){let e=m();p("ngClass",e.statusClass(e.run.status)),s(),R(" ",e.statusIcon(e.run.status)," ",e.run.status," ")}}function q(a,t){if(a&1&&N(0,"app-node-status-row",8),a&2){let e=t.$implicit;p("nodeId",e.id)("status",e.status)("durationMs",e.durationMs)}}function G(a,t){if(a&1&&(r(0,"div",9)(1,"span",10),o(2,"Elapsed: "),r(3,"span",11),o(4),i()(),r(5,"span",12),o(6,"Nodes: "),r(7,"span",13),o(8),i(),o(9,"/"),r(10,"span",14),o(11),i(),o(12," completed "),i()()),a&2){let e=m();s(4),d(e.elapsedDisplay),s(4),d(e.completedCount),s(3),d(e.nodes.length)}}var O=class a{route=c(D);api=c(M);sse=c(C);run;nodes=[];sseSub;timerInterval;startTime=Date.now();ngOnInit(){let t=this.route.snapshot.paramMap.get("runId");this.api.getRun(t).subscribe(e=>{this.run=e,this.startTime=new Date(e.startedAt).getTime(),this.rebuildNodeList()}),this.sseSub=this.sse.connect(t).subscribe(e=>{this.handleSseEvent(e)}),this.timerInterval=setInterval(()=>{},1e3)}ngOnDestroy(){this.sseSub?.unsubscribe(),this.timerInterval&&clearInterval(this.timerInterval)}handleSseEvent(t){let e=t.data,n=e.nodeId;switch(t.type){case"run:state":this.run=e,this.startTime=new Date(this.run.startedAt).getTime(),this.rebuildNodeList();break;case"node:start":this.updateNodeStatus(n,"running");break;case"node:complete":this.updateNodeStatus(n,"completed",e.durationMs);break;case"node:skip":this.updateNodeStatus(n,"skipped");break;case"node:fail":this.updateNodeStatus(n,"failed");break;case"run:complete":this.run&&(this.run.status=e.success?"completed":"failed");break}}rebuildNodeList(){this.run&&(this.nodes=Object.entries(this.run.nodes).map(([t,e])=>({id:t,status:e.status,durationMs:e.durationMs})))}updateNodeStatus(t,e,n){let x=this.nodes.find(f=>f.id===t);x?(x.status=e,n!==void 0&&(x.durationMs=n)):this.nodes.push({id:t,status:e,durationMs:n})}get completedCount(){return this.nodes.filter(t=>t.status==="completed").length}get elapsedDisplay(){let t=Math.floor((Date.now()-this.startTime)/1e3),e=Math.floor(t/60),n=t%60;return e>0?`${e}m ${n}s`:`${n}s`}statusClass(t){switch(t){case"completed":return"bg-green-500/10 text-green-400";case"failed":return"bg-red-500/10 text-red-400";case"running":return"bg-blue-500/10 text-blue-400";default:return"bg-slate-700 text-slate-400"}}statusIcon(t){switch(t){case"completed":return"\u2713";case"failed":return"\u2717";case"running":return"\u25CF";default:return"\u25CB"}}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=g({type:a,selectors:[["app-run-execution"]],decls:17,vars:4,consts:[[1,"max-w-3xl","mx-auto"],[1,"flex","items-center","mb-6","gap-2","text-sm"],["routerLink","/",1,"text-slate-500","hover:text-slate-300"],[1,"text-slate-600"],[1,"text-slate-300"],[1,"font-mono","text-slate-100"],[1,"text-xs","px-2","py-0.5","rounded","ml-2",3,"ngClass"],[1,"mb-6"],[3,"nodeId","status","durationMs"],[1,"bg-slate-800","rounded-lg","px-4","py-3","flex","items-center","text-sm"],[1,"text-slate-400"],[1,"text-slate-100","font-mono"],[1,"ml-6","text-slate-400"],[1,"text-green-400"],[1,"text-slate-100"]],template:function(e,n){e&1&&(r(0,"div",0)(1,"div",1)(2,"a",2),o(3,"Dashboard"),i(),r(4,"span",3),o(5,"\u203A"),i(),r(6,"span",4),o(7),i(),r(8,"span",3),o(9,"\u203A"),i(),r(10,"span",5),o(11),i(),u(12,Z,2,3,"span",6),i(),r(13,"div",7),E(14,q,1,3,"app-node-status-row",8,J),i(),u(16,G,13,3,"div",9),i()),e&2&&(s(7),d(n.run==null?null:n.run.workflow),s(4),d(n.run==null?null:n.run.runId),s(),l(n.run?12:-1),s(2),w(n.nodes),s(2),l(n.run?16:-1))},dependencies:[b,v,k,h],encapsulation:2})};export{O as RunExecutionComponent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as B,b as U,e as W,g as H,h as q,i as G,j as J}from"./chunk-L2VOQBBI.js";import{a as K}from"./chunk-OJJM5VOH.js";import{$ as V,D as T,Ga as z,H as _,K as h,P as d,Q as n,R as r,S as F,V as P,W as y,X as b,Y as u,Z as C,ba as i,ca as p,da as w,fa as S,ga as k,h as M,ha as R,ka as f,la as v,ma as O,n as D,na as E,o as m,p as g,va as A,wa as j,xa as L,ya as N,z as o,za as $}from"./chunk-U2H3QYAG.js";var I=s=>["/runs",s],X=s=>({$implicit:s});function Y(s,a){if(s&1&&(n(0,"div",27),i(1),r()),s&2){let t=u();o(),p(t.error)}}function Z(s,a){if(s&1){let t=y();n(0,"button",28),b("click",function(){let l=m(t).$implicit,c=u();return g(c.filter=l.status)}),F(1,"span",29),n(2,"span"),i(3),r(),n(4,"strong"),i(5),r()()}if(s&2){let t=a.$implicit,e=u();V("active",e.filter===t.status),o(),h("data-status",t.status),o(2),p(t.label),o(2),p(e.count(t.status))}}function tt(s,a){s&1&&P(0)}function et(s,a){if(s&1&&(n(0,"article",32)(1,"div",33)(2,"div")(3,"a",34),i(4),r(),n(5,"code"),i(6),r()(),n(7,"span",35),i(8),r()(),n(9,"div",36)(10,"span"),i(11),v(12,"date"),r(),n(13,"span"),i(14),r()(),_(15,tt,1,0,"ng-container",37),r()),s&2){let t=a.$implicit,e=u(2),l=C(66);o(3),d("routerLink",f(12,I,t.runId)),o(),p(t.workflow),o(2),p(t.runId),o(),h("data-status",t.status),o(),p(t.status),o(3),w("Started ",O(12,9,t.startedAt,"medium")),o(3),p(e.elapsed(t)),o(),d("ngTemplateOutlet",l)("ngTemplateOutletContext",f(14,X,t))}}function nt(s,a){if(s&1&&(n(0,"div",30),_(1,et,16,16,"article",31),r()),s&2){let t=u();o(),d("ngForOf",t.activeRuns)("ngForTrackBy",t.trackRun)}}function rt(s,a){s&1&&(n(0,"div",38),i(1,"No active runs."),r())}function at(s,a){s&1&&P(0)}function it(s,a){if(s&1&&(n(0,"tr")(1,"td")(2,"a",34),i(3),r(),n(4,"code"),i(5),r()(),n(6,"td")(7,"span",35),i(8),r()(),n(9,"td"),i(10),v(11,"date"),r(),n(12,"td"),i(13),r(),n(14,"td"),_(15,at,1,0,"ng-container",37),r()()),s&2){let t=a.$implicit,e=u(),l=C(66);o(2),d("routerLink",f(12,I,t.runId)),o(),p(t.workflow),o(2),p(t.runId),o(2),h("data-status",t.status),o(),p(t.status),o(2),p(O(11,9,t.startedAt,"medium")),o(3),p(e.elapsed(t)),o(2),d("ngTemplateOutlet",l)("ngTemplateOutletContext",f(14,X,t))}}function ot(s,a){s&1&&(n(0,"tr")(1,"td",39),i(2,"No runs match the current filters."),r()())}function st(s,a){if(s&1){let t=y();n(0,"div",40)(1,"a",41),i(2,"View"),r(),n(3,"button",42),b("click",function(){let l=m(t).$implicit,c=u();return g(c.perform(l,"cancel"))}),i(4,"Cancel"),r(),n(5,"button",42),b("click",function(){let l=m(t).$implicit,c=u();return g(c.perform(l,"abandon"))}),i(6,"Abandon"),r(),n(7,"button",42),b("click",function(){let l=m(t).$implicit,c=u();return g(c.perform(l,"approve"))}),i(8,"Approve"),r(),n(9,"button",42),b("click",function(){let l=m(t).$implicit,c=u();return g(c.perform(l,"reject"))}),i(10,"Reject"),r(),n(11,"button",42),b("click",function(){let l=m(t).$implicit,c=u();return g(c.perform(l,"resume"))}),i(12,"Resume"),r(),n(13,"button",43),b("click",function(){let l=m(t).$implicit,c=u();return g(c.perform(l,"delete"))}),i(14,"Delete"),r()()}if(s&2){let t=a.$implicit,e=u();o(),d("routerLink",f(7,I,t.runId)),o(2),d("disabled",!e.can(t,"cancel")||e.busyRun===t.runId),o(2),d("disabled",!e.can(t,"abandon")||e.busyRun===t.runId),o(2),d("disabled",!e.can(t,"approve")||e.busyRun===t.runId),o(2),d("disabled",!e.can(t,"reject")||e.busyRun===t.runId),o(2),d("disabled",!e.can(t,"resume")||e.busyRun===t.runId),o(2),d("disabled",!e.can(t,"delete")||e.busyRun===t.runId)}}var Q=class s{api=D(K);refreshTimer;runs=[];filter="all";search="";dateRange="all";loading=!1;error="";busyRun="";lastUpdated;statusItems=[{status:"all",label:"All"},{status:"running",label:"Running"},{status:"paused",label:"Paused"},{status:"completed",label:"Completed"},{status:"failed",label:"Failed"},{status:"cancelled",label:"Cancelled"}];ngOnInit(){this.loadRuns(),this.refreshTimer=setInterval(()=>this.loadRuns(!1),5e3)}ngOnDestroy(){this.refreshTimer&&clearInterval(this.refreshTimer)}get filteredRuns(){let a=this.search.trim().toLowerCase(),t=this.cutoffDate();return this.runs.filter(e=>(this.filter==="all"||e.status===this.filter)&&(!a||e.workflow.toLowerCase().includes(a)||e.runId.toLowerCase().includes(a))&&(!t||new Date(e.startedAt)>=t))}get activeRuns(){return this.filteredRuns.filter(a=>a.status==="running"||a.status==="paused")}get historyRuns(){return this.filteredRuns.filter(a=>a.status!=="running"&&a.status!=="paused")}loadRuns(a=!0){a&&(this.loading=!0),this.api.getRuns().pipe(M(()=>this.loading=!1)).subscribe({next:t=>{this.runs=t,this.lastUpdated=new Date,this.error=""},error:t=>this.error=t?.error?.error??"Unable to load workflow runs."})}count(a){return a==="all"?this.runs.length:this.runs.filter(t=>t.status===a).length}trackRun(a,t){return t.runId}elapsed(a){let t=new Date(a.completedAt??Date.now()).getTime()-new Date(a.startedAt).getTime();return t<6e4?`${Math.max(0,Math.round(t/1e3))}s`:t<36e5?`${Math.round(t/6e4)}m`:`${(t/36e5).toFixed(1)}h`}can(a,t){return t==="cancel"||t==="abandon"?a.status==="running":t==="approve"||t==="reject"?a.status==="paused":t==="resume"?["failed","paused","cancelled"].includes(a.status):!["running","paused"].includes(a.status)}perform(a,t){if(!this.can(a,t)||["cancel","abandon","delete","reject"].includes(t)&&!confirm(`${t} run ${a.runId}?`))return;let e=t==="reject"?prompt("Rejection reason","Rejected by operator")??void 0:void 0;t==="reject"&&e===void 0||(this.busyRun=a.runId,this.error="",this.api.runAction(a.runId,t,e).pipe(M(()=>this.busyRun="")).subscribe({next:()=>this.loadRuns(!1),error:l=>this.error=l?.error?.error??`Unable to ${t} run.`}))}cutoffDate(){if(this.dateRange==="all")return;let a=new Date;return this.dateRange==="today"?a.setHours(0,0,0,0):a.setDate(a.getDate()-Number(this.dateRange.slice(0,-1))),a}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=T({type:s,selectors:[["app-dashboard"]],decls:67,vars:17,consts:[["noActive",""],["actions",""],[1,"dashboard"],[1,"page-header"],[1,"eyebrow"],[1,"subtitle"],[1,"header-actions"],[1,"updated"],["type","button",1,"button","secondary",3,"click","disabled"],["routerLink","/workflows/builder",1,"button","primary"],["class","error-banner",4,"ngIf"],["role","group","aria-label","Run status filters",1,"summary"],["type","button","class","summary-item",3,"active","click",4,"ngFor","ngForOf"],[1,"controls"],["type","search","placeholder","Search workflow or run ID",1,"search",3,"ngModelChange","ngModel"],["aria-label","Date range",3,"ngModelChange","ngModel"],["value","all"],["value","today"],["value","7d"],["value","30d"],[1,"capacity"],[1,"run-section"],[1,"section-heading"],["class","active-grid",4,"ngIf","ngIfElse"],[1,"table-wrap"],[4,"ngFor","ngForOf","ngForTrackBy"],[4,"ngIf"],[1,"error-banner"],["type","button",1,"summary-item",3,"click"],[1,"status-dot"],[1,"active-grid"],["class","run-card",4,"ngFor","ngForOf","ngForTrackBy"],[1,"run-card"],[1,"run-title"],[3,"routerLink"],[1,"badge"],[1,"run-meta"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"empty"],["colspan","5",1,"empty"],[1,"actions"],["title","Open run",1,"icon-button",3,"routerLink"],["type","button",3,"click","disabled"],["type","button",1,"danger",3,"click","disabled"]],template:function(t,e){if(t&1){let l=y();n(0,"section",2)(1,"header",3)(2,"div")(3,"p",4),i(4,"Mission Control"),r(),n(5,"h1"),i(6,"Dashboard"),r(),n(7,"p",5),i(8,"Monitor workflow execution and control run lifecycle."),r()(),n(9,"div",6)(10,"span",7),i(11),v(12,"date"),r(),n(13,"button",8),b("click",function(){return e.loadRuns()}),i(14,"Refresh"),r(),n(15,"a",9),i(16,"New workflow"),r()()(),_(17,Y,2,1,"div",10),n(18,"div",11),_(19,Z,6,5,"button",12),r(),n(20,"div",13)(21,"input",14),R("ngModelChange",function(x){return m(l),k(e.search,x)||(e.search=x),g(x)}),r(),n(22,"select",15),R("ngModelChange",function(x){return m(l),k(e.dateRange,x)||(e.dateRange=x),g(x)}),n(23,"option",16),i(24,"All time"),r(),n(25,"option",17),i(26,"Today"),r(),n(27,"option",18),i(28,"Last 7 days"),r(),n(29,"option",19),i(30,"Last 30 days"),r()(),n(31,"span",20),i(32),r()(),n(33,"section",21)(34,"div",22)(35,"h2"),i(36,"Active runs"),r(),n(37,"span"),i(38),r()(),_(39,nt,2,2,"div",23)(40,rt,2,0,"ng-template",null,0,E),r(),n(42,"section",21)(43,"div",22)(44,"h2"),i(45,"Run history"),r(),n(46,"span"),i(47),r()(),n(48,"div",24)(49,"table")(50,"thead")(51,"tr")(52,"th"),i(53,"Workflow"),r(),n(54,"th"),i(55,"Status"),r(),n(56,"th"),i(57,"Started"),r(),n(58,"th"),i(59,"Duration"),r(),n(60,"th"),i(61,"Actions"),r()()(),n(62,"tbody"),_(63,it,16,16,"tr",25)(64,ot,3,0,"tr",26),r()()()()(),_(65,st,15,9,"ng-template",null,1,E)}if(t&2){let l=C(41);o(11),p(e.lastUpdated?"Updated "+O(12,14,e.lastUpdated,"HH:mm:ss"):"Not updated"),o(2),d("disabled",e.loading),o(4),d("ngIf",e.error),o(2),d("ngForOf",e.statusItems),o(2),S("ngModel",e.search),o(),S("ngModel",e.dateRange),o(10),w("",e.activeRuns.length," active"),o(6),p(e.activeRuns.length),o(),d("ngIf",e.activeRuns.length)("ngIfElse",l),o(8),p(e.historyRuns.length),o(16),d("ngForOf",e.historyRuns)("ngForTrackBy",e.trackRun),o(),d("ngIf",!e.historyRuns.length)}},dependencies:[$,A,j,L,J,q,G,B,H,U,W,z,N],styles:["[_nghost-%COMP%]{display:block}.dashboard[_ngcontent-%COMP%]{max-width:1440px;margin:0 auto;padding:28px 32px 56px}.page-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:24px;align-items:flex-end;margin-bottom:24px}.eyebrow[_ngcontent-%COMP%]{color:var(--primary);font-size:12px;font-weight:700;text-transform:uppercase;margin:0 0 5px}.page-header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{font-size:28px;line-height:1.2;margin:0}.subtitle[_ngcontent-%COMP%]{color:var(--text-secondary);margin:7px 0 0}.header-actions[_ngcontent-%COMP%], .controls[_ngcontent-%COMP%], .actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.updated[_ngcontent-%COMP%]{font-size:12px;color:var(--text-tertiary)}.button[_ngcontent-%COMP%], .actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%], .icon-button[_ngcontent-%COMP%]{border:1px solid var(--border-bright);background:var(--surface);color:var(--text-primary);padding:8px 11px;font:inherit;font-size:12px;text-decoration:none;cursor:pointer;border-radius:5px}.button.primary[_ngcontent-%COMP%]{background:var(--primary);border-color:var(--primary);color:var(--primary-foreground);font-weight:700}.button[_ngcontent-%COMP%]:disabled, .actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled{opacity:.34;cursor:not-allowed}.error-banner[_ngcontent-%COMP%]{border:1px solid var(--error);background:color-mix(in oklch,var(--error) 12%,var(--surface));padding:10px 12px;margin-bottom:16px;border-radius:5px}.summary[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));border:1px solid var(--border);background:var(--surface);border-radius:7px;overflow:hidden}.summary-item[_ngcontent-%COMP%]{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:8px;min-height:54px;border:0;border-right:1px solid var(--border);background:transparent;color:var(--text-secondary);padding:0 14px;cursor:pointer}.summary-item[_ngcontent-%COMP%]:last-child{border:0}.summary-item.active[_ngcontent-%COMP%]{background:var(--surface-elevated);color:var(--text-primary);box-shadow:inset 0 -2px var(--primary)}.status-dot[_ngcontent-%COMP%]{width:8px;height:8px;border-radius:50%;background:var(--text-tertiary)}.status-dot[data-status=running][_ngcontent-%COMP%], .badge[data-status=running][_ngcontent-%COMP%]{color:var(--primary)}.status-dot[data-status=running][_ngcontent-%COMP%]{background:var(--primary)}.status-dot[data-status=paused][_ngcontent-%COMP%], .badge[data-status=paused][_ngcontent-%COMP%]{color:var(--warning)}.status-dot[data-status=paused][_ngcontent-%COMP%]{background:var(--warning)}.status-dot[data-status=completed][_ngcontent-%COMP%], .badge[data-status=completed][_ngcontent-%COMP%]{color:var(--success)}.status-dot[data-status=completed][_ngcontent-%COMP%]{background:var(--success)}.status-dot[data-status=failed][_ngcontent-%COMP%], .status-dot[data-status=cancelled][_ngcontent-%COMP%]{background:var(--error)}.badge[data-status=failed][_ngcontent-%COMP%], .badge[data-status=cancelled][_ngcontent-%COMP%]{color:var(--error)}.controls[_ngcontent-%COMP%]{margin:18px 0}.search[_ngcontent-%COMP%], select[_ngcontent-%COMP%]{height:38px;border:1px solid var(--border);background:var(--surface);color:var(--text-primary);padding:0 11px;border-radius:5px}.search[_ngcontent-%COMP%]{width:min(390px,100%)}.capacity[_ngcontent-%COMP%]{margin-left:auto;color:var(--text-secondary);font-size:13px}.run-section[_ngcontent-%COMP%]{margin-top:28px}.section-heading[_ngcontent-%COMP%]{display:flex;align-items:center;gap:9px;margin-bottom:12px}.section-heading[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:16px;margin:0}.section-heading[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--text-tertiary);font-size:12px}.active-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(340px,1fr));gap:12px}.run-card[_ngcontent-%COMP%]{border:1px solid var(--border);background:var(--surface);padding:16px;border-radius:7px}.run-title[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:12px}.run-title[_ngcontent-%COMP%] a[_ngcontent-%COMP%], td[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--text-primary);font-weight:700;text-decoration:none}.run-title[_ngcontent-%COMP%] code[_ngcontent-%COMP%], td[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{display:block;color:var(--text-tertiary);font-size:11px;margin-top:4px}.badge[_ngcontent-%COMP%]{border:1px solid currentColor;height:fit-content;padding:3px 7px;border-radius:4px;font-size:11px;text-transform:uppercase}.run-meta[_ngcontent-%COMP%]{display:flex;justify-content:space-between;color:var(--text-secondary);font-size:12px;margin:18px 0 14px}.actions[_ngcontent-%COMP%]{flex-wrap:wrap}.actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%], .icon-button[_ngcontent-%COMP%]{padding:5px 7px}.actions[_ngcontent-%COMP%] .danger[_ngcontent-%COMP%]{color:var(--error)}.table-wrap[_ngcontent-%COMP%]{overflow:auto;border:1px solid var(--border);border-radius:7px}table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse;background:var(--surface);font-size:13px}th[_ngcontent-%COMP%]{text-align:left;color:var(--text-secondary);font-size:11px;text-transform:uppercase;font-weight:600}th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{padding:12px 14px;border-bottom:1px solid var(--border);white-space:nowrap}tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:last-child td[_ngcontent-%COMP%]{border-bottom:0}.empty[_ngcontent-%COMP%]{padding:24px;color:var(--text-tertiary);text-align:center;border:1px dashed var(--border);border-radius:7px}td.empty[_ngcontent-%COMP%]{border:0}.table-wrap[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{min-width:470px}@media(max-width:800px){.dashboard[_ngcontent-%COMP%]{padding:20px 16px}.page-header[_ngcontent-%COMP%]{align-items:flex-start;flex-direction:column}.summary[_ngcontent-%COMP%]{grid-template-columns:repeat(2,1fr)}.summary-item[_ngcontent-%COMP%]{border-bottom:1px solid var(--border)}.controls[_ngcontent-%COMP%]{align-items:stretch;flex-wrap:wrap}.search[_ngcontent-%COMP%]{width:100%}.capacity[_ngcontent-%COMP%]{margin-left:0}.active-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}"]})};export{Q as DashboardComponent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as Y,A as he,B as A,C as s,E as X,F as l,G as h,I as fe,J as ge,X as M,a as u,b as d,d as se,e as ae,f as le,g as ue,i as P,ia as _,j as p,l as Z,m,n as R,oa as f,pa as F,ra as K,s as de,sa as pe,t as V,ta as J,v as D,w as ce,x as k,y as b}from"./chunk-U2H3QYAG.js";var Ae=(()=>{class n{_renderer;_elementRef;onChange=e=>{};onTouched=()=>{};constructor(e,i){this._renderer=e,this._elementRef=i}setProperty(e,i){this._renderer.setProperty(this._elementRef.nativeElement,e,i)}registerOnTouched(e){this.onTouched=e}registerOnChange(e){this.onChange=e}setDisabledState(e){this.setProperty("disabled",e)}static \u0275fac=function(i){return new(i||n)(s(A),s(b))};static \u0275dir=l({type:n})}return n})(),te=(()=>{class n extends Ae{static \u0275fac=(()=>{let e;return function(r){return(e||(e=k(n)))(r||n)}})();static \u0275dir=l({type:n,features:[h]})}return n})(),W=new m("");var Ue={provide:W,useExisting:p(()=>Me),multi:!0};function He(){let n=J()?J().getUserAgent():"";return/android (\d+)/.test(n.toLowerCase())}var Le=new m(""),Me=(()=>{class n extends Ae{_compositionMode;_composing=!1;constructor(e,i,r){super(e,i),this._compositionMode=r,this._compositionMode==null&&(this._compositionMode=!He())}writeValue(e){let i=e??"";this.setProperty("value",i)}_handleInput(e){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(e)}_compositionStart(){this._composing=!0}_compositionEnd(e){this._composing=!1,this._compositionMode&&this.onChange(e)}static \u0275fac=function(i){return new(i||n)(s(A),s(b),s(Le,8))};static \u0275dir=l({type:n,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(i,r){i&1&&M("input",function(a){return r._handleInput(a.target.value)})("blur",function(){return r.onTouched()})("compositionstart",function(){return r._compositionStart()})("compositionend",function(a){return r._compositionEnd(a.target.value)})},standalone:!1,features:[_([Ue]),h]})}return n})();var Fe=new m(""),Ee=new m("");function we(n){return n!=null}function Ie(n){return fe(n)?ae(n):n}function Se(n){let t={};return n.forEach(e=>{t=e!=null?u(u({},t),e):t}),Object.keys(t).length===0?null:t}function Ne(n,t){return t.map(e=>e(n))}function $e(n){return!n.validate}function Oe(n){return n.map(t=>$e(t)?t:e=>t.validate(e))}function We(n){if(!n)return null;let t=n.filter(we);return t.length==0?null:function(e){return Se(Ne(e,t))}}function ne(n){return n!=null?We(Oe(n)):null}function qe(n){if(!n)return null;let t=n.filter(we);return t.length==0?null:function(e){let i=Ne(e,t).map(Ie);return ue(i).pipe(le(Se))}}function ie(n){return n!=null?qe(Oe(n)):null}function me(n,t){return n===null?[t]:Array.isArray(n)?[...n,t]:[n,t]}function ze(n){return n._rawValidators}function Ze(n){return n._rawAsyncValidators}function Q(n){return n?Array.isArray(n)?n:[n]:[]}function G(n,t){return Array.isArray(n)?n.includes(t):n===t}function _e(n,t){let e=Q(t);return Q(n).forEach(r=>{G(e,r)||e.push(r)}),e}function ve(n,t){return Q(t).filter(e=>!G(n,e))}var T=class{get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators=[];_rawAsyncValidators=[];_setValidators(t){this._rawValidators=t||[],this._composedValidatorFn=ne(this._rawValidators)}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=ie(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_onDestroyCallbacks=[];_registerOnDestroy(t){this._onDestroyCallbacks.push(t)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(t=>t()),this._onDestroyCallbacks=[]}reset(t=void 0){this.control?.reset(t)}hasError(t,e){return this.control?this.control.hasError(t,e):!1}getError(t,e){return this.control?this.control.getError(t,e):null}},C=class extends T{name;get formDirective(){return null}get path(){return null}},O=class extends T{_parent=null;name=null;valueAccessor=null},B=class{_cd;constructor(t){this._cd=t}get isTouched(){return this._cd?.control?._touched?.(),!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return this._cd?.control?._pristine?.(),!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return this._cd?.control?._status?.(),!!this._cd?.control?.valid}get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return this._cd?._submitted?.(),!!this._cd?.submitted}};var Tt=(()=>{class n extends B{constructor(e){super(e)}static \u0275fac=function(i){return new(i||n)(s(O,2))};static \u0275dir=l({type:n,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(i,r){i&2&&Y("ng-untouched",r.isUntouched)("ng-touched",r.isTouched)("ng-pristine",r.isPristine)("ng-dirty",r.isDirty)("ng-valid",r.isValid)("ng-invalid",r.isInvalid)("ng-pending",r.isPending)},standalone:!1,features:[h]})}return n})(),Bt=(()=>{class n extends B{constructor(e){super(e)}static \u0275fac=function(i){return new(i||n)(s(C,10))};static \u0275dir=l({type:n,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["","formArray",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(i,r){i&2&&Y("ng-untouched",r.isUntouched)("ng-touched",r.isTouched)("ng-pristine",r.isPristine)("ng-dirty",r.isDirty)("ng-valid",r.isValid)("ng-invalid",r.isInvalid)("ng-pending",r.isPending)("ng-submitted",r.isSubmitted)},standalone:!1,features:[h]})}return n})();var E="VALID",j="INVALID",v="PENDING",w="DISABLED",g=class{},U=class extends g{value;source;constructor(t,e){super(),this.value=t,this.source=e}},S=class extends g{pristine;source;constructor(t,e){super(),this.pristine=t,this.source=e}},N=class extends g{touched;source;constructor(t,e){super(),this.touched=t,this.source=e}},y=class extends g{status;source;constructor(t,e){super(),this.status=t,this.source=e}},ee=class extends g{source;constructor(t){super(),this.source=t}},H=class extends g{source;constructor(t){super(),this.source=t}};function xe(n){return(q(n)?n.validators:n)||null}function Xe(n){return Array.isArray(n)?ne(n):n||null}function Pe(n,t){return(q(t)?t.asyncValidators:n)||null}function Ye(n){return Array.isArray(n)?ie(n):n||null}function q(n){return n!=null&&!Array.isArray(n)&&typeof n=="object"}function Ke(n,t,e){let i=n.controls;if(!(t?Object.keys(i):i).length)throw new P(1e3,"");if(!i[e])throw new P(1001,"")}function Je(n,t,e){n._forEachChild((i,r)=>{if(e[r]===void 0)throw new P(-1002,"")})}var L=class{_pendingDirty=!1;_hasOwnPendingAsyncValidator=null;_pendingTouched=!1;_onCollectionChange=()=>{};_updateOn;_parent=null;_asyncValidationSubscription;_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators;_rawAsyncValidators;value;constructor(t,e){this._assignValidators(t),this._assignAsyncValidators(e)}get validator(){return this._composedValidatorFn}set validator(t){this._rawValidators=this._composedValidatorFn=t}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(t){this._rawAsyncValidators=this._composedAsyncValidatorFn=t}get parent(){return this._parent}get status(){return f(this.statusReactive)}set status(t){f(()=>this.statusReactive.set(t))}_status=F(()=>this.statusReactive());statusReactive=D(void 0);get valid(){return this.status===E}get invalid(){return this.status===j}get pending(){return this.status===v}get disabled(){return this.status===w}get enabled(){return this.status!==w}errors;get pristine(){return f(this.pristineReactive)}set pristine(t){f(()=>this.pristineReactive.set(t))}_pristine=F(()=>this.pristineReactive());pristineReactive=D(!0);get dirty(){return!this.pristine}get touched(){return f(this.touchedReactive)}set touched(t){f(()=>this.touchedReactive.set(t))}_touched=F(()=>this.touchedReactive());touchedReactive=D(!1);get untouched(){return!this.touched}_events=new se;events=this._events.asObservable();valueChanges;statusChanges;get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(t){this._assignValidators(t)}setAsyncValidators(t){this._assignAsyncValidators(t)}addValidators(t){this.setValidators(_e(t,this._rawValidators))}addAsyncValidators(t){this.setAsyncValidators(_e(t,this._rawAsyncValidators))}removeValidators(t){this.setValidators(ve(t,this._rawValidators))}removeAsyncValidators(t){this.setAsyncValidators(ve(t,this._rawAsyncValidators))}hasValidator(t){return G(this._rawValidators,t)}hasAsyncValidator(t){return G(this._rawAsyncValidators,t)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(t={}){let e=this.touched===!1;this.touched=!0;let i=t.sourceControl??this;t.onlySelf||this._parent?.markAsTouched(d(u({},t),{sourceControl:i})),e&&t.emitEvent!==!1&&this._events.next(new N(!0,i))}markAllAsDirty(t={}){this.markAsDirty({onlySelf:!0,emitEvent:t.emitEvent,sourceControl:this}),this._forEachChild(e=>e.markAllAsDirty(t))}markAllAsTouched(t={}){this.markAsTouched({onlySelf:!0,emitEvent:t.emitEvent,sourceControl:this}),this._forEachChild(e=>e.markAllAsTouched(t))}markAsUntouched(t={}){let e=this.touched===!0;this.touched=!1,this._pendingTouched=!1;let i=t.sourceControl??this;this._forEachChild(r=>{r.markAsUntouched({onlySelf:!0,emitEvent:t.emitEvent,sourceControl:i})}),t.onlySelf||this._parent?._updateTouched(t,i),e&&t.emitEvent!==!1&&this._events.next(new N(!1,i))}markAsDirty(t={}){let e=this.pristine===!0;this.pristine=!1;let i=t.sourceControl??this;t.onlySelf||this._parent?.markAsDirty(d(u({},t),{sourceControl:i})),e&&t.emitEvent!==!1&&this._events.next(new S(!1,i))}markAsPristine(t={}){let e=this.pristine===!1;this.pristine=!0,this._pendingDirty=!1;let i=t.sourceControl??this;this._forEachChild(r=>{r.markAsPristine({onlySelf:!0,emitEvent:t.emitEvent})}),t.onlySelf||this._parent?._updatePristine(t,i),e&&t.emitEvent!==!1&&this._events.next(new S(!0,i))}markAsPending(t={}){this.status=v;let e=t.sourceControl??this;t.emitEvent!==!1&&(this._events.next(new y(this.status,e)),this.statusChanges.emit(this.status)),t.onlySelf||this._parent?.markAsPending(d(u({},t),{sourceControl:e}))}disable(t={}){let e=this._parentMarkedDirty(t.onlySelf);this.status=w,this.errors=null,this._forEachChild(r=>{r.disable(d(u({},t),{onlySelf:!0}))}),this._updateValue();let i=t.sourceControl??this;t.emitEvent!==!1&&(this._events.next(new U(this.value,i)),this._events.next(new y(this.status,i)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(d(u({},t),{skipPristineCheck:e}),this),this._onDisabledChange.forEach(r=>r(!0))}enable(t={}){let e=this._parentMarkedDirty(t.onlySelf);this.status=E,this._forEachChild(i=>{i.enable(d(u({},t),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent}),this._updateAncestors(d(u({},t),{skipPristineCheck:e}),this),this._onDisabledChange.forEach(i=>i(!1))}_updateAncestors(t,e){t.onlySelf||(this._parent?.updateValueAndValidity(t),t.skipPristineCheck||this._parent?._updatePristine({},e),this._parent?._updateTouched({},e))}setParent(t){this._parent=t}getRawValue(){return this.value}updateValueAndValidity(t={}){if(this._setInitialStatus(),this._updateValue(),this.enabled){let i=this._cancelExistingSubscription();this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===E||this.status===v)&&this._runAsyncValidator(i,t.emitEvent)}let e=t.sourceControl??this;t.emitEvent!==!1&&(this._events.next(new U(this.value,e)),this._events.next(new y(this.status,e)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),t.onlySelf||this._parent?.updateValueAndValidity(d(u({},t),{sourceControl:e}))}_updateTreeValidity(t={emitEvent:!0}){this._forEachChild(e=>e._updateTreeValidity(t)),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?w:E}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(t,e){if(this.asyncValidator){this.status=v,this._hasOwnPendingAsyncValidator={emitEvent:e!==!1,shouldHaveEmitted:t!==!1};let i=Ie(this.asyncValidator(this));this._asyncValidationSubscription=i.subscribe(r=>{this._hasOwnPendingAsyncValidator=null,this.setErrors(r,{emitEvent:e,shouldHaveEmitted:t})})}}_cancelExistingSubscription(){if(this._asyncValidationSubscription){this._asyncValidationSubscription.unsubscribe();let t=(this._hasOwnPendingAsyncValidator?.emitEvent||this._hasOwnPendingAsyncValidator?.shouldHaveEmitted)??!1;return this._hasOwnPendingAsyncValidator=null,t}return!1}setErrors(t,e={}){this.errors=t,this._updateControlsErrors(e.emitEvent!==!1,this,e.shouldHaveEmitted)}get(t){let e=t;return e==null||(Array.isArray(e)||(e=e.split(".")),e.length===0)?null:e.reduce((i,r)=>i&&i._find(r),this)}getError(t,e){let i=e?this.get(e):this;return i?.errors?i.errors[t]:null}hasError(t,e){return!!this.getError(t,e)}get root(){let t=this;for(;t._parent;)t=t._parent;return t}_updateControlsErrors(t,e,i){this.status=this._calculateStatus(),t&&this.statusChanges.emit(this.status),(t||i)&&this._events.next(new y(this.status,e)),this._parent&&this._parent._updateControlsErrors(t,e,i)}_initObservables(){this.valueChanges=new V,this.statusChanges=new V}_calculateStatus(){return this._allControlsDisabled()?w:this.errors?j:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(v)?v:this._anyControlsHaveStatus(j)?j:E}_anyControlsHaveStatus(t){return this._anyControls(e=>e.status===t)}_anyControlsDirty(){return this._anyControls(t=>t.dirty)}_anyControlsTouched(){return this._anyControls(t=>t.touched)}_updatePristine(t,e){let i=!this._anyControlsDirty(),r=this.pristine!==i;this.pristine=i,t.onlySelf||this._parent?._updatePristine(t,e),r&&this._events.next(new S(this.pristine,e))}_updateTouched(t={},e){this.touched=this._anyControlsTouched(),this._events.next(new N(this.touched,e)),t.onlySelf||this._parent?._updateTouched(t,e)}_onDisabledChange=[];_registerOnCollectionChange(t){this._onCollectionChange=t}_setUpdateStrategy(t){q(t)&&t.updateOn!=null&&(this._updateOn=t.updateOn)}_parentMarkedDirty(t){return!t&&!!this._parent?.dirty&&!this._parent._anyControlsDirty()}_find(t){return null}_assignValidators(t){this._rawValidators=Array.isArray(t)?t.slice():t,this._composedValidatorFn=Xe(this._rawValidators)}_assignAsyncValidators(t){this._rawAsyncValidators=Array.isArray(t)?t.slice():t,this._composedAsyncValidatorFn=Ye(this._rawAsyncValidators)}},$=class extends L{constructor(t,e,i){super(xe(e),Pe(i,e)),this.controls=t,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}controls;registerControl(t,e){return this.controls[t]?this.controls[t]:(this.controls[t]=e,e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange),e)}addControl(t,e,i={}){this.registerControl(t,e),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}removeControl(t,e={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],this.updateValueAndValidity({emitEvent:e.emitEvent}),this._onCollectionChange()}setControl(t,e,i={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],e&&this.registerControl(t,e),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}contains(t){return this.controls.hasOwnProperty(t)&&this.controls[t].enabled}setValue(t,e={}){Je(this,!0,t),Object.keys(t).forEach(i=>{Ke(this,!0,i),this.controls[i].setValue(t[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(t,e={}){t!=null&&(Object.keys(t).forEach(i=>{let r=this.controls[i];r&&r.patchValue(t[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e))}reset(t={},e={}){this._forEachChild((i,r)=>{i.reset(t?t[r]:null,d(u({},e),{onlySelf:!0}))}),this._updatePristine(e,this),this._updateTouched(e,this),this.updateValueAndValidity(e),e?.emitEvent!==!1&&this._events.next(new H(this))}getRawValue(){return this._reduceChildren({},(t,e,i)=>(t[i]=e.getRawValue(),t))}_syncPendingControls(){let t=this._reduceChildren(!1,(e,i)=>i._syncPendingControls()?!0:e);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_forEachChild(t){Object.keys(this.controls).forEach(e=>{let i=this.controls[e];i&&t(i,e)})}_setUpControls(){this._forEachChild(t=>{t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(t){for(let[e,i]of Object.entries(this.controls))if(this.contains(e)&&t(i))return!0;return!1}_reduceValue(){let t={};return this._reduceChildren(t,(e,i,r)=>((i.enabled||this.disabled)&&(e[r]=i.value),e))}_reduceChildren(t,e){let i=t;return this._forEachChild((r,o)=>{i=e(i,r,o)}),i}_allControlsDisabled(){for(let t of Object.keys(this.controls))if(this.controls[t].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_find(t){return this.controls.hasOwnProperty(t)?this.controls[t]:null}};var re=new m("",{factory:()=>oe}),oe="always";function Qe(n,t){return[...t.path,n]}function Re(n,t,e=oe){ke(n,t),t.valueAccessor.writeValue(n.value),(n.disabled||e==="always")&&t.valueAccessor.setDisabledState?.(n.disabled),tt(n,t),it(n,t),nt(n,t),et(n,t)}function ye(n,t){n.forEach(e=>{e.registerOnValidatorChange&&e.registerOnValidatorChange(t)})}function et(n,t){if(t.valueAccessor.setDisabledState){let e=i=>{t.valueAccessor.setDisabledState(i)};n.registerOnDisabledChange(e),t._registerOnDestroy(()=>{n._unregisterOnDisabledChange(e)})}}function ke(n,t){let e=ze(n);t.validator!==null?n.setValidators(me(e,t.validator)):typeof e=="function"&&n.setValidators([e]);let i=Ze(n);t.asyncValidator!==null?n.setAsyncValidators(me(i,t.asyncValidator)):typeof i=="function"&&n.setAsyncValidators([i]);let r=()=>n.updateValueAndValidity();ye(t._rawValidators,r),ye(t._rawAsyncValidators,r)}function tt(n,t){t.valueAccessor.registerOnChange(e=>{n._pendingValue=e,n._pendingChange=!0,n._pendingDirty=!0,n.updateOn==="change"&&je(n,t)})}function nt(n,t){t.valueAccessor.registerOnTouched(()=>{n._pendingTouched=!0,n.updateOn==="blur"&&n._pendingChange&&je(n,t),n.updateOn!=="submit"&&n.markAsTouched()})}function je(n,t){n._pendingDirty&&n.markAsDirty(),n.setValue(n._pendingValue,{emitModelToViewChange:!1}),t.viewToModelUpdate(n._pendingValue),n._pendingChange=!1}function it(n,t){let e=(i,r)=>{t.valueAccessor.writeValue(i),r&&t.viewToModelUpdate(i)};n.registerOnChange(e),t._registerOnDestroy(()=>{n._unregisterOnChange(e)})}function rt(n,t){n==null,ke(n,t)}function ot(n,t){if(!n.hasOwnProperty("model"))return!1;let e=n.model;return e.isFirstChange()?!0:!Object.is(t,e.currentValue)}function st(n){return Object.getPrototypeOf(n.constructor)===te}function at(n,t){n._syncPendingControls(),t.forEach(e=>{let i=e.control;i.updateOn==="submit"&&i._pendingChange&&(e.viewToModelUpdate(i._pendingValue),i._pendingChange=!1)})}function lt(n,t){if(!t)return null;Array.isArray(t);let e,i,r;return t.forEach(o=>{o.constructor===Me?e=o:st(o)?i=o:r=o}),r||i||e||null}var ut={provide:C,useExisting:p(()=>dt)},I=Promise.resolve(),dt=(()=>{class n extends C{callSetDisabledState;get submitted(){return f(this.submittedReactive)}_submitted=F(()=>this.submittedReactive());submittedReactive=D(!1);_directives=new Set;form;ngSubmit=new V;options;constructor(e,i,r){super(),this.callSetDisabledState=r,this.form=new $({},ne(e),ie(i))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(e){I.then(()=>{let i=this._findContainer(e.path);e.control=i.registerControl(e.name,e.control),Re(e.control,e,this.callSetDisabledState),e.control.updateValueAndValidity({emitEvent:!1}),this._directives.add(e)})}getControl(e){return this.form.get(e.path)}removeControl(e){I.then(()=>{this._findContainer(e.path)?.removeControl(e.name),this._directives.delete(e)})}addFormGroup(e){I.then(()=>{let i=this._findContainer(e.path),r=new $({});rt(r,e),i.registerControl(e.name,r),r.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(e){I.then(()=>{this._findContainer(e.path)?.removeControl?.(e.name)})}getFormGroup(e){return this.form.get(e.path)}updateModel(e,i){I.then(()=>{this.form.get(e.path).setValue(i)})}setValue(e){this.control.setValue(e)}onSubmit(e){return this.submittedReactive.set(!0),at(this.form,this._directives),this.ngSubmit.emit(e),this.form._events.next(new ee(this.control)),e?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(e=void 0){this.form.reset(e),this.submittedReactive.set(!1)}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.form._updateOn=this.options.updateOn)}_findContainer(e){return e.pop(),e.length?this.form.get(e):this.form}static \u0275fac=function(i){return new(i||n)(s(Fe,10),s(Ee,10),s(re,8))};static \u0275dir=l({type:n,selectors:[["form",3,"ngNoForm","",3,"formGroup","",3,"formArray",""],["ng-form"],["","ngForm",""]],hostBindings:function(i,r){i&1&&M("submit",function(a){return r.onSubmit(a)})("reset",function(){return r.onReset()})},inputs:{options:[0,"ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[_([ut]),h]})}return n})();function Ce(n,t){let e=n.indexOf(t);e>-1&&n.splice(e,1)}function Ve(n){return typeof n=="object"&&n!==null&&Object.keys(n).length===2&&"value"in n&&"disabled"in n}var ct=class extends L{defaultValue=null;_onChange=[];_pendingValue;_pendingChange=!1;constructor(t=null,e,i){super(xe(e),Pe(i,e)),this._applyFormState(t),this._setUpdateStrategy(e),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),q(e)&&(e.nonNullable||e.initialValueIsDefault)&&(Ve(t)?this.defaultValue=t.value:this.defaultValue=t)}setValue(t,e={}){this.value=this._pendingValue=t,this._onChange.length&&e.emitModelToViewChange!==!1&&this._onChange.forEach(i=>i(this.value,e.emitViewToModelChange!==!1)),this.updateValueAndValidity(e)}patchValue(t,e={}){this.setValue(t,e)}reset(t=this.defaultValue,e={}){this._applyFormState(t),this.markAsPristine(e),this.markAsUntouched(e),this.setValue(this.value,e),e.overwriteDefaultValue&&(this.defaultValue=this.value),this._pendingChange=!1,e?.emitEvent!==!1&&this._events.next(new H(this))}_updateValue(){}_anyControls(t){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(t){this._onChange.push(t)}_unregisterOnChange(t){Ce(this._onChange,t)}registerOnDisabledChange(t){this._onDisabledChange.push(t)}_unregisterOnDisabledChange(t){Ce(this._onDisabledChange,t)}_forEachChild(t){}_syncPendingControls(){return this.updateOn==="submit"&&(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),this._pendingChange)?(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),!0):!1}_applyFormState(t){Ve(t)?(this.value=this._pendingValue=t.value,t.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=t}};var ht={provide:O,useExisting:p(()=>ft)},De=Promise.resolve(),ft=(()=>{class n extends O{_changeDetectorRef;callSetDisabledState;control=new ct;static ngAcceptInputType_isDisabled;_registered=!1;viewModel;name="";isDisabled;model;options;update=new V;constructor(e,i,r,o,a,c){super(),this._changeDetectorRef=a,this.callSetDisabledState=c,this._parent=e,this._setValidators(i),this._setAsyncValidators(r),this.valueAccessor=lt(this,o)}ngOnChanges(e){if(this._checkForErrors(),!this._registered||"name"in e){if(this._registered&&(this._checkName(),this.formDirective)){let i=e.name.previousValue;this.formDirective.removeControl({name:i,path:this._getPath(i)})}this._setUpControl()}"isDisabled"in e&&this._updateDisabled(e),ot(e,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective?.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!!(this.options&&this.options.standalone)}_setUpStandalone(){Re(this.control,this,this.callSetDisabledState),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._checkName()}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),!this._isStandalone()&&this.name}_updateValue(e){De.then(()=>{this.control.setValue(e,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(e){let i=e.isDisabled.currentValue,r=i!==0&&pe(i);De.then(()=>{r&&!this.control.disabled?this.control.disable():!r&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(e){return this._parent?Qe(e,this._parent):[e]}static \u0275fac=function(i){return new(i||n)(s(C,9),s(Fe,10),s(Ee,10),s(W,10),s(K,8),s(re,8))};static \u0275dir=l({type:n,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"],options:[0,"ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],standalone:!1,features:[_([ht]),h,ce]})}return n})();var Ht=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275dir=l({type:n,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""],standalone:!1})}return n})();var gt={provide:W,useExisting:p(()=>Te),multi:!0};function Ge(n,t){return n==null?`${t}`:(t&&typeof t=="object"&&(t="Object"),`${n}: ${t}`.slice(0,50))}function pt(n){return n.split(":")[0]}var Te=(()=>{class n extends te{value;_optionMap=new Map;_idCounter=0;set compareWith(e){this._compareWith=e}_compareWith=Object.is;appRefInjector=R(ge).injector;destroyRef=R(de);cdr=R(K);_queuedWrite=!1;_writeValueAfterRender(){this._queuedWrite||this.appRefInjector.destroyed||(this._queuedWrite=!0,he({write:()=>{this.destroyRef.destroyed||(this._queuedWrite=!1,this.writeValue(this.value))}},{injector:this.appRefInjector}))}writeValue(e){this.cdr.markForCheck(),this.value=e;let i=this._getOptionId(e),r=Ge(i,e);this.setProperty("value",r)}registerOnChange(e){this.onChange=i=>{this.value=this._getOptionValue(i),e(this.value)}}_registerOption(){return(this._idCounter++).toString()}_getOptionId(e){for(let i of this._optionMap.keys())if(this._compareWith(this._optionMap.get(i),e))return i;return null}_getOptionValue(e){let i=pt(e);return this._optionMap.has(i)?this._optionMap.get(i):e}static \u0275fac=(()=>{let e;return function(r){return(e||(e=k(n)))(r||n)}})();static \u0275dir=l({type:n,selectors:[["select","formControlName","",3,"multiple",""],["select","formControl","",3,"multiple",""],["select","ngModel","",3,"multiple",""]],hostBindings:function(i,r){i&1&&M("change",function(a){return r.onChange(a.target.value)})("blur",function(){return r.onTouched()})},inputs:{compareWith:"compareWith"},standalone:!1,features:[_([gt]),h]})}return n})(),Lt=(()=>{class n{_element;_renderer;_select;id;constructor(e,i,r){this._element=e,this._renderer=i,this._select=r,this._select&&(this.id=this._select._registerOption())}set ngValue(e){this._select!=null&&(this._select._optionMap.set(this.id,e),this._setElementValue(Ge(this.id,e)),this._select._writeValueAfterRender())}set value(e){this._setElementValue(e),this._select?._writeValueAfterRender()}_setElementValue(e){this._renderer.setProperty(this._element.nativeElement,"value",e)}ngOnDestroy(){this._select?._optionMap.delete(this.id),this._select?._writeValueAfterRender()}static \u0275fac=function(i){return new(i||n)(s(b),s(A),s(Te,9))};static \u0275dir=l({type:n,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"},standalone:!1})}return n})(),mt={provide:W,useExisting:p(()=>Be),multi:!0};function be(n,t){return n==null?`${t}`:(typeof t=="string"&&(t=`'${t}'`),t&&typeof t=="object"&&(t="Object"),`${n}: ${t}`.slice(0,50))}function _t(n){return n.split(":")[0]}var Be=(()=>{class n extends te{value;_optionMap=new Map;_idCounter=0;set compareWith(e){this._compareWith=e}_compareWith=Object.is;writeValue(e){this.value=e;let i;if(Array.isArray(e)){let r=e.map(o=>this._getOptionId(o));i=(o,a)=>{o._setSelected(r.indexOf(a)>-1)}}else i=r=>{r._setSelected(!1)};this._optionMap.forEach(i)}registerOnChange(e){this.onChange=i=>{let r=[],o=i.selectedOptions;if(o!==void 0){let a=o;for(let c=0;c<a.length;c++){let x=a[c],z=this._getOptionValue(x.value);r.push(z)}}else{let a=i.options;for(let c=0;c<a.length;c++){let x=a[c];if(x.selected){let z=this._getOptionValue(x.value);r.push(z)}}}this.value=r,e(r)}}_registerOption(e){let i=(this._idCounter++).toString();return this._optionMap.set(i,e),i}_getOptionId(e){for(let i of this._optionMap.keys())if(this._compareWith(this._optionMap.get(i)._value,e))return i;return null}_getOptionValue(e){let i=_t(e);return this._optionMap.has(i)?this._optionMap.get(i)._value:e}static \u0275fac=(()=>{let e;return function(r){return(e||(e=k(n)))(r||n)}})();static \u0275dir=l({type:n,selectors:[["select","multiple","","formControlName",""],["select","multiple","","formControl",""],["select","multiple","","ngModel",""]],hostBindings:function(i,r){i&1&&M("change",function(a){return r.onChange(a.target)})("blur",function(){return r.onTouched()})},inputs:{compareWith:"compareWith"},standalone:!1,features:[_([mt]),h]})}return n})(),$t=(()=>{class n{_element;_renderer;_select;id;_value;constructor(e,i,r){this._element=e,this._renderer=i,this._select=r,this._select&&(this.id=this._select._registerOption(this))}set ngValue(e){this._select!=null&&(this._value=e,this._setElementValue(be(this.id,e)),this._select.writeValue(this._select.value))}set value(e){this._select?(this._value=e,this._setElementValue(be(this.id,e)),this._select.writeValue(this._select.value)):this._setElementValue(e)}_setElementValue(e){this._renderer.setProperty(this._element.nativeElement,"value",e)}_setSelected(e){this._renderer.setProperty(this._element.nativeElement,"selected",e)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}static \u0275fac=function(i){return new(i||n)(s(b),s(A),s(Be,9))};static \u0275dir=l({type:n,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"},standalone:!1})}return n})();var vt=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=X({type:n});static \u0275inj=Z({})}return n})();var Wt=(()=>{class n{static withConfig(e){return{ngModule:n,providers:[{provide:re,useValue:e.callSetDisabledState??oe}]}}static \u0275fac=function(i){return new(i||n)};static \u0275mod=X({type:n});static \u0275inj=Z({imports:[vt]})}return n})();export{Me as a,Tt as b,Bt as c,dt as d,ft as e,Ht as f,Te as g,Lt as h,$t as i,Wt as j};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ba as i,k as s,n as o}from"./chunk-U2H3QYAG.js";var a=class r{http=o(i);getWorkflows(){return this.http.get("/api/workflows")}getWorkflowFolders(){return this.http.get("/api/workflows/folders")}createWorkflowFolder(t){return this.http.post("/api/workflows/folders",{path:t})}getWorkflow(t){return this.http.get("/api/workflows/detail",{params:{id:t}})}getRuns(){return this.http.get("/api/runs")}getRun(t){return this.http.get(`/api/runs/${t}`)}startRun(t,e){return this.http.post("/api/runs",{workflow:t,args:e})}saveWorkflow(t,e){return this.http.put("/api/workflows",{id:t,content:e})}runAction(t,e,l){let n=`/api/runs/${t}${e==="delete"?"":`/${e}`}`;return e==="delete"?this.http.delete(n):this.http.post(n,e==="reject"?{reason:l}:{})}static \u0275fac=function(e){return new(e||r)};static \u0275prov=s({token:r,factory:r.\u0275fac,providedIn:"root"})};export{a};
|