@sava-info-systems/api-maker-with-extensions 1.18.3 → 1.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{1351.c372d4232c6551fb.js → 1351.48e08341fba9b889.js} +1 -1
- package/dist/{1417.336e9ca469a92f03.js → 1417.5caf023140e7c67f.js} +1 -1
- package/dist/1468.d42293f7d802a787.js +1 -0
- package/dist/1959.a22fe393419f10c5.js +1 -0
- package/dist/{2162.bb1f670dabb5c84a.js → 2162.3c94f3d66c6312d5.js} +1 -1
- package/dist/{2442.18887167a25c7dee.js → 2442.adbc5b49349bb569.js} +1 -1
- package/dist/{2818.dd50a60acfbaad6b.js → 2818.71176f4848a9419f.js} +1 -1
- package/dist/3488.ada60be2dbcd9845.js +1 -0
- package/dist/{3545.d415d4baf2d79163.js → 3545.b5585792e9fe1447.js} +1 -1
- package/dist/{3605.e398ec79072f4bf2.js → 3605.3c6cdf2a08c47301.js} +1 -1
- package/dist/{3611.59468f2dba2cd6df.js → 3611.9577d58af5f1f4aa.js} +1 -1
- package/dist/{3621.43633d73990c0546.js → 3621.412300a009ea6346.js} +1 -1
- package/dist/{3732.d698a74f1f0e24e6.js → 3732.b5ac36f1448e215c.js} +1 -1
- package/dist/{379.0d35e4e001b196b4.js → 379.d3e61f3350a595dc.js} +1 -1
- package/dist/{3929.a017182a7e24cf7f.js → 3929.9ac933e926943db2.js} +1 -1
- package/dist/{4092.b7a59976bb87bf26.js → 4092.71b0eccc0cb429f0.js} +1 -1
- package/dist/{4124.1dab3feb76c9c039.js → 4124.a8329e77343e7087.js} +1 -1
- package/dist/{4316.3745e74e3d9c2865.js → 4316.542be541e58dff84.js} +1 -1
- package/dist/4344.d8f42d425eaec852.js +1 -0
- package/dist/{4689.4f5958fddadc577e.js → 4689.e827720779e0cf34.js} +1 -1
- package/dist/{4709.bd58a5ca8c74f29c.js → 4709.262c34f60b50ebc9.js} +1 -1
- package/dist/{4774.088c1fbbb2988ee5.js → 4774.a4368f3ce2e778da.js} +1 -1
- package/dist/{4880.968e1ffff2f417d9.js → 4880.70ca405524206be7.js} +1 -1
- package/dist/{5011.f661999b271a98de.js → 5011.ed9a6465223f760d.js} +1 -1
- package/dist/{5090.fb3787137ba94607.js → 5090.c8bf74c35b0a5d26.js} +1 -1
- package/dist/{5140.05120f243608b828.js → 5140.581ccd2699e2a8a8.js} +1 -1
- package/dist/{5362.4514e2ffb27ce0ac.js → 5362.912e053f78479e90.js} +1 -1
- package/dist/{5442.454ac3ebe7c10659.js → 5442.186b40719e7c1da9.js} +1 -1
- package/dist/{5455.c1f4f3493ea016d4.js → 5455.a1d0d507419e3c59.js} +1 -1
- package/dist/5729.f0ee236ba6579a94.js +1 -0
- package/dist/{5826.650d402e8a957ea3.js → 5826.44efead20568788a.js} +1 -1
- package/dist/{6053.fa624fe98db9a213.js → 6053.67f38f7b35484475.js} +1 -1
- package/dist/6220.b6c29e6e3e717880.js +1 -0
- package/dist/{6415.6b8243526609c494.js → 6415.a48241737e134178.js} +1 -1
- package/dist/{6589.1003b792dd929437.js → 6589.b9c83295e466e464.js} +1 -1
- package/dist/{6679.e71f655f0e7e3e6c.js → 6679.c5073d3a60b67e2e.js} +1 -1
- package/dist/{6828.e0cfd2be83bbc047.js → 6828.36c6805f2b3c6f38.js} +1 -1
- package/dist/{6866.2b7ff38ea0ea8d8f.js → 6866.4dd76a41246a20be.js} +1 -1
- package/dist/{6882.c12e0aff75132b05.js → 6882.fe03a3df377ca119.js} +1 -1
- package/dist/{7014.8aa576d25335a412.js → 7014.5db4db60cc21782e.js} +1 -1
- package/dist/7152.dab3cc50472f703f.js +1 -0
- package/dist/{7367.bd5d43e22b265555.js → 7367.ba1e63db0f9b97f4.js} +1 -1
- package/dist/{7374.b0ad763987f68749.js → 7374.ebfe1004d1773912.js} +1 -1
- package/dist/{7597.9fe66d68836d18f4.js → 7597.177f15771dcdea42.js} +1 -1
- package/dist/7759.2b4ed39a62323abd.js +1 -0
- package/dist/{807.2ba5cc740aa4efa0.js → 807.dba59148bbbbe7fb.js} +1 -1
- package/dist/{8219.46ff63825141f651.js → 8219.2c97945d465ab185.js} +1 -1
- package/dist/{8447.17357e24b9438857.js → 8447.87b3cf73f79cd889.js} +1 -1
- package/dist/{8970.3abda875c6d7de4f.js → 8970.8eece52bbc1c316c.js} +1 -1
- package/dist/9036.876c1f0c1ce4e82b.js +1 -0
- package/dist/{9347.cb017d6396c7f64e.js → 9347.4e7d02eee86c5778.js} +1 -1
- package/dist/{9429.3ce31b960b639d09.js → 9429.9299aa0abda3dc76.js} +1 -1
- package/dist/{9785.edd131cfe4b5abdb.js → 9785.35cc7f0c3778344e.js} +1 -1
- package/dist/{9882.1e4cda6c65811bb5.js → 9882.a94c746b42e5fc0e.js} +1 -1
- package/dist/{9957.baf57c960e56a490.js → 9957.47ed0e74bdfeddd5.js} +1 -1
- package/dist/assets/schema-types/store-types.ts +1 -0
- package/dist/assets/schema-types/types.ts +1 -0
- package/dist/assets/styles/out/colors-dark.css +1 -1
- package/dist/assets/styles/out/styles.css +1 -1
- package/dist/assets/styles/styles.scss +2 -0
- package/dist/{common.2e05fdf2a25495d6.js → common.d4eb1616e93e21e1.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/main.7d84949326f61c3e.js +1 -0
- package/dist/runtime.f7e0fa10d087fa0b.js +1 -0
- package/main.js +1 -1
- package/package.json +4 -4
- package/sandbox/Dockerfile +1 -0
- package/sandbox/assets/schema-types/store-types.js +1 -0
- package/sandbox/package.json +2 -1
- package/sandbox/sandbox.js +1 -1
- package/src/assets/schema-types/store-types.ts +1 -0
- package/src/assets/schema-types/types.ts +1 -0
- package/src/tools/local-client.js +1 -1
- package/dist/1468.7643522cc3e89857.js +0 -1
- package/dist/1959.59ee99be25f59755.js +0 -1
- package/dist/3488.7052042211d08d07.js +0 -1
- package/dist/4344.b6f194f896eb2205.js +0 -1
- package/dist/5729.9b201708284e16bc.js +0 -1
- package/dist/6220.7d7df941537ed662.js +0 -1
- package/dist/7152.4f047369765b7ac5.js +0 -1
- package/dist/7759.6c363b1156e3658a.js +0 -1
- package/dist/9036.18609df03a18bbdb.js +0 -1
- package/dist/main.b85e625cdc44b214.js +0 -1
- package/dist/runtime.f9839e08ff0d235d.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1351,6589,8970,3732],{6589:(l,o,c)=>{c.d(o,{Zm:()=>t,kK:()=>_,mO:()=>a,v$:()=>i});var t=function(n){return n.FORM_DATA="FORM_DATA",n.JSON="JSON",n.TEXT="TEXT",n}(t||{}),a=function(n){return n.GET="GET",n.POST="POST",n.PUT="PUT",n.DELETE="DELETE",n}(a||{}),i=function(n){return n.CONTENT_TYPE="content-type",n.ACCEPT_ENCODING="accept-encoding",n.NO_COMPRESSION_STD="x-no-compression",n.AUTHORIZATION_AM="x-am-authorization",n.AUTHORIZATION_AM_USER="x-am-user-authorization",n.AUTHORIZATION_AWS="x-aws-authorization",n.AUTHORIZATION_GOOGLE="x-google-authorization",n.AUTHORIZATION_AZURE="x-azure-authorization",n.RUN_IN_SANDBOX="x-am-run-in-sandbox",n.ORIGIN="origin",n.AUTHORIZATION="authorization",n.META="x-am-meta",n.SECRET="x-am-secret",n.CONTENT_TYPE_RESPONSE="x-am-content-type-response",n.CACHE_CONTROL="x-am-cache-control",n.CODE_HASH="x-am-code-hash",n.SANDBOX_TIMEOUT="x-am-sandbox-timeout",n.GET_ENCRYPTED_DATA="x-am-get-encrypted-data",n.ENCRYPTED_PAYLOAD="x-am-encrypted-payload",n.RESPONSE_CASE="x-am-response-case",n.RESPONSE_OBJECT_TYPE="x-am-response-object-type",n.AM_I18N="x-am-internationalization",n.DATA_SOURCE="x-am-data-source",n.TEST_HOOK="x-am-test-hook",n.TEST_EVENT="x-am-test-event",n.INTER_COMM="x-am-inter-comm",n.SEND_ONLY_OBJECTS="x-am-send-only-objects-in-stream",n.AM_REQUEST_ID="x-am-request-id",n.AM_STORE_TOKEN="x-am-store-token",n.AM_WS_Client_ID="x-am-ws-client-id",n}(i||{}),_=function(n){return n.DB_MASTER_NAME="db-master-name",n.ADMIN_PATH="admin-path",n}(_||{})}}]);
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1351,6589,8970,3732],{6589:(l,o,c)=>{c.d(o,{Zm:()=>t,kK:()=>_,mO:()=>a,v$:()=>i});var t=function(n){return n.FORM_DATA="FORM_DATA",n.JSON="JSON",n.TEXT="TEXT",n}(t||{}),a=function(n){return n.GET="GET",n.POST="POST",n.PUT="PUT",n.DELETE="DELETE",n}(a||{}),i=function(n){return n.CONTENT_TYPE="content-type",n.ACCEPT_ENCODING="accept-encoding",n.NO_COMPRESSION_STD="x-no-compression",n.AUTHORIZATION_AM="x-am-authorization",n.AUTHORIZATION_AM_USER="x-am-user-authorization",n.AUTHORIZATION_AWS="x-aws-authorization",n.AUTHORIZATION_GOOGLE="x-google-authorization",n.AUTHORIZATION_AZURE="x-azure-authorization",n.RUN_IN_SANDBOX="x-am-run-in-sandbox",n.ORIGIN="origin",n.AUTHORIZATION="authorization",n.META="x-am-meta",n.SECRET="x-am-secret",n.CONTENT_TYPE_RESPONSE="x-am-content-type-response",n.CACHE_CONTROL="x-am-cache-control",n.CODE_HASH="x-am-code-hash",n.SANDBOX_TIMEOUT="x-am-sandbox-timeout",n.GET_ENCRYPTED_DATA="x-am-get-encrypted-data",n.ENCRYPTED_PAYLOAD="x-am-encrypted-payload",n.RESPONSE_CASE="x-am-response-case",n.RESPONSE_OBJECT_TYPE="x-am-response-object-type",n.AM_I18N="x-am-internationalization",n.DATA_SOURCE="x-am-data-source",n.TEST_HOOK="x-am-test-hook",n.TEST_EVENT="x-am-test-event",n.INTER_COMM="x-am-inter-comm",n.SEND_ONLY_OBJECTS="x-am-send-only-objects-in-stream",n.AM_REQUEST_ID="x-am-request-id",n.AM_STORE_TOKEN="x-am-store-token",n.AM_WS_Client_ID="x-am-ws-client-id",n.RUN_IN_DEBUGGER="x-am-run-in-debugger",n}(i||{}),_=function(n){return n.DB_MASTER_NAME="db-master-name",n.ADMIN_PATH="admin-path",n}(_||{})}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1417],{1417:(Z,f,a)=>{a.r(f),a.d(f,{SecretManagementM:()=>_});var M=a(7060),y=a(2173),D=a(
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1417],{1417:(Z,f,a)=>{a.r(f),a.d(f,{SecretManagementM:()=>_});var M=a(7060),y=a(2173),D=a(1709),F=a(2508),e=a(540),o=a(467),l=a(8727),h=a(5046),m=a(7326),R=a(7376),p=a(6645),w=a(5203),S=a(6129),E=a(6708),u=a(5779),I=a(7337),T=a(7237),P=a(9992),k=a(334),X=a(3966),j=a(1987),G=a(177),g=a(7645),N=a(7515),W=a(8542);function A(s,c){if(1&s){const t=e.RV6();e.j41(0,"span",15),e.bIt("click",function(){e.eBV(t);const r=e.XpG();return e.Njj(r.edit())}),e.nrm(1,"i",16),e.k0s()}}function U(s,c){if(1&s){const t=e.RV6();e.j41(0,"span",17),e.bIt("click",function(){e.eBV(t);const r=e.XpG();return e.Njj(r.clone())}),e.nrm(1,"i",18),e.k0s()}}function O(s,c){if(1&s){const t=e.RV6();e.j41(0,"span",19),e.bIt("click",function(){e.eBV(t);const r=e.XpG();return e.Njj(r.removePermanentDialog())}),e.nrm(1,"i",20),e.k0s()}}function $(s,c){1&s&&(e.j41(0,"tr")(1,"th"),e.EFF(2,"ID"),e.k0s(),e.j41(3,"th"),e.EFF(4,"Name"),e.k0s(),e.nrm(5,"th",21),e.k0s())}function b(s,c){1&s&&e.nrm(0,"i",24)}function x(s,c){if(1&s&&(e.j41(0,"tr",22)(1,"td"),e.EFF(2),e.k0s(),e.j41(3,"td"),e.EFF(4),e.k0s(),e.j41(5,"td"),e.DNE(6,b,1,0,"i",23),e.k0s()()),2&s){const t=c.$implicit;e.Y8G("pSelectableRow",t),e.R7$(2),e.JRh(t._id),e.R7$(2),e.JRh(t.name),e.R7$(2),e.Y8G("ngIf",t.isDefault)}}function K(s,c){1&s&&e.nrm(0,"p-progressSpinner",25)}let C=(()=>{class s{secretS;generalCS;notificationS;confirmationService;navigationCS;authCS;constantsCS;eventCenterCS;eventCenterS;constantsS;cd;generalS;loading={grid:!1};subscriptions=[];rows=[];rowsMap={};showAll=!1;selectedRows=[];gridKey=p.GX._id;constructor(t,n,r,i,d,B,Y,Q,J,L,z,H){this.secretS=t,this.generalCS=n,this.notificationS=r,this.confirmationService=i,this.navigationCS=d,this.authCS=B,this.constantsCS=Y,this.eventCenterCS=Q,this.eventCenterS=J,this.constantsS=L,this.cd=z,this.generalS=H}ngOnInit(){this.loadGridData(),this.subscriptions.push(this.eventCenterS.headerC.dataSecretForm.eventChannel.subscribe(t=>{(t.action===l.K.SAVED||t.action===l.K.UPDATED)&&(this.eventCenterS.headerC.secManFormC.hideModal(),this.loadGridData())})),this.generalS.setNewTitle("API Maker - Secrets")}loadGridData(){var t=this;this.loading.grid=!0;const n={find:{user:this.authCS.getUserId(),active:!0},select:{name:1,active:1,isDefault:1},sort:{name:1}};this.showAll&&delete n.find.active,this.subscriptions.push(this.secretS.query(n).subscribe(function(){var r=(0,o.A)(function*(i){i.success&&(t.selectedRows=[],t.rows=i.data,t.rowsMap=R.keyBy(t.rows,p.GX._id));const d=t.navigationCS.getQueryParam(m.F.secret);t.rowsMap[d]&&(yield t.fillData()),t.generalS.setNewTitle("API Maker - Secrets"),t.loading.grid=!1,t.cd.detectChanges()});return function(i){return r.apply(this,arguments)}}()))}add(){this.eventCenterS.headerC.dataSecretForm.formData=void 0,this.eventCenterS.headerC.dataSecretForm.mode=h.X.ADD,this.eventCenterS.headerC.dataSecretForm.eventChannel.emit({action:l.K.OPEN_FORM_IN_ADD_MODE}),this.eventCenterS.headerC.secManFormC.showModal()}view(){this.eventCenterS.headerC.dataSecretForm.formData=this.selectedRows[0],this.eventCenterS.headerC.dataSecretForm.mode=h.X.VIEW,this.eventCenterS.headerC.dataSecretForm.eventChannel.emit({action:l.K.OPEN_FORM_IN_VIEW_MODE}),this.eventCenterS.headerC.secManFormC.showModal()}edit(){this.eventCenterS.headerC.dataSecretForm.formData=this.selectedRows[0],this.eventCenterS.headerC.dataSecretForm.mode=h.X.EDIT,this.eventCenterS.headerC.dataSecretForm.eventChannel.emit({action:l.K.OPEN_FORM_IN_EDIT_MODE}),this.eventCenterS.headerC.secManFormC.showModal()}clone(){var t=this;return(0,o.A)(function*(){try{if(!t.selectedRows[0])return;const n=(yield t.secretS.getById(t.selectedRows[0]._id).toPromise()).data;delete n._id,delete n.isDefault,n.name=`${n.name}-clone`,(yield t.secretS.post(n).toPromise()).success?(t.notificationS.showSuccess(t.constantsS.secrets.cloneSuccess),t.loadGridData()):t.notificationS.showSuccess(t.constantsS.secrets.cloneSuccess)}catch{t.notificationS.showError(t.constantsS.secrets.cloneError)}})()}removePermanentDialog(){var t=this;return(0,o.A)(function*(){var n;t.confirmationService.confirm({message:t.constantsCS.secret.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(n=(0,o.A)(function*(){yield t.removePermanent()}),function(){return n.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,o.A)(function*(){t.loading.grid=!0;try{(yield t.secretS.permanentDelete(t.selectedRows[0]._id).toPromise()).success&&(t.notificationS.showSuccess(t.constantsCS.secret.removePermanent),t.resetSelectedRows(),t.loadGridData())}catch(n){t.notificationS.showErrorFromResponse(n.error,t.constantsCS.secret.removePermanentError)}t.loading.grid=!1})()}resetSelectedRows(){this.selectedRows.length=0}resetDependents(){var t=this;return(0,o.A)(function*(){yield t.navigationCS.setQueryParam(m.F.secret,null)})()}secretSelected(){var t=this;return(0,o.A)(function*(){t.resetDependents(),t.fillData()})()}fillData(){var t=this;return(0,o.A)(function*(){t.selectedRows.length?yield t.navigationCS.setQueryParam(m.F.secret,t.selectedRows[0]._id):yield t.navigationCS.setQueryParam(m.F.secret,"")})()}ngOnDestroy(){this.generalCS.unsubscribe(this.subscriptions)}dblClickSecrets(){this.selectedRows.length&&this.edit()}static \u0275fac=function(n){return new(n||s)(e.rXU(w.S),e.rXU(S.f),e.rXU(E.m),e.rXU(u.td),e.rXU(I.$),e.rXU(T.l),e.rXU(P.s),e.rXU(k.u),e.rXU(X.d),e.rXU(j.X),e.rXU(e.gRc),e.rXU(S.f))};static \u0275cmp=e.VBU({type:s,selectors:[["app-secret-man-w"]],decls:17,vars:10,consts:[[1,"card","shadow-sm",2,"height","calc(100vh - 50px)"],[1,"card-header"],["src","/assets/images/icons/secret.svg","alt","Secret Management",1,"fa-fw","mr-1"],["href","https://docs.apimaker.dev/v1/docs/secrets/secrets.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3","mr-1",2,"font-size","25px"],["tooltipPosition","left","pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 100px)",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["tooltipPosition","left","pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["tooltipPosition","left","pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","fa-fw"],["tooltipPosition","left","pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],[2,"width","40px"],[3,"pSelectableRow"],["class","fas fa-check fa-fw text-success",4,"ngIf"],[1,"fas","fa-check","fa-fw","text-success"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(n,r){1&n&&(e.j41(0,"div",0)(1,"div",1)(2,"span"),e.nrm(3,"img",2),e.EFF(4," Secrets"),e.k0s(),e.j41(5,"a",3),e.nrm(6,"img",4),e.k0s(),e.j41(7,"span",5),e.bIt("click",function(){return r.add()}),e.nrm(8,"i",6),e.k0s(),e.DNE(9,A,2,0,"span",7),e.DNE(10,U,2,0,"span",8),e.DNE(11,O,2,0,"span",9),e.k0s(),e.j41(12,"div",10)(13,"p-table",11),e.bIt("selectionChange",function(d){return r.selectedRows=d})("selectionChange",function(){return r.secretSelected()})("dblclick",function(){return r.dblClickSecrets()}),e.DNE(14,$,6,0,"ng-template",12),e.DNE(15,x,7,4,"ng-template",13),e.k0s(),e.DNE(16,K,1,0,"p-progressSpinner",14),e.k0s()()),2&n&&(e.R7$(9),e.Y8G("ngIf",r.selectedRows.length),e.R7$(1),e.Y8G("ngIf",r.selectedRows.length),e.R7$(1),e.Y8G("ngIf",r.selectedRows.length),e.R7$(2),e.Y8G("selectionMode","multiple")("metaKeySelection",!0)("selection",r.selectedRows)("dataKey",r.gridKey)("scrollable",!0)("value",r.rows),e.R7$(3),e.Y8G("ngIf",r.loading.grid))},dependencies:[G.bT,g.XI,u.Ei,g.d5,N.p,W.m],encapsulation:2})}return s})();const V=[{path:"",component:(()=>{class s{constructor(){}ngOnInit(){}static \u0275fac=function(n){return new(n||s)};static \u0275cmp=e.VBU({type:s,selectors:[["app-sec-man-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1"]],template:function(n,r){1&n&&(e.j41(0,"div",0),e.nrm(1,"app-secret-man-w"),e.k0s())},dependencies:[C],encapsulation:2})}return s})(),canActivate:[y.Z]}];let _=(()=>{class s{static \u0275fac=function(n){return new(n||s)};static \u0275mod=e.$C({type:s});static \u0275inj=e.G2t({imports:[M.iI.forChild(V),D.u,F.v]})}return s})()}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1468],{1078:(ee,F,s)=>{s.d(F,{h:()=>Z});var M=s(467),e=s(4341),f=s(6645),u=s(5046),m=s(8727),I=s(2676),t=s(540),C=s(6708),P=s(7668),D=s(6129),S=s(1987),U=s(7237),y=s(3864),b=s(5938),B=s(334),T=s(177),x=s(3478),R=s(7515),K=s(8150),L=s(5430);function G(d,v){1&d&&(t.j41(0,"span"),t.nrm(1,"i",34),t.EFF(2," Add Interval"),t.k0s())}function W(d,v){1&d&&(t.j41(0,"span"),t.nrm(1,"i",35),t.EFF(2," View Interval"),t.k0s())}function N(d,v){1&d&&(t.j41(0,"span"),t.nrm(1,"i",36),t.EFF(2," Edit Interval"),t.k0s())}function V(d,v){1&d&&(t.j41(0,"div",39)(1,"a",40),t.EFF(2,"Reference"),t.k0s()())}function w(d,v){if(1&d){const i=t.RV6();t.j41(0,"div",15)(1,"label",16),t.EFF(2,"Custom"),t.k0s(),t.j41(3,"div",14)(4,"input",37),t.bIt("blur",function(l){t.eBV(i);const O=t.XpG();return t.Njj(O.validateCronExpression(l))}),t.k0s(),t.DNE(5,V,3,0,"div",38),t.k0s()()}if(2&d){const i=t.XpG();t.R7$(5),t.Y8G("ngIf",i.form.get("timeInterval").value===i.ESchedulerInterval.CUSTOM)}}function A(d,v){1&d&&(t.j41(0,"div",41)(1,"div",42)(2,"div",43)(3,"div",44),t.EFF(4,"Custom CRON writing guide"),t.k0s(),t.j41(5,"div",45)(6,"table",46)(7,"tr")(8,"td",47),t.EFF(9,"Seconds"),t.k0s(),t.j41(10,"td",48),t.EFF(11," : "),t.k0s(),t.j41(12,"td",49),t.EFF(13,"0-59"),t.k0s()(),t.j41(14,"tr")(15,"td",47),t.EFF(16,"Minutes"),t.k0s(),t.j41(17,"td",48),t.EFF(18," : "),t.k0s(),t.j41(19,"td",49),t.EFF(20,"0-59"),t.k0s()(),t.j41(21,"tr")(22,"td",47),t.EFF(23,"Hours"),t.k0s(),t.j41(24,"td",48),t.EFF(25," : "),t.k0s(),t.j41(26,"td",49),t.EFF(27,"0-23"),t.k0s()(),t.j41(28,"tr")(29,"td",47),t.EFF(30,"Day of Month"),t.k0s(),t.j41(31,"td",48),t.EFF(32," : "),t.k0s(),t.j41(33,"td",49),t.EFF(34,"1-31"),t.k0s()(),t.j41(35,"tr")(36,"td",47),t.EFF(37,"Months"),t.k0s(),t.j41(38,"td",48),t.EFF(39," : "),t.k0s(),t.j41(40,"td",49),t.EFF(41,"0-11 (Jan-Dec)"),t.k0s()(),t.j41(42,"tr")(43,"td",47),t.EFF(44,"Day of Week"),t.k0s(),t.j41(45,"td",48),t.EFF(46," : "),t.k0s(),t.j41(47,"td",49),t.EFF(48,"0-6 (Sun-Sat)"),t.k0s()()()()(),t.j41(49,"div",50)(50,"span"),t.EFF(51,"Note:- "),t.k0s(),t.j41(52,"span")(53,"a",40),t.EFF(54,"Reference"),t.k0s(),t.EFF(55," is having only 5 fields and this cron expression support 6 fields, precision upto seconds."),t.k0s()()()())}function X(d,v){1&d&&(t.j41(0,"span"),t.EFF(1,"Save"),t.k0s())}function Y(d,v){1&d&&(t.j41(0,"span"),t.EFF(1,"Update interval"),t.k0s())}function H(d,v){if(1&d){const i=t.RV6();t.j41(0,"button",51),t.bIt("click",function(){t.eBV(i);const l=t.XpG();return t.Njj(l.save())}),t.nrm(1,"i",52),t.DNE(2,X,2,0,"span",4),t.DNE(3,Y,2,0,"span",4),t.k0s()}if(2&d){const i=t.XpG();t.Y8G("disabled",i.form.invalid),t.R7$(2),t.Y8G("ngIf",i.data.mode===i.EFormMode.ADD),t.R7$(1),t.Y8G("ngIf",i.data.mode===i.EFormMode.EDIT)}}function k(d,v){1&d&&t.nrm(0,"p-progressSpinner",53)}let Z=(()=>{class d{fb;ns;schedulerS;generalS;constantsS;authCS;monacoS;dataProviderS;eventCenterCS;data;loading={form:!1};EFormMode=u.X;form;ESchedulerInterval=I.Y;subscriptions=[];intervalList=[];timezoneList=[];constructor(i,c,l,O,j,J,z,Q,q){this.fb=i,this.ns=c,this.schedulerS=l,this.generalS=O,this.constantsS=j,this.authCS=J,this.monacoS=z,this.dataProviderS=Q,this.eventCenterCS=q}ngOnInit(){var i=this;this.intervalList=this.dataProviderS.getSchedulerIntervals(),this.timezoneList=this.dataProviderS.getTimeZones(),this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var c=(0,M.A)(function*(l){l&&(i.form.enable(),l.action===m.K.OPEN_FORM_IN_EDIT_MODE?(i.form.reset(),i.form.patchValue(i.data.formData)):l.action===m.K.OPEN_FORM_IN_VIEW_MODE?(i.form.patchValue(i.data.formData),i.form.reset(),i.form.disable()):l.action===m.K.OPEN_FORM_IN_ADD_MODE&&(i.form.reset(),i.form.get("active").setValue(!1)))});return function(l){return c.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({timeZone:[null,[e.k0.required]],timeInterval:[null,[e.k0.required]],customInterval:[null,[]],active:[null,[]]}),this.manageValidations()}showModal(){$("#idIntervals").modal("show"),this.form.get(f.W$.active).setValue(!0)}hideModal(){$("#idIntervals").modal("hide")}manageValidations(){const i=this.form.get("timeInterval"),c=this.form.get("customInterval");i.valueChanges.subscribe(l=>{c.setValidators(l===I.Y.CUSTOM?[e.k0.required]:[]),c.updateValueAndValidity()})}validateCronExpression(i){var c=this;return(0,M.A)(function*(){const l=c.form.get("customInterval"),O=l.value;(yield c.schedulerS.isCronExpressionValid(O).toPromise()).data.valid||l.setValue("")})()}save(){var i=this;return(0,M.A)(function*(){const c=i.form.value;try{if(i.data.mode===u.X.ADD)i.eventCenterCS.intervalArr.next(c);else if(i.data.mode===u.X.EDIT){const l=Object.assign(i.data.formData,c);i.eventCenterCS.intervalArr.next(l)}i.data.eventChannel.emit({action:i.data.mode===u.X.ADD?m.K.SAVED:m.K.UPDATED})}catch(l){console.log(l)}})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(c){return new(c||d)(t.rXU(e.ok),t.rXU(C.m),t.rXU(P.t),t.rXU(D.f),t.rXU(S.X),t.rXU(U.l),t.rXU(y.e),t.rXU(b.n),t.rXU(B.u))};static \u0275cmp=t.VBU({type:d,selectors:[["app-intervals-add-edit"]],inputs:{data:"data"},decls:50,vars:13,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idIntervals","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-lg"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],["href","https://docs.apimaker.dev/v1/docs/apis-all/schedulers/user-created-schedulers-api.html#interval-time","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],[1,"modal-body","overflow-auto"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-8"],[1,"row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],[1,"col-2","input-group","input-group-sm"],[1,"input-group-prepend"],["id","spanTimeInterval",1,"input-group-text","form-control","form-control-sm"],[1,"col-10","pl-0"],["formControlName","timeInterval","optionLabel","name","optionValue","id","filterBy","name","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter"],[1,"col-4"],["class","row",4,"ngIf"],["formControlName","timeZone","optionLabel","name","optionValue","id","filterBy","name","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter"],[1,"col-6","col-form-label","col-form-label-sm","text-right"],[1,"col-6","col-form-label","col-form-label-sm","align-middle","mb-0","pt-1"],["formControlName","active",3,"binary"],["class","form-group row mt-5",4,"ngIf"],[1,"modal-footer"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],["formControlName","customInterval","name","customInterval","placeholder","Custom","spellcheck","false","type","text",1,"form-control","form-control-sm",3,"blur"],["class","text-center",4,"ngIf"],[1,"text-center"],["href","https://crontab.guru","target","_blank",1,"text-info",2,"text-decoration","underline"],[1,"form-group","row","mt-5"],[1,"col-12"],[1,"border"],[1,"h6","border-bottom","p-3","m-0","text-center"],[1,"p-3","font-monospaced"],[1,"table","table-sm","table-condensed","w-100","mb-0"],[1,"text-right","pr-1","border-0",2,"width","49%"],[1,"border-0",2,"width","10px"],[1,"border-0"],[1,"text-center","small","border-left","border-right","border-bottom","p-2"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(c,l){1&c&&(t.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),t.DNE(4,G,3,0,"span",4),t.DNE(5,W,3,0,"span",4),t.DNE(6,N,3,0,"span",4),t.j41(7,"div",5)(8,"button",6)(9,"span",7),t.nrm(10,"i",8),t.k0s()(),t.j41(11,"a",9),t.nrm(12,"img",10),t.k0s()()(),t.j41(13,"div",11)(14,"form",12)(15,"div",13)(16,"div",14)(17,"div",15)(18,"label",16),t.EFF(19,"Time Interval"),t.k0s(),t.j41(20,"div",14)(21,"div",15)(22,"div",17)(23,"div",18)(24,"span",19),t.EFF(25,"Every "),t.k0s()()(),t.j41(26,"div",20),t.nrm(27,"p-dropdown",21),t.k0s()()()()(),t.j41(28,"div",22),t.DNE(29,w,6,1,"div",23),t.k0s()(),t.j41(30,"div",13)(31,"div",14)(32,"div",15)(33,"label",16),t.EFF(34,"Time Zone"),t.k0s(),t.j41(35,"div",14),t.nrm(36,"p-dropdown",24),t.k0s()()(),t.j41(37,"div",22)(38,"div",15)(39,"label",25),t.EFF(40,"Active"),t.k0s(),t.j41(41,"label",26),t.nrm(42,"p-checkbox",27),t.k0s()()()(),t.DNE(43,A,56,0,"div",28),t.k0s()(),t.j41(44,"div",29)(45,"button",30),t.nrm(46,"i",31),t.EFF(47," Close"),t.k0s(),t.DNE(48,H,4,3,"button",32),t.k0s(),t.DNE(49,k,1,0,"p-progressSpinner",33),t.k0s()()()),2&c&&(t.R7$(4),t.Y8G("ngIf",l.data.mode===l.EFormMode.ADD),t.R7$(1),t.Y8G("ngIf",l.data.mode===l.EFormMode.VIEW),t.R7$(1),t.Y8G("ngIf",l.data.mode===l.EFormMode.EDIT),t.R7$(8),t.Y8G("formGroup",l.form),t.R7$(13),t.Y8G("options",l.intervalList)("filter",!0),t.R7$(2),t.Y8G("ngIf",l.form.get("timeInterval").value===l.ESchedulerInterval.CUSTOM),t.R7$(7),t.Y8G("options",l.timezoneList)("filter",!0),t.R7$(6),t.Y8G("binary",!0),t.R7$(1),t.Y8G("ngIf",l.form.get("timeInterval").value===l.ESchedulerInterval.CUSTOM),t.R7$(5),t.Y8G("ngIf",l.data.mode!==l.EFormMode.VIEW),t.R7$(1),t.Y8G("ngIf",l.loading.form))},dependencies:[e.qT,e.me,e.BC,e.cb,e.j4,e.JD,T.bT,x.U,R.p,K.ms,L.Sc],encapsulation:2})}return d})()},4370:(ee,F,s)=>{s.d(F,{X:()=>Ee});var M=s(467),e=s(540),f=s(4341),u=s(8727),m=s(5046),I=s(7376),C=s(2676),P=s(4388),D=s(6645),S=s(5312),U=s(5632),y=s(9239),b=s(8677),B=s(2133),T=s(6708),x=s(7668),R=s(6129),K=s(1987),L=s(7237),G=s(3864),W=s(6268),N=s(334),V=s(3966),w=s(5938),A=s(177),X=s(3478),Y=s(4098),H=s(6914),k=s(7645),Z=s(5779),d=s(7515),v=s(4945),i=s(8542),c=s(5430),l=s(4466),O=s(1078);const j=["intervalsAddEditC"],J=["insertCodeModalC"],z=["monacoEditorModalC"];function Q(r,p){1&r&&(e.j41(0,"span"),e.nrm(1,"i",52),e.EFF(2," Add Scheduler"),e.k0s())}function q(r,p){1&r&&(e.j41(0,"span"),e.nrm(1,"i",53),e.EFF(2," View Scheduler"),e.k0s())}function te(r,p){if(1&r&&(e.j41(0,"span"),e.nrm(1,"i",54),e.EFF(2," Edit Scheduler "),e.j41(3,"span",55),e.EFF(4),e.k0s()()),2&r){const n=e.XpG();e.R7$(4),e.JRh(n.form.get("name").value)}}function ae(r,p){if(1&r&&(e.j41(0,"span",56),e.EFF(1),e.k0s()),2&r){const n=e.XpG();e.R7$(1),e.SpI("The system will allow ",n.form.get(n.ISchedulerProps.schedulerTimeoutInMinutes).value," minutes for the scheduler to complete its work.")}}function ne(r,p){if(1&r){const n=e.RV6();e.j41(0,"div",57)(1,"app-monaco-editor",58),e.bIt("editorGenerated",function(o){e.eBV(n);const _=e.XpG();return e.Njj(_.editorGenerated(o))}),e.k0s()()}if(2&r){const n=e.XpG();e.R7$(1),e.Y8G("isSchemaEditor",!0)("editorOptions",n.editorOptionsSchedulers)}}function oe(r,p){if(1&r){const n=e.RV6();e.j41(0,"span",59),e.bIt("click",function(){e.eBV(n);const o=e.XpG();return e.Njj(o.add())}),e.nrm(1,"i",60),e.k0s()}}function se(r,p){1&r&&(e.j41(0,"tr"),e.nrm(1,"th",61),e.j41(2,"th"),e.EFF(3,"Time Interval"),e.k0s(),e.j41(4,"th"),e.EFF(5,"Time Zone"),e.k0s(),e.j41(6,"th"),e.EFF(7,"Custom Interval"),e.k0s(),e.j41(8,"th",62),e.EFF(9,"Action"),e.k0s()())}function re(r,p){1&r&&e.nrm(0,"i",67)}function ie(r,p){1&r&&e.nrm(0,"i",68)}function le(r,p){if(1&r){const n=e.RV6();e.j41(0,"div",69)(1,"button",70),e.bIt("click",function(o){e.eBV(n);const _=e.XpG().$implicit,E=e.XpG();return e.Njj(E.edit(o,_))}),e.nrm(2,"i",71),e.k0s(),e.j41(3,"button",72),e.bIt("click",function(o){e.eBV(n);const _=e.XpG().$implicit,E=e.XpG();return e.Njj(E.deleteInterval(o,_))}),e.nrm(4,"i",73),e.k0s()()}}function de(r,p){if(1&r&&(e.j41(0,"tr",63)(1,"td"),e.DNE(2,re,1,0,"i",64),e.DNE(3,ie,1,0,"i",65),e.k0s(),e.j41(4,"td")(5,"span"),e.EFF(6),e.k0s()(),e.j41(7,"td"),e.EFF(8),e.k0s(),e.j41(9,"td")(10,"span"),e.EFF(11),e.k0s()(),e.j41(12,"td"),e.DNE(13,le,5,0,"div",66),e.k0s()()),2&r){const n=p.$implicit,a=e.XpG();e.Y8G("pSelectableRow",n),e.R7$(2),e.Y8G("ngIf",n.active),e.R7$(1),e.Y8G("ngIf",!n.active),e.R7$(3),e.SpI("Every ",a.intervalListMap[n.timeInterval].name,""),e.R7$(2),e.JRh(n.timeZone),e.R7$(3),e.JRh(a.intervalListMap[n.timeInterval].name===a.ESchedulerInterval.CUSTOM?n.customInterval:""),e.R7$(2),e.Y8G("ngIf",!n.isReadOnly&&a.data.mode!==a.EFormMode.VIEW)}}function _e(r,p){if(1&r){const n=e.RV6();e.j41(0,"a",74),e.bIt("click",function(){e.eBV(n);const o=e.XpG();return e.Njj(o.viewError())}),e.EFF(1,"View error"),e.k0s()}}function ce(r,p){1&r&&(e.j41(0,"span"),e.EFF(1,"Save"),e.k0s())}function me(r,p){1&r&&(e.j41(0,"span"),e.EFF(1,"Update"),e.k0s())}function ue(r,p){if(1&r){const n=e.RV6();e.j41(0,"button",75),e.bIt("click",function(){e.eBV(n);const o=e.XpG();return e.Njj(o.save(!0))}),e.nrm(1,"i",76),e.DNE(2,ce,2,0,"span",4),e.DNE(3,me,2,0,"span",4),e.k0s()}if(2&r){const n=e.XpG();e.Y8G("disabled",n.form.invalid),e.R7$(2),e.Y8G("ngIf",n.data.mode===n.EFormMode.ADD),e.R7$(1),e.Y8G("ngIf",n.data.mode===n.EFormMode.EDIT)}}function fe(r,p){1&r&&e.nrm(0,"p-progressSpinner",77)}const pe=function(r){return{"text-danger font-weight-bold":r}};let Ee=(()=>{class r{fb;ns;schedulerS;generalS;constantsS;authCS;monacoS;instanceS;notificationS;eventCenterCS;eventCenterS;dataProviderS;generalCS;data;loading={form:!1};EFormMode=m.X;form;subscriptions=[];ESchedulerInterval=C.Y;editorSchedulers;editorOptionsSchedulers={readOnly:!1,language:"typescript",contextmenu:!0};intervalList=[];selectedRows=[];rows=[];rowsMap={};dataItem={mode:m.X.ADD,eventChannel:new e.bkB,formData:void 0};intervalListMap={};gridKey="id";idCounter=0;BE_HOST_PORT=S.c.BE_HOST_PORT;DOCS_HOST_PORT=S.c.DOCS_HOST_PORT;shouldLoadMonacoEditor=!1;lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};ISchedulerProps=D.VC;intervalsAddEditC;insertCodeModalC;viewDockerfileModelC;constructor(n,a,o,_,E,g,h,ve,he,Me,Ie,Ce,De){this.fb=n,this.ns=a,this.schedulerS=o,this.generalS=_,this.constantsS=E,this.authCS=g,this.monacoS=h,this.instanceS=ve,this.notificationS=he,this.eventCenterCS=Me,this.eventCenterS=Ie,this.dataProviderS=Ce,this.generalCS=De}ngOnInit(){var n=this;this.intervalList=this.dataProviderS.getSchedulerIntervals(),this.intervalListMap=I.keyBy(this.intervalList,D.qb.id),this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var a=(0,M.A)(function*(o){if(o)if(n.form.enable(),o.action===u.K.OPEN_FORM_IN_EDIT_MODE)yield n.updateEditCommon();else if(o.action===u.K.OPEN_FORM_IN_VIEW_MODE)yield n.updateEditCommon(),n.form.disable();else if(o.action===u.K.OPEN_FORM_IN_ADD_MODE){n.form.reset(),n.rows=[];const _=yield n.instanceS.getDefaultContent(n.BE_HOST_PORT,U.O.SCHEDULERS).toPromise();n.generalCS.setValueInEditor(n,"editorSchedulers",_.data),n.form.get(D.VC.isActive).setValue(!1),n.form.get(D.VC.runOnNativeProcess).setValue(!1)}});return function(o){return a.apply(this,arguments)}}())),this.subscriptions.push(this.dataItem.eventChannel.subscribe(function(){var a=(0,M.A)(function*(o){o&&(n.form.enable(),(o.action===u.K.SAVED||o.action===u.K.UPDATED)&&(n.intervalsAddEditC.hideModal(),n.loadGridData()))});return function(o){return a.apply(this,arguments)}}())),this.subscriptions.push(this.eventCenterCS.intervalArr.subscribe(a=>{this.dataItem.mode===m.X.ADD&&(this.rows.unshift(a),this.loadGridData())}))}createForm(){this.form=this.fb.group({name:[null,[f.k0.required]],schedulerTimeoutInMinutes:[null,[f.k0.min(1),f.k0.max(43200)]],isActive:[null,[]],runOnNativeProcess:[null,[]]})}showInsertCodeModel(){this.generalCS.messageReceivedFor=P.r.All,this.insertCodeModalC.showModal(b.Z.SchedulerManFormC)}updateEditCommon(){var n=this;return(0,M.A)(function*(){const a=yield n.schedulerS.queryOne({find:{guid:n.data.formData.guid,user:n.authCS.gUser._id}});n.form.reset(),n.form.patchValue(a),n.rows=a.intervalArr||[],n.generalCS.setValueInEditor(n,"editorSchedulers",a.schedulerCode||""),n.loadGridData()})()}loadGridData(){this.selectedRows=[];for(const n of this.rows)n.id=this.idCounter++;this.rowsMap=I.keyBy(this.rows,this.gridKey)}reqActiveIndex=0;tabIndexReq={Basic:0,Code:1,Intervals:2};save(n){var a=this;return(0,M.A)(function*(){const o=a.form.getRawValue();let _;_=a.data.formData&&a.data.formData._id?yield a.schedulerS.queryOne({find:{guid:a.data.formData.guid,user:a.authCS.gUser._id}}):{};const E=I.find(_.versions||[],{isActive:!0});E&&(E.apiCodeStr=a.editorSchedulers.getValue());const g=Object.assign({},_,o);g.user=a.authCS.getUserId(),g.intervalArr=a.rows,g.schedulerCode=a.editorSchedulers.getValue();for(const h of g?.versions||[])h.version=h.version.toString();try{let h;a.loading.form=!0,a.lastError=void 0,a.data.mode===m.X.ADD?h=yield a.schedulerS.post(g).toPromise():a.data.mode===m.X.EDIT&&(h=yield a.schedulerS.put(_._id,g,{select:D.GX._id}).toPromise()),a.ns.showSuccess(a.data.mode===m.X.ADD?a.constantsS.schedulers.addSuccess:a.constantsS.schedulers.editSuccess),a.data.eventChannel.emit({action:a.data.mode===m.X.ADD?u.K.SAVED:u.K.UPDATED,closeModal:n}),a.form.get("name").disable(),a.eventCenterS.schedulerSavedAndUpdate.next(!0),a.loading.form=!1}catch(h){"Please Provide Interval."===h.error.errors[0].message&&(a.reqActiveIndex=a.tabIndexReq.Intervals),a.loading.form=!1,a.ns.showErrorFromResponse(h.error||h,"Unable to save scheduler."),a.lastError=h.error}})()}showModal(){this.lastError=void 0,this.shouldLoadMonacoEditor=!0,setTimeout(()=>{$("#idSchedulerForm").modal("show")},100)}hideModal(){$("#idSchedulerForm").modal("hide")}add(){this.dataItem.formData=void 0,this.dataItem.mode=m.X.ADD,this.dataItem.eventChannel.emit({action:u.K.OPEN_FORM_IN_ADD_MODE}),this.intervalsAddEditC.showModal()}view(){this.dataItem.formData=this.rowsMap[this.selectedRows[0]],this.dataItem.mode=m.X.VIEW,this.dataItem.eventChannel.emit({action:u.K.OPEN_FORM_IN_VIEW_MODE}),this.intervalsAddEditC.showModal()}edit(n,a){n.stopPropagation(),n.preventDefault(),this.dataItem.formData=a,this.dataItem.mode=m.X.EDIT,this.dataItem.eventChannel.emit({action:u.K.OPEN_FORM_IN_EDIT_MODE}),this.intervalsAddEditC.showModal()}deleteInterval(n,a){n.stopPropagation(),n.preventDefault(),this.rows.splice(this.rows.indexOf(a),1),this.notificationS.showSuccess(this.constantsS.interval.removePermanent)}editorGenerated(n){var a=this;return(0,M.A)(function*(){a.editorSchedulers=n,yield a.monacoS.loadSchemaEditorSettings(a.BE_HOST_PORT,a.authCS.getUserId(),null),a.monacoS.addSaveCodeKeyBinding(n,o=>{a.form.valid&&a.save(!0)}),a.monacoS.addInsertCodeKeyBinding(n,o=>{a.generalCS.messageReceivedFor=P.r.All,a.data.mode!==m.X.VIEW&&a.insertCodeModalC.showModal(b.Z.SchedulerManFormC)}),a.subscriptions.push(a.generalS.messageReceived.subscribe(o=>{o.type&&o.type===B.R.TEXT_COPIED&&o.componentName===b.Z.SchedulerManFormC&&(a.monacoS.insertAtCursor(n,o.selectedText),a.insertCodeModalC.hideModal())}))})()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),y.L.json)}dblClickIntervalOpenModel(n){this.selectedRows.length&&this.data.mode!==m.X.VIEW&&this.edit(n,this.selectedRows[0])}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions),this.eventCenterS.schedulerSavedAndUpdate.next(!1)}static \u0275fac=function(a){return new(a||r)(e.rXU(f.ok),e.rXU(T.m),e.rXU(x.t),e.rXU(R.f),e.rXU(K.X),e.rXU(L.l),e.rXU(G.e),e.rXU(W.J),e.rXU(T.m),e.rXU(N.u),e.rXU(V.d),e.rXU(w.n),e.rXU(R.f))};static \u0275cmp=e.VBU({type:r,selectors:[["app-w-scheduler-man-form"]],viewQuery:function(a,o){if(1&a&&(e.GBs(j,5),e.GBs(J,5),e.GBs(z,5)),2&a){let _;e.mGM(_=e.lsd())&&(o.intervalsAddEditC=_.first),e.mGM(_=e.lsd())&&(o.insertCodeModalC=_.first),e.mGM(_=e.lsd())&&(o.viewDockerfileModelC=_.first)}},inputs:{data:"data"},decls:69,vars:30,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idSchedulerForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-full"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close",3,"click"],["aria-hidden","true"],[1,"fas","fa-window-close"],["pTooltip","Insert Code","sava-no-dbl-click","",1,"cursor-pointer","mr-1",2,"font-size","1.4em",3,"click"],[1,"fas","fa-info-circle","text-info","fa-fw"],["href","https://docs.apimaker.dev/v1/docs/apis-all/schedulers/user-created-schedulers-api.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n2",2,"font-size","25px"],[1,"modal-body","overflow-auto"],[1,"w-100",3,"activeIndex","activeIndexChange"],["header","Basic Info"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-3","col-form-label","col-form-label-sm","text-right"],[1,"col-7"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],["formControlName","schedulerTimeoutInMinutes","name","schedulerTimeoutInMinutes","spellcheck","false","type","number","placeholder","10",1,"form-control","form-control-sm",3,"min"],["class","mt-1px small text-info",4,"ngIf"],[1,"align-middle","mb-0","pt-1"],["formControlName","isActive","label","Active",3,"binary"],["formControlName","runOnNativeProcess","pTooltip","Code will run on actual process and not in sandbox, so be careful with code. You can not use sandbox packages in this mode. You can use all Node.js packages + some packages on which API Maker is dependent on. You can use features of global variable 'g'.","label","Run Native",3,"ngClass","binary"],["header","Code"],["class","overflow-hidden mb-3","style","height: calc(100vh - 270px);",4,"ngIf"],["header","Intervals"],[1,"overflow-auto",2,"height","calc(100vh - 206px)"],[1,"card","shadow-sm","h-100","mr-1","ml-1"],[1,"card-header"],[1,"fas","fa-stopwatch","text-warning","fa-fw","mr-1"],["href","https://docs.apimaker.dev/v1/docs/apis-all/schedulers/user-created-schedulers-api.html#create-intervals-in-scheduler","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3","mr-1",2,"font-size","25px"],["class","float-right cursor-pointer ml-3","pTooltip","Add New",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","200px",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],[1,"modal-footer"],["href","javascript:;","class","text-danger",3,"click",4,"ngIf"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary",3,"click"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"data"],["intervalsAddEditC",""],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],[1,"ml-2","font-weight-normal","small","text-muted"],[1,"mt-1px","small","text-info"],[1,"overflow-hidden","mb-3",2,"height","calc(100vh - 270px)"],[3,"isSchemaEditor","editorOptions","editorGenerated"],["pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],[2,"width","40px"],[2,"width","100px"],[3,"pSelectableRow"],["class","fas fa-circle fa-fw text-success text-v-small",4,"ngIf"],["class","fas fa-circle fa-fw text-muted text-v-small",4,"ngIf"],["class","text-center",4,"ngIf"],[1,"fas","fa-circle","fa-fw","text-success","text-v-small"],[1,"fas","fa-circle","fa-fw","text-muted","text-v-small"],[1,"text-center"],["pTooltip","Edit",1,"btn","btn-xsm-custom","mr-1",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw","cursor-pointer"],["pTooltip","Delete",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"far","fa-trash-alt","text-danger","fa-fw","cursor-pointer"],["href","javascript:;",1,"text-danger",3,"click"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,o){1&a&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.DNE(4,Q,3,0,"span",4),e.DNE(5,q,3,0,"span",4),e.DNE(6,te,5,1,"span",4),e.j41(7,"div",5)(8,"button",6),e.bIt("click",function(){return o.hideModal()}),e.j41(9,"span",7),e.nrm(10,"i",8),e.k0s()(),e.j41(11,"span",9),e.bIt("click",function(){return o.showInsertCodeModel()}),e.nrm(12,"i",10),e.k0s(),e.j41(13,"a",11),e.nrm(14,"img",12),e.k0s()()(),e.j41(15,"div",13)(16,"p-tabView",14),e.bIt("activeIndexChange",function(E){return o.reqActiveIndex=E}),e.j41(17,"p-tabPanel",15)(18,"form",16)(19,"div",17)(20,"label",18),e.EFF(21,"Name"),e.k0s(),e.j41(22,"div",19),e.nrm(23,"input",20),e.k0s()(),e.j41(24,"div",17)(25,"label",18),e.EFF(26,"Timeout in minutes"),e.k0s(),e.j41(27,"div",19),e.nrm(28,"input",21),e.DNE(29,ae,2,1,"span",22),e.k0s()(),e.j41(30,"div",17),e.nrm(31,"label",18),e.j41(32,"div",19)(33,"label",23),e.nrm(34,"p-checkbox",24),e.k0s()()(),e.j41(35,"div",17),e.nrm(36,"label",18),e.j41(37,"div",19)(38,"label",23),e.nrm(39,"p-checkbox",25),e.k0s()()()()(),e.j41(40,"p-tabPanel",26),e.DNE(41,ne,2,2,"div",27),e.k0s(),e.j41(42,"p-tabPanel",28)(43,"div",29)(44,"div",30)(45,"div",31)(46,"span"),e.nrm(47,"i",32),e.EFF(48," Interval"),e.k0s(),e.j41(49,"a",33),e.nrm(50,"img",34),e.k0s(),e.DNE(51,oe,2,0,"span",35),e.k0s(),e.j41(52,"div",36)(53,"p-table",37),e.bIt("selectionChange",function(E){return o.selectedRows=E})("dblclick",function(E){return o.dblClickIntervalOpenModel(E)}),e.DNE(54,se,10,0,"ng-template",38),e.DNE(55,de,14,7,"ng-template",39),e.k0s()()()()()()(),e.j41(56,"div",40),e.DNE(57,_e,2,0,"a",41),e.j41(58,"button",42),e.bIt("click",function(){return o.hideModal()}),e.nrm(59,"i",43),e.EFF(60," Close"),e.k0s(),e.DNE(61,ue,4,3,"button",44),e.k0s(),e.DNE(62,fe,1,0,"p-progressSpinner",45),e.k0s()()(),e.nrm(63,"app-intervals-add-edit",46,47)(65,"app-insert-code-modal",48,49)(67,"app-monaco-editor-modal",50,51)),2&a&&(e.R7$(4),e.Y8G("ngIf",o.data.mode===o.EFormMode.ADD),e.R7$(1),e.Y8G("ngIf",o.data.mode===o.EFormMode.VIEW),e.R7$(1),e.Y8G("ngIf",o.data.mode===o.EFormMode.EDIT),e.R7$(10),e.Y8G("activeIndex",o.reqActiveIndex),e.R7$(2),e.Y8G("formGroup",o.form),e.R7$(10),e.Y8G("min",1),e.R7$(1),e.Y8G("ngIf",o.form.get(o.ISchedulerProps.schedulerTimeoutInMinutes).value),e.R7$(5),e.Y8G("binary",!0),e.R7$(5),e.Y8G("ngClass",e.eq3(28,pe,!0===o.form.get(o.ISchedulerProps.runOnNativeProcess).value))("binary",!0),e.R7$(2),e.Y8G("ngIf",o.shouldLoadMonacoEditor),e.R7$(10),e.Y8G("ngIf",o.data.mode!==o.EFormMode.VIEW),e.R7$(2),e.Y8G("selectionMode","multiple")("metaKeySelection",!0)("selection",o.selectedRows)("dataKey",o.gridKey)("scrollable",!0)("value",o.rows),e.R7$(4),e.Y8G("ngIf",o.lastError),e.R7$(4),e.Y8G("ngIf",o.data.mode!==o.EFormMode.VIEW),e.R7$(1),e.Y8G("ngIf",o.loading.form),e.R7$(1),e.Y8G("data",o.dataItem),e.R7$(2),e.Y8G("frameId","idInsertCodeSchedulers")("modalId","idInsertCodeSchedulersForm")("docsHostPort",o.DOCS_HOST_PORT),e.R7$(2),e.Y8G("modalId","idMonacoEditorModalInScheduler")("editorOptionsMonacoEditorModal",o.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[f.qT,f.me,f.Q0,f.BC,f.cb,f.VZ,f.j4,f.JD,A.YU,A.bT,X.U,Y.V,H.A,k.XI,Z.Ei,k.d5,d.p,v.JQ,v.Kp,i.m,c.Sc,l.J,O.h],encapsulation:2})}return r})()},1468:(ee,F,s)=>{s.d(F,{X:()=>t});var M=s(1709),u=(s(4370),s(1078),s(2508)),m=s(540);let t=(()=>{class C{static \u0275fac=function(S){return new(S||C)};static \u0275mod=m.$C({type:C});static \u0275inj=m.G2t({imports:[M.u,u.v]})}return C})()}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1959],{1959:(O,S,i)=>{i.r(S),i.d(S,{SchedulerManM:()=>I});var c=i(7060),e=i(1709),o=i(540),h=i(4565);let m=(()=>{class _{constructor(){}ngOnInit(){}static \u0275fac=function(p){return new(p||_)};static \u0275cmp=o.VBU({type:_,selectors:[["app-scheduler-man-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1"]],template:function(p,x){1&p&&(o.j41(0,"div",0),o.nrm(1,"app-scheduler-man-w"),o.k0s())},dependencies:[h.g],encapsulation:2})}return _})();var d=i(2173),R=i(1468);const g=[{path:"scheduler-layout",component:m,canActivate:[d.Z]}];let I=(()=>{class _{static \u0275fac=function(p){return new(p||_)};static \u0275mod=o.$C({type:_});static \u0275inj=o.G2t({imports:[c.iI.forChild(g),e.u,R.X]})}return _})()},4565:(O,S,i)=>{i.d(S,{g:()=>ue});var c=i(467),e=i(540),o=i(8727),h=i(5046),m=i(7326),d=i(7376),g=i(6645),P=i(5632),I=i(1325),_=i(7668),y=i(6129),M=i(6708),p=i(5779),x=i(7337),L=i(7237),A=i(1987),W=i(3966),T=i(7060),G=i(4341),w=i(177),C=i(7645),b=i(7515),N=i(8542),j=i(5430),k=i(4370);const U=["schedulerManFormC"];function B(n,r){if(1&n){const t=e.RV6();e.j41(0,"span",17),e.bIt("click",function(){e.eBV(t);const a=e.XpG(2);return e.Njj(a.edit())}),e.nrm(1,"i",18),e.k0s()}}function F(n,r){if(1&n){const t=e.RV6();e.j41(0,"span",19),e.bIt("click",function(){e.eBV(t);const a=e.XpG(2);return e.Njj(a.clone())}),e.nrm(1,"i",20),e.k0s()}}function X(n,r){if(1&n){const t=e.RV6();e.j41(0,"span",21),e.bIt("click",function(){e.eBV(t);const a=e.XpG(2);return e.Njj(a.removePermanentDialog())}),e.nrm(1,"i",22),e.k0s()}}function K(n,r){if(1&n){const t=e.RV6();e.j41(0,"span")(1,"span",12),e.bIt("click",function(){e.eBV(t);const a=e.XpG();return e.Njj(a.add())}),e.nrm(2,"i",13),e.k0s(),e.DNE(3,B,2,0,"span",14),e.DNE(4,F,2,0,"span",15),e.DNE(5,X,2,0,"span",16),e.k0s()}if(2&n){const t=e.XpG();e.R7$(3),e.Y8G("ngIf",t.selectedRows.length),e.R7$(1),e.Y8G("ngIf",t.selectedRows.length),e.R7$(1),e.Y8G("ngIf",t.selectedRows.length)}}function $(n,r){if(1&n){const t=e.RV6();e.j41(0,"span",23)(1,"label",24)(2,"p-checkbox",25),e.bIt("ngModelChange",function(a){e.eBV(t);const l=e.XpG();return e.Njj(l.eventCenterS.group.apisRegex.allSchedulers=a)}),e.k0s()()()}if(2&n){const t=e.XpG();e.R7$(2),e.Y8G("ngModel",t.eventCenterS.group.apisRegex.allSchedulers)("binary",!0)}}function Y(n,r){if(1&n){const t=e.RV6();e.j41(0,"span",23)(1,"label",24)(2,"p-checkbox",25),e.bIt("ngModelChange",function(a){e.eBV(t);const l=e.XpG();return e.Njj(l.eventCenterS.filterInLog.apisRegex.allSchedulers=a)}),e.k0s()()()}if(2&n){const t=e.XpG();e.R7$(2),e.Y8G("ngModel",t.eventCenterS.filterInLog.apisRegex.allSchedulers)("binary",!0)}}function V(n,r){if(1&n&&(e.j41(0,"div")(1,"div",26),e.EFF(2),e.k0s()()),2&n){const t=e.XpG();e.R7$(2),e.JRh(t.constantsS.group.allSchedulersPermitted)}}function Q(n,r){1&n&&(e.j41(0,"th",34),e.nrm(1,"p-tableHeaderCheckbox"),e.k0s())}function H(n,r){1&n&&e.nrm(0,"th",36)}function J(n,r){1&n&&e.nrm(0,"th")}function z(n,r){1&n&&e.nrm(0,"th",37)}function Z(n,r){if(1&n&&(e.j41(0,"tr"),e.DNE(1,Q,2,0,"th",32),e.DNE(2,H,1,0,"th",33),e.nrm(3,"th",34),e.j41(4,"th"),e.EFF(5,"Name"),e.k0s(),e.DNE(6,J,1,0,"th",6),e.DNE(7,z,1,0,"th",35),e.k0s()),2&n){const t=e.XpG(2);e.R7$(1),e.Y8G("ngIf",t.isMultiSelect),e.R7$(1),e.Y8G("ngIf",!t.isDependentOnGroup&&!t.isLPM&&!t.isFilterLogTable),e.R7$(4),e.Y8G("ngIf",t.isLPM),e.R7$(1),e.Y8G("ngIf",!t.isDependentOnGroup&&!t.isLPM&&!t.isFilterLogTable)}}function q(n,r){if(1&n&&(e.j41(0,"td"),e.nrm(1,"p-tableCheckbox",43),e.k0s()),2&n){const t=e.XpG().$implicit;e.R7$(1),e.Y8G("value",t)("pSelectableRow",t)}}function ee(n,r){if(1&n&&(e.j41(0,"td",44)(1,"span"),e.EFF(2),e.k0s()()),2&n){const t=e.XpG().rowIndex;e.R7$(2),e.JRh(t+1)}}function te(n,r){1&n&&e.nrm(0,"i",45)}function ne(n,r){1&n&&e.nrm(0,"i",46)}function se(n,r){1&n&&e.nrm(0,"i",47)}function ae(n,r){if(1&n){const t=e.RV6();e.j41(0,"div")(1,"label",48)(2,"p-checkbox",49),e.bIt("ngModelChange",function(a){e.eBV(t);const l=e.XpG(2).$implicit;return e.Njj(l.saveResponseInLog=a)})("click",function(a){e.eBV(t);const l=e.XpG(4);return e.Njj(l.generalS.stopPropagation(a))}),e.k0s()()()}if(2&n){const t=e.XpG(2).$implicit;e.R7$(2),e.Y8G("ngModel",t.saveResponseInLog)("binary",!0)}}function ie(n,r){if(1&n&&(e.j41(0,"td"),e.DNE(1,ae,3,2,"div",6),e.k0s()),2&n){const t=e.XpG().$implicit,s=e.XpG(2);e.R7$(1),e.Y8G("ngIf",s.selectedRows.indexOf(t)>=0)}}const re=function(){return["/api-info/api-testing/testing"]},le=function(n,r){return{at_category:"SCHEDULERS",at_user:n,at_api:r}};function oe(n,r){if(1&n&&(e.j41(0,"td")(1,"div",44)(2,"a",50),e.bIt("click",function(s){return s.stopPropagation()}),e.nrm(3,"i",51),e.k0s()()()),2&n){const t=e.XpG().$implicit,s=e.XpG(2);e.R7$(2),e.Y8G("routerLink",e.lJ4(2,re))("queryParams",e.l_i(3,le,s.authCS.getUserId(),t._id))}}function ce(n,r){if(1&n&&(e.j41(0,"tr",38),e.DNE(1,q,2,2,"td",6),e.DNE(2,ee,3,1,"td",39),e.j41(3,"td"),e.DNE(4,te,1,0,"i",40),e.DNE(5,ne,1,0,"i",41),e.k0s(),e.j41(6,"td")(7,"span"),e.EFF(8),e.k0s(),e.DNE(9,se,1,0,"i",42),e.k0s(),e.DNE(10,ie,2,1,"td",6),e.DNE(11,oe,4,6,"td",6),e.k0s()),2&n){const t=r.$implicit,s=e.XpG(2);e.Y8G("pSelectableRow",t),e.R7$(1),e.Y8G("ngIf",s.isMultiSelect),e.R7$(1),e.Y8G("ngIf",!s.isDependentOnGroup&&!s.isLPM&&!s.isFilterLogTable),e.R7$(2),e.Y8G("ngIf",t.isActive),e.R7$(1),e.Y8G("ngIf",!t.isActive),e.R7$(3),e.JRh(t.name),e.R7$(1),e.Y8G("ngIf",t.runOnNativeProcess),e.R7$(1),e.Y8G("ngIf",s.isLPM),e.R7$(1),e.Y8G("ngIf",!s.isDependentOnGroup&&!s.isLPM&&!s.isFilterLogTable)}}function _e(n,r){1&n&&e.nrm(0,"p-progressSpinner",52)}function de(n,r){if(1&n){const t=e.RV6();e.j41(0,"div",27)(1,"p-table",28),e.bIt("selectionChange",function(a){e.eBV(t);const l=e.XpG();return e.Njj(l.selectedRows=a)})("selectionChange",function(){e.eBV(t);const a=e.XpG();return e.Njj(a.selectionChange())})("dblclick",function(){e.eBV(t);const a=e.XpG();return e.Njj(a.dblClickSchedulerList())}),e.DNE(2,Z,8,4,"ng-template",29),e.DNE(3,ce,12,9,"ng-template",30),e.k0s(),e.DNE(4,_e,1,0,"p-progressSpinner",31),e.k0s()}if(2&n){const t=e.XpG();e.R7$(1),e.Y8G("selectionMode","multiple")("metaKeySelection",t.metaKeySelection)("selection",t.selectedRows)("dataKey",t.gridKey)("scrollable",!0)("value",t.rows),e.R7$(3),e.Y8G("ngIf",t.loading.grid)}}let ue=(()=>{class n{schedulerS;generalS;notificationS;confirmationService;navigationCS;authCS;constantsS;eventCenterS;cd;router;isReadOnly=!1;isMultiSelect=!1;isDependentOnGroup=!1;isLPM=!1;isFilterLogTable=!1;metaKeySelection=!0;loading={grid:!1};subscriptions=[];data={mode:h.X.ADD,eventChannel:new e.bkB,formData:void 0};rows=[];rowsMap={};rowsMapName={};showAll=!1;selectedRows=[];gridKey=g.GX._id;EUserType=I.l;schedulerManFormC;constructor(t,s,a,l,E,f,u,v,D,pe){this.schedulerS=t,this.generalS=s,this.notificationS=a,this.confirmationService=l,this.navigationCS=E,this.authCS=f,this.constantsS=u,this.eventCenterS=v,this.cd=D,this.router=pe}ngOnInit(){var t=this;this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(s=>{s.action===o.K.SAVED?(this.schedulerManFormC.hideModal(),this.loadGridData()):s.action===o.K.UPDATED&&(s.closeModal&&this.schedulerManFormC.hideModal(),this.loadGridData())})),this.isDependentOnGroup&&this.subscriptions.push(this.eventCenterS.group.selectedGroups.subscribe(function(){var s=(0,c.A)(function*(a){a.length&&t.loadGridData()});return function(a){return s.apply(this,arguments)}}())),(this.isFilterLogTable||this.isLPM)&&this.subscriptions.push(this.eventCenterS.filterInLog.refreshGrid.subscribe(s=>{s&&this.loadGridData()})),this.generalS.setNewTitle("API Maker - Scheduler")}loadGridData(){var t=this;this.loading.grid=!0;const s={find:{user:this.authCS.getUserId(),active:!0},select:{name:1,label:1,isActive:1,active:1,runOnNativeProcess:1},sort:{name:1}};this.showAll&&delete s.find.active,this.subscriptions.push(this.schedulerS.query(s).subscribe(function(){var a=(0,c.A)(function*(l){l.success?(t.selectedRows=[],t.rows=l.data||[],t.rowsMap=d.keyBy(t.rows,g.GX._id),t.rowsMapName=d.keyBy(t.rows,g.VC.name)):t.resetGridAndUrl();const E=t.navigationCS.getQueryParam(m.F.am_scheduler)||(t.isFilterLogTable?t.eventCenterS.filterInLog.schedulersIds.value.join(","):t.eventCenterS.group.schedulersIds.value.join(","))||(t.isDependentOnGroup&&t.eventCenterS.group.selectedGroups.value[0]?.queryParams?.schedulerNames?t.eventCenterS.group.selectedGroups.value[0]?.queryParams.schedulerNames.join(","):"");if(E){const f=E.split(","),u=d.intersection(d.keys(t.rowsMap),f),v=[];for(const D of u)t.rowsMap[D]&&v.push(t.rowsMap[D]);t.selectedRows=v,t.eventCenterS.group.selectedSchedulers.next(v),t.eventCenterS.group.schedulersIds.next(u),t.eventCenterS.filterInLog.schedulersIds.next(u)}if(t.isLPM&&t.eventCenterS.group.selectedGroups.value[0]?.queryParams?.schedulerNames?.length){const f=t.eventCenterS.group.selectedGroups.value[0];for(const u of f?.queryParams?.schedulerNames)t.rowsMapName[u]&&(t.rowsMapName[u].saveResponseInLog=f.schedulersLog?.[u]?.saveResponseInLog||!1);t.setResDataInEventCenter()}t.loading.grid=!1,t.cd.detectChanges()});return function(l){return a.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=h.X.ADD,this.data.eventChannel.emit({action:o.K.OPEN_FORM_IN_ADD_MODE}),this.schedulerManFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=h.X.VIEW,this.data.eventChannel.emit({action:o.K.OPEN_FORM_IN_VIEW_MODE}),this.schedulerManFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=h.X.EDIT,this.data.eventChannel.emit({action:o.K.OPEN_FORM_IN_EDIT_MODE}),this.schedulerManFormC.showModal()}clone(){var t=this;return(0,c.A)(function*(){try{if(!t.selectedRows[0]||!t.selectedRows[0])return;const s=(yield t.schedulerS.getById(t.selectedRows[0]._id).toPromise()).data;delete s._id,s.name=`${s.name}-clone`,(yield t.schedulerS.post(s).toPromise()).success?(t.notificationS.showSuccess(t.constantsS.schedulers.cloneSuccess),t.loadGridData()):t.notificationS.showSuccess(t.constantsS.schedulers.cloneSuccess)}catch{t.notificationS.showError(t.constantsS.schedulers.cloneError)}})()}setResDataInEventCenter(){this.isDependentOnGroup&&(this.eventCenterS.group.schedulersApis.next(this.selectedRows),this.eventCenterS.group.selectedSchedulers.next(this.selectedRows)),this.isFilterLogTable&&this.eventCenterS.filterInLog.schedulersApis.next(this.selectedRows)}removePermanentDialog(){var t=this;return(0,c.A)(function*(){var s;t.confirmationService.confirm({message:t.constantsS.schedulers.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(s=(0,c.A)(function*(){yield t.removePermanent()}),function(){return s.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,c.A)(function*(){t.loading.grid=!0;const s=yield t.schedulerS.permanentDelete(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,s.success?(t.notificationS.showSuccess(t.constantsS.schedulers.removePermanent),t.resetGridAndUrl(),t.loadGridData()):t.notificationS.showErrorFromResponse(s,t.constantsS.schedulers.removePermanentError)})()}resetDependents(){var t=this;return(0,c.A)(function*(){yield t.navigationCS.setQueryParam(m.F.am_scheduler,null)})()}selectionChange(){var t=this;return(0,c.A)(function*(){t.resetDependents().then(),t.fillData().then(),t.selectedRows?.[0]?t.generalS.setNewTitle(t.selectedRows[0].name,P.O.SCHEDULERS):t.generalS.setNewTitle("API Maker - Scheduler")})()}resetGridAndUrl(){this.rows=[],this.selectedRows=[],this.rowsMap={},this.rowsMapName={}}fillData(){var t=this;return(0,c.A)(function*(){if(!t.selectedRows.length)return yield t.navigationCS.setQueryParam(m.F.am_scheduler,""),t.eventCenterS.group.schedulersIds.next([]),t.eventCenterS.group.schedulersApis.next([]),t.eventCenterS.filterInLog.schedulersIds.next([]),void t.eventCenterS.filterInLog.schedulersApis.next([]);if(t.isDependentOnGroup||t.isFilterLogTable)t.eventCenterS.group.schedulersIds.next(d.map(t.selectedRows,"_id")),t.eventCenterS.group.schedulersApis.next(t.selectedRows),t.isFilterLogTable&&(t.eventCenterS.filterInLog.schedulersIds.next(d.map(t.selectedRows,"_id")),t.eventCenterS.filterInLog.schedulersApis.next(t.selectedRows));else{const s=(yield t.schedulerS.getById(t.selectedRows[0]._id).toPromise()).data;s._id?yield t.navigationCS.setQueryParam(m.F.am_scheduler,s._id):t.resetDependents()}})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickSchedulerList(){this.selectedRows.length&&!this.isMultiSelect&&this.edit()}static \u0275fac=function(s){return new(s||n)(e.rXU(_.t),e.rXU(y.f),e.rXU(M.m),e.rXU(p.td),e.rXU(x.$),e.rXU(L.l),e.rXU(A.X),e.rXU(W.d),e.rXU(e.gRc),e.rXU(T.Ix))};static \u0275cmp=e.VBU({type:n,selectors:[["app-scheduler-man-w"]],viewQuery:function(s,a){if(1&s&&e.GBs(U,5),2&s){let l;e.mGM(l=e.lsd())&&(a.schedulerManFormC=l.first)}},inputs:{isReadOnly:["IsReadOnly","isReadOnly"],isMultiSelect:["IsMultiSelect","isMultiSelect"],isDependentOnGroup:["IsDependentOnGroup","isDependentOnGroup"],isLPM:"isLPM",isFilterLogTable:"isFilterLogTable",metaKeySelection:"metaKeySelection"},decls:16,vars:6,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/schedulers.svg","alt","Schedulers",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/apis-all/schedulers/user-created-schedulers-api.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],[4,"ngIf"],["class","float-right cursor-pointer","tooltipPosition","left","pTooltip","All Schedulers",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["class","h-100",4,"ngIf"],[3,"data"],["schedulerManFormC",""],["pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Permanent Delete",3,"click",4,"ngIf"],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","fa-fw"],["pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["tooltipPosition","left","pTooltip","All Schedulers",1,"float-right","cursor-pointer"],[1,"mb-0","mt--2px"],[3,"ngModel","binary","ngModelChange"],[1,"p-2","text-center","text-success"],[1,"h-100"],["styleClass","p-datatable-striped schedulers-grid-height","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["style","width: 40px;",4,"ngIf"],["style","width: 80px;",4,"ngIf"],[2,"width","40px"],["style","width: 60px;",4,"ngIf"],[2,"width","80px"],[2,"width","60px"],[3,"pSelectableRow"],["class","text-center",4,"ngIf"],["class","fas fa-circle fa-fw align-middle text-success text-v-small",4,"ngIf"],["class","fas fa-circle fa-fw align-middle text-muted text-v-small",4,"ngIf"],["pTooltip","Running on native process","class","fas fa-radiation ml-2 text-danger",4,"ngIf"],[3,"value","pSelectableRow"],[1,"text-center"],[1,"fas","fa-circle","fa-fw","align-middle","text-success","text-v-small"],[1,"fas","fa-circle","fa-fw","align-middle","text-muted","text-v-small"],["pTooltip","Running on native process",1,"fas","fa-radiation","ml-2","text-danger"],[1,"m-0","vertical-align-sub"],["label","Save Response In Log",3,"ngModel","binary","ngModelChange","click"],["href","javascript:","tooltipPosition","left","pTooltip","Test API",1,"btn","btn-xsm-custom","mr-3",3,"routerLink","queryParams","click"],[1,"fas","fa-vial","text-info","fa-fw","test-tube","pt-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(s,a){1&s&&(e.j41(0,"div",0)(1,"div",1)(2,"span"),e.nrm(3,"img",2),e.EFF(4," Scheduler List"),e.k0s(),e.j41(5,"div",3)(6,"a",4),e.nrm(7,"img",5),e.k0s()(),e.DNE(8,K,6,3,"span",6),e.DNE(9,$,3,2,"span",7),e.DNE(10,Y,3,2,"span",7),e.k0s(),e.j41(11,"div",8),e.DNE(12,V,3,1,"div",6),e.DNE(13,de,5,7,"div",9),e.k0s()(),e.nrm(14,"app-w-scheduler-man-form",10,11)),2&s&&(e.R7$(8),e.Y8G("ngIf",!a.isReadOnly),e.R7$(1),e.Y8G("ngIf",a.isDependentOnGroup),e.R7$(1),e.Y8G("ngIf",a.isFilterLogTable),e.R7$(2),e.Y8G("ngIf",a.eventCenterS.group.apisRegex.allSchedulers||a.eventCenterS.filterInLog.apisRegex.allSchedulers),e.R7$(1),e.Y8G("ngIf",!(a.eventCenterS.group.apisRegex.allSchedulers||a.eventCenterS.filterInLog.apisRegex.allSchedulers)),e.R7$(1),e.Y8G("data",a.data))},dependencies:[T.Wk,G.BC,G.vS,w.bT,C.XI,p.Ei,C.d5,C.S9,C.nA,b.p,N.m,j.Sc,k.X],encapsulation:2})}return n})()}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[2162],{2162:(ye,h,o)=>{o.r(h),o.d(h,{RedisDashboardM:()=>ge});var F=o(7431),N=o(7060),l=o(467),e=o(540),k=o(7376),d=o(8727),m=o(5046),I=o(6589),g=o(5312),v=o(3864),y=o(6129),R=o(6708),D=o(7237),E=o(1987),S=o(5779),C=o(6268),p=o(177),b=o(6914),K=o(9861),T=o(7515),G=o(572),j=o(8542),c=o(4341),w=o(9239),x=o(3478),M=o(4466);const O=["monacoEditorModalC"];function V(n,i){1&n&&(e.j41(0,"span"),e.nrm(1,"i",28),e.EFF(2," Add New Key"),e.k0s())}function A(n,i){1&n&&(e.j41(0,"span"),e.nrm(1,"i",29),e.EFF(2," View New Key"),e.k0s())}function X(n,i){1&n&&(e.j41(0,"span"),e.nrm(1,"i",30),e.EFF(2," Edit New Key"),e.k0s())}function B(n,i){1&n&&(e.j41(0,"label",31),e.EFF(1,"Key Name"),e.k0s())}function P(n,i){1&n&&(e.j41(0,"div",32),e.nrm(1,"input",33),e.k0s())}function U(n,i){if(1&n){const t=e.RV6();e.j41(0,"div",34)(1,"app-monaco-editor",35),e.bIt("editorGenerated",function(s){e.eBV(t);const r=e.XpG();return e.Njj(r.editorGenerated(s))}),e.k0s()()}if(2&n){const t=e.XpG();e.R7$(1),e.Y8G("isSchemaEditor",!0)("editorOptions",t.editorOptionsRedis)}}function Y(n,i){if(1&n){const t=e.RV6();e.j41(0,"a",36),e.bIt("click",function(){e.eBV(t);const s=e.XpG();return e.Njj(s.viewError())}),e.EFF(1,"View error"),e.k0s()}}function L(n,i){1&n&&(e.j41(0,"span"),e.EFF(1,"Save"),e.k0s())}function J(n,i){1&n&&(e.j41(0,"span"),e.EFF(1,"Update"),e.k0s())}function H(n,i){if(1&n){const t=e.RV6();e.j41(0,"button",37),e.bIt("click",function(){e.eBV(t);const s=e.XpG();return e.Njj(s.save())}),e.nrm(1,"i",38),e.DNE(2,L,2,0,"span",4),e.DNE(3,J,2,0,"span",4),e.k0s()}if(2&n){const t=e.XpG();e.Y8G("disabled",!(null!=t.form.get("keyName").value&&t.form.get("keyName").value.toString().trim())),e.R7$(2),e.Y8G("ngIf",t.data.mode===t.EFormMode.ADD),e.R7$(1),e.Y8G("ngIf",t.data.mode===t.EFormMode.EDIT)}}function W(n,i){1&n&&e.nrm(0,"p-progressSpinner",39)}const z=function(n){return{"col-3":n}},Q=function(n,i){return{"col-3":n,"col-6":i}};let Z=(()=>{class n{fb;ns;monacoS;instanceS;constantsS;authCS;generalCS;data;loading={form:!1};EFormMode=m.X;form;subscriptions=[];editorRedis;editorOptionsRedis={readOnly:!1,language:"json",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};BE_HOST_PORT=g.c.BE_HOST_PORT;viewDockerfileModelC;actualKeyData;constructor(t,a,s,r,f,u,_){this.fb=t,this.ns=a,this.monacoS=s,this.instanceS=r,this.constantsS=f,this.authCS=u,this.generalCS=_}ngOnInit(){var t=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var a=(0,l.A)(function*(s){s&&(t.form.enable(),s.action===d.K.OPEN_FORM_IN_EDIT_MODE?(t.actualKeyData=s,t.form.reset(),t.form.get("ttl").setValue(t.actualKeyData.data.ttl),t.form.get("keyName").setValue(t.actualKeyData.data.keyName)):s.action===d.K.OPEN_FORM_IN_VIEW_MODE?(t.form.reset(),t.form.disable()):s.action===d.K.OPEN_FORM_IN_ADD_MODE&&(t.form.reset(),t.generalCS.setValueInEditor(t,"editorRedis","{}")))});return function(s){return a.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({keyName:[null,[c.k0.required]],ttl:[null,[c.k0.required]]})}showModal(){this.lastError=void 0,$("#idNewKeyForm").modal("show")}hideModal(){$("#idNewKeyForm").modal("hide")}save(){var t=this;return(0,l.A)(function*(){const a=t.form.getRawValue();a.redisCodeStr=t.editorRedis.getValue();try{let s;if(t.loading.form=!0,t.lastError=void 0,t.data.mode===m.X.ADD)s=yield t.instanceS.saveRedisKeys(a),t.ns.showSuccess(t.constantsS.redis.addSuccess),t.data.eventChannel.emit({action:t.data.mode===m.X.ADD?d.K.SAVED:d.K.UPDATED});else if(t.data.mode===m.X.EDIT){const r={keyName:t.actualKeyData.data.keyName,redisCodeStr:t.actualKeyData.data.redisCodeStr,ttl:t.form.get("ttl").value};yield t.instanceS.updateRedisKeys(r),t.ns.showSuccess(t.constantsS.redis.editSuccess),t.data.eventChannel.emit({action:d.K.UPDATED,data:t.form.get("ttl").value})}t.loading.form=!1}catch(s){t.loading.form=!1,t.ns.showErrorFromResponse(s.error||s,"Unable to save redis key."),t.lastError=s.error}})()}editorGenerated(t){var a=this;return(0,l.A)(function*(){a.editorRedis=t,yield a.monacoS.loadSchemaEditorSettings(a.BE_HOST_PORT,a.authCS.getUserId(),null),a.monacoS.addSaveCodeKeyBinding(t,s=>{a.form.valid&&a.save()})})()}viewError(){this.viewDockerfileModelC.showModal(this.generalCS.stringify(this.lastError),w.L.json)}ngOnDestroy(){this.generalCS.unsubscribe(this.subscriptions)}static \u0275fac=function(a){return new(a||n)(e.rXU(c.ok),e.rXU(R.m),e.rXU(v.e),e.rXU(C.J),e.rXU(E.X),e.rXU(D.l),e.rXU(y.f))};static \u0275cmp=e.VBU({type:n,selectors:[["app-redis-new-key-form"]],viewQuery:function(a,s){if(1&a&&e.GBs(O,5),2&a){let r;e.mGM(r=e.lsd())&&(s.viewDockerfileModelC=r.first)}},inputs:{data:"data"},decls:32,vars:20,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idNewKeyForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-lg"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],["href","https://docs.apimaker.dev/v1/docs/dashboard/redis-dashboard.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","mt-1","mr-1",2,"font-size","22px"],[1,"modal-body","overflow-auto"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],["class","col-2 col-form-label col-form-label-sm text-right",4,"ngIf"],["class","col-6",4,"ngIf"],[1,"col-form-label","col-form-label-sm","text-right",3,"ngClass"],[3,"ngClass"],["formControlName","ttl","name","ttl","spellcheck","false","type","number","placeholder","Please provide value",1,"form-control","form-control-sm"],["class","overflow-hidden mb-3","style","height: calc(100vh - 270px);",4,"ngIf"],[1,"modal-footer"],["href","javascript:;","class","text-danger",3,"click",4,"ngIf"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],[1,"col-2","col-form-label","col-form-label-sm","text-right"],[1,"col-6"],["formControlName","keyName","name","keyName","spellcheck","false","type","text","placeholder","Please provide key name",1,"form-control","form-control-sm"],[1,"overflow-hidden","mb-3",2,"height","calc(100vh - 270px)"],[3,"isSchemaEditor","editorOptions","editorGenerated"],["href","javascript:;",1,"text-danger",3,"click"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,s){1&a&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.DNE(4,V,3,0,"span",4),e.DNE(5,A,3,0,"span",4),e.DNE(6,X,3,0,"span",4),e.j41(7,"div",5)(8,"button",6)(9,"span",7),e.nrm(10,"i",8),e.k0s()(),e.j41(11,"a",9),e.nrm(12,"img",10),e.k0s()()(),e.j41(13,"div",11)(14,"form",12)(15,"div",13),e.DNE(16,B,2,0,"label",14),e.DNE(17,P,2,0,"div",15),e.j41(18,"label",16),e.EFF(19,"TTL"),e.k0s(),e.j41(20,"div",17),e.nrm(21,"input",18),e.k0s()(),e.DNE(22,U,2,2,"div",19),e.k0s()(),e.j41(23,"div",20),e.DNE(24,Y,2,0,"a",21),e.j41(25,"button",22),e.nrm(26,"i",23),e.EFF(27," Close"),e.k0s(),e.DNE(28,H,4,3,"button",24),e.k0s(),e.DNE(29,W,1,0,"p-progressSpinner",25),e.k0s()()(),e.nrm(30,"app-monaco-editor-modal",26,27)),2&a&&(e.R7$(4),e.Y8G("ngIf",s.data.mode===s.EFormMode.ADD),e.R7$(1),e.Y8G("ngIf",s.data.mode===s.EFormMode.VIEW),e.R7$(1),e.Y8G("ngIf",s.data.mode===s.EFormMode.EDIT),e.R7$(8),e.Y8G("formGroup",s.form),e.R7$(2),e.Y8G("ngIf",s.data.mode===s.EFormMode.ADD),e.R7$(1),e.Y8G("ngIf",s.data.mode===s.EFormMode.ADD),e.R7$(1),e.Y8G("ngClass",e.eq3(15,z,s.data.mode===s.EFormMode.EDIT)),e.R7$(2),e.Y8G("ngClass",e.l_i(17,Q,s.data.mode===s.EFormMode.ADD,s.data.mode===s.EFormMode.EDIT)),e.R7$(2),e.Y8G("ngIf",s.data.mode===s.EFormMode.ADD),e.R7$(2),e.Y8G("ngIf",s.lastError),e.R7$(4),e.Y8G("ngIf",s.data.mode!==s.EFormMode.VIEW),e.R7$(1),e.Y8G("ngIf",s.loading.form),e.R7$(1),e.Y8G("modalId","idMonacoEditorModalInRedisDashboard")("editorOptionsMonacoEditorModal",s.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[c.qT,c.me,c.Q0,c.BC,c.cb,c.j4,c.JD,p.YU,p.bT,x.U,b.A,T.p,M.J],encapsulation:2})}return n})();const q=["redisNewKeyFormC"];function ee(n,i){if(1&n&&(e.j41(0,"span",7)(1,"h4",8),e.EFF(2),e.k0s()()),2&n){const t=e.XpG(2);e.R7$(2),e.JRh(t.constantsS.redis.setupExternalRedis)}}function te(n,i){if(1&n){const t=e.RV6();e.j41(0,"span",28),e.bIt("click",function(){e.eBV(t);const s=e.XpG(4);return e.Njj(s.keyDelete())}),e.nrm(1,"i",29),e.k0s()}}function se(n,i){if(1&n&&(e.j41(0,"div",30),e.EFF(1),e.k0s()),2&n){const t=i.$implicit;e.R7$(1),e.JRh(t.label)}}function ae(n,i){1&n&&e.nrm(0,"p-progressSpinner",31)}function ne(n,i){if(1&n){const t=e.RV6();e.j41(0,"div",11)(1,"div",12)(2,"span"),e.nrm(3,"img",13),e.EFF(4," Redis Dashboard"),e.k0s(),e.j41(5,"span")(6,"div",14)(7,"a",15),e.nrm(8,"img",16),e.k0s()(),e.j41(9,"span",17),e.bIt("click",function(){e.eBV(t);const s=e.XpG(3);return e.Njj(s.add())}),e.nrm(10,"i",18),e.k0s(),e.j41(11,"span",19),e.bIt("click",function(){e.eBV(t);const s=e.XpG(3);return e.Njj(s.loadRedisDataList())}),e.nrm(12,"i",20),e.k0s(),e.DNE(13,te,2,0,"span",21),e.j41(14,"span",22),e.bIt("click",function(){e.eBV(t);const s=e.XpG(3);return e.Njj(s.flushAll())}),e.nrm(15,"i",23),e.k0s()()(),e.j41(16,"div",24)(17,"p-tree",25),e.bIt("selectionChange",function(s){e.eBV(t);const r=e.XpG(3);return e.Njj(r.selectedKeys=s)})("selectionChange",function(){e.eBV(t);const s=e.XpG(3);return e.Njj(s.selectedKeysChange())}),e.DNE(18,se,2,1,"ng-template",26),e.k0s(),e.DNE(19,ae,1,0,"p-progressSpinner",27),e.k0s()()}if(2&n){const t=e.XpG(3);e.R7$(13),e.Y8G("ngIf",null==t.selectedKeys?null:t.selectedKeys.length),e.R7$(4),e.Y8G("value",t.parsedData)("selection",t.selectedKeys)("filter",!0)("metaKeySelection",!0),e.R7$(2),e.Y8G("ngIf",t.loading.grid)}}function oe(n,i){if(1&n){const t=e.RV6();e.j41(0,"span",39),e.bIt("click",function(){e.eBV(t);const s=e.XpG(4);return e.Njj(s.update())}),e.nrm(1,"i",40),e.j41(2,"span"),e.EFF(3,"Update"),e.k0s()()}}function ie(n,i){if(1&n){const t=e.RV6();e.j41(0,"span",39),e.bIt("click",function(){e.eBV(t);const s=e.XpG(4);return e.Njj(s.updateTTL())}),e.nrm(1,"i",40),e.j41(2,"span"),e.EFF(3,"UpdateTTL"),e.k0s()()}}function re(n,i){if(1&n&&(e.j41(0,"span",41)(1,"span"),e.EFF(2),e.k0s()()),2&n){const t=e.XpG(4);e.R7$(2),e.JRh(t.ttlValue)}}function le(n,i){if(1&n){const t=e.RV6();e.j41(0,"div",11)(1,"div",12)(2,"span",32),e.nrm(3,"i",33),e.EFF(4," Redis "),e.k0s(),e.j41(5,"span",34),e.EFF(6),e.k0s(),e.DNE(7,oe,4,0,"span",35),e.DNE(8,ie,4,0,"span",35),e.DNE(9,re,3,1,"span",36),e.k0s(),e.j41(10,"div",37)(11,"app-monaco-editor",38),e.bIt("editorGenerated",function(s){e.eBV(t);const r=e.XpG(3);return e.Njj(r.editorGenerated(s))}),e.k0s()()()}if(2&n){const t=e.XpG(3);e.R7$(6),e.JRh(null==t.selectedKeys||null==t.selectedKeys[0]?null:t.selectedKeys[0].key),e.R7$(1),e.Y8G("ngIf",null==t.selectedKeys||null==t.selectedKeys[0]?null:t.selectedKeys[0].key),e.R7$(1),e.Y8G("ngIf",null==t.selectedKeys||null==t.selectedKeys[0]?null:t.selectedKeys[0].key),e.R7$(1),e.Y8G("ngIf",(null==t.selectedKeys||null==t.selectedKeys[0]?null:t.selectedKeys[0].key)&&t.ttlValue>0),e.R7$(2),e.Y8G("isSchemaEditor",!1)("editorOptions",t.editorOptionsSchema)}}const de=function(){return{height:"100%"}},ce=function(){return[30,70]};function me(n,i){1&n&&(e.j41(0,"p-splitter",9),e.DNE(1,ne,20,6,"ng-template",10),e.DNE(2,le,12,6,"ng-template",10),e.k0s()),2&n&&(e.Aen(e.lJ4(3,de)),e.Y8G("panelSizes",e.lJ4(4,ce)))}function pe(n,i){if(1&n&&(e.j41(0,"div",3)(1,"div",4),e.DNE(2,ee,3,1,"span",5),e.DNE(3,me,3,5,"p-splitter",6),e.k0s()()),2&n){const t=e.XpG();e.R7$(2),e.Y8G("ngIf",!t.isExternalRedisSetupDoneByRoot),e.R7$(1),e.Y8G("ngIf",t.isExternalRedisSetupDoneByRoot)}}let fe=(()=>{class n{monacoS;generalS;ns;authCS;constantsS;cd;confirmationService;instanceS;isDependentOnGroup=!0;selectByKey="_id";treeNodes=[];subscriptions=[];selectedKeys;allTreeItemsMap={};editor;editorOptionsSchema={readOnly:!1,language:"json",contextmenu:!0};loading={grid:!1};selectedItem;autoCompleteData=[];BE_HOST_PORT=g.c.BE_HOST_PORT;redisNewKeyFormC;data={mode:m.X.ADD,eventChannel:new e.bkB,formData:void 0};virtual={itemHeight:28};parsedData;ttlValue;intervalRef;constructor(t,a,s,r,f,u,_,ve){this.monacoS=t,this.generalS=a,this.ns=s,this.authCS=r,this.constantsS=f,this.cd=u,this.confirmationService=_,this.instanceS=ve}ngOnInit(){this.getExternalRedisSetupFromPackageJson(),this.loadRedisDataList(),this.startTTLReduceInterval(),this.subscriptions.push(this.data.eventChannel.subscribe(t=>{t&&(t.action===d.K.SAVED?(this.redisNewKeyFormC.hideModal(),this.loadRedisDataList()):t.action===d.K.UPDATED&&(this.redisNewKeyFormC.hideModal(),this.loadRedisDataList(),this.ttlValue=t.data))})),this.generalS.setNewTitle("API Maker - Redis Dashboard")}loadRedisDataList(){var t=this;return(0,l.A)(function*(){t.loading.grid=!0;const a=(yield t.instanceS.getRedisKeysTree().toPromise()).data;for(const r of a)t.generalS.convertKTreeItemToPrimeNGTreeItem(r);const s={};t.generalS.getMapOfAllItems(s,a),t.parsedData=a,t.treeNodes=t.parsedData,t.allTreeItemsMap=s,t.loading.grid=!1,t.cd.detectChanges()})()}selectedKeysChange(){var t=this;return(0,l.A)(function*(){if(t.ttlValue="",1===t.selectedKeys.length){const a=t.selectedKeys[0];if(a.children?.length)t.editor.setValue("");else{const s=yield t.instanceS.getRedisValue(a.key).toPromise();s?.data?.value&&(t.editor.setValue("string"==typeof s?.data?.value?s.data.value:JSON.stringify(s?.data?.value,null,4)),s?.data?.ttl>0&&(t.ttlValue=s.data.ttl))}}else t.editor.setValue("")})()}startTTLReduceInterval(){this.intervalRef=setInterval(()=>{this.ttlValue>0&&this.ttlValue--},1e3)}stopTTLReduceInterval(){clearInterval(this.intervalRef)}update(){var t=this;return(0,l.A)(function*(){try{t.loading.grid=!0;const a={keyName:t.selectedKeys[0].key,redisCodeStr:t.editor.getValue(),ttl:t.ttlValue};yield t.instanceS.updateRedisKeys(a),t.data.mode=m.X.EDIT,t.ns.showSuccess(t.constantsS.redis.editSuccess),t.loading.grid=!1}catch(a){t.loading.grid=!1,t.ns.showErrorFromResponse(a.error||a,"Unable to update.")}})()}updateTTL(){var t=this;return(0,l.A)(function*(){try{const a={keyName:t.selectedKeys[0].key,redisCodeStr:t.editor.getValue(),ttl:t.ttlValue};t.data.formData=void 0,t.data.mode=m.X.EDIT,t.data.eventChannel.emit({action:d.K.OPEN_FORM_IN_EDIT_MODE,data:a}),t.redisNewKeyFormC.showModal()}catch(a){t.loading.grid=!1,t.ns.showErrorFromResponse(a.error||a,"Unable to update TTL.")}})()}editorGenerated(t){var a=this;return(0,l.A)(function*(){a.editor=t,yield a.monacoS.loadSchemaEditorSettings(a.BE_HOST_PORT,a.authCS.getUserId(),null)})()}add(){this.data.formData=void 0,this.data.mode=m.X.ADD,this.data.eventChannel.emit({action:d.K.OPEN_FORM_IN_ADD_MODE}),this.redisNewKeyFormC.showModal()}keyDelete(){var t=this;return(0,l.A)(function*(){var a;t.confirmationService.confirm({message:t.constantsS.redis.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(a=(0,l.A)(function*(){yield t.removePermanent()}),function(){return a.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,l.A)(function*(){t.loading.grid=!0;const a=yield t.instanceS.redisKeyPermanentDelete(k.map(t.selectedKeys,"key")).toPromise();t.loading.grid=!1,a.success?(t.ns.showSuccess(t.constantsS.redis.removePermanent),t.loadRedisDataList(),t.editor.setValue(""),t.selectedKeys=[],t.ttlValue=""):t.ns.showErrorFromResponse(a,t.constantsS.redis.removePermanentError)})()}isExternalRedisSetupDoneByRoot;getExternalRedisSetupFromPackageJson(){var t=this;return(0,l.A)(function*(){t.loading.grid=!0;try{const a=(yield t.instanceS.getExternalSetupStatus().toPromise()).data;t.loading.grid=!1,t.isExternalRedisSetupDoneByRoot=!0===a.isRedisSetupDone}catch{t.isExternalRedisSetupDoneByRoot=!1}})()}flushAll(){var t=this;return(0,l.A)(function*(){var a;t.confirmationService.confirm({message:t.constantsS.redis.flushAllConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(a=(0,l.A)(function*(){yield t.flushAllData()}),function(){return a.apply(this,arguments)})})})()}flushAllData(){var t=this;return(0,l.A)(function*(){t.loading.grid=!0;const a=yield t.instanceS.resetCache().toPromise();t.loading.grid=!1,a.success?(t.ns.showSuccess("Flush operation completed."),t.loadRedisDataList(),t.selectedItem=!1,t.editor.setValue("")):t.ns.showErrorFromResponse(a,t.constantsS.redis.removePermanentError)})()}ngOnDestroy(){this.stopTTLReduceInterval(),this.generalS.unsubscribe(this.subscriptions)}ERequestMethod=I.mO;undefined=void 0;static \u0275fac=function(a){return new(a||n)(e.rXU(v.e),e.rXU(y.f),e.rXU(R.m),e.rXU(D.l),e.rXU(E.X),e.rXU(e.gRc),e.rXU(S.td),e.rXU(C.J))};static \u0275cmp=e.VBU({type:n,selectors:[["app-redis-dashboard"]],viewQuery:function(a,s){if(1&a&&e.GBs(q,5),2&a){let r;e.mGM(r=e.lsd())&&(s.redisNewKeyFormC=r.first)}},inputs:{isDependentOnGroup:["IsDependentOnGroup","isDependentOnGroup"]},decls:3,vars:2,consts:[["class","pt-1 pl-1 pr-1",4,"ngIf"],[3,"data"],["redisNewKeyFormC",""],[1,"pt-1","pl-1","pr-1"],[1,"overflow-hidden",2,"height","calc(100vh - 46px)"],["class","text-center",4,"ngIf"],[3,"panelSizes","style",4,"ngIf"],[1,"text-center"],[1,"mt-5","pt-5"],[3,"panelSizes"],["pTemplate",""],[1,"card","shadow-sm","h-100","w-100"],[1,"card-header"],["src","../../../../assets/images/icons/redis.png","alt","Redis",1,"fa-fw"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/dashboard/redis-dashboard.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],["pTooltip","Add New Key",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["pTooltip","Refresh",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-sync-alt","text-info","fa-fw"],["class","float-right cursor-pointer ml-3","pTooltip","Delete",3,"click",4,"ngIf"],["pTooltip","Flush redis database",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-warning"],[1,"card-body","p-0"],["selectionMode","multiple","scrollHeight","calc(100vh - 128px)",1,"w-full",3,"value","selection","filter","metaKeySelection","selectionChange"],["pTemplate","default"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["pTooltip","Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","text-danger","fa-fw"],[1,"w-100","prevent-text-selection","cursor-pointer"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"],[1,"align-top"],[1,"fas","fa-cog","text-danger","fa-fw","mr-1"],[1,"ml-2","d-inline-block",2,"color","#57be1e","max-width","700px"],["class","float-right cursor-pointer ml-3",3,"click",4,"ngIf"],["class","float-right text-info cursor-pointer ml-3",4,"ngIf"],[1,"overflow-hidden",2,"height","calc(100vh - 84px)"],[3,"isSchemaEditor","editorOptions","editorGenerated"],[1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],[1,"float-right","text-info","cursor-pointer","ml-3"]],template:function(a,s){1&a&&(e.DNE(0,pe,4,2,"div",0),e.nrm(1,"app-redis-new-key-form",1,2)),2&a&&(e.Y8G("ngIf",void 0!==s.isExternalRedisSetupDoneByRoot),e.R7$(1),e.Y8G("data",s.data))},dependencies:[p.bT,b.A,S.Ei,K.PH,T.p,G.O,j.m,Z]})}return n})();var ue=o(2818),_e=o(2508);const he=[{path:"",component:fe}];let ge=(()=>{class n{static \u0275fac=function(a){return new(a||n)};static \u0275mod=e.$C({type:n});static \u0275inj=e.G2t({imports:[N.iI.forChild(he),F.u,ue.DashboardM,_e.v]})}return n})()}}]);
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[2162],{2162:(ye,h,o)=>{o.r(h),o.d(h,{RedisDashboardM:()=>ge});var F=o(1709),N=o(7060),l=o(467),e=o(540),k=o(7376),d=o(8727),m=o(5046),I=o(6589),g=o(5312),v=o(3864),y=o(6129),R=o(6708),D=o(7237),E=o(1987),S=o(5779),C=o(6268),p=o(177),b=o(6914),K=o(9861),T=o(7515),G=o(572),j=o(8542),c=o(4341),w=o(9239),x=o(3478),M=o(4466);const O=["monacoEditorModalC"];function V(n,i){1&n&&(e.j41(0,"span"),e.nrm(1,"i",28),e.EFF(2," Add New Key"),e.k0s())}function A(n,i){1&n&&(e.j41(0,"span"),e.nrm(1,"i",29),e.EFF(2," View New Key"),e.k0s())}function X(n,i){1&n&&(e.j41(0,"span"),e.nrm(1,"i",30),e.EFF(2," Edit New Key"),e.k0s())}function B(n,i){1&n&&(e.j41(0,"label",31),e.EFF(1,"Key Name"),e.k0s())}function P(n,i){1&n&&(e.j41(0,"div",32),e.nrm(1,"input",33),e.k0s())}function U(n,i){if(1&n){const t=e.RV6();e.j41(0,"div",34)(1,"app-monaco-editor",35),e.bIt("editorGenerated",function(s){e.eBV(t);const r=e.XpG();return e.Njj(r.editorGenerated(s))}),e.k0s()()}if(2&n){const t=e.XpG();e.R7$(1),e.Y8G("isSchemaEditor",!0)("editorOptions",t.editorOptionsRedis)}}function Y(n,i){if(1&n){const t=e.RV6();e.j41(0,"a",36),e.bIt("click",function(){e.eBV(t);const s=e.XpG();return e.Njj(s.viewError())}),e.EFF(1,"View error"),e.k0s()}}function L(n,i){1&n&&(e.j41(0,"span"),e.EFF(1,"Save"),e.k0s())}function J(n,i){1&n&&(e.j41(0,"span"),e.EFF(1,"Update"),e.k0s())}function H(n,i){if(1&n){const t=e.RV6();e.j41(0,"button",37),e.bIt("click",function(){e.eBV(t);const s=e.XpG();return e.Njj(s.save())}),e.nrm(1,"i",38),e.DNE(2,L,2,0,"span",4),e.DNE(3,J,2,0,"span",4),e.k0s()}if(2&n){const t=e.XpG();e.Y8G("disabled",!(null!=t.form.get("keyName").value&&t.form.get("keyName").value.toString().trim())),e.R7$(2),e.Y8G("ngIf",t.data.mode===t.EFormMode.ADD),e.R7$(1),e.Y8G("ngIf",t.data.mode===t.EFormMode.EDIT)}}function W(n,i){1&n&&e.nrm(0,"p-progressSpinner",39)}const z=function(n){return{"col-3":n}},Q=function(n,i){return{"col-3":n,"col-6":i}};let Z=(()=>{class n{fb;ns;monacoS;instanceS;constantsS;authCS;generalCS;data;loading={form:!1};EFormMode=m.X;form;subscriptions=[];editorRedis;editorOptionsRedis={readOnly:!1,language:"json",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};BE_HOST_PORT=g.c.BE_HOST_PORT;viewDockerfileModelC;actualKeyData;constructor(t,a,s,r,f,u,_){this.fb=t,this.ns=a,this.monacoS=s,this.instanceS=r,this.constantsS=f,this.authCS=u,this.generalCS=_}ngOnInit(){var t=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var a=(0,l.A)(function*(s){s&&(t.form.enable(),s.action===d.K.OPEN_FORM_IN_EDIT_MODE?(t.actualKeyData=s,t.form.reset(),t.form.get("ttl").setValue(t.actualKeyData.data.ttl),t.form.get("keyName").setValue(t.actualKeyData.data.keyName)):s.action===d.K.OPEN_FORM_IN_VIEW_MODE?(t.form.reset(),t.form.disable()):s.action===d.K.OPEN_FORM_IN_ADD_MODE&&(t.form.reset(),t.generalCS.setValueInEditor(t,"editorRedis","{}")))});return function(s){return a.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({keyName:[null,[c.k0.required]],ttl:[null,[c.k0.required]]})}showModal(){this.lastError=void 0,$("#idNewKeyForm").modal("show")}hideModal(){$("#idNewKeyForm").modal("hide")}save(){var t=this;return(0,l.A)(function*(){const a=t.form.getRawValue();a.redisCodeStr=t.editorRedis.getValue();try{let s;if(t.loading.form=!0,t.lastError=void 0,t.data.mode===m.X.ADD)s=yield t.instanceS.saveRedisKeys(a),t.ns.showSuccess(t.constantsS.redis.addSuccess),t.data.eventChannel.emit({action:t.data.mode===m.X.ADD?d.K.SAVED:d.K.UPDATED});else if(t.data.mode===m.X.EDIT){const r={keyName:t.actualKeyData.data.keyName,redisCodeStr:t.actualKeyData.data.redisCodeStr,ttl:t.form.get("ttl").value};yield t.instanceS.updateRedisKeys(r),t.ns.showSuccess(t.constantsS.redis.editSuccess),t.data.eventChannel.emit({action:d.K.UPDATED,data:t.form.get("ttl").value})}t.loading.form=!1}catch(s){t.loading.form=!1,t.ns.showErrorFromResponse(s.error||s,"Unable to save redis key."),t.lastError=s.error}})()}editorGenerated(t){var a=this;return(0,l.A)(function*(){a.editorRedis=t,yield a.monacoS.loadSchemaEditorSettings(a.BE_HOST_PORT,a.authCS.getUserId(),null),a.monacoS.addSaveCodeKeyBinding(t,s=>{a.form.valid&&a.save()})})()}viewError(){this.viewDockerfileModelC.showModal(this.generalCS.stringify(this.lastError),w.L.json)}ngOnDestroy(){this.generalCS.unsubscribe(this.subscriptions)}static \u0275fac=function(a){return new(a||n)(e.rXU(c.ok),e.rXU(R.m),e.rXU(v.e),e.rXU(C.J),e.rXU(E.X),e.rXU(D.l),e.rXU(y.f))};static \u0275cmp=e.VBU({type:n,selectors:[["app-redis-new-key-form"]],viewQuery:function(a,s){if(1&a&&e.GBs(O,5),2&a){let r;e.mGM(r=e.lsd())&&(s.viewDockerfileModelC=r.first)}},inputs:{data:"data"},decls:32,vars:20,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idNewKeyForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-lg"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],["href","https://docs.apimaker.dev/v1/docs/dashboard/redis-dashboard.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","mt-1","mr-1",2,"font-size","22px"],[1,"modal-body","overflow-auto"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],["class","col-2 col-form-label col-form-label-sm text-right",4,"ngIf"],["class","col-6",4,"ngIf"],[1,"col-form-label","col-form-label-sm","text-right",3,"ngClass"],[3,"ngClass"],["formControlName","ttl","name","ttl","spellcheck","false","type","number","placeholder","Please provide value",1,"form-control","form-control-sm"],["class","overflow-hidden mb-3","style","height: calc(100vh - 270px);",4,"ngIf"],[1,"modal-footer"],["href","javascript:;","class","text-danger",3,"click",4,"ngIf"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],[1,"col-2","col-form-label","col-form-label-sm","text-right"],[1,"col-6"],["formControlName","keyName","name","keyName","spellcheck","false","type","text","placeholder","Please provide key name",1,"form-control","form-control-sm"],[1,"overflow-hidden","mb-3",2,"height","calc(100vh - 270px)"],[3,"isSchemaEditor","editorOptions","editorGenerated"],["href","javascript:;",1,"text-danger",3,"click"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,s){1&a&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.DNE(4,V,3,0,"span",4),e.DNE(5,A,3,0,"span",4),e.DNE(6,X,3,0,"span",4),e.j41(7,"div",5)(8,"button",6)(9,"span",7),e.nrm(10,"i",8),e.k0s()(),e.j41(11,"a",9),e.nrm(12,"img",10),e.k0s()()(),e.j41(13,"div",11)(14,"form",12)(15,"div",13),e.DNE(16,B,2,0,"label",14),e.DNE(17,P,2,0,"div",15),e.j41(18,"label",16),e.EFF(19,"TTL"),e.k0s(),e.j41(20,"div",17),e.nrm(21,"input",18),e.k0s()(),e.DNE(22,U,2,2,"div",19),e.k0s()(),e.j41(23,"div",20),e.DNE(24,Y,2,0,"a",21),e.j41(25,"button",22),e.nrm(26,"i",23),e.EFF(27," Close"),e.k0s(),e.DNE(28,H,4,3,"button",24),e.k0s(),e.DNE(29,W,1,0,"p-progressSpinner",25),e.k0s()()(),e.nrm(30,"app-monaco-editor-modal",26,27)),2&a&&(e.R7$(4),e.Y8G("ngIf",s.data.mode===s.EFormMode.ADD),e.R7$(1),e.Y8G("ngIf",s.data.mode===s.EFormMode.VIEW),e.R7$(1),e.Y8G("ngIf",s.data.mode===s.EFormMode.EDIT),e.R7$(8),e.Y8G("formGroup",s.form),e.R7$(2),e.Y8G("ngIf",s.data.mode===s.EFormMode.ADD),e.R7$(1),e.Y8G("ngIf",s.data.mode===s.EFormMode.ADD),e.R7$(1),e.Y8G("ngClass",e.eq3(15,z,s.data.mode===s.EFormMode.EDIT)),e.R7$(2),e.Y8G("ngClass",e.l_i(17,Q,s.data.mode===s.EFormMode.ADD,s.data.mode===s.EFormMode.EDIT)),e.R7$(2),e.Y8G("ngIf",s.data.mode===s.EFormMode.ADD),e.R7$(2),e.Y8G("ngIf",s.lastError),e.R7$(4),e.Y8G("ngIf",s.data.mode!==s.EFormMode.VIEW),e.R7$(1),e.Y8G("ngIf",s.loading.form),e.R7$(1),e.Y8G("modalId","idMonacoEditorModalInRedisDashboard")("editorOptionsMonacoEditorModal",s.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[c.qT,c.me,c.Q0,c.BC,c.cb,c.j4,c.JD,p.YU,p.bT,x.U,b.A,T.p,M.J],encapsulation:2})}return n})();const q=["redisNewKeyFormC"];function ee(n,i){if(1&n&&(e.j41(0,"span",7)(1,"h4",8),e.EFF(2),e.k0s()()),2&n){const t=e.XpG(2);e.R7$(2),e.JRh(t.constantsS.redis.setupExternalRedis)}}function te(n,i){if(1&n){const t=e.RV6();e.j41(0,"span",28),e.bIt("click",function(){e.eBV(t);const s=e.XpG(4);return e.Njj(s.keyDelete())}),e.nrm(1,"i",29),e.k0s()}}function se(n,i){if(1&n&&(e.j41(0,"div",30),e.EFF(1),e.k0s()),2&n){const t=i.$implicit;e.R7$(1),e.JRh(t.label)}}function ae(n,i){1&n&&e.nrm(0,"p-progressSpinner",31)}function ne(n,i){if(1&n){const t=e.RV6();e.j41(0,"div",11)(1,"div",12)(2,"span"),e.nrm(3,"img",13),e.EFF(4," Redis Dashboard"),e.k0s(),e.j41(5,"span")(6,"div",14)(7,"a",15),e.nrm(8,"img",16),e.k0s()(),e.j41(9,"span",17),e.bIt("click",function(){e.eBV(t);const s=e.XpG(3);return e.Njj(s.add())}),e.nrm(10,"i",18),e.k0s(),e.j41(11,"span",19),e.bIt("click",function(){e.eBV(t);const s=e.XpG(3);return e.Njj(s.loadRedisDataList())}),e.nrm(12,"i",20),e.k0s(),e.DNE(13,te,2,0,"span",21),e.j41(14,"span",22),e.bIt("click",function(){e.eBV(t);const s=e.XpG(3);return e.Njj(s.flushAll())}),e.nrm(15,"i",23),e.k0s()()(),e.j41(16,"div",24)(17,"p-tree",25),e.bIt("selectionChange",function(s){e.eBV(t);const r=e.XpG(3);return e.Njj(r.selectedKeys=s)})("selectionChange",function(){e.eBV(t);const s=e.XpG(3);return e.Njj(s.selectedKeysChange())}),e.DNE(18,se,2,1,"ng-template",26),e.k0s(),e.DNE(19,ae,1,0,"p-progressSpinner",27),e.k0s()()}if(2&n){const t=e.XpG(3);e.R7$(13),e.Y8G("ngIf",null==t.selectedKeys?null:t.selectedKeys.length),e.R7$(4),e.Y8G("value",t.parsedData)("selection",t.selectedKeys)("filter",!0)("metaKeySelection",!0),e.R7$(2),e.Y8G("ngIf",t.loading.grid)}}function oe(n,i){if(1&n){const t=e.RV6();e.j41(0,"span",39),e.bIt("click",function(){e.eBV(t);const s=e.XpG(4);return e.Njj(s.update())}),e.nrm(1,"i",40),e.j41(2,"span"),e.EFF(3,"Update"),e.k0s()()}}function ie(n,i){if(1&n){const t=e.RV6();e.j41(0,"span",39),e.bIt("click",function(){e.eBV(t);const s=e.XpG(4);return e.Njj(s.updateTTL())}),e.nrm(1,"i",40),e.j41(2,"span"),e.EFF(3,"UpdateTTL"),e.k0s()()}}function re(n,i){if(1&n&&(e.j41(0,"span",41)(1,"span"),e.EFF(2),e.k0s()()),2&n){const t=e.XpG(4);e.R7$(2),e.JRh(t.ttlValue)}}function le(n,i){if(1&n){const t=e.RV6();e.j41(0,"div",11)(1,"div",12)(2,"span",32),e.nrm(3,"i",33),e.EFF(4," Redis "),e.k0s(),e.j41(5,"span",34),e.EFF(6),e.k0s(),e.DNE(7,oe,4,0,"span",35),e.DNE(8,ie,4,0,"span",35),e.DNE(9,re,3,1,"span",36),e.k0s(),e.j41(10,"div",37)(11,"app-monaco-editor",38),e.bIt("editorGenerated",function(s){e.eBV(t);const r=e.XpG(3);return e.Njj(r.editorGenerated(s))}),e.k0s()()()}if(2&n){const t=e.XpG(3);e.R7$(6),e.JRh(null==t.selectedKeys||null==t.selectedKeys[0]?null:t.selectedKeys[0].key),e.R7$(1),e.Y8G("ngIf",null==t.selectedKeys||null==t.selectedKeys[0]?null:t.selectedKeys[0].key),e.R7$(1),e.Y8G("ngIf",null==t.selectedKeys||null==t.selectedKeys[0]?null:t.selectedKeys[0].key),e.R7$(1),e.Y8G("ngIf",(null==t.selectedKeys||null==t.selectedKeys[0]?null:t.selectedKeys[0].key)&&t.ttlValue>0),e.R7$(2),e.Y8G("isSchemaEditor",!1)("editorOptions",t.editorOptionsSchema)}}const de=function(){return{height:"100%"}},ce=function(){return[30,70]};function me(n,i){1&n&&(e.j41(0,"p-splitter",9),e.DNE(1,ne,20,6,"ng-template",10),e.DNE(2,le,12,6,"ng-template",10),e.k0s()),2&n&&(e.Aen(e.lJ4(3,de)),e.Y8G("panelSizes",e.lJ4(4,ce)))}function pe(n,i){if(1&n&&(e.j41(0,"div",3)(1,"div",4),e.DNE(2,ee,3,1,"span",5),e.DNE(3,me,3,5,"p-splitter",6),e.k0s()()),2&n){const t=e.XpG();e.R7$(2),e.Y8G("ngIf",!t.isExternalRedisSetupDoneByRoot),e.R7$(1),e.Y8G("ngIf",t.isExternalRedisSetupDoneByRoot)}}let fe=(()=>{class n{monacoS;generalS;ns;authCS;constantsS;cd;confirmationService;instanceS;isDependentOnGroup=!0;selectByKey="_id";treeNodes=[];subscriptions=[];selectedKeys;allTreeItemsMap={};editor;editorOptionsSchema={readOnly:!1,language:"json",contextmenu:!0};loading={grid:!1};selectedItem;autoCompleteData=[];BE_HOST_PORT=g.c.BE_HOST_PORT;redisNewKeyFormC;data={mode:m.X.ADD,eventChannel:new e.bkB,formData:void 0};virtual={itemHeight:28};parsedData;ttlValue;intervalRef;constructor(t,a,s,r,f,u,_,ve){this.monacoS=t,this.generalS=a,this.ns=s,this.authCS=r,this.constantsS=f,this.cd=u,this.confirmationService=_,this.instanceS=ve}ngOnInit(){this.getExternalRedisSetupFromPackageJson(),this.loadRedisDataList(),this.startTTLReduceInterval(),this.subscriptions.push(this.data.eventChannel.subscribe(t=>{t&&(t.action===d.K.SAVED?(this.redisNewKeyFormC.hideModal(),this.loadRedisDataList()):t.action===d.K.UPDATED&&(this.redisNewKeyFormC.hideModal(),this.loadRedisDataList(),this.ttlValue=t.data))})),this.generalS.setNewTitle("API Maker - Redis Dashboard")}loadRedisDataList(){var t=this;return(0,l.A)(function*(){t.loading.grid=!0;const a=(yield t.instanceS.getRedisKeysTree().toPromise()).data;for(const r of a)t.generalS.convertKTreeItemToPrimeNGTreeItem(r);const s={};t.generalS.getMapOfAllItems(s,a),t.parsedData=a,t.treeNodes=t.parsedData,t.allTreeItemsMap=s,t.loading.grid=!1,t.cd.detectChanges()})()}selectedKeysChange(){var t=this;return(0,l.A)(function*(){if(t.ttlValue="",1===t.selectedKeys.length){const a=t.selectedKeys[0];if(a.children?.length)t.editor.setValue("");else{const s=yield t.instanceS.getRedisValue(a.key).toPromise();s?.data?.value&&(t.editor.setValue("string"==typeof s?.data?.value?s.data.value:JSON.stringify(s?.data?.value,null,4)),s?.data?.ttl>0&&(t.ttlValue=s.data.ttl))}}else t.editor.setValue("")})()}startTTLReduceInterval(){this.intervalRef=setInterval(()=>{this.ttlValue>0&&this.ttlValue--},1e3)}stopTTLReduceInterval(){clearInterval(this.intervalRef)}update(){var t=this;return(0,l.A)(function*(){try{t.loading.grid=!0;const a={keyName:t.selectedKeys[0].key,redisCodeStr:t.editor.getValue(),ttl:t.ttlValue};yield t.instanceS.updateRedisKeys(a),t.data.mode=m.X.EDIT,t.ns.showSuccess(t.constantsS.redis.editSuccess),t.loading.grid=!1}catch(a){t.loading.grid=!1,t.ns.showErrorFromResponse(a.error||a,"Unable to update.")}})()}updateTTL(){var t=this;return(0,l.A)(function*(){try{const a={keyName:t.selectedKeys[0].key,redisCodeStr:t.editor.getValue(),ttl:t.ttlValue};t.data.formData=void 0,t.data.mode=m.X.EDIT,t.data.eventChannel.emit({action:d.K.OPEN_FORM_IN_EDIT_MODE,data:a}),t.redisNewKeyFormC.showModal()}catch(a){t.loading.grid=!1,t.ns.showErrorFromResponse(a.error||a,"Unable to update TTL.")}})()}editorGenerated(t){var a=this;return(0,l.A)(function*(){a.editor=t,yield a.monacoS.loadSchemaEditorSettings(a.BE_HOST_PORT,a.authCS.getUserId(),null)})()}add(){this.data.formData=void 0,this.data.mode=m.X.ADD,this.data.eventChannel.emit({action:d.K.OPEN_FORM_IN_ADD_MODE}),this.redisNewKeyFormC.showModal()}keyDelete(){var t=this;return(0,l.A)(function*(){var a;t.confirmationService.confirm({message:t.constantsS.redis.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(a=(0,l.A)(function*(){yield t.removePermanent()}),function(){return a.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,l.A)(function*(){t.loading.grid=!0;const a=yield t.instanceS.redisKeyPermanentDelete(k.map(t.selectedKeys,"key")).toPromise();t.loading.grid=!1,a.success?(t.ns.showSuccess(t.constantsS.redis.removePermanent),t.loadRedisDataList(),t.editor.setValue(""),t.selectedKeys=[],t.ttlValue=""):t.ns.showErrorFromResponse(a,t.constantsS.redis.removePermanentError)})()}isExternalRedisSetupDoneByRoot;getExternalRedisSetupFromPackageJson(){var t=this;return(0,l.A)(function*(){t.loading.grid=!0;try{const a=(yield t.instanceS.getExternalSetupStatus().toPromise()).data;t.loading.grid=!1,t.isExternalRedisSetupDoneByRoot=!0===a.isRedisSetupDone}catch{t.isExternalRedisSetupDoneByRoot=!1}})()}flushAll(){var t=this;return(0,l.A)(function*(){var a;t.confirmationService.confirm({message:t.constantsS.redis.flushAllConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(a=(0,l.A)(function*(){yield t.flushAllData()}),function(){return a.apply(this,arguments)})})})()}flushAllData(){var t=this;return(0,l.A)(function*(){t.loading.grid=!0;const a=yield t.instanceS.resetCache().toPromise();t.loading.grid=!1,a.success?(t.ns.showSuccess("Flush operation completed."),t.loadRedisDataList(),t.selectedItem=!1,t.editor.setValue("")):t.ns.showErrorFromResponse(a,t.constantsS.redis.removePermanentError)})()}ngOnDestroy(){this.stopTTLReduceInterval(),this.generalS.unsubscribe(this.subscriptions)}ERequestMethod=I.mO;undefined=void 0;static \u0275fac=function(a){return new(a||n)(e.rXU(v.e),e.rXU(y.f),e.rXU(R.m),e.rXU(D.l),e.rXU(E.X),e.rXU(e.gRc),e.rXU(S.td),e.rXU(C.J))};static \u0275cmp=e.VBU({type:n,selectors:[["app-redis-dashboard"]],viewQuery:function(a,s){if(1&a&&e.GBs(q,5),2&a){let r;e.mGM(r=e.lsd())&&(s.redisNewKeyFormC=r.first)}},inputs:{isDependentOnGroup:["IsDependentOnGroup","isDependentOnGroup"]},decls:3,vars:2,consts:[["class","pt-1 pl-1 pr-1",4,"ngIf"],[3,"data"],["redisNewKeyFormC",""],[1,"pt-1","pl-1","pr-1"],[1,"overflow-hidden",2,"height","calc(100vh - 46px)"],["class","text-center",4,"ngIf"],[3,"panelSizes","style",4,"ngIf"],[1,"text-center"],[1,"mt-5","pt-5"],[3,"panelSizes"],["pTemplate",""],[1,"card","shadow-sm","h-100","w-100"],[1,"card-header"],["src","../../../../assets/images/icons/redis.png","alt","Redis",1,"fa-fw"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/dashboard/redis-dashboard.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],["pTooltip","Add New Key",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["pTooltip","Refresh",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-sync-alt","text-info","fa-fw"],["class","float-right cursor-pointer ml-3","pTooltip","Delete",3,"click",4,"ngIf"],["pTooltip","Flush redis database",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-warning"],[1,"card-body","p-0"],["selectionMode","multiple","scrollHeight","calc(100vh - 128px)",1,"w-full",3,"value","selection","filter","metaKeySelection","selectionChange"],["pTemplate","default"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["pTooltip","Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","text-danger","fa-fw"],[1,"w-100","prevent-text-selection","cursor-pointer"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"],[1,"align-top"],[1,"fas","fa-cog","text-danger","fa-fw","mr-1"],[1,"ml-2","d-inline-block",2,"color","#57be1e","max-width","700px"],["class","float-right cursor-pointer ml-3",3,"click",4,"ngIf"],["class","float-right text-info cursor-pointer ml-3",4,"ngIf"],[1,"overflow-hidden",2,"height","calc(100vh - 84px)"],[3,"isSchemaEditor","editorOptions","editorGenerated"],[1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],[1,"float-right","text-info","cursor-pointer","ml-3"]],template:function(a,s){1&a&&(e.DNE(0,pe,4,2,"div",0),e.nrm(1,"app-redis-new-key-form",1,2)),2&a&&(e.Y8G("ngIf",void 0!==s.isExternalRedisSetupDoneByRoot),e.R7$(1),e.Y8G("data",s.data))},dependencies:[p.bT,b.A,S.Ei,K.PH,T.p,G.O,j.m,Z]})}return n})();var ue=o(2818),_e=o(2508);const he=[{path:"",component:fe}];let ge=(()=>{class n{static \u0275fac=function(a){return new(a||n)};static \u0275mod=e.$C({type:n});static \u0275inj=e.G2t({imports:[N.iI.forChild(he),F.u,ue.DashboardM,_e.v]})}return n})()}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[2442],{2442:(ne,f,o)=>{o.r(f),o.d(f,{ExtLicensesM:()=>q});var v=o(7060),C=o(1570),I=o(7431),y=o(2173),c=o(467),m=o(1325),p=o(6645),S=o(5632),e=o(540),x=o(7237),L=o(3860),U=o(6129),k=o(6268),P=o(6708),b=o(4752),u=o(5779),F=o(1987),A=o(3966),l=o(4341),h=o(177),R=o(3478),g=o(7645),T=o(7515),j=o(8542);function w(i,r){1&i&&(e.j41(0,"span",5),e.nrm(1,"i",31),e.k0s())}function G(i,r){1&i&&(e.j41(0,"tr")(1,"th",32),e.EFF(2,"#"),e.k0s(),e.j41(3,"th",32),e.EFF(4,"\xa0"),e.k0s(),e.j41(5,"th",33),e.EFF(6,"License Key"),e.k0s(),e.j41(7,"th",34),e.EFF(8,"Server Info"),e.k0s(),e.j41(9,"th",35),e.EFF(10,"Action Required"),e.k0s(),e.j41(11,"th",36),e.EFF(12,"Actions"),e.k0s()())}function D(i,r){1&i&&(e.j41(0,"span"),e.nrm(1,"i",47),e.k0s())}function K(i,r){1&i&&(e.j41(0,"span"),e.nrm(1,"i",48),e.k0s())}function N(i,r){1&i&&(e.j41(0,"span"),e.nrm(1,"i",49),e.k0s())}function M(i,r){if(1&i){const t=e.RV6();e.j41(0,"div")(1,"span"),e.EFF(2),e.k0s(),e.j41(3,"a",50),e.bIt("click",function(){e.eBV(t);const n=e.XpG().$implicit,a=e.XpG();return e.Njj(a.hideLicenseKey(n))}),e.nrm(4,"i",51),e.k0s()()}if(2&i){const t=e.XpG().$implicit;e.R7$(2),e.JRh(t.licenseKey)}}function B(i,r){if(1&i){const t=e.RV6();e.j41(0,"div")(1,"span"),e.EFF(2,"\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7"),e.k0s(),e.j41(3,"a",50),e.bIt("click",function(){e.eBV(t);const n=e.XpG().$implicit,a=e.XpG();return e.Njj(a.showLicenseKey(n))}),e.nrm(4,"i",52),e.k0s()()}}function X(i,r){1&i&&(e.j41(0,"span"),e.nrm(1,"i",53),e.EFF(2," All good"),e.k0s())}function O(i,r){if(1&i&&(e.j41(0,"div")(1,"span"),e.EFF(2),e.k0s()()),2&i){const t=r.$implicit;e.R7$(2),e.SpI("\u274c ",t.message,"")}}function V(i,r){if(1&i&&(e.j41(0,"div"),e.DNE(1,O,3,1,"div",54),e.k0s()),2&i){const t=e.XpG().$implicit;e.R7$(1),e.Y8G("ngForOf",t.licenseError)}}function Y(i,r){if(1&i){const t=e.RV6();e.j41(0,"a",55),e.bIt("click",function(){e.eBV(t);const n=e.XpG().$implicit,a=e.XpG();return e.Njj(a.resetMacAddress(n))}),e.nrm(1,"i",56),e.k0s()}}function H(i,r){if(1&i){const t=e.RV6();e.j41(0,"a",57),e.bIt("click",function(){e.eBV(t);const n=e.XpG().$implicit,a=e.XpG();return e.Njj(a.showDialogToGetNewLicenseKey(n))}),e.nrm(1,"i",58),e.k0s()}}function J(i,r){if(1&i){const t=e.RV6();e.j41(0,"a",59),e.bIt("click",function(){e.eBV(t);const n=e.XpG().$implicit,a=e.XpG();return e.Njj(a.reduceUsage__click(n,"REDUCE_CPU_USAGE"))}),e.nrm(1,"i",60),e.k0s()}}function W(i,r){if(1&i){const t=e.RV6();e.j41(0,"a",61),e.bIt("click",function(){e.eBV(t);const n=e.XpG().$implicit,a=e.XpG();return e.Njj(a.reduceUsage__click(n,"REDUCE_UI_PAGES_USAGE"))}),e.nrm(1,"i",62),e.k0s()}}function Z(i,r){if(1&i&&(e.j41(0,"tr",37)(1,"td",38),e.EFF(2),e.k0s(),e.j41(3,"td",38),e.DNE(4,D,2,0,"span",39),e.DNE(5,K,2,0,"span",39),e.DNE(6,N,2,0,"span",39),e.k0s(),e.j41(7,"td",40),e.DNE(8,M,5,1,"div",39),e.DNE(9,B,5,0,"div",39),e.k0s(),e.j41(10,"td")(11,"span"),e.EFF(12),e.k0s(),e.nrm(13,"br"),e.j41(14,"a",41),e.EFF(15),e.k0s()(),e.j41(16,"td",42),e.DNE(17,X,3,0,"span",39),e.DNE(18,V,2,1,"div",39),e.k0s(),e.j41(19,"td",38),e.DNE(20,Y,2,0,"a",43),e.DNE(21,H,2,0,"a",44),e.DNE(22,J,2,0,"a",45),e.DNE(23,W,2,0,"a",46),e.k0s()()),2&i){const t=r.$implicit,s=r.rowIndex;e.Y8G("pSelectableRow",t),e.R7$(2),e.JRh(s+1),e.R7$(2),e.Y8G("ngIf","PENDING"===t.licenseCheckStatus),e.R7$(1),e.Y8G("ngIf","VALID"===t.licenseCheckStatus),e.R7$(1),e.Y8G("ngIf","INVALID"===t.licenseCheckStatus),e.R7$(2),e.Y8G("ngIf",t.showLicenseKey),e.R7$(1),e.Y8G("ngIf",!t.showLicenseKey),e.R7$(3),e.JRh(t.hostName),e.R7$(2),e.FS9("href",t.beHostPort,e.B4B),e.R7$(1),e.JRh(t.beHostPort),e.R7$(2),e.Y8G("ngIf","VALID"===t.licenseCheckStatus&&0===t.licenseError.length),e.R7$(1),e.Y8G("ngIf",t.licenseError.length),e.R7$(2),e.Y8G("ngIf",t.licenseActions.indexOf("RESET_MAC")>=0),e.R7$(1),e.Y8G("ngIf",t.licenseActions.indexOf("LICENSE_NOT_FOUND")>=0||t.licenseActions.indexOf("EXPIRED")>=0),e.R7$(1),e.Y8G("ngIf",t.licenseActions.indexOf("REDUCE_CPU_USAGE")>=0),e.R7$(1),e.Y8G("ngIf",t.licenseActions.indexOf("REDUCE_UI_PAGES_USAGE")>=0)}}function z(i,r){1&i&&e.nrm(0,"p-progressSpinner",63)}const Q=[{path:"",component:(()=>{class i{authCS;authS;generalCS;instanceS;ns;navigationS;confirmationService;constantsS;eventCenterS;EUserType=m.l;EAPICategory=S.O;gridKey=p.GX._id;loading={grid:!1};serverList=[];newLicenseKey="";setLicenseKeyForObj;showValidationInProgress;constructor(t,s,n,a,d,E,ee,te,se){this.authCS=t,this.authS=s,this.generalCS=n,this.instanceS=a,this.ns=d,this.navigationS=E,this.confirmationService=ee,this.constantsS=te,this.eventCenterS=se}ngOnInit(){return this.authS.backendSettings.extensions?this.authCS.gUser?.userType!==m.l.ADMIN?this.navigationS.gotoDashboard():(this.generalCS.setNewTitle("AM - Extensions Licenses"),void this.loadData().then()):this.navigationS.gotoDashboard()}loadData(){var t=this;return(0,c.A)(function*(){t.loading.grid=!0;try{t.serverList=[];const s=(yield t.instanceS.getFullSystemInfo().toPromise()).data,n=_.groupBy(s,p.qb.hostName);for(const a in n)t.serverList.push(n[a][0])}catch(s){console.log(s),t.ns.showErrorFromResponse(s.error||s,"Unable to load server information.")}t.loading.grid=!1})()}resetMacAddress(t){var s=this;return(0,c.A)(function*(){var n;s.confirmationService.confirm({message:s.constantsS.license.resetMacAddressConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(n=(0,c.A)(function*(){try{yield s.instanceS.resetMacAddressOfLicense({key:t.licenseKey}).toPromise(),s.ns.showSuccess("MAC address reset successfully."),s.setUIAfterFix(1e4)}catch(a){console.log(a),s.ns.showErrorFromResponse(a.error||a,"Unable to reset MAC address of license.")}}),function(){return n.apply(this,arguments)})})})()}showLicenseKey(t){t.showLicenseKey=!0}hideLicenseKey(t){t.showLicenseKey=!1}showModalSetLicenseKey(){$("#idSetLicenseKeyModal").modal("show")}hideModalSetLicenseKey(){$("#idSetLicenseKeyModal").modal("hide")}showDialogToGetNewLicenseKey(t){this.setLicenseKeyForObj=t,this.newLicenseKey=t.licenseKey,this.showModalSetLicenseKey()}setLicenseKeyAPICall(t){var s=this;return(0,c.A)(function*(){try{yield s.instanceS.setLicenseKeyOnServer({updateMode:"LICENSE_KEY",uniqueServerId:t.uniqueServerId,uniqueProcessId:t.uniqueProcessId,workerId:t.workerId,licenseKey:s.newLicenseKey,serverName:t.hostName}).toPromise(),s.hideModalSetLicenseKey(),s.ns.showSuccess("License key set successfully."),s.setUIAfterFix(6e3)}catch(n){console.log(n),s.ns.showErrorFromResponse(n.error||n,"Unable to reset MAC address of license.")}})()}reduceUsage__click(t,s){var n=this;let a="";var d;"REDUCE_CPU_USAGE"===s?a=this.constantsS.license.setCPUCoreConfirm:"REDUCE_UI_PAGES_USAGE"===s&&(a=this.constantsS.license.setUIPageCountConfirm),this.confirmationService.confirm({message:a,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(d=(0,c.A)(function*(){"REDUCE_CPU_USAGE"===s?yield n.hitReduceAPICallForCPU(t):"REDUCE_UI_PAGES_USAGE"===s&&(yield n.hitReduceAPICallForDBMasters(t))}),function(){return d.apply(this,arguments)})})}hitReduceAPICallForCPU(t){var s=this;return(0,c.A)(function*(){try{const n=(t.licenseError||[]).find(a=>a.licensePermitsCPU)?.licensePermitsCPU;if(!n)return void s.ns.showError("Unable to find CPU core issue in license error.");yield s.instanceS.setLicenseKeyOnServer({updateMode:"CPU_CORE",uniqueServerId:t.uniqueServerId,uniqueProcessId:t.uniqueProcessId,workerId:t.workerId,serverName:t.hostName,cpuCore:n}).toPromise(),s.hideModalSetLicenseKey(),s.ns.showSuccess("CPU core set successfully."),s.setUIAfterFix(1e4)}catch(n){console.log(n),s.ns.showErrorFromResponse(n.error||n,"Unable to set CPU core of license.")}})()}hitReduceAPICallForDBMasters(t){var s=this;return(0,c.A)(function*(){try{const n=(t.licenseError||[]).find(a=>a.licensePermitsDBMasterCount)?.licensePermitsDBMasterCount;if(!n)return void s.ns.showError("Unable to find UI Pages count issue in license error.");yield s.instanceS.setLicenseKeyOnServer({updateMode:"UI_PAGES_COUNT",uniqueServerId:t.uniqueServerId,uniqueProcessId:t.uniqueProcessId,workerId:t.workerId,serverName:t.hostName,dbMasterCount:n}).toPromise(),s.hideModalSetLicenseKey(),s.ns.showSuccess("UI Pages count set successfully."),s.setUIAfterFix(1e4)}catch(n){console.log(n),s.ns.showErrorFromResponse(n.error||n,"Unable to set UI Pages count of license.")}})()}setUIAfterFix(t){var s=this;this.loadData().then(),this.showValidationInProgress=!0,setTimeout((0,c.A)(function*(){yield s.loadData(),s.showValidationInProgress=!1,yield s.eventCenterS.headerC.setLicenseHasIssues(s.serverList)}),t)}static \u0275fac=function(s){return new(s||i)(e.rXU(x.l),e.rXU(L.Y),e.rXU(U.f),e.rXU(k.J),e.rXU(P.m),e.rXU(b.O),e.rXU(u.td),e.rXU(F.X),e.rXU(A.d))};static \u0275cmp=e.VBU({type:i,selectors:[["app-ext-licenses"]],decls:39,vars:7,consts:[[1,"pt-1","pl-1","pr-1"],[1,"full-body","overflow-hidden"],[1,"card"],[1,"card-header"],["src","/assets/images/icons/license.svg","alt","Extension license icon",1,"fa-fw","mr-1",2,"vertical-align","text-top"],[1,"float-right"],["class","float-right",4,"ngIf"],[1,"card-body","p-0","overflow-auto","text-center",2,"height","calc(100vh - 88px)"],["styleClass","p-datatable-striped custom-api-grid-height","scrollHeight","flex",3,"selectionMode","dataKey","scrollable","value"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idSetLicenseKeyModal","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-lg"],[1,"modal-content"],[1,"modal-header"],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],[1,"modal-body","overflow-auto"],[1,"container","pt-3"],[1,"form-group","row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],[1,"col-6"],["name","licenseKey","spellcheck","false","type","text","autocomplete","off",1,"form-control","form-control-sm","font-monospaced",3,"ngModel","ngModelChange"],[1,"modal-footer"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["tooltipPosition","left","pTooltip","Validation in progress.",1,"fas","fa-sync-alt","text-success","fa-fw","fa-spin"],[1,"text-center","bg-table-header",2,"width","30px"],[1,"bg-table-header",2,"width","300px"],[1,"bg-table-header",2,"width","240px"],[1,"bg-table-header"],[1,"text-center","bg-table-header",2,"width","125px"],[3,"pSelectableRow"],[1,"text-center"],[4,"ngIf"],[1,"small","font-monospaced"],["target","_blank",1,"ml-2","small","text-muted",3,"href"],[1,""],["class","btn btn-xsm-custom ml-1","pTooltip","Reset registered mac address.","tooltipPosition","left","href","javascript:",3,"click",4,"ngIf"],["class","btn btn-xsm-custom ml-1","pTooltip","Set license key","tooltipPosition","left","href","javascript:",3,"click",4,"ngIf"],["class","btn btn-xsm-custom ml-1","pTooltip","Set CPU core usage from license","tooltipPosition","left","href","javascript:",3,"click",4,"ngIf"],["class","btn btn-xsm-custom ml-1","pTooltip","Set UI Pages usage from license","tooltipPosition","left","href","javascript:",3,"click",4,"ngIf"],["pTooltip","License validation will happen in future.",1,"fas","fa-circle","text-warning"],["pTooltip","Valid license",1,"fas","fa-circle","text-success"],["pTooltip","Invalid license",1,"fas","fa-circle","text-danger"],["href","javascript:",1,"btn","btn-xsm-custom","ml-2",3,"click"],[1,"fas","fa-eye-slash","fa-fw","pt-1"],[1,"fas","fa-eye","fa-fw","pt-1"],[1,"fas","fa-check","fa-fw","text-success"],[4,"ngFor","ngForOf"],["pTooltip","Reset registered mac address.","tooltipPosition","left","href","javascript:",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"fas","fa-history","text-info","fa-fw","pt-1"],["pTooltip","Set license key","tooltipPosition","left","href","javascript:",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"fas","fa-wrench","text-success","fa-fw","pt-1"],["pTooltip","Set CPU core usage from license","tooltipPosition","left","href","javascript:",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"fas","fa-microchip","text-success","fa-fw","pt-1"],["pTooltip","Set UI Pages usage from license","tooltipPosition","left","href","javascript:",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"fab","fa-html5","text-success","fa-fw","pt-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(s,n){1&s&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"span"),e.nrm(5,"img",4),e.EFF(6," Server List "),e.k0s(),e.j41(7,"div",5),e.DNE(8,w,2,0,"span",6),e.k0s()(),e.j41(9,"div",7)(10,"p-table",8),e.DNE(11,G,13,0,"ng-template",9),e.DNE(12,Z,24,16,"ng-template",10),e.k0s(),e.DNE(13,z,1,0,"p-progressSpinner",11),e.k0s()()()(),e.j41(14,"div",12)(15,"div",13)(16,"div",14)(17,"div",15)(18,"span"),e.nrm(19,"i",16),e.EFF(20," Set License Key"),e.k0s(),e.j41(21,"button",17)(22,"span",18),e.nrm(23,"i",19),e.k0s()()(),e.j41(24,"div",20)(25,"form",21)(26,"div",22)(27,"label",23),e.EFF(28,"Name"),e.k0s(),e.j41(29,"div",24)(30,"input",25),e.bIt("ngModelChange",function(d){return n.newLicenseKey=d}),e.k0s()()()()(),e.j41(31,"div",26)(32,"button",27),e.nrm(33,"i",28),e.EFF(34," Close "),e.k0s(),e.j41(35,"button",29),e.bIt("click",function(){return n.setLicenseKeyAPICall(n.setLicenseKeyForObj)}),e.nrm(36,"i",30),e.j41(37,"span"),e.EFF(38,"Set Key"),e.k0s()()()()()()),2&s&&(e.R7$(8),e.Y8G("ngIf",n.showValidationInProgress),e.R7$(2),e.Y8G("selectionMode","multiple")("dataKey",n.gridKey)("scrollable",!0)("value",n.serverList),e.R7$(3),e.Y8G("ngIf",n.loading.grid),e.R7$(17),e.Y8G("ngModel",n.newLicenseKey))},dependencies:[l.qT,l.me,l.BC,l.cb,l.vS,l.cV,h.Sq,h.bT,R.U,g.XI,u.Ei,g.d5,T.p,j.m],styles:[".bg-table-header[_ngcontent-%COMP%]{background-color:#272727}"]})}return i})(),canActivate:[y.Z]}];let q=(()=>{class i{static \u0275fac=function(s){return new(s||i)};static \u0275mod=e.$C({type:i});static \u0275inj=e.G2t({imports:[v.iI.forChild(Q),I.u,C.P]})}return i})()}}]);
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[2442],{2442:(ne,f,o)=>{o.r(f),o.d(f,{ExtLicensesM:()=>q});var v=o(7060),C=o(1570),I=o(1709),y=o(2173),c=o(467),m=o(1325),p=o(6645),S=o(5632),e=o(540),x=o(7237),L=o(3860),U=o(6129),k=o(6268),P=o(6708),b=o(4752),u=o(5779),F=o(1987),A=o(3966),l=o(4341),h=o(177),R=o(3478),g=o(7645),T=o(7515),j=o(8542);function w(i,r){1&i&&(e.j41(0,"span",5),e.nrm(1,"i",31),e.k0s())}function G(i,r){1&i&&(e.j41(0,"tr")(1,"th",32),e.EFF(2,"#"),e.k0s(),e.j41(3,"th",32),e.EFF(4,"\xa0"),e.k0s(),e.j41(5,"th",33),e.EFF(6,"License Key"),e.k0s(),e.j41(7,"th",34),e.EFF(8,"Server Info"),e.k0s(),e.j41(9,"th",35),e.EFF(10,"Action Required"),e.k0s(),e.j41(11,"th",36),e.EFF(12,"Actions"),e.k0s()())}function D(i,r){1&i&&(e.j41(0,"span"),e.nrm(1,"i",47),e.k0s())}function K(i,r){1&i&&(e.j41(0,"span"),e.nrm(1,"i",48),e.k0s())}function N(i,r){1&i&&(e.j41(0,"span"),e.nrm(1,"i",49),e.k0s())}function M(i,r){if(1&i){const t=e.RV6();e.j41(0,"div")(1,"span"),e.EFF(2),e.k0s(),e.j41(3,"a",50),e.bIt("click",function(){e.eBV(t);const n=e.XpG().$implicit,a=e.XpG();return e.Njj(a.hideLicenseKey(n))}),e.nrm(4,"i",51),e.k0s()()}if(2&i){const t=e.XpG().$implicit;e.R7$(2),e.JRh(t.licenseKey)}}function B(i,r){if(1&i){const t=e.RV6();e.j41(0,"div")(1,"span"),e.EFF(2,"\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7"),e.k0s(),e.j41(3,"a",50),e.bIt("click",function(){e.eBV(t);const n=e.XpG().$implicit,a=e.XpG();return e.Njj(a.showLicenseKey(n))}),e.nrm(4,"i",52),e.k0s()()}}function X(i,r){1&i&&(e.j41(0,"span"),e.nrm(1,"i",53),e.EFF(2," All good"),e.k0s())}function O(i,r){if(1&i&&(e.j41(0,"div")(1,"span"),e.EFF(2),e.k0s()()),2&i){const t=r.$implicit;e.R7$(2),e.SpI("\u274c ",t.message,"")}}function V(i,r){if(1&i&&(e.j41(0,"div"),e.DNE(1,O,3,1,"div",54),e.k0s()),2&i){const t=e.XpG().$implicit;e.R7$(1),e.Y8G("ngForOf",t.licenseError)}}function Y(i,r){if(1&i){const t=e.RV6();e.j41(0,"a",55),e.bIt("click",function(){e.eBV(t);const n=e.XpG().$implicit,a=e.XpG();return e.Njj(a.resetMacAddress(n))}),e.nrm(1,"i",56),e.k0s()}}function H(i,r){if(1&i){const t=e.RV6();e.j41(0,"a",57),e.bIt("click",function(){e.eBV(t);const n=e.XpG().$implicit,a=e.XpG();return e.Njj(a.showDialogToGetNewLicenseKey(n))}),e.nrm(1,"i",58),e.k0s()}}function J(i,r){if(1&i){const t=e.RV6();e.j41(0,"a",59),e.bIt("click",function(){e.eBV(t);const n=e.XpG().$implicit,a=e.XpG();return e.Njj(a.reduceUsage__click(n,"REDUCE_CPU_USAGE"))}),e.nrm(1,"i",60),e.k0s()}}function W(i,r){if(1&i){const t=e.RV6();e.j41(0,"a",61),e.bIt("click",function(){e.eBV(t);const n=e.XpG().$implicit,a=e.XpG();return e.Njj(a.reduceUsage__click(n,"REDUCE_UI_PAGES_USAGE"))}),e.nrm(1,"i",62),e.k0s()}}function Z(i,r){if(1&i&&(e.j41(0,"tr",37)(1,"td",38),e.EFF(2),e.k0s(),e.j41(3,"td",38),e.DNE(4,D,2,0,"span",39),e.DNE(5,K,2,0,"span",39),e.DNE(6,N,2,0,"span",39),e.k0s(),e.j41(7,"td",40),e.DNE(8,M,5,1,"div",39),e.DNE(9,B,5,0,"div",39),e.k0s(),e.j41(10,"td")(11,"span"),e.EFF(12),e.k0s(),e.nrm(13,"br"),e.j41(14,"a",41),e.EFF(15),e.k0s()(),e.j41(16,"td",42),e.DNE(17,X,3,0,"span",39),e.DNE(18,V,2,1,"div",39),e.k0s(),e.j41(19,"td",38),e.DNE(20,Y,2,0,"a",43),e.DNE(21,H,2,0,"a",44),e.DNE(22,J,2,0,"a",45),e.DNE(23,W,2,0,"a",46),e.k0s()()),2&i){const t=r.$implicit,s=r.rowIndex;e.Y8G("pSelectableRow",t),e.R7$(2),e.JRh(s+1),e.R7$(2),e.Y8G("ngIf","PENDING"===t.licenseCheckStatus),e.R7$(1),e.Y8G("ngIf","VALID"===t.licenseCheckStatus),e.R7$(1),e.Y8G("ngIf","INVALID"===t.licenseCheckStatus),e.R7$(2),e.Y8G("ngIf",t.showLicenseKey),e.R7$(1),e.Y8G("ngIf",!t.showLicenseKey),e.R7$(3),e.JRh(t.hostName),e.R7$(2),e.FS9("href",t.beHostPort,e.B4B),e.R7$(1),e.JRh(t.beHostPort),e.R7$(2),e.Y8G("ngIf","VALID"===t.licenseCheckStatus&&0===t.licenseError.length),e.R7$(1),e.Y8G("ngIf",t.licenseError.length),e.R7$(2),e.Y8G("ngIf",t.licenseActions.indexOf("RESET_MAC")>=0),e.R7$(1),e.Y8G("ngIf",t.licenseActions.indexOf("LICENSE_NOT_FOUND")>=0||t.licenseActions.indexOf("EXPIRED")>=0),e.R7$(1),e.Y8G("ngIf",t.licenseActions.indexOf("REDUCE_CPU_USAGE")>=0),e.R7$(1),e.Y8G("ngIf",t.licenseActions.indexOf("REDUCE_UI_PAGES_USAGE")>=0)}}function z(i,r){1&i&&e.nrm(0,"p-progressSpinner",63)}const Q=[{path:"",component:(()=>{class i{authCS;authS;generalCS;instanceS;ns;navigationS;confirmationService;constantsS;eventCenterS;EUserType=m.l;EAPICategory=S.O;gridKey=p.GX._id;loading={grid:!1};serverList=[];newLicenseKey="";setLicenseKeyForObj;showValidationInProgress;constructor(t,s,n,a,d,E,ee,te,se){this.authCS=t,this.authS=s,this.generalCS=n,this.instanceS=a,this.ns=d,this.navigationS=E,this.confirmationService=ee,this.constantsS=te,this.eventCenterS=se}ngOnInit(){return this.authS.backendSettings.extensions?this.authCS.gUser?.userType!==m.l.ADMIN?this.navigationS.gotoDashboard():(this.generalCS.setNewTitle("AM - Extensions Licenses"),void this.loadData().then()):this.navigationS.gotoDashboard()}loadData(){var t=this;return(0,c.A)(function*(){t.loading.grid=!0;try{t.serverList=[];const s=(yield t.instanceS.getFullSystemInfo().toPromise()).data,n=_.groupBy(s,p.qb.hostName);for(const a in n)t.serverList.push(n[a][0])}catch(s){console.log(s),t.ns.showErrorFromResponse(s.error||s,"Unable to load server information.")}t.loading.grid=!1})()}resetMacAddress(t){var s=this;return(0,c.A)(function*(){var n;s.confirmationService.confirm({message:s.constantsS.license.resetMacAddressConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(n=(0,c.A)(function*(){try{yield s.instanceS.resetMacAddressOfLicense({key:t.licenseKey}).toPromise(),s.ns.showSuccess("MAC address reset successfully."),s.setUIAfterFix(1e4)}catch(a){console.log(a),s.ns.showErrorFromResponse(a.error||a,"Unable to reset MAC address of license.")}}),function(){return n.apply(this,arguments)})})})()}showLicenseKey(t){t.showLicenseKey=!0}hideLicenseKey(t){t.showLicenseKey=!1}showModalSetLicenseKey(){$("#idSetLicenseKeyModal").modal("show")}hideModalSetLicenseKey(){$("#idSetLicenseKeyModal").modal("hide")}showDialogToGetNewLicenseKey(t){this.setLicenseKeyForObj=t,this.newLicenseKey=t.licenseKey,this.showModalSetLicenseKey()}setLicenseKeyAPICall(t){var s=this;return(0,c.A)(function*(){try{yield s.instanceS.setLicenseKeyOnServer({updateMode:"LICENSE_KEY",uniqueServerId:t.uniqueServerId,uniqueProcessId:t.uniqueProcessId,workerId:t.workerId,licenseKey:s.newLicenseKey,serverName:t.hostName}).toPromise(),s.hideModalSetLicenseKey(),s.ns.showSuccess("License key set successfully."),s.setUIAfterFix(6e3)}catch(n){console.log(n),s.ns.showErrorFromResponse(n.error||n,"Unable to reset MAC address of license.")}})()}reduceUsage__click(t,s){var n=this;let a="";var d;"REDUCE_CPU_USAGE"===s?a=this.constantsS.license.setCPUCoreConfirm:"REDUCE_UI_PAGES_USAGE"===s&&(a=this.constantsS.license.setUIPageCountConfirm),this.confirmationService.confirm({message:a,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(d=(0,c.A)(function*(){"REDUCE_CPU_USAGE"===s?yield n.hitReduceAPICallForCPU(t):"REDUCE_UI_PAGES_USAGE"===s&&(yield n.hitReduceAPICallForDBMasters(t))}),function(){return d.apply(this,arguments)})})}hitReduceAPICallForCPU(t){var s=this;return(0,c.A)(function*(){try{const n=(t.licenseError||[]).find(a=>a.licensePermitsCPU)?.licensePermitsCPU;if(!n)return void s.ns.showError("Unable to find CPU core issue in license error.");yield s.instanceS.setLicenseKeyOnServer({updateMode:"CPU_CORE",uniqueServerId:t.uniqueServerId,uniqueProcessId:t.uniqueProcessId,workerId:t.workerId,serverName:t.hostName,cpuCore:n}).toPromise(),s.hideModalSetLicenseKey(),s.ns.showSuccess("CPU core set successfully."),s.setUIAfterFix(1e4)}catch(n){console.log(n),s.ns.showErrorFromResponse(n.error||n,"Unable to set CPU core of license.")}})()}hitReduceAPICallForDBMasters(t){var s=this;return(0,c.A)(function*(){try{const n=(t.licenseError||[]).find(a=>a.licensePermitsDBMasterCount)?.licensePermitsDBMasterCount;if(!n)return void s.ns.showError("Unable to find UI Pages count issue in license error.");yield s.instanceS.setLicenseKeyOnServer({updateMode:"UI_PAGES_COUNT",uniqueServerId:t.uniqueServerId,uniqueProcessId:t.uniqueProcessId,workerId:t.workerId,serverName:t.hostName,dbMasterCount:n}).toPromise(),s.hideModalSetLicenseKey(),s.ns.showSuccess("UI Pages count set successfully."),s.setUIAfterFix(1e4)}catch(n){console.log(n),s.ns.showErrorFromResponse(n.error||n,"Unable to set UI Pages count of license.")}})()}setUIAfterFix(t){var s=this;this.loadData().then(),this.showValidationInProgress=!0,setTimeout((0,c.A)(function*(){yield s.loadData(),s.showValidationInProgress=!1,yield s.eventCenterS.headerC.setLicenseHasIssues(s.serverList)}),t)}static \u0275fac=function(s){return new(s||i)(e.rXU(x.l),e.rXU(L.Y),e.rXU(U.f),e.rXU(k.J),e.rXU(P.m),e.rXU(b.O),e.rXU(u.td),e.rXU(F.X),e.rXU(A.d))};static \u0275cmp=e.VBU({type:i,selectors:[["app-ext-licenses"]],decls:39,vars:7,consts:[[1,"pt-1","pl-1","pr-1"],[1,"full-body","overflow-hidden"],[1,"card"],[1,"card-header"],["src","/assets/images/icons/license.svg","alt","Extension license icon",1,"fa-fw","mr-1",2,"vertical-align","text-top"],[1,"float-right"],["class","float-right",4,"ngIf"],[1,"card-body","p-0","overflow-auto","text-center",2,"height","calc(100vh - 88px)"],["styleClass","p-datatable-striped custom-api-grid-height","scrollHeight","flex",3,"selectionMode","dataKey","scrollable","value"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idSetLicenseKeyModal","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-lg"],[1,"modal-content"],[1,"modal-header"],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],[1,"modal-body","overflow-auto"],[1,"container","pt-3"],[1,"form-group","row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],[1,"col-6"],["name","licenseKey","spellcheck","false","type","text","autocomplete","off",1,"form-control","form-control-sm","font-monospaced",3,"ngModel","ngModelChange"],[1,"modal-footer"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["tooltipPosition","left","pTooltip","Validation in progress.",1,"fas","fa-sync-alt","text-success","fa-fw","fa-spin"],[1,"text-center","bg-table-header",2,"width","30px"],[1,"bg-table-header",2,"width","300px"],[1,"bg-table-header",2,"width","240px"],[1,"bg-table-header"],[1,"text-center","bg-table-header",2,"width","125px"],[3,"pSelectableRow"],[1,"text-center"],[4,"ngIf"],[1,"small","font-monospaced"],["target","_blank",1,"ml-2","small","text-muted",3,"href"],[1,""],["class","btn btn-xsm-custom ml-1","pTooltip","Reset registered mac address.","tooltipPosition","left","href","javascript:",3,"click",4,"ngIf"],["class","btn btn-xsm-custom ml-1","pTooltip","Set license key","tooltipPosition","left","href","javascript:",3,"click",4,"ngIf"],["class","btn btn-xsm-custom ml-1","pTooltip","Set CPU core usage from license","tooltipPosition","left","href","javascript:",3,"click",4,"ngIf"],["class","btn btn-xsm-custom ml-1","pTooltip","Set UI Pages usage from license","tooltipPosition","left","href","javascript:",3,"click",4,"ngIf"],["pTooltip","License validation will happen in future.",1,"fas","fa-circle","text-warning"],["pTooltip","Valid license",1,"fas","fa-circle","text-success"],["pTooltip","Invalid license",1,"fas","fa-circle","text-danger"],["href","javascript:",1,"btn","btn-xsm-custom","ml-2",3,"click"],[1,"fas","fa-eye-slash","fa-fw","pt-1"],[1,"fas","fa-eye","fa-fw","pt-1"],[1,"fas","fa-check","fa-fw","text-success"],[4,"ngFor","ngForOf"],["pTooltip","Reset registered mac address.","tooltipPosition","left","href","javascript:",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"fas","fa-history","text-info","fa-fw","pt-1"],["pTooltip","Set license key","tooltipPosition","left","href","javascript:",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"fas","fa-wrench","text-success","fa-fw","pt-1"],["pTooltip","Set CPU core usage from license","tooltipPosition","left","href","javascript:",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"fas","fa-microchip","text-success","fa-fw","pt-1"],["pTooltip","Set UI Pages usage from license","tooltipPosition","left","href","javascript:",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"fab","fa-html5","text-success","fa-fw","pt-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(s,n){1&s&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"span"),e.nrm(5,"img",4),e.EFF(6," Server List "),e.k0s(),e.j41(7,"div",5),e.DNE(8,w,2,0,"span",6),e.k0s()(),e.j41(9,"div",7)(10,"p-table",8),e.DNE(11,G,13,0,"ng-template",9),e.DNE(12,Z,24,16,"ng-template",10),e.k0s(),e.DNE(13,z,1,0,"p-progressSpinner",11),e.k0s()()()(),e.j41(14,"div",12)(15,"div",13)(16,"div",14)(17,"div",15)(18,"span"),e.nrm(19,"i",16),e.EFF(20," Set License Key"),e.k0s(),e.j41(21,"button",17)(22,"span",18),e.nrm(23,"i",19),e.k0s()()(),e.j41(24,"div",20)(25,"form",21)(26,"div",22)(27,"label",23),e.EFF(28,"Name"),e.k0s(),e.j41(29,"div",24)(30,"input",25),e.bIt("ngModelChange",function(d){return n.newLicenseKey=d}),e.k0s()()()()(),e.j41(31,"div",26)(32,"button",27),e.nrm(33,"i",28),e.EFF(34," Close "),e.k0s(),e.j41(35,"button",29),e.bIt("click",function(){return n.setLicenseKeyAPICall(n.setLicenseKeyForObj)}),e.nrm(36,"i",30),e.j41(37,"span"),e.EFF(38,"Set Key"),e.k0s()()()()()()),2&s&&(e.R7$(8),e.Y8G("ngIf",n.showValidationInProgress),e.R7$(2),e.Y8G("selectionMode","multiple")("dataKey",n.gridKey)("scrollable",!0)("value",n.serverList),e.R7$(3),e.Y8G("ngIf",n.loading.grid),e.R7$(17),e.Y8G("ngModel",n.newLicenseKey))},dependencies:[l.qT,l.me,l.BC,l.cb,l.vS,l.cV,h.Sq,h.bT,R.U,g.XI,u.Ei,g.d5,T.p,j.m],styles:[".bg-table-header[_ngcontent-%COMP%]{background-color:#272727}"]})}return i})(),canActivate:[y.Z]}];let q=(()=>{class i{static \u0275fac=function(s){return new(s||i)};static \u0275mod=e.$C({type:i});static \u0275inj=e.G2t({imports:[v.iI.forChild(Q),I.u,C.P]})}return i})()}}]);
|