
static.chunk-TJE3PVGV.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of yamcs-web Show documentation
Show all versions of yamcs-web Show documentation
Web UI for managing and monitoring Yamcs
import{a as ve,b as be}from"./chunk-HPYXCO75.js";import{e as Te,f as Ae}from"./chunk-RL3R2NWK.js";import{a as ot,c as rt,d as fe,e as Se}from"./chunk-AD76HIUY.js";import{$e as Gt,Aa as _,Ba as O,Bc as kt,Ca as N,Cb as W,Dc as Ct,Ea as P,Eb as bt,Ec as Mt,Eg as nt,Fa as A,Ga as s,Gb as K,Hb as At,Hc as $t,Ib as J,Ic as qt,Jb as q,Ka as V,Kb as Et,Kg as de,L as D,La as R,Lc as Ot,Le as Z,Ma as B,Of as ee,Pa as G,Qa as o,Qf as ie,Qg as _e,R as x,Ra as C,Re as Rt,Rg as ue,S as y,Sa as g,Se as Bt,Te as Yt,Uc as X,Uf as ne,Ug as he,Ve as jt,Wa as I,We as zt,Wf as ae,Wg as at,Xa as Y,Xg as Ce,Ya as E,Ye as Ut,Yf as oe,Z as F,Za as L,Zd as Lt,Ze as Ht,ab as u,af as Qt,ag as re,bb as h,bg as le,bh as $,cb as Q,cf as Wt,cg as me,db as St,ed as Nt,f as S,fa as l,ga as f,hd as gt,hf as Kt,hh as k,if as Jt,ih as ge,jd as j,je as Vt,jf as Xt,jg as se,jh as xe,kd as Ft,kh as ye,lf as tt,na as c,oc as wt,pa as d,pc as Dt,ra as yt,rb as M,tf as Zt,tg as ce,ua as p,uf as te,va as v,vf as et,vg as pe,wa as T,xa as b,xb as vt,xg as it,ya as a,yb as Tt,yc as Pt,za as n,zc as It}from"./chunk-7FNOC45H.js";var lt=class extends wt{constructor(e){super();this.yamcs=e;this.items$=new S([]);this.totalSize$=new S(0);this.loading$=new S(!1)}connect(){return this.items$}loadAlgorithms(e){return this.loading$.next(!0),this.yamcs.yamcsClient.getAlgorithms(this.yamcs.instance,e).then(r=>{this.loading$.next(!1),this.totalSize$.next(r.totalSize);let m=[];for(let w of r.systems||[])m.push({name:w.qualifiedName,system:w});for(let w of r.algorithms||[])m.push({name:w.qualifiedName,algorithm:w});this.items$.next(m)})}disconnect(){this.items$.complete(),this.totalSize$.complete(),this.loading$.complete()}};var Me=["top"],Ee=t=>({c:t}),$e=()=>["/algorithms"],qe=(t,i)=>({c:t,system:i});function Oe(t,i){if(t&1&&_(0,"ya-breadcrumb",10),t&2){let e=i.$implicit;d("link",e.route)("queryParams",e.queryParams)("label",e.name)}}function Ne(t,i){if(t&1&&(a(0,"div",4)(1,"ya-breadcrumb-trail"),_(2,"ya-breadcrumb",9),T(3,Oe,1,3,"ya-breadcrumb",10,v),n()()),t&2){let e=s(),r=s();l(2),d("queryParams",E(1,Ee,r.yamcs.context)),l(),b(e)}}function Fe(t,i){t&1&&c(0,Ne,5,3,"div",4),t&2&&p(i.length?0:-1)}function Le(t,i){t&1&&(a(0,"th",24),o(1,"Name"),n())}function Ve(t,i){if(t&1&&(a(0,"mat-icon",26),o(1,"folder"),n(),a(2,"a",27),o(3),u(4,"filename"),n()),t&2){let e=s().$implicit,r=s(2);l(2),d("routerLink",Y(5,$e))("queryParams",L(6,qe,r.yamcs.context,e.name)),l(),g("",h(4,3,e.name),"/ ")}}function Re(t,i){if(t&1&&_(0,"ya-highlight",28),t&2){let e=s(2).$implicit,r=s(2);d("text",e.algorithm.qualifiedName)("term",r.filterForm.value.filter)}}function Be(t,i){if(t&1&&(_(0,"ya-highlight",28),u(1,"slice")),t&2){let e=s(2).$implicit,r=s(2);d("text",Q(1,2,e.algorithm.qualifiedName,r.system.length+1))("term",r.filterForm.value.filter)}}function Ye(t,i){if(t&1&&(a(0,"mat-icon",26),o(1,"transform"),n(),a(2,"a",27),c(3,Re,1,2,"ya-highlight",28)(4,Be,2,5,"ya-highlight",28),n()),t&2){let e=s().$implicit,r=s(2);l(2),d("routerLink","/algorithms"+e.algorithm.qualifiedName)("queryParams",E(4,Ee,r.yamcs.context)),l(),p(r.system?-1:3),l(),p(r.system?4:-1)}}function je(t,i){if(t&1&&(a(0,"td",25),c(1,Ve,5,9)(2,Ye,5,6),n()),t&2){let e=i.$implicit;l(),p(e.system?1:-1),l(),p(e.algorithm?2:-1)}}function ze(t,i){t&1&&(a(0,"th",24),o(1,"Type"),n())}function Ue(t,i){if(t&1&&(a(0,"td",29),o(1),n()),t&2){let e=i.$implicit;l(),C((e.algorithm==null?null:e.algorithm.type)||"-")}}function He(t,i){t&1&&(a(0,"th",24),o(1,"Language"),n())}function Ge(t,i){if(t&1&&(a(0,"td",29),o(1),n()),t&2){let e=i.$implicit;l(),C((e.algorithm==null?null:e.algorithm.language)||"-")}}function Qe(t,i){t&1&&(a(0,"th",24),o(1,"Scope"),n())}function We(t,i){if(t&1&&(a(0,"td",29),o(1),n()),t&2){let e=i.$implicit;l(),C((e.algorithm==null?null:e.algorithm.scope)||"-")}}function Ke(t,i){t&1&&(a(0,"th",24),o(1,"Description"),n())}function Je(t,i){if(t&1&&o(0),t&2){let e=s().$implicit;g(" ",e.system.shortDescription||"-"," ")}}function Xe(t,i){if(t&1&&o(0),t&2){let e=s().$implicit;g(" ",e.algorithm.shortDescription||"-"," ")}}function Ze(t,i){if(t&1&&(a(0,"td",30),c(1,Je,1,1)(2,Xe,1,1),n()),t&2){let e=i.$implicit;l(),p(e.system?1:-1),l(),p(e.algorithm?2:-1)}}function ti(t,i){t&1&&_(0,"th",31)}function ei(t,i){t&1&&_(0,"td",29)}function ii(t,i){t&1&&_(0,"tr",32)}function ni(t,i){if(t&1&&_(0,"tr",33),t&2){let e=i.$implicit,r=s(2);yt("selected",r.selection.isSelected(e))}}function ai(t,i){if(t&1&&(a(0,"table",7),O(1,11),c(2,Le,2,0,"th",12)(3,je,3,2,"td",13),N(),O(4,14),c(5,ze,2,0,"th",12)(6,Ue,2,1,"td",15),N(),O(7,16),c(8,He,2,0,"th",12)(9,Ge,2,1,"td",15),N(),O(10,17),c(11,Qe,2,0,"th",12)(12,We,2,1,"td",15),N(),O(13,18),c(14,Ke,2,0,"th",12)(15,Ze,3,2,"td",19),N(),O(16,20),c(17,ti,1,0,"th",21)(18,ei,1,0,"td",15),N(),c(19,ii,1,0,"tr",22)(20,ni,1,2,"tr",23),n()),t&2){let e=s();d("dataSource",e.dataSource),l(19),d("matHeaderRowDef",e.displayedColumns),l(),d("matRowDefColumns",e.displayedColumns)}}function oi(t,i){if(t&1&&(a(0,"div",2),o(1," The Mission Database for "),a(2,"i"),o(3),n(),o(4," does not define any algorithms. "),n()),t&2){let e=s();l(3),C(e.yamcs.instance)}}var mt=class t{constructor(i,e,r,m){this.yamcs=i;this.route=r;this.router=m;this.filterForm=new kt({filter:new Ct,scope:new Ct("ANY")});this.shortName=!1;this.pageSize=100;this.system=null;this.breadcrumb$=new S([]);this.displayedColumns=["name","type","language","scope","shortDescription","actions"];this.scopeOptions=[{id:"ANY",label:"Any scope"},{id:"GLOBAL",label:"Global"},{id:"COMMAND_VERIFICATION",label:"Command Verification"},{id:"CONTAINER_PROCESSING",label:"Container Processing"}];this.selection=new Dt(!1);e.setTitle("Algorithms"),this.dataSource=new lt(i)}ngAfterViewInit(){let i=this.route.snapshot.queryParamMap;i.has("filter")&&(this.filter=i.get("filter")||"",this.filterForm.get("filter").setValue(this.filter)),i.has("scope")&&(this.scope=i.get("scope"),this.filterForm.get("scope").setValue(this.scope)),this.filterForm.get("filter").valueChanges.subscribe(e=>{this.paginator.pageIndex=0,this.filter=e,this.updateDataSource()}),this.filterForm.get("scope").valueChanges.forEach(e=>{this.scope=e!=="ANY"?e:null,this.updateDataSource()}),this.changeSystem(this.route.snapshot.queryParamMap),this.queryParamMapSubscription=this.route.queryParamMap.subscribe(e=>{e.get("system")!==this.system&&this.changeSystem(e)}),this.paginator.page.subscribe(()=>{this.updateDataSource(),this.top.nativeElement.scrollIntoView()})}changeSystem(i){this.system=i.get("system"),this.updateBrowsePath(),i.has("page")?this.paginator.pageIndex=Number(i.get("page")):this.paginator.pageIndex=0,this.updateDataSource()}updateDataSource(){this.updateURL();let i={system:this.system||"/",pos:this.paginator.pageIndex*this.pageSize,limit:this.pageSize};this.filter&&(i.q=this.filter),this.scope&&(i.scope=this.scope),this.dataSource.loadAlgorithms(i).then(()=>{this.selection.clear(),this.updateBrowsePath()})}updateURL(){this.router.navigate([],{replaceUrl:!0,relativeTo:this.route,queryParams:{page:this.paginator.pageIndex||null,filter:this.filter||null,scope:this.scope||null,system:this.system||null},queryParamsHandling:"merge"})}updateBrowsePath(){let i=[],e="";if(this.system)for(let r of this.system.slice(1).split("/"))e+="/"+r,i.push({name:r,route:"/algorithms",queryParams:{system:e,c:this.yamcs.context}});this.breadcrumb$.next(i)}selectNext(){let i=this.dataSource.items$.value,e=0;if(this.selection.hasValue()){let r=this.selection.selected[0];i.indexOf(r)!==-1&&(e=Math.min(i.indexOf(r)+1,i.length-1))}this.selection.select(i[e])}selectPrevious(){let i=this.dataSource.items$.value,e=0;if(this.selection.hasValue()){let r=this.selection.selected[0];i.indexOf(r)!==-1&&(e=Math.max(i.indexOf(r)-1,0))}this.selection.select(i[e])}applySelection(){if(this.selection.hasValue()){let i=this.selection.selected[0];this.dataSource.items$.value.indexOf(i)!==-1&&this.router.navigate(["/algorithms"+i.algorithm?.qualifiedName],{queryParams:{c:this.yamcs.context}})}}ngOnDestroy(){this.queryParamMapSubscription?.unsubscribe(),this.dataSource.disconnect()}static{this.\u0275fac=function(e){return new(e||t)(f($),f(W),f(K),f(J))}}static{this.\u0275cmp=D({type:t,selectors:[["ng-component"]],viewQuery:function(e,r){if(e&1&&(V(Me,7),V(Z,7)),e&2){let m;R(m=B())&&(r.top=m.first),R(m=B())&&(r.paginator=m.first)}},standalone:!0,features:[I],decls:17,vars:13,consts:[["top",""],["empty",""],[1,"panel-content"],[3,"formGroup"],[1,"filter-bar"],["placeholder","Search by name","icon","search",3,"onArrowDown","onArrowUp","onEnter","formControl"],["formControlName","scope",3,"options"],["mat-table","",1,"ya-data-table","expand",3,"dataSource"],[3,"pageSize","hidePageSize","showFirstLastButtons","length"],["link","/algorithms","icon","account_tree",3,"queryParams"],[3,"link","queryParams","label"],["matColumnDef","name"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","class","primary-td",4,"matCellDef"],["matColumnDef","type"],["mat-cell","",4,"matCellDef"],["matColumnDef","language"],["matColumnDef","scope"],["matColumnDef","shortDescription"],["mat-cell","","class","wrap200",4,"matCellDef"],["matColumnDef","actions"],["mat-header-cell","","class","expand",4,"matHeaderCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",3,"selected",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],["mat-cell","",1,"primary-td"],[1,"icon12",2,"vertical-align","middle"],[3,"routerLink","queryParams"],[3,"text","term"],["mat-cell",""],["mat-cell","",1,"wrap200"],["mat-header-cell","",1,"expand"],["mat-header-row",""],["mat-row",""]],template:function(e,r){if(e&1){let m=P();a(0,"app-instance-page")(1,"app-instance-toolbar"),o(2," Algorithms "),n(),_(3,"span",null,0),a(5,"div",2)(6,"form",3),c(7,Fe,1,1),u(8,"async"),a(9,"div",4)(10,"ya-search-filter",5),A("onArrowDown",function(){return x(m),y(r.selectNext())})("onArrowUp",function(){return x(m),y(r.selectPrevious())})("onEnter",function(){return x(m),y(r.applySelection())}),n(),_(11,"ya-select",6),n()(),c(12,ai,21,3,"table",7),_(13,"mat-paginator",8),u(14,"async"),n(),c(15,oi,5,1,"ng-template",null,1,St),n()}if(e&2){let m;l(6),d("formGroup",r.filterForm),l(),p((m=h(8,9,r.breadcrumb$))?7:-1,m),l(3),d("formControl",r.filterForm.controls.filter),l(),d("options",r.scopeOptions),l(),p(r.dataSource?12:-1),l(),d("pageSize",r.pageSize)("hidePageSize",!0)("showFirstLastButtons",!0)("length",h(14,11,r.dataSource.totalSize$))}},dependencies:[rt,ot,k,M,Tt,Mt,Pt,It,$t,qt,Ot,q,X,Z,Rt,Yt,Ht,jt,Bt,Gt,zt,Ut,Qt,Wt,te,Zt,oe,se,ee,de],styles:[".primary-td[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{margin-right:7px}"],changeDetection:0})}};function ri(t,i){if(t&1&&_(0,"ya-led",0),t&2){let e=s();d("color",e.onColor)("fade",!1)("width",e.size)("height",e.size)}}function li(t,i){if(t&1&&_(0,"ya-led",1),t&2){let e=s();d("fade",!1)("width",e.size)("height",e.size)}}var ct=class t{constructor(){this.size=14;this.onColor=re;this.offColor=le}static{this.\u0275fac=function(e){return new(e||t)}}static{this.\u0275cmp=D({type:t,selectors:[["app-algorithm-status"]],inputs:{status:"status",size:"size"},standalone:!0,features:[I],decls:2,vars:2,consts:[[3,"color","fade","width","height"],["color","red",3,"fade","width","height"]],template:function(e,r){e&1&&c(0,ri,1,4,"ya-led",0)(1,li,1,3,"ya-led",1),e&2&&(p(r.status.errorMessage?-1:0),l(),p(r.status.errorMessage?1:-1))},dependencies:[k,me],styles:["[_nghost-%COMP%]{line-height:0;font-size:0}"],changeDetection:0})}};var mi=["text"],si=(t,i)=>({c:t,system:i}),ci=t=>["/mdb/parameters/",t],dt=t=>({c:t});function pi(t,i){if(t&1&&(a(0,"a",2),o(1),n()),t&2){let e=i,r=s();d("queryParams",L(2,si,r.yamcs.context,e)),l(),g(" ",e," ")}}function di(t,i){if(t&1&&(a(0,"dt"),o(1),n(),a(2,"dd"),o(3),n()),t&2){let e=i.$implicit;l(),C(e.namespace),l(2),C(e.name)}}function _i(t,i){if(t&1&&(a(0,"dt"),o(1,"Description"),n(),a(2,"dd"),_(3,"app-markdown",5),n()),t&2){let e=s();l(3),d("text",e.algorithm.longDescription)}}function ui(t,i){if(t&1&&(a(0,"dt"),o(1,"Description"),n(),a(2,"dd"),o(3),n()),t&2){let e=s();l(3),g(" ",e.algorithm.shortDescription||"-"," ")}}function hi(t,i){if(t&1&&o(0),t&2){let e=s(2);g(" ",e.status.errorMessage," ")}}function Ci(t,i){t&1&&o(0," OK ")}function gi(t,i){if(t&1&&(a(0,"span"),o(1),u(2,"nanosDuration"),n()),t&2){let e=s(2);l(),g(" ",h(2,1,e.status.execTimeNs/e.status.runCount)," ")}}function fi(t,i){t&1&&(a(0,"span"),o(1,"-"),n())}function xi(t,i){if(t&1&&(_(0,"mat-divider"),a(1,"dl",3)(2,"dt"),o(3,"Status"),n(),a(4,"dd",6),_(5,"app-algorithm-status",7),o(6," \xA0 "),c(7,hi,1,1)(8,Ci,1,0),n(),a(9,"dt"),o(10,"Run count"),n(),a(11,"dd"),o(12),u(13,"number"),n(),a(14,"dt"),o(15,"Total run time"),n(),a(16,"dd"),o(17),u(18,"nanosDuration"),n(),a(19,"dt"),o(20,"Average run time"),n(),a(21,"dd"),c(22,gi,3,3,"span")(23,fi,2,0,"span"),n(),a(24,"dt"),o(25,"Last run"),n(),a(26,"dd"),o(27),u(28,"datetime"),n()()),t&2){let e=s();l(5),d("status",e.status),l(2),p(e.status.errorMessage?7:8),l(5),C(h(13,6,e.status.runCount)||"-"),l(5),g(" ",h(18,8,e.status.execTimeNs)||"-"," "),l(5),p(e.status.runCount?22:23),l(5),C(h(28,10,e.status.lastRun)||"-")}}function yi(t,i){t&1&&(a(0,"ya-help"),o(1," You may override the MDB algorithm text. Such a change is scoped to the current processor only and will not persist across server restarts. "),n())}function Si(t,i){t&1&&(a(0,"span",8),o(1,"MDB Override"),n())}function vi(t,i){if(t&1){let e=P();a(0,"div",9)(1,"ya-button",11),u(2,"async"),A("click",function(){x(e);let m=s(2);return y(m.saveTextChanges())}),o(3," Save "),n(),a(4,"ya-button",12),u(5,"async"),A("click",function(){x(e);let m=s(2);return y(m.revertText())}),o(6," Restore MDB text "),n()()}if(t&2){let e,r=s(2);l(),d("disabled",!h(2,2,r.dirty$)),l(3),d("disabled",!((e=h(5,4,r.overrides$))!=null&&e.textOverride))}}function Ti(t,i){if(t&1&&(_(0,"mat-divider"),a(1,"dl",3)(2,"dt"),o(3," Text "),c(4,yi,2,0,"ya-help"),_(5,"br"),c(6,Si,2,0,"span",8),u(7,"async"),n(),a(8,"dd"),c(9,vi,7,6,"div",9),_(10,"div",10,0),n()()),t&2){let e,r=s();l(4),p(r.isChangeMissionDatabaseEnabled()?4:-1),l(2),p((e=h(7,3,r.overrides$))!=null&&e.textOverride?6:-1),l(3),p(r.isChangeMissionDatabaseEnabled()?9:-1)}}function bi(t,i){if(t&1&&(a(0,"td"),o(1,"Operand"),n(),a(2,"td"),o(3),n()),t&2){let e=s().$implicit;l(3),C(e.value)}}function Ai(t,i){if(t&1&&(a(0,"td"),o(1,"Operator"),n(),a(2,"td"),o(3),n()),t&2){let e=s().$implicit;l(3),C(e.operator)}}function Ei(t,i){t&1&&(a(0,"td"),o(1,"Operand"),n(),a(2,"td"),o(3,"this"),n())}function wi(t,i){if(t&1&&(a(0,"td"),o(1,"Operand"),n(),a(2,"td")(3,"a",13),o(4),n()()),t&2){let e=s().$implicit,r=s(2);l(3),d("routerLink",E(3,ci,e.parameter.qualifiedName))("queryParams",E(5,dt,r.yamcs.context)),l(),g(" ",e.parameter.qualifiedName," ")}}function Di(t,i){if(t&1&&(a(0,"tr"),c(1,bi,4,1)(2,Ai,4,1)(3,Ei,4,0)(4,wi,5,7),n()),t&2){let e,r=i.$implicit;l(),p((e=r.type)==="VALUE_OPERAND"?1:e==="OPERATOR"?2:e==="THIS_PARAMETER_OPERAND"?3:e==="PARAMETER"?4:-1)}}function Pi(t,i){if(t&1&&(_(0,"mat-divider"),a(1,"dl",3)(2,"dt"),o(3,"Postfix Expression"),n(),a(4,"dd")(5,"table",4)(6,"tr")(7,"th"),o(8,"Type"),n(),a(9,"th"),o(10,"Value"),n()(),T(11,Di,5,1,"tr",null,v),n()()()),t&2){let e=s();l(11),b(e.algorithm.mathElements)}}function Ii(t,i){t&1&&o(0," Parameter ")}function ki(t,i){t&1&&o(0," Argument ")}function Mi(t,i){t&1&&o(0," Unknown ")}function $i(t,i){if(t&1&&(a(0,"a",14),o(1),n()),t&2){let e=s().$implicit,r=s(2);d("routerLink","/telemetry/parameters"+e.parameter.qualifiedName)("queryParams",E(3,dt,r.yamcs.context)),l(),g(" ",e.parameter.qualifiedName," ")}}function qi(t,i){if(t&1&&o(0),t&2){let e=s().$implicit;g(" ",e.argument.name," ")}}function Oi(t,i){t&1&&o(0," - ")}function Ni(t,i){if(t&1&&(a(0,"tr")(1,"td"),o(2),n(),a(3,"td"),c(4,Ii,1,0)(5,ki,1,0)(6,Mi,1,0),n(),a(7,"td"),c(8,$i,2,5,"a",14)(9,qi,1,1)(10,Oi,1,0),n(),a(11,"td",15),o(12),n(),a(13,"td",15),o(14),n()()),t&2){let e,r=i.$implicit;l(2),C(r.inputName||"-"),l(2),p(r.parameter?4:r.argument?5:6),l(4),p(r.parameter?8:r.argument?9:10),l(4),g(" ",(e=r.parameterInstance)!==null&&e!==void 0?e:"-"," "),l(2),g(" ",r.mandatory?"Yes":"No"," ")}}function Fi(t,i){if(t&1&&(a(0,"table",4)(1,"tr")(2,"th"),o(3,"Input name"),n(),a(4,"th"),o(5,"Type"),n(),a(6,"th"),o(7,"Ref"),n(),a(8,"th"),o(9,"Instance"),n(),a(10,"th"),o(11,"Mandatory"),n()(),T(12,Ni,15,5,"tr",null,v),n()),t&2){let e=s();l(12),b(e.algorithm.inputParameter)}}function Li(t,i){t&1&&(a(0,"span"),o(1,"-"),n())}function Vi(t,i){if(t&1&&(a(0,"tr")(1,"td"),o(2),n(),a(3,"td")(4,"a",14),o(5),n()()()),t&2){let e=i.$implicit,r=s(2);l(2),C(e.outputName||"-"),l(2),d("routerLink","/telemetry/parameters"+e.parameter.qualifiedName)("queryParams",E(4,dt,r.yamcs.context)),l(),g(" ",e.parameter.qualifiedName," ")}}function Ri(t,i){if(t&1&&(a(0,"table",4)(1,"tr")(2,"th"),o(3,"Output name"),n(),a(4,"th"),o(5,"Parameter"),n()(),T(6,Vi,6,6,"tr",null,v),n()),t&2){let e=s();l(6),b(e.algorithm.outputParameter)}}function Bi(t,i){t&1&&(a(0,"span"),o(1,"-"),n())}function Yi(t,i){if(t&1&&(a(0,"tr")(1,"td"),o(2,"OnParameterUpdate"),n(),a(3,"td")(4,"a",14),o(5),n()()()),t&2){let e=i.$implicit,r=s();l(4),d("routerLink","/telemetry/parameters"+e.qualifiedName)("queryParams",E(3,dt,r.yamcs.context)),l(),g(" ",e.qualifiedName," ")}}function ji(t,i){if(t&1&&(a(0,"tr")(1,"td"),o(2,"OnPeriodicRate"),n(),a(3,"td"),o(4),n()()),t&2){let e=s();l(4),g("",e.algorithm.onPeriodicRate," ms")}}var pt=class t{constructor(i,e,r){this.yamcs=i;this.messageService=e;this.authService=r;this.overrides$=new S(null);this.dirty$=new S(!1)}ngAfterViewInit(){this.algorithm.text&&(this.initializeEditor(),this.refreshOverrides())}isChangeMissionDatabaseEnabled(){return this.authService.getUser().hasSystemPrivilege("ChangeMissionDatabase")}initializeEditor(){let i=[Vt,Ft.of([Lt]),j.lineWrapping];this.isChangeMissionDatabaseEnabled()?i.push(j.updateListener.of(m=>{m.docChanged&&this.dirty$.next(!0)})):i.push(gt.readOnly.of(!0));let e=j.theme({"&":{height:"300px",fontSize:"12px"},".cm-scroller":{overflow:"auto",fontFamily:"'Roboto Mono', monospace"}},{dark:!1});switch(i.push(e),this.algorithm.language.toLowerCase()){case"java-expression":i.push(ve());break;case"javascript":i.push(Te());break;case"python":i.push(be());break;default:console.warn(`Unexpected language ${this.algorithm.language}`)}let r=gt.create({doc:this.algorithm.text,extensions:i});this.editorView=new j({state:r,parent:this.textContainer.nativeElement})}refreshOverrides(){let i=this.algorithm.qualifiedName,e=this.yamcs.instance,r=this.yamcs.processor;this.yamcs.yamcsClient.getAlgorithmOverrides(e,r,i).then(m=>{this.overrides$.next(m),m.textOverride?this.updateEditorValue(m.textOverride.text):this.updateEditorValue(this.algorithm.text)}).catch(m=>this.messageService.showError(m))}updateEditorValue(i){this.editorView.dispatch({changes:{from:0,to:this.editorView.state.doc.length,insert:i}}),this.dirty$.next(!1)}saveTextChanges(){let i=this.editorView.state.doc.toString(),e=this.yamcs.instance,r=this.yamcs.processor;this.yamcs.yamcsClient.updateAlgorithmText(e,r,this.algorithm.qualifiedName,i).then(()=>this.refreshOverrides()).catch(m=>this.messageService.showError(m))}revertText(){let i=this.yamcs.instance,e=this.yamcs.processor;this.yamcs.yamcsClient.revertAlgorithmText(i,e,this.algorithm.qualifiedName).then(()=>this.refreshOverrides()).catch(r=>this.messageService.showError(r))}static{this.\u0275fac=function(e){return new(e||t)(f($),f(tt),f(ge))}}static{this.\u0275cmp=D({type:t,selectors:[["app-algorithm-detail"]],viewQuery:function(e,r){if(e&1&&V(mi,5),e&2){let m;R(m=B())&&(r.textContainer=m.first)}},inputs:{algorithm:"algorithm",status:"status"},standalone:!0,features:[I],decls:60,vars:16,consts:[["text",""],[1,"dl-horizontal","no-lead"],["routerLink","/algorithms",1,"ya-link",3,"queryParams"],[1,"dl-horizontal"],["yaDataTable",""],[3,"text"],[2,"display","flex","align-items","center"],[3,"status"],[1,"override-annotation"],[2,"padding-bottom","5px"],[1,"algorithm-text"],["icon","save",2,"margin-right","5px",3,"click","disabled"],["icon","undo",3,"click","disabled"],[1,"ya-link",3,"routerLink","queryParams"],[3,"routerLink","queryParams"],[2,"text-align","center"]],template:function(e,r){if(e&1&&(a(0,"dl",1)(1,"dt"),o(2,"Algorithm"),n(),a(3,"dd"),o(4),u(5,"shortName"),n(),a(6,"dt"),o(7,"System"),n(),a(8,"dd"),c(9,pi,2,5,"a",2),u(10,"spaceSystemName"),n(),T(11,di,4,2,null,null,v),c(13,_i,4,1)(14,ui,4,1),n(),_(15,"mat-divider"),a(16,"dl",3)(17,"dt"),o(18,"Scope"),n(),a(19,"dd"),o(20),n(),a(21,"dt"),o(22,"Type"),n(),a(23,"dd"),o(24),n(),a(25,"dt"),o(26,"Language"),n(),a(27,"dd"),o(28),n()(),c(29,xi,29,12)(30,Ti,12,5)(31,Pi,13,0),_(32,"mat-divider"),a(33,"dl",3)(34,"dt"),o(35,"Input parameters"),n(),a(36,"dd"),c(37,Fi,14,0,"table",4)(38,Li,2,0,"span"),n()(),_(39,"mat-divider"),a(40,"dl",3)(41,"dt"),o(42,"Output parameters"),n(),a(43,"dd"),c(44,Ri,8,0,"table",4)(45,Bi,2,0,"span"),n()(),_(46,"mat-divider"),a(47,"dl",3)(48,"dt"),o(49,"Triggers"),n(),a(50,"dd")(51,"table",4)(52,"tr")(53,"th"),o(54,"Type"),n(),a(55,"th"),o(56,"Value"),n()(),T(57,Yi,6,5,"tr",null,v),c(59,ji,5,1,"tr"),n()()()),e&2){let m;l(4),C(h(5,12,r.algorithm.qualifiedName)),l(5),p((m=h(10,14,r.algorithm.qualifiedName))?9:-1,m),l(2),b(r.algorithm.alias),l(2),p(r.algorithm.longDescription?13:14),l(7),C(r.algorithm.scope||"-"),l(4),C(r.algorithm.type||"-"),l(4),C(r.algorithm.language||"-"),l(),p(r.status&&r.algorithm.scope==="GLOBAL"?29:-1),l(),p(r.algorithm.text?30:-1),l(),p(r.algorithm.mathElements?31:-1),l(6),p(r.algorithm.inputParameter?37:38),l(7),p(r.algorithm.outputParameter?44:45),l(13),b(r.algorithm.onParameterUpdate),l(2),p(r.algorithm.onPeriodicRate?59:-1)}},dependencies:[ct,Ae,k,M,vt,q,it,Nt,et,ae,nt,_e,at,Ce],styles:["code[_ngcontent-%COMP%]{display:block;background-color:#fafafa;padding:1em;font-size:10px;border:1px solid #d3d3d3;white-space:pre}.algorithm-text[_ngcontent-%COMP%]{border:1px solid rgba(0,0,0,.12)}.override-annotation[_ngcontent-%COMP%]{font-style:italic;font-weight:300}"],changeDetection:0})}};function zi(t,i){if(t&1&&(_(0,"app-algorithm-detail",1),u(1,"async")),t&2){let e=s();d("algorithm",i)("status",h(1,2,e.status$))}}var _t=class t{constructor(i){this.yamcs=i;this.qualifiedName=F.required({alias:"algorithm"});this.status$=new S(null)}ngOnInit(){let i=this.yamcs.instance;this.algorithm$=this.yamcs.yamcsClient.getAlgorithm(i,this.qualifiedName()),this.yamcs.processor&&(this.algorithmStatusSubscription=this.yamcs.yamcsClient.createAlgorithmStatusSubscription({instance:this.yamcs.instance,processor:this.yamcs.processor,name:this.qualifiedName()},e=>this.status$.next(e)))}ngOnDestroy(){this.algorithmStatusSubscription?.cancel()}static{this.\u0275fac=function(e){return new(e||t)(f($))}}static{this.\u0275cmp=D({type:t,selectors:[["ng-component"]],inputs:{qualifiedName:[1,"algorithm","qualifiedName"]},standalone:!0,features:[I],decls:3,vars:3,consts:[[1,"panel-content"],[3,"algorithm","status"]],template:function(e,r){if(e&1&&(a(0,"div",0),c(1,zi,2,4,"app-algorithm-detail",1),u(2,"async"),n()),e&2){let m;l(),p((m=h(2,1,r.algorithm$))?1:-1,m)}},dependencies:[pt,k,M],encapsulation:2,changeDetection:0})}};var we=()=>[],De=t=>({c:t});function Ui(t,i){if(t&1){let e=P();_(0,"span",5),a(1,"ya-text-action",6),A("click",function(){x(e);let m=s(4);return y(m.switchToSection("runs"))}),o(2," Runs "),n(),o(3," \xA0\xA0 "),a(4,"ya-text-action",7),A("click",function(){x(e);let m=s(4);return y(m.switchToSection("logs"))}),o(5," Logs "),n()}if(t&2){let e=i;l(),d("active",e==="runs"),l(3),d("active",e==="logs")}}function Hi(t,i){t&1&&(a(0,"mat-icon",10),o(1,"error"),n())}function Gi(t,i){t&1&&(a(0,"mat-icon",11),o(1,"check_circle"),n())}function Qi(t,i){t&1&&_(0,"br")}function Wi(t,i){if(t&1&&(a(0,"a",14),o(1),n(),o(2," : "),_(3,"ya-value",15),c(4,Qi,1,0,"br")),t&2){let e=i.$implicit,r=i.$index,m=i.$count,w=s(8);d("routerLink","/telemetry/parameters"+e.id.name)("queryParams",E(5,De,w.yamcs.context)),l(),g(" ",e.id.name," "),l(2),d("value",e.engValue),l(),p(r!==m-1?4:-1)}}function Ki(t,i){t&1&&o(0," - ")}function Ji(t,i){t&1&&_(0,"br")}function Xi(t,i){if(t&1&&(a(0,"a",14),o(1),n(),o(2," : "),_(3,"ya-value",15),c(4,Ji,1,0,"br")),t&2){let e=i.$implicit,r=i.$index,m=i.$count,w=s(8);d("routerLink","/telemetry/parameters"+e.id.name)("queryParams",E(5,De,w.yamcs.context)),l(),g(" ",e.id.name," "),l(2),d("value",e.engValue),l(),p(r!==m-1?4:-1)}}function Zi(t,i){t&1&&o(0," - ")}function tn(t,i){if(t&1&&(a(0,"tr")(1,"td",9),c(2,Hi,2,0,"mat-icon",10)(3,Gi,2,0,"mat-icon",11),n(),a(4,"td",12),o(5),u(6,"datetime"),n(),a(7,"td",13),T(8,Wi,5,7,null,null,v),c(10,Ki,1,0),n(),a(11,"td",13),T(12,Xi,5,7,null,null,v),c(14,Zi,1,0),n(),a(15,"td",12),o(16),u(17,"nvl"),n(),a(18,"td",12),o(19),n(),_(20,"td"),n()),t&2){let e=i.$implicit;l(2),p(e.error?2:3),l(3),C(h(6,6,e.time)),l(3),b(e.inputs||Y(11,we)),l(2),p(e.inputs!=null&&e.inputs.length?-1:10),l(2),b(e.outputs||Y(12,we)),l(2),p(e.outputs!=null&&e.outputs.length?-1:14),l(2),C(Q(17,8,e.returnValue,"-")),l(3),C(e.error||"-")}}function en(t,i){if(t&1&&(a(0,"table",8)(1,"tr"),_(2,"th",9),a(3,"th"),o(4,"Started"),n(),a(5,"th"),o(6,"Inputs"),n(),a(7,"th"),o(8,"Outputs"),n(),a(9,"th"),o(10,"Return value"),n(),a(11,"th"),o(12,"Error"),n(),_(13,"th"),n(),T(14,tn,21,13,"tr",null,v),n()),t&2){let e=s();l(14),b(e.runs)}}function nn(t,i){if(t&1){let e=P();a(0,"ya-empty-message")(1,"p"),o(2,"Tracing has started."),n(),a(3,"p"),o(4," This page does "),a(5,"strong"),o(6,"not"),n(),o(7," update automatically. "),n(),a(8,"p"),o(9," Hit refresh, or check back at a later time when you think there should be trace entries. "),n(),a(10,"p")(11,"ya-button",16),A("click",function(){x(e);let m=s(6);return y(m.refreshData())}),o(12,"Refresh"),n()()()}}function an(t,i){if(t&1&&c(0,en,16,0,"table",8)(1,nn,13,0,"ya-empty-message"),t&2){let e=i;p(e.runs!=null&&e.runs.length?0:1)}}function on(t,i){if(t&1){let e=P();a(0,"ya-empty-message")(1,"p"),o(2,"Tracing has started."),n(),a(3,"p"),o(4," This page does "),a(5,"strong"),o(6,"not"),n(),o(7," update automatically. "),n(),a(8,"p"),o(9," Hit refresh, or check back at a later time when you think there should be trace entries. "),n(),a(10,"p")(11,"ya-button",16),A("click",function(){x(e);let m=s(5);return y(m.refreshData())}),o(12,"Refresh"),n()()()}}function rn(t,i){if(t&1&&(c(0,an,2,1),u(1,"async"),c(2,on,13,0,"ya-empty-message")),t&2){let e,r=s(4);p((e=h(1,1,r.trace$))?0:2,e)}}function ln(t,i){if(t&1&&(a(0,"tr")(1,"td",18),o(2),u(3,"datetime"),n(),a(4,"td",19),o(5),n()()),t&2){let e=i.$implicit;l(2),g(" [",h(3,2,e.time),"] "),l(3),C(e.msg)}}function mn(t,i){if(t&1&&(a(0,"table",17),T(1,ln,6,4,"tr",null,v),n()),t&2){let e=s();l(),b(e.logs)}}function sn(t,i){if(t&1){let e=P();a(0,"ya-empty-message")(1,"p"),o(2,"Tracing has started."),n(),a(3,"p"),o(4," This page does "),a(5,"strong"),o(6,"not"),n(),o(7," update automatically. "),n(),a(8,"p"),o(9," Hit refresh, or check back at a later time when you think there should be trace entries. "),n(),a(10,"p")(11,"ya-button",16),A("click",function(){x(e);let m=s(6);return y(m.refreshData())}),o(12,"Refresh"),n()()()}}function cn(t,i){if(t&1&&c(0,mn,3,0,"table",17)(1,sn,13,0,"ya-empty-message"),t&2){let e=i;p(e.logs!=null&&e.logs.length?0:1)}}function pn(t,i){if(t&1){let e=P();a(0,"ya-empty-message")(1,"p"),o(2,"Tracing has started."),n(),a(3,"p"),o(4," This page does "),a(5,"strong"),o(6,"not"),n(),o(7," update automatically. "),n(),a(8,"p"),o(9," Hit refresh, or check back at a later time when you think there should be trace entries. "),n(),a(10,"p")(11,"ya-button",16),A("click",function(){x(e);let m=s(5);return y(m.refreshData())}),o(12,"Refresh"),n()()()}}function dn(t,i){if(t&1&&(c(0,cn,2,1),u(1,"async"),c(2,pn,13,0,"ya-empty-message")),t&2){let e,r=s(4);p((e=h(1,1,r.trace$))?0:2,e)}}function _n(t,i){if(t&1){let e=P();a(0,"div",1)(1,"div",2)(2,"ya-button",3),A("click",function(){x(e);let m=s(3);return y(m.stopTrace())}),o(3,"Stop trace"),n(),o(4," \xA0 "),a(5,"ya-button",3),A("click",function(){x(e);let m=s(3);return y(m.refreshData())}),o(6,"Refresh"),n(),o(7," \xA0 "),c(8,Ui,6,2),u(9,"async"),n()(),a(10,"div",4),c(11,rn,3,3),u(12,"async"),c(13,dn,3,3),u(14,"async"),n()}if(t&2){let e,r=s(3);l(8),p((e=h(9,3,r.section$))?8:-1,e),l(3),p(h(12,5,r.section$)==="runs"?11:-1),l(2),p(h(14,7,r.section$)==="logs"?13:-1)}}function un(t,i){if(t&1){let e=P();a(0,"ya-empty-message",0)(1,"p"),o(2,"The trace tool captures runs, inputs, outputs and log messages of this algorithm."),n(),a(3,"p")(4,"ya-button",16),A("click",function(){x(e);let m=s(3);return y(m.startTrace())}),o(5,"Start trace"),n()()()}}function hn(t,i){t&1&&c(0,_n,15,9)(1,un,6,0,"ya-empty-message",0),t&2&&p(i.traceEnabled?0:1)}function Cn(t,i){if(t&1&&(c(0,hn,2,1),u(1,"async")),t&2){let e,r=s();p((e=h(1,1,r.status$))?0:-1,e)}}var ut=class t{constructor(i,e,r,m){this.route=i;this.router=e;this.yamcs=r;this.messageService=m;this.qualifiedName=F.required({alias:"algorithm"});this.status$=new S(null);this.trace$=new S(null);this.section$=new S("runs")}ngOnInit(){this.algorithm$=this.yamcs.yamcsClient.getAlgorithm(this.yamcs.instance,this.qualifiedName()),this.refreshData()}ngAfterViewInit(){let i=this.route.snapshot.queryParamMap;i.has("section")&&this.switchToSection(i.get("section"))}switchToSection(i){this.section$.next(i),this.router.navigate([],{replaceUrl:!0,relativeTo:this.route,queryParams:{section:i},queryParamsHandling:"merge"})}refreshData(){this.yamcs.processor?(this.yamcs.yamcsClient.getAlgorithmStatus(this.yamcs.instance,this.yamcs.processor,this.qualifiedName()).then(i=>{this.status$.next(i)}).catch(i=>{this.messageService.showError(i)}),this.yamcs.yamcsClient.getAlgorithmTrace(this.yamcs.instance,this.yamcs.processor,this.qualifiedName()).then(i=>{this.trace$.next(i)}).catch(i=>{this.messageService.showError(i)})):(this.status$.next(null),this.trace$.next(null))}startTrace(){this.yamcs.yamcsClient.startAlgorithmTrace(this.yamcs.instance,this.yamcs.processor,this.qualifiedName()).then(()=>{this.refreshData()}).catch(i=>this.messageService.showError(i))}stopTrace(){this.yamcs.yamcsClient.stopAlgorithmTrace(this.yamcs.instance,this.yamcs.processor,this.qualifiedName()).then(()=>{this.refreshData(),this.switchToSection("runs"),this.router.navigate([],{replaceUrl:!0,relativeTo:this.route,queryParams:{section:null},queryParamsHandling:"merge"})}).catch(i=>this.messageService.showError(i))}static{this.\u0275fac=function(e){return new(e||t)(f(K),f(J),f($),f(tt))}}static{this.\u0275cmp=D({type:t,selectors:[["ng-component"]],inputs:{qualifiedName:[1,"algorithm","qualifiedName"]},standalone:!0,features:[I],decls:2,vars:3,consts:[["headerTitle","Trace"],[1,"extra-bar-container"],[1,"extra-bar"],[3,"click"],[1,"panel-content"],[1,"separator",2,"margin-left","10px","margin-right","10px"],["icon","directions_run",3,"click","active"],["icon","menu_book",3,"click","active"],["yaDataTable","",1,"expand"],[1,"status"],[1,"error"],[1,"ok"],[2,"width","200px"],[2,"width","400px"],[1,"secundary",3,"routerLink","queryParams"],[3,"value"],["appearance","primary",3,"click"],[1,"logs","mono",2,"width","100%"],["width","1",1,"time",2,"white-space","nowrap"],[1,"msg",2,"white-space","pre"]],template:function(e,r){if(e&1&&(c(0,Cn,2,3),u(1,"async")),e&2){let m;p((m=h(1,1,r.algorithm$))?0:-1,m)}},dependencies:[k,M,q,it,X,et,ie,ne,pe,nt,ue],styles:[".extra-bar-container[_ngcontent-%COMP%]{padding:12px;border-bottom:1.1px solid rgba(0,0,0,.08)}.extra-bar[_ngcontent-%COMP%]{height:24px;line-height:24px}.separator[_ngcontent-%COMP%]{border-right:1px solid rgba(0,0,0,.12)}table.logs[_ngcontent-%COMP%]{line-height:12px}table.logs[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{font-size:12px;color:#000000a7}table.logs[_ngcontent-%COMP%] td.time[_ngcontent-%COMP%]{color:#00000059}.status[_ngcontent-%COMP%] .ok[_ngcontent-%COMP%]{color:#00c752}.status[_ngcontent-%COMP%] .error[_ngcontent-%COMP%]{color:var(--y-error-color)}"],changeDetection:0})}};var Pe=t=>({c:t}),gn=(t,i)=>({c:t,system:i});function fn(t,i){if(t&1&&(a(0,"a",9),o(1),n()),t&2){let e=s().$implicit,r=s(2);d("queryParams",L(2,gn,r.yamcs.context,e.path)),l(),C(e.name)}}function xn(t,i){if(t&1&&(c(0,fn,2,5,"a",9),o(1," / ")),t&2){let e=i.$index;p(e!==0?0:-1)}}function yn(t,i){if(t&1&&(a(0,"app-instance-page")(1,"app-instance-toolbar"),T(2,xn,2,1,null,null,v),u(4,"parents"),a(5,"span"),o(6),u(7,"shortName"),n(),_(8,"ya-title-copy",4),n(),a(9,"nav",5,0)(11,"a",6,1),o(13," Summary "),n(),a(14,"a",7,2),o(16," Trace "),n()(),a(17,"div",8)(18,"mat-tab-nav-panel",null,3),_(20,"router-outlet"),n()()()),t&2){let e=i,r=G(12),m=G(15),w=G(19),xt=s();l(2),b(h(4,9,e.qualifiedName)),l(4),C(h(7,11,e.qualifiedName)),l(2),d("text",e.qualifiedName),l(),d("mat-stretch-tabs",!1)("tabPanel",w),l(2),d("active",r.isActive)("queryParams",E(13,Pe,xt.yamcs.context)),l(3),d("active",m.isActive)("queryParams",E(15,Pe,xt.yamcs.context))("disabled",e.scope!=="GLOBAL")}}var ht=class t{constructor(i,e){this.yamcs=i;this.title=e;this.qualifiedName=F.required({alias:"algorithm"})}ngOnInit(){this.algorithm$=this.yamcs.yamcsClient.getAlgorithm(this.yamcs.instance,this.qualifiedName()),this.algorithm$.then(i=>{this.title.setTitle(i.name)})}static{this.\u0275fac=function(e){return new(e||t)(f($),f(W))}}static{this.\u0275cmp=D({type:t,selectors:[["ng-component"]],inputs:{qualifiedName:[1,"algorithm","qualifiedName"]},standalone:!0,features:[I],decls:2,vars:3,consts:[["tabs",""],["rla","routerLinkActive"],["rlb","routerLinkActive"],["tabPanel",""],[3,"text"],["mat-tab-nav-bar","",1,"secondary",3,"mat-stretch-tabs","tabPanel"],["mat-tab-link","","routerLink","-/summary","routerLinkActive","",3,"active","queryParams"],["mat-tab-link","","routerLink","-/trace","routerLinkActive","",3,"active","queryParams","disabled"],[1,"tab-content-wrapper"],["routerLink","/algorithms",1,"ya-link","ya-header-link",3,"queryParams"]],template:function(e,r){if(e&1&&(c(0,yn,21,17,"app-instance-page"),u(1,"async")),e&2){let m;p((m=h(1,1,r.algorithm$))?0:-1,m)}},dependencies:[rt,ot,k,M,At,q,Et,Kt,Xt,Jt,ce,he,at],styles:[".tab-content-wrapper[_ngcontent-%COMP%]{position:absolute;inset:37px 0 0;overflow:auto}.tab-content-wrapper.noscroll[_ngcontent-%COMP%]{overflow:hidden}"],changeDetection:0})}};var Sn=t=>{let i=t,e=t.findIndex(m=>m.path==="-");e!==-1&&(i=t.slice(0,e));let r="/"+i.map(m=>m.path).join("/");return{consumed:i,posParams:{algorithm:new bt(r,{})}}},io=[{path:"",canActivate:[xe,fe],canActivateChild:[ye],runGuardsAndResolvers:"always",component:Se,children:[{path:"",pathMatch:"full",component:mt},{matcher:Sn,component:ht,children:[{path:"",pathMatch:"full",redirectTo:"-/summary"},{path:"-/summary",component:_t},{path:"-/trace",component:ut}]}]}];export{io as ROUTES};
© 2015 - 2025 Weber Informatics LLC | Privacy Policy