@sava-info-systems/api-maker-with-extensions 1.10.0 → 1.11.0
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/1025.js +1 -1
- package/dist/1097.js +1 -1
- package/dist/148.js +1 -1
- package/dist/1558.js +1 -1
- package/dist/1678.js +1 -1
- package/dist/1754.js +1 -1
- package/dist/1928.js +1 -1
- package/dist/1957.js +1 -1
- package/dist/2140.js +1 -1
- package/dist/2295.js +1 -1
- package/dist/2473.js +1 -1
- package/dist/2714.js +1 -1
- package/dist/2735.js +1 -1
- package/dist/2908.js +1 -1
- package/dist/3139.js +1 -1
- package/dist/3450.js +1 -1
- package/dist/4110.js +1 -1
- package/dist/4181.js +1 -1
- package/dist/4186.js +1 -1
- package/dist/4211.js +1 -1
- package/dist/4575.js +1 -1
- package/dist/4842.js +1 -1
- package/dist/485.js +1 -1
- package/dist/4895.js +1 -1
- package/dist/5249.js +1 -1
- package/dist/5334.js +1 -1
- package/dist/5421.js +1 -1
- package/dist/5679.js +1 -1
- package/dist/5761.js +1 -1
- package/dist/5765.js +1 -1
- package/dist/6236.js +1 -1
- package/dist/6393.js +1 -1
- package/dist/6401.js +1 -1
- package/dist/7368.js +1 -1
- package/dist/7436.js +1 -1
- package/dist/7470.js +1 -1
- package/dist/7649.js +1 -1
- package/dist/7975.js +1 -1
- package/dist/7977.js +1 -1
- package/dist/7987.js +1 -1
- package/dist/8125.js +1 -1
- package/dist/8266.js +1 -1
- package/dist/8296.js +1 -1
- package/dist/8841.js +1 -1
- package/dist/885.js +1 -1
- package/dist/891.js +1 -1
- package/dist/913.js +1 -1
- package/dist/9243.js +1 -1
- package/dist/9575.js +1 -1
- package/dist/9939.js +1 -1
- package/dist/assets/schema-types/InterfaceProps.ts +3 -1
- package/dist/assets/schema-types/types.ts +313 -12
- package/dist/common.js +1 -1
- package/dist/main.js +1 -1
- package/main.js +1 -1
- package/package.json +4 -4
- package/sandbox/assets/schema-types/types.js +41 -0
- package/sandbox/sandbox.js +1 -1
- package/src/assets/schema-types/types.ts +313 -12
- package/src/public/dist-db-masters/browser/main.js +49 -49
package/dist/2473.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[2473],{2473:(we,x,r)=>{r.r(x),r.d(x,{ApiUserM:()=>Ce});var G=r(7664),Y=r(8176),J=r(3726),e=r(4946),h=r(5219),k=r(5043),p=r(5861),c=r(3157),m=r(328),v=r(6212),_=r(6990),f=r(1162),U=r(5312),S=r(7240),A=r(9961),O=r(2189),C=r(5852),w=r(7414),I=r(2915),Z=r(6814),g=r(5431),y=r(7680),b=r(3259),d=r(95),Q=r(7672),F=r(553),L=r(9394),q=r(2660),V=r(8057);function K(a,o){1&a&&(e.TgZ(0,"span"),e._UZ(1,"i",23),e._uU(2," Add API User"),e.qZA())}function H(a,o){1&a&&(e.TgZ(0,"span"),e._UZ(1,"i",24),e._uU(2," View API User"),e.qZA())}function W(a,o){1&a&&(e.TgZ(0,"span"),e._UZ(1,"i",25),e._uU(2," Edit API User"),e.qZA())}function B(a,o){1&a&&(e.TgZ(0,"div",10)(1,"label",11),e._uU(2,"Password"),e.qZA(),e.TgZ(3,"div",12),e._UZ(4,"input",26),e.qZA()())}function z(a,o){if(1&a){const t=e.EpF();e.TgZ(0,"div",10)(1,"label",11),e._uU(2,"Swagger Token"),e.qZA(),e.TgZ(3,"div",12),e._UZ(4,"input",27),e.qZA(),e.TgZ(5,"div",28)(6,"button",29),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.generateRandomStringForSwaggerURLPart())}),e._UZ(7,"i",30),e.qZA()()()}}function j(a,o){if(1&a&&(e.TgZ(0,"div",10),e._UZ(1,"label",11),e.TgZ(2,"div",12)(3,"a",31),e._uU(4,"View Swagger JSON"),e.qZA()()()),2&a){const t=e.oxw();e.xp6(3),e.cQ8("href","",t.environment.BE_HOST_PORT+t.EApiPaths.API+t.EApiPaths.SITES+t.EModelApiPaths.INSTANCE,"/",t.authCS.gUser.apiPath,"/get-swagger-docs/",t.form.getRawValue().swaggerURLRandomPart,"",e.LSH)}}function X(a,o){1&a&&(e.TgZ(0,"span"),e._uU(1,"Save User"),e.qZA())}function ee(a,o){1&a&&(e.TgZ(0,"span"),e._uU(1,"Update User"),e.qZA())}function te(a,o){if(1&a){const t=e.EpF();e.TgZ(0,"button",32),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.save())}),e._UZ(1,"i",33),e.YNc(2,X,2,0,"span",4),e.YNc(3,ee,2,0,"span",4),e.qZA()}if(2&a){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function se(a,o){1&a&&e._UZ(0,"p-progressSpinner",34)}let P=(()=>{class a{fb;ns;apiUserS;generalS;constantsS;authCS;data;loading={form:!1};EFormMode=m.D;form;subscriptions=[];environment=F.N;constructor(t,i,s,n,l,u){this.fb=t,this.ns=i,this.apiUserS=s,this.generalS=n,this.constantsS=l,this.authCS=u}ngOnInit(){var t=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var i=(0,p.Z)(function*(s){if(s)if(t.form.enable(),s.action===c.F.OPEN_FORM_IN_EDIT_MODE){const n=yield t.apiUserS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(n.data),t.form.get("password").setValidators([]),t.form.get("password").updateValueAndValidity()}else if(s.action===c.F.OPEN_FORM_IN_VIEW_MODE){const n=yield t.apiUserS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(n.data),t.form.disable()}else s.action===c.F.OPEN_FORM_IN_ADD_MODE&&(t.form.reset(),t.form.get("password").setValidators([d.kI.required]),t.form.get("password").updateValueAndValidity())});return function(s){return i.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[d.kI.required]],username:[null,[d.kI.required]],password:[null,[]],swaggerURLRandomPart:[null,[]],enableSwaggerDocs:[!1,[]]})}showModal(){$("#idApiUsersForm").modal("show")}hideModal(){$("#idApiUsersForm").modal("hide")}save(){var t=this;return(0,p.Z)(function*(){const i=t.form.getRawValue();i.user=t.authCS.getUserId();try{let s;if(t.loading.form=!0,t.data.mode===m.D.ADD){if(!i.password)return t.loading.form=!1,t.ns.showError(t.constantsS.apiUser.passwordError);t.processDataBeforeSaveOrUpdate(i),s=yield t.apiUserS.post(i).toPromise()}else t.data.mode===m.D.EDIT&&(t.form.get("password").value||delete i.password,t.processDataBeforeSaveOrUpdate(i),s=yield t.apiUserS.put(t.data.formData._id,i,{select:f.iH._id}).toPromise());t.ns.showSuccess(t.data.mode===m.D.ADD?t.constantsS.apiUser.addSuccess:t.constantsS.apiUser.editSuccess),t.data.eventChannel.emit({action:t.data.mode===m.D.ADD?c.F.SAVED:c.F.UPDATED}),t.loading.form=!1}catch(s){t.loading.form=!1,t.ns.showErrorFromResponse(s.error||s,"Unable to save user info.")}})()}processDataBeforeSaveOrUpdate(t){t.password&&(t.password=this.generalS.getEncryptedString(t.password,F.N.crypto.passCommunication))}generateRandomStringForSwaggerURLPart(){this.form.patchValue({swaggerURLRandomPart:this.generalS.getRandomStringWithCapitals(32)})}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}EApiPaths=Q.k$;EModelApiPaths=L.k4;static \u0275fac=function(i){return new(i||a)(e.Y36(d.qu),e.Y36(A.W),e.Y36(U.q),e.Y36(S.b),e.Y36(w.L),e.Y36(C.D))};static \u0275cmp=e.Xpm({type:a,selectors:[["app-w-api-user-form"]],inputs:{data:"data"},decls:36,vars:10,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idApiUsersForm","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"],["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",3,"formGroup"],[1,"form-group","row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],[1,"col-6"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],["formControlName","username","name","username","spellcheck","false","type","text","placeholder","Please provide username",1,"form-control","form-control-sm"],["class","form-group row",4,"ngIf"],[1,"align-middle","mb-0","pt-1"],["formControlName","enableSwaggerDocs","label","Enable Swagger Docs",3,"binary"],[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","password","name","password","spellcheck","false","type","password","placeholder","Please provide password",1,"form-control","form-control-sm"],["formControlName","swaggerURLRandomPart","name","swaggerURLRandomPart","spellcheck","false","type","text","placeholder","Please generate random URL",1,"form-control","form-control-sm"],[1,"col-2","pl-0"],["pTooltip","Generate random swagger token","type","button",1,"btn","btn-sm","btn-outline-info",3,"click"],[1,"fas","fa-star-of-life","text-info","fa-fw"],["target","_blank",3,"href"],["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(i,s){1&i&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,K,3,0,"span",4),e.YNc(5,H,3,0,"span",4),e.YNc(6,W,3,0,"span",4),e.TgZ(7,"button",5)(8,"span",6),e._UZ(9,"i",7),e.qZA()()(),e.TgZ(10,"div",8)(11,"form",9)(12,"div",10)(13,"label",11),e._uU(14,"Name"),e.qZA(),e.TgZ(15,"div",12),e._UZ(16,"input",13),e.qZA()(),e.TgZ(17,"div",10)(18,"label",11),e._uU(19,"Username"),e.qZA(),e.TgZ(20,"div",12),e._UZ(21,"input",14),e.qZA()(),e.YNc(22,B,5,0,"div",15),e.TgZ(23,"div",10),e._UZ(24,"label",11),e.TgZ(25,"div",12)(26,"label",16),e._UZ(27,"p-checkbox",17),e.qZA()()(),e.YNc(28,z,8,0,"div",15),e.YNc(29,j,5,3,"div",15),e.qZA()(),e.TgZ(30,"div",18)(31,"button",19),e._UZ(32,"i",20),e._uU(33," Close"),e.qZA(),e.YNc(34,te,4,3,"button",21),e.qZA(),e.YNc(35,se,1,0,"p-progressSpinner",22),e.qZA()()()),2&i&&(e.xp6(4),e.Q6J("ngIf",s.data.mode===s.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",s.data.mode===s.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",s.data.mode===s.EFormMode.EDIT),e.xp6(5),e.Q6J("formGroup",s.form),e.xp6(11),e.Q6J("ngIf",s.data.mode!==s.EFormMode.VIEW),e.xp6(5),e.Q6J("binary",!0),e.xp6(1),e.Q6J("ngIf",s.form.getRawValue().enableSwaggerDocs),e.xp6(1),e.Q6J("ngIf",s.form.getRawValue().enableSwaggerDocs&&s.form.getRawValue().swaggerURLRandomPart),e.xp6(5),e.Q6J("ngIf",s.data.mode!==s.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",s.loading.form))},dependencies:[d._Y,d.Fj,d.JJ,d.JL,d.sg,d.u,Z.O5,q.y,y.G,b.u,V.XZ],encapsulation:2})}return a})();const ae=["apiUserFormC"];function ie(a,o){if(1&a){const t=e.EpF();e.TgZ(0,"span",17),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.edit())}),e._UZ(1,"i",18),e.qZA()}}function re(a,o){if(1&a){const t=e.EpF();e.TgZ(0,"span",19),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.removePermanentDialog())}),e._UZ(1,"i",20),e.qZA()}}function ne(a,o){1&a&&(e.TgZ(0,"tr")(1,"th"),e._uU(2,"Name"),e.qZA(),e.TgZ(3,"th"),e._uU(4,"Username"),e.qZA()())}function oe(a,o){if(1&a&&(e.TgZ(0,"tr",21)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA()()),2&a){const t=o.$implicit;e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(t.name),e.xp6(2),e.Oqu(t.username)}}function le(a,o){1&a&&e._UZ(0,"p-progressSpinner",22)}let E=(()=>{class a{apiUserS;generalS;notificationS;navigationCS;authCS;constantsS;confirmationService;eventCenterS;loading={grid:!1};subscriptions=[];data={mode:m.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;selectedRows=[];gridKey=f.iH._id;apiUserFormC;constructor(t,i,s,n,l,u,T,D){this.apiUserS=t,this.generalS=i,this.notificationS=s,this.navigationCS=n,this.authCS=l,this.constantsS=u,this.confirmationService=T,this.eventCenterS=D}ngOnInit(){this.eventCenterS.apiUser.selectedApiUsers.next([]),this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(t=>{(t.action===c.F.SAVED||t.action===c.F.UPDATED)&&(this.apiUserFormC.hideModal(),this.loadGridData())})),this.generalS.setNewTitle("API Maker - API Users")}loadGridData(){var t=this;this.loading.grid=!0;const i={find:{user:this.authCS.getUserId(),active:!0},select:{name:1,username:1,active:1},sort:{name:1}};this.showAll&&delete i.find.active,this.subscriptions.push(this.apiUserS.query(i).subscribe(function(){var s=(0,p.Z)(function*(n){if(n.success&&(t.selectedRows=[],t.rows=n.data,t.rowsMap=_.keyBy(t.rows,f.iH._id),t.rows[0]?._id)){const l=(yield t.apiUserS.getById(t.rows[0]._id).toPromise()).data;l._id&&(yield t.navigationCS.setQueryParam(v.p.api_user,l._id),t.eventCenterS.apiUser.selectedApiUsers.next([l]),t.selectedRows=[l],yield t.fillData())}t.generalS.setNewTitle("API Maker - API Users"),t.loading.grid=!1});return function(n){return s.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=m.D.ADD,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_ADD_MODE}),this.apiUserFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=m.D.VIEW,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_VIEW_MODE}),this.apiUserFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=m.D.EDIT,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_EDIT_MODE}),this.apiUserFormC.showModal()}removePermanentDialog(){var t=this;return(0,p.Z)(function*(){var i;t.confirmationService.confirm({message:t.constantsS.apiUser.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(i=(0,p.Z)(function*(){yield t.removePermanent()}),function(){return i.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,p.Z)(function*(){t.loading.grid=!0;const i=yield t.apiUserS.permanentDelete(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,i.success?(t.notificationS.showSuccess(t.constantsS.apiUser.removePermanent),t.resetSelectedRows(),t.loadGridData()):t.notificationS.showErrorFromResponse(i,t.constantsS.apiUser.removePermanentError)})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.apiUser.selectedApiUsers.next([])}resetDependents(){var t=this;return(0,p.Z)(function*(){t.eventCenterS.apiUser.selectedApiUsers.next([]),yield t.navigationCS.setQueryParam(v.p.api_user,null)})()}apiUserSelected(){var t=this;return(0,p.Z)(function*(){yield t.resetDependents(),yield t.fillData()})()}fillData(){var t=this;return(0,p.Z)(function*(){if(!t.selectedRows.length)return yield t.navigationCS.setQueryParam(v.p.api_user,""),void t.eventCenterS.apiUser.selectedApiUsers.next([]);const i=(yield t.apiUserS.getById(t.selectedRows[0]._id).toPromise()).data;i._id?(yield t.navigationCS.setQueryParam(v.p.api_user,i._id),t.eventCenterS.apiUser.selectedApiUsers.next([i])):t.resetDependents().then()})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickUsers(){this.selectedRows.length&&this.edit()}static \u0275fac=function(i){return new(i||a)(e.Y36(U.q),e.Y36(S.b),e.Y36(A.W),e.Y36(O.S),e.Y36(C.D),e.Y36(w.L),e.Y36(h.YP),e.Y36(I.u))};static \u0275cmp=e.Xpm({type:a,selectors:[["app-w-api-users"]],viewQuery:function(i,s){if(1&i&&e.Gf(ae,5),2&i){let n;e.iGM(n=e.CRH())&&(s.apiUserFormC=n.first)}},decls:19,vars:10,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/api-user.svg","alt","API Group Permissions",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/apis-security/api-user-permission.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",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","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"],[3,"data"],["apiUserFormC",""],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],[3,"pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(i,s){1&i&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"img",2),e._uU(4," API Users"),e.qZA(),e.TgZ(5,"div",3)(6,"a",4),e._UZ(7,"img",5),e.qZA()(),e.TgZ(8,"span",6),e.NdJ("click",function(){return s.add()}),e._UZ(9,"i",7),e.qZA(),e.YNc(10,ie,2,0,"span",8),e.YNc(11,re,2,0,"span",9),e.qZA(),e.TgZ(12,"div",10)(13,"p-table",11),e.NdJ("selectionChange",function(l){return s.selectedRows=l})("dblclick",function(){return s.dblClickUsers()})("selectionChange",function(){return s.apiUserSelected()}),e.YNc(14,ne,5,0,"ng-template",12),e.YNc(15,oe,5,3,"ng-template",13),e.qZA(),e.YNc(16,le,1,0,"p-progressSpinner",14),e.qZA()(),e._UZ(17,"app-w-api-user-form",15,16)),2&i&&(e.xp6(10),e.Q6J("ngIf",s.selectedRows.length),e.xp6(1),e.Q6J("ngIf",s.selectedRows.length),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",s.selectedRows)("dataKey",s.gridKey)("scrollable",!0)("value",s.rows),e.xp6(3),e.Q6J("ngIf",s.loading.grid),e.xp6(1),e.Q6J("data",s.data))},dependencies:[Z.O5,g.iA,h.jx,g.Ei,y.G,b.u,P],encapsulation:2})}return a})();var pe=r(1426),ce=r(8883),de=r(5561);function me(a,o){if(1&a){const t=e.EpF();e.TgZ(0,"span",10),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.saveUserPermissions())}),e._UZ(1,"i",11),e._uU(2," Save"),e.qZA()}}function ue(a,o){1&a&&(e.TgZ(0,"tr"),e._UZ(1,"th",15),e.TgZ(2,"th"),e._uU(3,"Name"),e.qZA()())}function fe(a,o){if(1&a&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",18),e.qZA()),2&a){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("value",t)("pSelectableRow",t)}}function ge(a,o){if(1&a&&(e.TgZ(0,"tr",16),e.YNc(1,fe,2,2,"td",17),e.TgZ(2,"td"),e._uU(3),e.qZA()()),2&a){const t=o.$implicit,i=e.oxw(2);e.Q6J("pSelectableRow",t),e.xp6(1),e.Q6J("ngIf",i.showCheckbox),e.xp6(2),e.Oqu(t.name)}}function he(a,o){if(1&a){const t=e.EpF();e.TgZ(0,"p-table",12),e.NdJ("selectionChange",function(s){e.CHM(t);const n=e.oxw();return e.KtG(n.selectedRows=s)})("selectionChange",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.apiGroupSelected())}),e.YNc(1,ue,4,0,"ng-template",13),e.YNc(2,ge,4,3,"ng-template",14),e.qZA()}if(2&a){const t=e.oxw();e.Q6J("selectionMode","multiple")("metaKeySelection",!1)("selection",t.selectedRows)("dataKey",t.gridKey)("scrollable",!0)("value",t.rows)}}function ve(a,o){1&a&&e._UZ(0,"p-progressSpinner",19)}let N=(()=>{class a{groupS;generalS;notificationS;navigationS;authCS;apiUserS;constantsS;eventCenterS;showCheckbox=!0;loading={grid:!1};subscriptions=[];data={eventChannel:new e.vpe};rows=[];rowsMap={};selectedRows=[];gridKey=f.IF.name;constructor(t,i,s,n,l,u,T,D){this.groupS=t,this.generalS=i,this.notificationS=s,this.navigationS=n,this.authCS=l,this.apiUserS=u,this.constantsS=T,this.eventCenterS=D}ngOnInit(){var t=this;this.eventCenterS.apiUser.selectedGroups.next([]),this.subscriptions.push(this.eventCenterS.apiUser.selectedApiUsers.pipe((0,pe.b)(10)).subscribe(function(){var i=(0,p.Z)(function*(s){s.length?yield t.loadGridData():t.resetList()});return function(s){return i.apply(this,arguments)}}()))}loadGridData(){var t=this;return(0,p.Z)(function*(){t.loading.grid=!0;const i={find:{user:t.authCS.getUserId(),active:!0},select:{name:1},sort:{name:1}},s=yield t.groupS.query(i).toPromise();if(s.success){t.selectedRows=[],t.rows=s.data,t.rowsMap=_.keyBy(t.rows,"name");const n=t.eventCenterS.apiUser.selectedApiUsers.value[0].groupNames||[],l=[];for(const u of n)t.rowsMap[u]&&l.push(t.rowsMap[u]);t.selectedRows=l,t.eventCenterS.apiUser.selectedGroups.next(_.map(t.selectedRows,"_id"))}t.loading.grid=!1})()}resetList(){var t=this;return(0,p.Z)(function*(){t.rows=[],t.rowsMap={},t.selectedRows.length=0,t.eventCenterS.apiUser.selectedGroups.next([])})()}apiGroupSelected(){var t=this;return(0,p.Z)(function*(){t.eventCenterS.apiUser.selectedGroups.next(_.map(t.selectedRows,t.gridKey))})()}saveUserPermissions(){var t=this;return(0,p.Z)(function*(){const i=JSON.parse(JSON.stringify(t.eventCenterS.apiUser.selectedApiUsers.value[0]));i.user=t.authCS.getUserId(),i.groupNames=t.eventCenterS.apiUser.selectedGroups.value||[],t.loading.grid=!0;const s=yield t.apiUserS.put(i._id,i,{select:f.iH._id}).toPromise();s&&s.success&&t.notificationS.showSuccess("User updated successfully."),t.loading.grid=!1})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(i){return new(i||a)(e.Y36(ce.e),e.Y36(S.b),e.Y36(A.W),e.Y36(de.X),e.Y36(C.D),e.Y36(U.q),e.Y36(w.L),e.Y36(I.u))};static \u0275cmp=e.Xpm({type:a,selectors:[["app-w-api-group-list"]],inputs:{showCheckbox:"showCheckbox"},decls:12,vars:3,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/api-group.svg","alt","API Group Permissions",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/apis-security/api-group-permission.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],["class","float-right cursor-pointer ml-3","pTooltip","Save",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["pTooltip","Save",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-save","fa-fw","text-success"],["styleClass","p-datatable-striped","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange"],["pTemplate","header"],["pTemplate","body"],[2,"width","40px"],[3,"pSelectableRow"],[4,"ngIf"],[3,"value","pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(i,s){1&i&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"img",2),e._uU(4," Groups"),e.qZA(),e.TgZ(5,"div",3)(6,"a",4),e._UZ(7,"img",5),e.qZA()(),e.YNc(8,me,3,0,"span",6),e.qZA(),e.TgZ(9,"div",7),e.YNc(10,he,3,6,"p-table",8),e.YNc(11,ve,1,0,"p-progressSpinner",9),e.qZA()()),2&i&&(e.xp6(8),e.Q6J("ngIf",s.eventCenterS.apiUser.selectedApiUsers.value.length),e.xp6(2),e.Q6J("ngIf",s.eventCenterS.apiUser.selectedApiUsers.value.length),e.xp6(1),e.Q6J("ngIf",s.loading.grid))},dependencies:[Z.O5,g.iA,h.jx,g.Ei,g.UA,y.G,b.u],encapsulation:2})}return a})();function _e(a,o){1&a&&(e.TgZ(0,"div",3),e._UZ(1,"app-w-api-users"),e.qZA())}function Ue(a,o){1&a&&(e.TgZ(0,"div",4),e._UZ(1,"app-w-api-group-list"),e.qZA())}const Se=function(){return{height:"calc(100% - 100px);"}},R=function(){return[50,50]};const Ae=[{path:"layout",component:(()=>{class a{constructor(){}ngOnInit(){}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=e.Xpm({type:a,selectors:[["app-api-user-layout"]],decls:4,vars:7,consts:[[1,"pt-1","pl-1","pr-1"],["styleClass","full-body border-0 shadow-sm mb-5","orientation","horizontal",3,"panelSizes","minSizes"],["pTemplate",""],[1,"col","flex","align-items-center","justify-content-center","pl-0","pr-1"],[1,"col","flex","align-items-center","justify-content-center","pl-1","pr-0"]],template:function(i,s){1&i&&(e.TgZ(0,"div",0)(1,"p-splitter",1),e.YNc(2,_e,2,0,"ng-template",2),e.YNc(3,Ue,2,0,"ng-template",2),e.qZA()()),2&i&&(e.xp6(1),e.Akn(e.DdM(4,Se)),e.Q6J("panelSizes",e.DdM(5,R))("minSizes",e.DdM(6,R)))},dependencies:[h.jx,k.q,E,N],encapsulation:2})}return a})(),canActivate:[J.P]}];let Ce=(()=>{class a{static \u0275fac=function(i){return new(i||a)};static \u0275mod=e.oAB({type:a});static \u0275inj=e.cJS({imports:[G.Bz.forChild(Ae),Y.u]})}return a})()}}]);
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[2473],{2473:(we,x,r)=>{r.r(x),r.d(x,{ApiUserM:()=>Ce});var G=r(7664),Y=r(8761),J=r(3726),e=r(4946),h=r(5219),k=r(5043),p=r(5861),c=r(3157),m=r(328),v=r(6212),_=r(6990),f=r(1162),U=r(5312),S=r(7240),A=r(9961),O=r(2189),C=r(5852),w=r(7414),I=r(2915),Z=r(6814),g=r(5431),y=r(7680),b=r(3259),d=r(95),Q=r(7672),F=r(553),L=r(9394),q=r(2660),V=r(8057);function K(a,o){1&a&&(e.TgZ(0,"span"),e._UZ(1,"i",23),e._uU(2," Add API User"),e.qZA())}function H(a,o){1&a&&(e.TgZ(0,"span"),e._UZ(1,"i",24),e._uU(2," View API User"),e.qZA())}function W(a,o){1&a&&(e.TgZ(0,"span"),e._UZ(1,"i",25),e._uU(2," Edit API User"),e.qZA())}function B(a,o){1&a&&(e.TgZ(0,"div",10)(1,"label",11),e._uU(2,"Password"),e.qZA(),e.TgZ(3,"div",12),e._UZ(4,"input",26),e.qZA()())}function z(a,o){if(1&a){const t=e.EpF();e.TgZ(0,"div",10)(1,"label",11),e._uU(2,"Swagger Token"),e.qZA(),e.TgZ(3,"div",12),e._UZ(4,"input",27),e.qZA(),e.TgZ(5,"div",28)(6,"button",29),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.generateRandomStringForSwaggerURLPart())}),e._UZ(7,"i",30),e.qZA()()()}}function j(a,o){if(1&a&&(e.TgZ(0,"div",10),e._UZ(1,"label",11),e.TgZ(2,"div",12)(3,"a",31),e._uU(4,"View Swagger JSON"),e.qZA()()()),2&a){const t=e.oxw();e.xp6(3),e.cQ8("href","",t.environment.BE_HOST_PORT+t.EApiPaths.API+t.EApiPaths.SITES+t.EModelApiPaths.INSTANCE,"/",t.authCS.gUser.apiPath,"/get-swagger-docs/",t.form.getRawValue().swaggerURLRandomPart,"",e.LSH)}}function X(a,o){1&a&&(e.TgZ(0,"span"),e._uU(1,"Save User"),e.qZA())}function ee(a,o){1&a&&(e.TgZ(0,"span"),e._uU(1,"Update User"),e.qZA())}function te(a,o){if(1&a){const t=e.EpF();e.TgZ(0,"button",32),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.save())}),e._UZ(1,"i",33),e.YNc(2,X,2,0,"span",4),e.YNc(3,ee,2,0,"span",4),e.qZA()}if(2&a){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function se(a,o){1&a&&e._UZ(0,"p-progressSpinner",34)}let P=(()=>{class a{fb;ns;apiUserS;generalS;constantsS;authCS;data;loading={form:!1};EFormMode=m.D;form;subscriptions=[];environment=F.N;constructor(t,i,s,n,l,u){this.fb=t,this.ns=i,this.apiUserS=s,this.generalS=n,this.constantsS=l,this.authCS=u}ngOnInit(){var t=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var i=(0,p.Z)(function*(s){if(s)if(t.form.enable(),s.action===c.F.OPEN_FORM_IN_EDIT_MODE){const n=yield t.apiUserS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(n.data),t.form.get("password").setValidators([]),t.form.get("password").updateValueAndValidity()}else if(s.action===c.F.OPEN_FORM_IN_VIEW_MODE){const n=yield t.apiUserS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(n.data),t.form.disable()}else s.action===c.F.OPEN_FORM_IN_ADD_MODE&&(t.form.reset(),t.form.get("password").setValidators([d.kI.required]),t.form.get("password").updateValueAndValidity())});return function(s){return i.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[d.kI.required]],username:[null,[d.kI.required]],password:[null,[]],swaggerURLRandomPart:[null,[]],enableSwaggerDocs:[!1,[]]})}showModal(){$("#idApiUsersForm").modal("show")}hideModal(){$("#idApiUsersForm").modal("hide")}save(){var t=this;return(0,p.Z)(function*(){const i=t.form.getRawValue();i.user=t.authCS.getUserId();try{let s;if(t.loading.form=!0,t.data.mode===m.D.ADD){if(!i.password)return t.loading.form=!1,t.ns.showError(t.constantsS.apiUser.passwordError);t.processDataBeforeSaveOrUpdate(i),s=yield t.apiUserS.post(i).toPromise()}else t.data.mode===m.D.EDIT&&(t.form.get("password").value||delete i.password,t.processDataBeforeSaveOrUpdate(i),s=yield t.apiUserS.put(t.data.formData._id,i,{select:f.iH._id}).toPromise());t.ns.showSuccess(t.data.mode===m.D.ADD?t.constantsS.apiUser.addSuccess:t.constantsS.apiUser.editSuccess),t.data.eventChannel.emit({action:t.data.mode===m.D.ADD?c.F.SAVED:c.F.UPDATED}),t.loading.form=!1}catch(s){t.loading.form=!1,t.ns.showErrorFromResponse(s.error||s,"Unable to save user info.")}})()}processDataBeforeSaveOrUpdate(t){t.password&&(t.password=this.generalS.getEncryptedString(t.password,F.N.crypto.passCommunication))}generateRandomStringForSwaggerURLPart(){this.form.patchValue({swaggerURLRandomPart:this.generalS.getRandomStringWithCapitals(32)})}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}EApiPaths=Q.k$;EModelApiPaths=L.k4;static \u0275fac=function(i){return new(i||a)(e.Y36(d.qu),e.Y36(A.W),e.Y36(U.q),e.Y36(S.b),e.Y36(w.L),e.Y36(C.D))};static \u0275cmp=e.Xpm({type:a,selectors:[["app-w-api-user-form"]],inputs:{data:"data"},decls:36,vars:10,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idApiUsersForm","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"],["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",3,"formGroup"],[1,"form-group","row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],[1,"col-6"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],["formControlName","username","name","username","spellcheck","false","type","text","placeholder","Please provide username",1,"form-control","form-control-sm"],["class","form-group row",4,"ngIf"],[1,"align-middle","mb-0","pt-1"],["formControlName","enableSwaggerDocs","label","Enable Swagger Docs",3,"binary"],[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","password","name","password","spellcheck","false","type","password","placeholder","Please provide password",1,"form-control","form-control-sm"],["formControlName","swaggerURLRandomPart","name","swaggerURLRandomPart","spellcheck","false","type","text","placeholder","Please generate random URL",1,"form-control","form-control-sm"],[1,"col-2","pl-0"],["pTooltip","Generate random swagger token","type","button",1,"btn","btn-sm","btn-outline-info",3,"click"],[1,"fas","fa-star-of-life","text-info","fa-fw"],["target","_blank",3,"href"],["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(i,s){1&i&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,K,3,0,"span",4),e.YNc(5,H,3,0,"span",4),e.YNc(6,W,3,0,"span",4),e.TgZ(7,"button",5)(8,"span",6),e._UZ(9,"i",7),e.qZA()()(),e.TgZ(10,"div",8)(11,"form",9)(12,"div",10)(13,"label",11),e._uU(14,"Name"),e.qZA(),e.TgZ(15,"div",12),e._UZ(16,"input",13),e.qZA()(),e.TgZ(17,"div",10)(18,"label",11),e._uU(19,"Username"),e.qZA(),e.TgZ(20,"div",12),e._UZ(21,"input",14),e.qZA()(),e.YNc(22,B,5,0,"div",15),e.TgZ(23,"div",10),e._UZ(24,"label",11),e.TgZ(25,"div",12)(26,"label",16),e._UZ(27,"p-checkbox",17),e.qZA()()(),e.YNc(28,z,8,0,"div",15),e.YNc(29,j,5,3,"div",15),e.qZA()(),e.TgZ(30,"div",18)(31,"button",19),e._UZ(32,"i",20),e._uU(33," Close"),e.qZA(),e.YNc(34,te,4,3,"button",21),e.qZA(),e.YNc(35,se,1,0,"p-progressSpinner",22),e.qZA()()()),2&i&&(e.xp6(4),e.Q6J("ngIf",s.data.mode===s.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",s.data.mode===s.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",s.data.mode===s.EFormMode.EDIT),e.xp6(5),e.Q6J("formGroup",s.form),e.xp6(11),e.Q6J("ngIf",s.data.mode!==s.EFormMode.VIEW),e.xp6(5),e.Q6J("binary",!0),e.xp6(1),e.Q6J("ngIf",s.form.getRawValue().enableSwaggerDocs),e.xp6(1),e.Q6J("ngIf",s.form.getRawValue().enableSwaggerDocs&&s.form.getRawValue().swaggerURLRandomPart),e.xp6(5),e.Q6J("ngIf",s.data.mode!==s.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",s.loading.form))},dependencies:[d._Y,d.Fj,d.JJ,d.JL,d.sg,d.u,Z.O5,q.y,y.G,b.u,V.XZ],encapsulation:2})}return a})();const ae=["apiUserFormC"];function ie(a,o){if(1&a){const t=e.EpF();e.TgZ(0,"span",17),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.edit())}),e._UZ(1,"i",18),e.qZA()}}function re(a,o){if(1&a){const t=e.EpF();e.TgZ(0,"span",19),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.removePermanentDialog())}),e._UZ(1,"i",20),e.qZA()}}function ne(a,o){1&a&&(e.TgZ(0,"tr")(1,"th"),e._uU(2,"Name"),e.qZA(),e.TgZ(3,"th"),e._uU(4,"Username"),e.qZA()())}function oe(a,o){if(1&a&&(e.TgZ(0,"tr",21)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA()()),2&a){const t=o.$implicit;e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(t.name),e.xp6(2),e.Oqu(t.username)}}function le(a,o){1&a&&e._UZ(0,"p-progressSpinner",22)}let E=(()=>{class a{apiUserS;generalS;notificationS;navigationCS;authCS;constantsS;confirmationService;eventCenterS;loading={grid:!1};subscriptions=[];data={mode:m.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;selectedRows=[];gridKey=f.iH._id;apiUserFormC;constructor(t,i,s,n,l,u,T,D){this.apiUserS=t,this.generalS=i,this.notificationS=s,this.navigationCS=n,this.authCS=l,this.constantsS=u,this.confirmationService=T,this.eventCenterS=D}ngOnInit(){this.eventCenterS.apiUser.selectedApiUsers.next([]),this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(t=>{(t.action===c.F.SAVED||t.action===c.F.UPDATED)&&(this.apiUserFormC.hideModal(),this.loadGridData())})),this.generalS.setNewTitle("API Maker - API Users")}loadGridData(){var t=this;this.loading.grid=!0;const i={find:{user:this.authCS.getUserId(),active:!0},select:{name:1,username:1,active:1},sort:{name:1}};this.showAll&&delete i.find.active,this.subscriptions.push(this.apiUserS.query(i).subscribe(function(){var s=(0,p.Z)(function*(n){if(n.success&&(t.selectedRows=[],t.rows=n.data,t.rowsMap=_.keyBy(t.rows,f.iH._id),t.rows[0]?._id)){const l=(yield t.apiUserS.getById(t.rows[0]._id).toPromise()).data;l._id&&(yield t.navigationCS.setQueryParam(v.p.api_user,l._id),t.eventCenterS.apiUser.selectedApiUsers.next([l]),t.selectedRows=[l],yield t.fillData())}t.generalS.setNewTitle("API Maker - API Users"),t.loading.grid=!1});return function(n){return s.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=m.D.ADD,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_ADD_MODE}),this.apiUserFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=m.D.VIEW,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_VIEW_MODE}),this.apiUserFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=m.D.EDIT,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_EDIT_MODE}),this.apiUserFormC.showModal()}removePermanentDialog(){var t=this;return(0,p.Z)(function*(){var i;t.confirmationService.confirm({message:t.constantsS.apiUser.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(i=(0,p.Z)(function*(){yield t.removePermanent()}),function(){return i.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,p.Z)(function*(){t.loading.grid=!0;const i=yield t.apiUserS.permanentDelete(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,i.success?(t.notificationS.showSuccess(t.constantsS.apiUser.removePermanent),t.resetSelectedRows(),t.loadGridData()):t.notificationS.showErrorFromResponse(i,t.constantsS.apiUser.removePermanentError)})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.apiUser.selectedApiUsers.next([])}resetDependents(){var t=this;return(0,p.Z)(function*(){t.eventCenterS.apiUser.selectedApiUsers.next([]),yield t.navigationCS.setQueryParam(v.p.api_user,null)})()}apiUserSelected(){var t=this;return(0,p.Z)(function*(){yield t.resetDependents(),yield t.fillData()})()}fillData(){var t=this;return(0,p.Z)(function*(){if(!t.selectedRows.length)return yield t.navigationCS.setQueryParam(v.p.api_user,""),void t.eventCenterS.apiUser.selectedApiUsers.next([]);const i=(yield t.apiUserS.getById(t.selectedRows[0]._id).toPromise()).data;i._id?(yield t.navigationCS.setQueryParam(v.p.api_user,i._id),t.eventCenterS.apiUser.selectedApiUsers.next([i])):t.resetDependents().then()})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickUsers(){this.selectedRows.length&&this.edit()}static \u0275fac=function(i){return new(i||a)(e.Y36(U.q),e.Y36(S.b),e.Y36(A.W),e.Y36(O.S),e.Y36(C.D),e.Y36(w.L),e.Y36(h.YP),e.Y36(I.u))};static \u0275cmp=e.Xpm({type:a,selectors:[["app-w-api-users"]],viewQuery:function(i,s){if(1&i&&e.Gf(ae,5),2&i){let n;e.iGM(n=e.CRH())&&(s.apiUserFormC=n.first)}},decls:19,vars:10,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/api-user.svg","alt","API Group Permissions",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/apis-security/api-user-permission.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",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","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"],[3,"data"],["apiUserFormC",""],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],[3,"pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(i,s){1&i&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"img",2),e._uU(4," API Users"),e.qZA(),e.TgZ(5,"div",3)(6,"a",4),e._UZ(7,"img",5),e.qZA()(),e.TgZ(8,"span",6),e.NdJ("click",function(){return s.add()}),e._UZ(9,"i",7),e.qZA(),e.YNc(10,ie,2,0,"span",8),e.YNc(11,re,2,0,"span",9),e.qZA(),e.TgZ(12,"div",10)(13,"p-table",11),e.NdJ("selectionChange",function(l){return s.selectedRows=l})("dblclick",function(){return s.dblClickUsers()})("selectionChange",function(){return s.apiUserSelected()}),e.YNc(14,ne,5,0,"ng-template",12),e.YNc(15,oe,5,3,"ng-template",13),e.qZA(),e.YNc(16,le,1,0,"p-progressSpinner",14),e.qZA()(),e._UZ(17,"app-w-api-user-form",15,16)),2&i&&(e.xp6(10),e.Q6J("ngIf",s.selectedRows.length),e.xp6(1),e.Q6J("ngIf",s.selectedRows.length),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",s.selectedRows)("dataKey",s.gridKey)("scrollable",!0)("value",s.rows),e.xp6(3),e.Q6J("ngIf",s.loading.grid),e.xp6(1),e.Q6J("data",s.data))},dependencies:[Z.O5,g.iA,h.jx,g.Ei,y.G,b.u,P],encapsulation:2})}return a})();var pe=r(1426),ce=r(8883),de=r(5561);function me(a,o){if(1&a){const t=e.EpF();e.TgZ(0,"span",10),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.saveUserPermissions())}),e._UZ(1,"i",11),e._uU(2," Save"),e.qZA()}}function ue(a,o){1&a&&(e.TgZ(0,"tr"),e._UZ(1,"th",15),e.TgZ(2,"th"),e._uU(3,"Name"),e.qZA()())}function fe(a,o){if(1&a&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",18),e.qZA()),2&a){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("value",t)("pSelectableRow",t)}}function ge(a,o){if(1&a&&(e.TgZ(0,"tr",16),e.YNc(1,fe,2,2,"td",17),e.TgZ(2,"td"),e._uU(3),e.qZA()()),2&a){const t=o.$implicit,i=e.oxw(2);e.Q6J("pSelectableRow",t),e.xp6(1),e.Q6J("ngIf",i.showCheckbox),e.xp6(2),e.Oqu(t.name)}}function he(a,o){if(1&a){const t=e.EpF();e.TgZ(0,"p-table",12),e.NdJ("selectionChange",function(s){e.CHM(t);const n=e.oxw();return e.KtG(n.selectedRows=s)})("selectionChange",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.apiGroupSelected())}),e.YNc(1,ue,4,0,"ng-template",13),e.YNc(2,ge,4,3,"ng-template",14),e.qZA()}if(2&a){const t=e.oxw();e.Q6J("selectionMode","multiple")("metaKeySelection",!1)("selection",t.selectedRows)("dataKey",t.gridKey)("scrollable",!0)("value",t.rows)}}function ve(a,o){1&a&&e._UZ(0,"p-progressSpinner",19)}let N=(()=>{class a{groupS;generalS;notificationS;navigationS;authCS;apiUserS;constantsS;eventCenterS;showCheckbox=!0;loading={grid:!1};subscriptions=[];data={eventChannel:new e.vpe};rows=[];rowsMap={};selectedRows=[];gridKey=f.IF.name;constructor(t,i,s,n,l,u,T,D){this.groupS=t,this.generalS=i,this.notificationS=s,this.navigationS=n,this.authCS=l,this.apiUserS=u,this.constantsS=T,this.eventCenterS=D}ngOnInit(){var t=this;this.eventCenterS.apiUser.selectedGroups.next([]),this.subscriptions.push(this.eventCenterS.apiUser.selectedApiUsers.pipe((0,pe.b)(10)).subscribe(function(){var i=(0,p.Z)(function*(s){s.length?yield t.loadGridData():t.resetList()});return function(s){return i.apply(this,arguments)}}()))}loadGridData(){var t=this;return(0,p.Z)(function*(){t.loading.grid=!0;const i={find:{user:t.authCS.getUserId(),active:!0},select:{name:1},sort:{name:1}},s=yield t.groupS.query(i).toPromise();if(s.success){t.selectedRows=[],t.rows=s.data,t.rowsMap=_.keyBy(t.rows,"name");const n=t.eventCenterS.apiUser.selectedApiUsers.value[0].groupNames||[],l=[];for(const u of n)t.rowsMap[u]&&l.push(t.rowsMap[u]);t.selectedRows=l,t.eventCenterS.apiUser.selectedGroups.next(_.map(t.selectedRows,"_id"))}t.loading.grid=!1})()}resetList(){var t=this;return(0,p.Z)(function*(){t.rows=[],t.rowsMap={},t.selectedRows.length=0,t.eventCenterS.apiUser.selectedGroups.next([])})()}apiGroupSelected(){var t=this;return(0,p.Z)(function*(){t.eventCenterS.apiUser.selectedGroups.next(_.map(t.selectedRows,t.gridKey))})()}saveUserPermissions(){var t=this;return(0,p.Z)(function*(){const i=JSON.parse(JSON.stringify(t.eventCenterS.apiUser.selectedApiUsers.value[0]));i.user=t.authCS.getUserId(),i.groupNames=t.eventCenterS.apiUser.selectedGroups.value||[],t.loading.grid=!0;const s=yield t.apiUserS.put(i._id,i,{select:f.iH._id}).toPromise();s&&s.success&&t.notificationS.showSuccess("User updated successfully."),t.loading.grid=!1})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(i){return new(i||a)(e.Y36(ce.e),e.Y36(S.b),e.Y36(A.W),e.Y36(de.X),e.Y36(C.D),e.Y36(U.q),e.Y36(w.L),e.Y36(I.u))};static \u0275cmp=e.Xpm({type:a,selectors:[["app-w-api-group-list"]],inputs:{showCheckbox:"showCheckbox"},decls:12,vars:3,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/api-group.svg","alt","API Group Permissions",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/apis-security/api-group-permission.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],["class","float-right cursor-pointer ml-3","pTooltip","Save",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["pTooltip","Save",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-save","fa-fw","text-success"],["styleClass","p-datatable-striped","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange"],["pTemplate","header"],["pTemplate","body"],[2,"width","40px"],[3,"pSelectableRow"],[4,"ngIf"],[3,"value","pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(i,s){1&i&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"img",2),e._uU(4," Groups"),e.qZA(),e.TgZ(5,"div",3)(6,"a",4),e._UZ(7,"img",5),e.qZA()(),e.YNc(8,me,3,0,"span",6),e.qZA(),e.TgZ(9,"div",7),e.YNc(10,he,3,6,"p-table",8),e.YNc(11,ve,1,0,"p-progressSpinner",9),e.qZA()()),2&i&&(e.xp6(8),e.Q6J("ngIf",s.eventCenterS.apiUser.selectedApiUsers.value.length),e.xp6(2),e.Q6J("ngIf",s.eventCenterS.apiUser.selectedApiUsers.value.length),e.xp6(1),e.Q6J("ngIf",s.loading.grid))},dependencies:[Z.O5,g.iA,h.jx,g.Ei,g.UA,y.G,b.u],encapsulation:2})}return a})();function _e(a,o){1&a&&(e.TgZ(0,"div",3),e._UZ(1,"app-w-api-users"),e.qZA())}function Ue(a,o){1&a&&(e.TgZ(0,"div",4),e._UZ(1,"app-w-api-group-list"),e.qZA())}const Se=function(){return{height:"calc(100% - 100px);"}},R=function(){return[50,50]};const Ae=[{path:"layout",component:(()=>{class a{constructor(){}ngOnInit(){}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=e.Xpm({type:a,selectors:[["app-api-user-layout"]],decls:4,vars:7,consts:[[1,"pt-1","pl-1","pr-1"],["styleClass","full-body border-0 shadow-sm mb-5","orientation","horizontal",3,"panelSizes","minSizes"],["pTemplate",""],[1,"col","flex","align-items-center","justify-content-center","pl-0","pr-1"],[1,"col","flex","align-items-center","justify-content-center","pl-1","pr-0"]],template:function(i,s){1&i&&(e.TgZ(0,"div",0)(1,"p-splitter",1),e.YNc(2,_e,2,0,"ng-template",2),e.YNc(3,Ue,2,0,"ng-template",2),e.qZA()()),2&i&&(e.xp6(1),e.Akn(e.DdM(4,Se)),e.Q6J("panelSizes",e.DdM(5,R))("minSizes",e.DdM(6,R)))},dependencies:[h.jx,k.q,E,N],encapsulation:2})}return a})(),canActivate:[J.P]}];let Ce=(()=>{class a{static \u0275fac=function(i){return new(i||a)};static \u0275mod=e.oAB({type:a});static \u0275inj=e.cJS({imports:[G.Bz.forChild(Ae),Y.u]})}return a})()}}]);
|
package/dist/2714.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[2714],{5050:(mt,v,i)=>{i.r(v),i.d(v,{I18nM:()=>lt});var b=i(7664),N=i(8176),t=i(4946),l=i(5861),c=i(3157),d=i(328),p=i(6212),x=i(6990),u=i(1162),I=i(7240),C=i(9961),A=i(2189),_=i(5852),S=i(6233),y=i(7414),D=i(5219),P=i(2915),Z=i(6814),E=i(5431),T=i(7680),O=i(3259),f=i(95),U=i(553),R=i(1601),Y=i(2304),J=i(2660),Q=i(756),W=i(5025);const k=["monacoEditorModalC"];function G(a,r){1&a&&(t.TgZ(0,"span"),t._UZ(1,"i",28),t._uU(2," Add Internationalization"),t.qZA())}function V(a,r){1&a&&(t.TgZ(0,"span"),t._UZ(1,"i",29),t._uU(2," View Internationalization"),t.qZA())}function H(a,r){1&a&&(t.TgZ(0,"span"),t._UZ(1,"i",30),t._uU(2," Edit Internationalization"),t.qZA())}function B(a,r){if(1&a){const e=t.EpF();t.TgZ(0,"a",31),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.viewError())}),t._uU(1,"View error"),t.qZA()}}function K(a,r){1&a&&(t.TgZ(0,"span"),t._uU(1,"Save"),t.qZA())}function z(a,r){1&a&&(t.TgZ(0,"span"),t._uU(1,"Update"),t.qZA())}function j(a,r){if(1&a){const e=t.EpF();t.TgZ(0,"button",32),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.save())}),t._UZ(1,"i",33),t.YNc(2,K,2,0,"span",4),t.YNc(3,z,2,0,"span",4),t.qZA()}if(2&a){const e=t.oxw();t.Q6J("disabled",e.form.invalid),t.xp6(2),t.Q6J("ngIf",e.data.mode===e.EFormMode.ADD),t.xp6(1),t.Q6J("ngIf",e.data.mode===e.EFormMode.EDIT)}}function L(a,r){1&a&&t._UZ(0,"p-progressSpinner",34)}let w=(()=>{class a{fb;ns;generalCS;constantsS;authCS;i18nS;monacoS;data;loading={form:!1};EFormMode=d.D;form;subscriptions=[];editorI18N;editorOptionsI18N={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};BE_HOST_PORT=U.N.BE_HOST_PORT;monacoDecorations=[];tab;viewDockerfileModelC;constructor(e,o,n,s,m,h,g){this.fb=e,this.ns=o,this.generalCS=n,this.constantsS=s,this.authCS=m,this.i18nS=h,this.monacoS=g}ngOnInit(){var e=this;return(0,l.Z)(function*(){e.createForm(),e.subscriptions.push(e.data.eventChannel.subscribe(function(){var o=(0,l.Z)(function*(n){if(n)if(e.form.enable(),n.action===c.F.OPEN_FORM_IN_EDIT_MODE){const s=yield e.i18nS.getById(e.data.formData._id).toPromise();e.form.reset(),e.form.patchValue(s.data),e.generalCS.setValueInEditor(e,"editorI18N",s.data.keysCode||"")}else if(n.action===c.F.OPEN_FORM_IN_VIEW_MODE){const s=yield e.i18nS.getById(e.data.formData._id).toPromise();e.form.reset(),e.form.patchValue(s.data),e.generalCS.setValueInEditor(e,"editorI18N",s.data.keysCode||""),e.form.disable()}else if(n.action===c.F.OPEN_FORM_IN_ADD_MODE){e.form.reset();const s=(yield e.i18nS.getSampleI18nText().toPromise()).data;s&&e.generalCS.setValueInEditor(e,"editorI18N",s)}});return function(n){return o.apply(this,arguments)}}()))})()}createForm(){this.form=this.fb.group({name:[null,[f.kI.required]]})}showModal(){this.lastError=void 0,$("#idI18NForm").modal("show")}hideModal(){$("#idI18NForm").modal("hide")}save(){var e=this;return(0,l.Z)(function*(){const o=e.form.getRawValue();o.user=e.authCS.getUserId(),o.keysCode=e.editorI18N.getValue();try{let n;e.loading.form=!0,e.lastError=void 0,e.monacoS.clearEditorDecorations(e.editorI18N,e.monacoDecorations),e.data.mode===d.D.ADD?n=yield e.i18nS.post(o).toPromise():e.data.mode===d.D.EDIT&&(n=yield e.i18nS.put(e.data.formData._id,o,{select:u.iH._id}).toPromise()),e.ns.showSuccess(e.data.mode===d.D.ADD?e.constantsS.i18n.addSuccess:e.constantsS.i18n.editSuccess),e.data.eventChannel.emit({action:e.data.mode===d.D.ADD?c.F.SAVED:c.F.UPDATED}),e.loading.form=!1}catch(n){e.loading.form=!1,e.ns.showErrorFromResponse(n.error||n,"Unable to save internationalization."),e.lastError=n.error,e.tab=e.tab||{},e.tab.axiosResponse={data:n.error},e.monacoS.highlightErrorInMonacoEditor(e.editorI18N,e.tab,"MainSandbox.ts",e.monacoDecorations)}})()}editorGenerated(e){var o=this;return(0,l.Z)(function*(){o.editorI18N=e,yield o.monacoS.loadSchemaEditorSettings(o.BE_HOST_PORT,o.authCS.getUserId(),null),o.monacoS.addSaveCodeKeyBinding(e,n=>{o.form.valid&&o.save()})})()}viewError(){this.viewDockerfileModelC.showModal(this.generalCS.stringify(this.lastError),R.d.json)}ngOnDestroy(){this.generalCS.unsubscribe(this.subscriptions)}static \u0275fac=function(o){return new(o||a)(t.Y36(f.qu),t.Y36(C.W),t.Y36(I.b),t.Y36(y.L),t.Y36(_.D),t.Y36(S.q),t.Y36(Y.b))};static \u0275cmp=t.Xpm({type:a,selectors:[["app-i18n-form"]],viewQuery:function(o,n){if(1&o&&t.Gf(k,5),2&o){let s;t.iGM(s=t.CRH())&&(n.viewDockerfileModelC=s.first)}},inputs:{data:"data"},decls:33,vars:12,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idI18NForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-xl"],[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/i18/i18.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-2","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"],["formControlName","name","name","name","spellcheck","false","placeholder","Please provide name","type","text",1,"form-control","form-control-sm"],[1,"overflow-hidden","mb-3",2,"height","calc(100vh - 220px)"],[3,"isSchemaEditor","editorOptions","editorGenerated"],[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"],["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(o,n){1&o&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),t.YNc(4,G,3,0,"span",4),t.YNc(5,V,3,0,"span",4),t.YNc(6,H,3,0,"span",4),t.TgZ(7,"div",5)(8,"button",6)(9,"span",7),t._UZ(10,"i",8),t.qZA()(),t.TgZ(11,"a",9),t._UZ(12,"img",10),t.qZA()()(),t.TgZ(13,"div",11)(14,"form",12)(15,"div",13)(16,"div",14)(17,"div",15)(18,"label",16),t._uU(19,"Name"),t.qZA(),t.TgZ(20,"div",14),t._UZ(21,"input",17),t.qZA()()()(),t.TgZ(22,"div",18)(23,"app-monaco-editor",19),t.NdJ("editorGenerated",function(m){return n.editorGenerated(m)}),t.qZA()()()(),t.TgZ(24,"div",20),t.YNc(25,B,2,0,"a",21),t.TgZ(26,"button",22),t._UZ(27,"i",23),t._uU(28," Close"),t.qZA(),t.YNc(29,j,4,3,"button",24),t.qZA(),t.YNc(30,L,1,0,"p-progressSpinner",25),t.qZA()()(),t._UZ(31,"app-monaco-editor-modal",26,27)),2&o&&(t.xp6(4),t.Q6J("ngIf",n.data.mode===n.EFormMode.ADD),t.xp6(1),t.Q6J("ngIf",n.data.mode===n.EFormMode.VIEW),t.xp6(1),t.Q6J("ngIf",n.data.mode===n.EFormMode.EDIT),t.xp6(8),t.Q6J("formGroup",n.form),t.xp6(9),t.Q6J("isSchemaEditor",!0)("editorOptions",n.editorOptionsI18N),t.xp6(2),t.Q6J("ngIf",n.lastError),t.xp6(4),t.Q6J("ngIf",n.data.mode!==n.EFormMode.VIEW),t.xp6(1),t.Q6J("ngIf",n.loading.form),t.xp6(1),t.Q6J("modalId","idMonacoEditorModalInI18n")("editorOptionsMonacoEditorModal",n.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[f._Y,f.Fj,f.JJ,f.JL,f.sg,f.u,Z.O5,J.y,Q.O,T.G,W.A],encapsulation:2})}return a})();const q=["i18nFormC"];function X(a,r){if(1&a){const e=t.EpF();t.TgZ(0,"span",17),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.edit())}),t._UZ(1,"i",18),t.qZA()}}function tt(a,r){if(1&a){const e=t.EpF();t.TgZ(0,"span",19),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.clone())}),t._UZ(1,"i",20),t.qZA()}}function et(a,r){if(1&a){const e=t.EpF();t.TgZ(0,"span",21),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.removePermanentDialog())}),t._UZ(1,"i",22),t.qZA()}}function nt(a,r){1&a&&(t.TgZ(0,"tr")(1,"th"),t._uU(2,"Name"),t.qZA()())}function ot(a,r){if(1&a&&(t.TgZ(0,"tr",23)(1,"td"),t._uU(2),t.qZA()()),2&a){const e=r.$implicit;t.Q6J("pSelectableRow",e),t.xp6(2),t.Oqu(e.name)}}function at(a,r){1&a&&t._UZ(0,"p-progressSpinner",24)}let F=(()=>{class a{generalS;notificationS;navigationCS;authCS;i18nS;constantsS;cd;confirmationService;eventCenterS;loading={grid:!1};subscriptions=[];data={mode:d.D.ADD,eventChannel:new t.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;selectedRows=[];gridKey=u.iH._id;i18nFormC;constructor(e,o,n,s,m,h,g,ct,dt){this.generalS=e,this.notificationS=o,this.navigationCS=n,this.authCS=s,this.i18nS=m,this.constantsS=h,this.cd=g,this.confirmationService=ct,this.eventCenterS=dt}ngOnInit(){this.eventCenterS.i18n.selectedI18n.next([]),this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(e=>{(e.action===c.F.SAVED||e.action===c.F.UPDATED)&&(this.i18nFormC.hideModal(),this.loadGridData())})),this.generalS.setNewTitle("API Maker - Internationalization")}loadGridData(){var e=this;this.loading.grid=!0;const o={find:{user:this.authCS.getUserId(),active:!0},select:{name:1,active:1},sort:{name:1}};this.showAll&&delete o.find.active,this.subscriptions.push(this.i18nS.query(o).subscribe(function(){var n=(0,l.Z)(function*(s){s.success&&(e.selectedRows=[],e.rows=s.data,e.rowsMap=x.keyBy(e.rows,u.iH._id));const m=e.navigationCS.getQueryParam(p.p.am_i18n);e.rowsMap[m]&&(yield e.fillData()),e.loading.grid=!1,e.cd.detectChanges()});return function(s){return n.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=d.D.ADD,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_ADD_MODE}),this.i18nFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=d.D.VIEW,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_VIEW_MODE}),this.i18nFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=d.D.EDIT,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_EDIT_MODE}),this.i18nFormC.showModal()}clone(){var e=this;return(0,l.Z)(function*(){try{if(!e.selectedRows[0])return;const o=(yield e.i18nS.getById(e.selectedRows[0]._id).toPromise()).data;delete o._id,o.name=`${o.name}-clone`,(yield e.i18nS.post(o).toPromise()).success?(e.notificationS.showSuccess(e.constantsS.logProfile.cloneSuccess),e.loadGridData()):e.notificationS.showSuccess(e.constantsS.logProfile.cloneSuccess)}catch{e.notificationS.showError(e.constantsS.logProfile.cloneError)}})()}removePermanentDialog(){var e=this;return(0,l.Z)(function*(){var o;e.confirmationService.confirm({message:e.constantsS.i18n.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(o=(0,l.Z)(function*(){yield e.removePermanent()}),function(){return o.apply(this,arguments)})})})()}removePermanent(){var e=this;return(0,l.Z)(function*(){e.loading.grid=!0;const o=yield e.i18nS.permanentDelete(e.selectedRows[0]._id).toPromise();e.loading.grid=!1,o.success?(e.notificationS.showSuccess(e.constantsS.i18n.removePermanent),e.resetSelectedRows(),e.loadGridData()):e.notificationS.showErrorFromResponse(o,e.constantsS.i18n.removePermanentError)})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.i18n.selectedI18n.next([])}resetDependents(){var e=this;return(0,l.Z)(function*(){e.eventCenterS.i18n.selectedI18n.next([]),yield e.navigationCS.setQueryParam(p.p.am_i18n,null)})()}i18NSelected(){var e=this;return(0,l.Z)(function*(){e.resetDependents().then(),e.fillData().then()})()}fillData(){var e=this;return(0,l.Z)(function*(){if(!e.selectedRows.length)return yield e.navigationCS.setQueryParam(p.p.am_i18n,""),void e.eventCenterS.i18n.selectedI18n.next([]);const o=(yield e.i18nS.getById(e.selectedRows[0]._id).toPromise()).data;o._id?(yield e.navigationCS.setQueryParam(p.p.am_i18n,o._id),e.eventCenterS.i18n.selectedI18n.next([o])):e.resetDependents()})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickI18N(){this.selectedRows.length&&this.edit()}static \u0275fac=function(o){return new(o||a)(t.Y36(I.b),t.Y36(C.W),t.Y36(A.S),t.Y36(_.D),t.Y36(S.q),t.Y36(y.L),t.Y36(t.sBO),t.Y36(D.YP),t.Y36(P.u))};static \u0275cmp=t.Xpm({type:a,selectors:[["app-i18n-w"]],viewQuery:function(o,n){if(1&o&&t.Gf(q,5),2&o){let s;t.iGM(s=t.CRH())&&(n.i18nFormC=s.first)}},decls:19,vars:11,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/i18n.svg","alt","Internationalization",1,"fa-fw","mr-1"],["href","https://docs.apimaker.dev/v1/docs/i18/i18.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"],[3,"data"],["i18nFormC",""],["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"],[3,"pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(o,n){1&o&&(t.TgZ(0,"div",0)(1,"div",1)(2,"span"),t._UZ(3,"img",2),t._uU(4," Internationalization"),t.qZA(),t.TgZ(5,"a",3),t._UZ(6,"img",4),t.qZA(),t.TgZ(7,"span",5),t.NdJ("click",function(){return n.add()}),t._UZ(8,"i",6),t.qZA(),t.YNc(9,X,2,0,"span",7),t.YNc(10,tt,2,0,"span",8),t.YNc(11,et,2,0,"span",9),t.qZA(),t.TgZ(12,"div",10)(13,"p-table",11),t.NdJ("selectionChange",function(m){return n.selectedRows=m})("selectionChange",function(){return n.i18NSelected()})("dblclick",function(){return n.dblClickI18N()}),t.YNc(14,nt,3,0,"ng-template",12),t.YNc(15,ot,3,2,"ng-template",13),t.qZA(),t.YNc(16,at,1,0,"p-progressSpinner",14),t.qZA()(),t._UZ(17,"app-i18n-form",15,16)),2&o&&(t.xp6(9),t.Q6J("ngIf",n.selectedRows.length),t.xp6(1),t.Q6J("ngIf",n.selectedRows.length),t.xp6(1),t.Q6J("ngIf",n.selectedRows.length),t.xp6(2),t.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",n.selectedRows)("dataKey",n.gridKey)("scrollable",!0)("value",n.rows),t.xp6(3),t.Q6J("ngIf",n.loading.grid),t.xp6(1),t.Q6J("data",n.data))},dependencies:[Z.O5,E.iA,D.jx,E.Ei,T.G,O.u,w],encapsulation:2})}return a})(),M=(()=>{class a{constructor(){}ngOnInit(){}static \u0275fac=function(o){return new(o||a)};static \u0275cmp=t.Xpm({type:a,selectors:[["app-I18N-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1"]],template:function(o,n){1&o&&(t.TgZ(0,"div",0),t._UZ(1,"app-i18n-w"),t.qZA())},dependencies:[F],encapsulation:2})}return a})();var it=i(3726),st=i(4950);const rt=[{path:"main",component:M,canActivate:[it.P]}];let lt=(()=>{class a{static \u0275fac=function(o){return new(o||a)};static \u0275mod=t.oAB({type:a});static \u0275inj=t.cJS({imports:[b.Bz.forChild(rt),N.u,st.A]})}return a})()}}]);
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[2714],{5050:(mt,v,i)=>{i.r(v),i.d(v,{I18nM:()=>lt});var b=i(7664),N=i(8761),t=i(4946),l=i(5861),c=i(3157),d=i(328),p=i(6212),x=i(6990),u=i(1162),I=i(7240),C=i(9961),A=i(2189),_=i(5852),S=i(6233),y=i(7414),D=i(5219),P=i(2915),Z=i(6814),E=i(5431),T=i(7680),O=i(3259),f=i(95),U=i(553),R=i(1601),Y=i(2304),J=i(2660),Q=i(756),W=i(5025);const k=["monacoEditorModalC"];function G(a,r){1&a&&(t.TgZ(0,"span"),t._UZ(1,"i",28),t._uU(2," Add Internationalization"),t.qZA())}function V(a,r){1&a&&(t.TgZ(0,"span"),t._UZ(1,"i",29),t._uU(2," View Internationalization"),t.qZA())}function H(a,r){1&a&&(t.TgZ(0,"span"),t._UZ(1,"i",30),t._uU(2," Edit Internationalization"),t.qZA())}function B(a,r){if(1&a){const e=t.EpF();t.TgZ(0,"a",31),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.viewError())}),t._uU(1,"View error"),t.qZA()}}function K(a,r){1&a&&(t.TgZ(0,"span"),t._uU(1,"Save"),t.qZA())}function z(a,r){1&a&&(t.TgZ(0,"span"),t._uU(1,"Update"),t.qZA())}function j(a,r){if(1&a){const e=t.EpF();t.TgZ(0,"button",32),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.save())}),t._UZ(1,"i",33),t.YNc(2,K,2,0,"span",4),t.YNc(3,z,2,0,"span",4),t.qZA()}if(2&a){const e=t.oxw();t.Q6J("disabled",e.form.invalid),t.xp6(2),t.Q6J("ngIf",e.data.mode===e.EFormMode.ADD),t.xp6(1),t.Q6J("ngIf",e.data.mode===e.EFormMode.EDIT)}}function L(a,r){1&a&&t._UZ(0,"p-progressSpinner",34)}let w=(()=>{class a{fb;ns;generalCS;constantsS;authCS;i18nS;monacoS;data;loading={form:!1};EFormMode=d.D;form;subscriptions=[];editorI18N;editorOptionsI18N={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};BE_HOST_PORT=U.N.BE_HOST_PORT;monacoDecorations=[];tab;viewDockerfileModelC;constructor(e,o,n,s,m,h,g){this.fb=e,this.ns=o,this.generalCS=n,this.constantsS=s,this.authCS=m,this.i18nS=h,this.monacoS=g}ngOnInit(){var e=this;return(0,l.Z)(function*(){e.createForm(),e.subscriptions.push(e.data.eventChannel.subscribe(function(){var o=(0,l.Z)(function*(n){if(n)if(e.form.enable(),n.action===c.F.OPEN_FORM_IN_EDIT_MODE){const s=yield e.i18nS.getById(e.data.formData._id).toPromise();e.form.reset(),e.form.patchValue(s.data),e.generalCS.setValueInEditor(e,"editorI18N",s.data.keysCode||"")}else if(n.action===c.F.OPEN_FORM_IN_VIEW_MODE){const s=yield e.i18nS.getById(e.data.formData._id).toPromise();e.form.reset(),e.form.patchValue(s.data),e.generalCS.setValueInEditor(e,"editorI18N",s.data.keysCode||""),e.form.disable()}else if(n.action===c.F.OPEN_FORM_IN_ADD_MODE){e.form.reset();const s=(yield e.i18nS.getSampleI18nText().toPromise()).data;s&&e.generalCS.setValueInEditor(e,"editorI18N",s)}});return function(n){return o.apply(this,arguments)}}()))})()}createForm(){this.form=this.fb.group({name:[null,[f.kI.required]]})}showModal(){this.lastError=void 0,$("#idI18NForm").modal("show")}hideModal(){$("#idI18NForm").modal("hide")}save(){var e=this;return(0,l.Z)(function*(){const o=e.form.getRawValue();o.user=e.authCS.getUserId(),o.keysCode=e.editorI18N.getValue();try{let n;e.loading.form=!0,e.lastError=void 0,e.monacoS.clearEditorDecorations(e.editorI18N,e.monacoDecorations),e.data.mode===d.D.ADD?n=yield e.i18nS.post(o).toPromise():e.data.mode===d.D.EDIT&&(n=yield e.i18nS.put(e.data.formData._id,o,{select:u.iH._id}).toPromise()),e.ns.showSuccess(e.data.mode===d.D.ADD?e.constantsS.i18n.addSuccess:e.constantsS.i18n.editSuccess),e.data.eventChannel.emit({action:e.data.mode===d.D.ADD?c.F.SAVED:c.F.UPDATED}),e.loading.form=!1}catch(n){e.loading.form=!1,e.ns.showErrorFromResponse(n.error||n,"Unable to save internationalization."),e.lastError=n.error,e.tab=e.tab||{},e.tab.axiosResponse={data:n.error},e.monacoS.highlightErrorInMonacoEditor(e.editorI18N,e.tab,"MainSandbox.ts",e.monacoDecorations)}})()}editorGenerated(e){var o=this;return(0,l.Z)(function*(){o.editorI18N=e,yield o.monacoS.loadSchemaEditorSettings(o.BE_HOST_PORT,o.authCS.getUserId(),null),o.monacoS.addSaveCodeKeyBinding(e,n=>{o.form.valid&&o.save()})})()}viewError(){this.viewDockerfileModelC.showModal(this.generalCS.stringify(this.lastError),R.d.json)}ngOnDestroy(){this.generalCS.unsubscribe(this.subscriptions)}static \u0275fac=function(o){return new(o||a)(t.Y36(f.qu),t.Y36(C.W),t.Y36(I.b),t.Y36(y.L),t.Y36(_.D),t.Y36(S.q),t.Y36(Y.b))};static \u0275cmp=t.Xpm({type:a,selectors:[["app-i18n-form"]],viewQuery:function(o,n){if(1&o&&t.Gf(k,5),2&o){let s;t.iGM(s=t.CRH())&&(n.viewDockerfileModelC=s.first)}},inputs:{data:"data"},decls:33,vars:12,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idI18NForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-xl"],[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/i18/i18.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-2","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"],["formControlName","name","name","name","spellcheck","false","placeholder","Please provide name","type","text",1,"form-control","form-control-sm"],[1,"overflow-hidden","mb-3",2,"height","calc(100vh - 220px)"],[3,"isSchemaEditor","editorOptions","editorGenerated"],[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"],["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(o,n){1&o&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),t.YNc(4,G,3,0,"span",4),t.YNc(5,V,3,0,"span",4),t.YNc(6,H,3,0,"span",4),t.TgZ(7,"div",5)(8,"button",6)(9,"span",7),t._UZ(10,"i",8),t.qZA()(),t.TgZ(11,"a",9),t._UZ(12,"img",10),t.qZA()()(),t.TgZ(13,"div",11)(14,"form",12)(15,"div",13)(16,"div",14)(17,"div",15)(18,"label",16),t._uU(19,"Name"),t.qZA(),t.TgZ(20,"div",14),t._UZ(21,"input",17),t.qZA()()()(),t.TgZ(22,"div",18)(23,"app-monaco-editor",19),t.NdJ("editorGenerated",function(m){return n.editorGenerated(m)}),t.qZA()()()(),t.TgZ(24,"div",20),t.YNc(25,B,2,0,"a",21),t.TgZ(26,"button",22),t._UZ(27,"i",23),t._uU(28," Close"),t.qZA(),t.YNc(29,j,4,3,"button",24),t.qZA(),t.YNc(30,L,1,0,"p-progressSpinner",25),t.qZA()()(),t._UZ(31,"app-monaco-editor-modal",26,27)),2&o&&(t.xp6(4),t.Q6J("ngIf",n.data.mode===n.EFormMode.ADD),t.xp6(1),t.Q6J("ngIf",n.data.mode===n.EFormMode.VIEW),t.xp6(1),t.Q6J("ngIf",n.data.mode===n.EFormMode.EDIT),t.xp6(8),t.Q6J("formGroup",n.form),t.xp6(9),t.Q6J("isSchemaEditor",!0)("editorOptions",n.editorOptionsI18N),t.xp6(2),t.Q6J("ngIf",n.lastError),t.xp6(4),t.Q6J("ngIf",n.data.mode!==n.EFormMode.VIEW),t.xp6(1),t.Q6J("ngIf",n.loading.form),t.xp6(1),t.Q6J("modalId","idMonacoEditorModalInI18n")("editorOptionsMonacoEditorModal",n.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[f._Y,f.Fj,f.JJ,f.JL,f.sg,f.u,Z.O5,J.y,Q.O,T.G,W.A],encapsulation:2})}return a})();const q=["i18nFormC"];function X(a,r){if(1&a){const e=t.EpF();t.TgZ(0,"span",17),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.edit())}),t._UZ(1,"i",18),t.qZA()}}function tt(a,r){if(1&a){const e=t.EpF();t.TgZ(0,"span",19),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.clone())}),t._UZ(1,"i",20),t.qZA()}}function et(a,r){if(1&a){const e=t.EpF();t.TgZ(0,"span",21),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.removePermanentDialog())}),t._UZ(1,"i",22),t.qZA()}}function nt(a,r){1&a&&(t.TgZ(0,"tr")(1,"th"),t._uU(2,"Name"),t.qZA()())}function ot(a,r){if(1&a&&(t.TgZ(0,"tr",23)(1,"td"),t._uU(2),t.qZA()()),2&a){const e=r.$implicit;t.Q6J("pSelectableRow",e),t.xp6(2),t.Oqu(e.name)}}function at(a,r){1&a&&t._UZ(0,"p-progressSpinner",24)}let F=(()=>{class a{generalS;notificationS;navigationCS;authCS;i18nS;constantsS;cd;confirmationService;eventCenterS;loading={grid:!1};subscriptions=[];data={mode:d.D.ADD,eventChannel:new t.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;selectedRows=[];gridKey=u.iH._id;i18nFormC;constructor(e,o,n,s,m,h,g,ct,dt){this.generalS=e,this.notificationS=o,this.navigationCS=n,this.authCS=s,this.i18nS=m,this.constantsS=h,this.cd=g,this.confirmationService=ct,this.eventCenterS=dt}ngOnInit(){this.eventCenterS.i18n.selectedI18n.next([]),this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(e=>{(e.action===c.F.SAVED||e.action===c.F.UPDATED)&&(this.i18nFormC.hideModal(),this.loadGridData())})),this.generalS.setNewTitle("API Maker - Internationalization")}loadGridData(){var e=this;this.loading.grid=!0;const o={find:{user:this.authCS.getUserId(),active:!0},select:{name:1,active:1},sort:{name:1}};this.showAll&&delete o.find.active,this.subscriptions.push(this.i18nS.query(o).subscribe(function(){var n=(0,l.Z)(function*(s){s.success&&(e.selectedRows=[],e.rows=s.data,e.rowsMap=x.keyBy(e.rows,u.iH._id));const m=e.navigationCS.getQueryParam(p.p.am_i18n);e.rowsMap[m]&&(yield e.fillData()),e.loading.grid=!1,e.cd.detectChanges()});return function(s){return n.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=d.D.ADD,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_ADD_MODE}),this.i18nFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=d.D.VIEW,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_VIEW_MODE}),this.i18nFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=d.D.EDIT,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_EDIT_MODE}),this.i18nFormC.showModal()}clone(){var e=this;return(0,l.Z)(function*(){try{if(!e.selectedRows[0])return;const o=(yield e.i18nS.getById(e.selectedRows[0]._id).toPromise()).data;delete o._id,o.name=`${o.name}-clone`,(yield e.i18nS.post(o).toPromise()).success?(e.notificationS.showSuccess(e.constantsS.logProfile.cloneSuccess),e.loadGridData()):e.notificationS.showSuccess(e.constantsS.logProfile.cloneSuccess)}catch{e.notificationS.showError(e.constantsS.logProfile.cloneError)}})()}removePermanentDialog(){var e=this;return(0,l.Z)(function*(){var o;e.confirmationService.confirm({message:e.constantsS.i18n.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(o=(0,l.Z)(function*(){yield e.removePermanent()}),function(){return o.apply(this,arguments)})})})()}removePermanent(){var e=this;return(0,l.Z)(function*(){e.loading.grid=!0;const o=yield e.i18nS.permanentDelete(e.selectedRows[0]._id).toPromise();e.loading.grid=!1,o.success?(e.notificationS.showSuccess(e.constantsS.i18n.removePermanent),e.resetSelectedRows(),e.loadGridData()):e.notificationS.showErrorFromResponse(o,e.constantsS.i18n.removePermanentError)})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.i18n.selectedI18n.next([])}resetDependents(){var e=this;return(0,l.Z)(function*(){e.eventCenterS.i18n.selectedI18n.next([]),yield e.navigationCS.setQueryParam(p.p.am_i18n,null)})()}i18NSelected(){var e=this;return(0,l.Z)(function*(){e.resetDependents().then(),e.fillData().then()})()}fillData(){var e=this;return(0,l.Z)(function*(){if(!e.selectedRows.length)return yield e.navigationCS.setQueryParam(p.p.am_i18n,""),void e.eventCenterS.i18n.selectedI18n.next([]);const o=(yield e.i18nS.getById(e.selectedRows[0]._id).toPromise()).data;o._id?(yield e.navigationCS.setQueryParam(p.p.am_i18n,o._id),e.eventCenterS.i18n.selectedI18n.next([o])):e.resetDependents()})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickI18N(){this.selectedRows.length&&this.edit()}static \u0275fac=function(o){return new(o||a)(t.Y36(I.b),t.Y36(C.W),t.Y36(A.S),t.Y36(_.D),t.Y36(S.q),t.Y36(y.L),t.Y36(t.sBO),t.Y36(D.YP),t.Y36(P.u))};static \u0275cmp=t.Xpm({type:a,selectors:[["app-i18n-w"]],viewQuery:function(o,n){if(1&o&&t.Gf(q,5),2&o){let s;t.iGM(s=t.CRH())&&(n.i18nFormC=s.first)}},decls:19,vars:11,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/i18n.svg","alt","Internationalization",1,"fa-fw","mr-1"],["href","https://docs.apimaker.dev/v1/docs/i18/i18.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"],[3,"data"],["i18nFormC",""],["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"],[3,"pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(o,n){1&o&&(t.TgZ(0,"div",0)(1,"div",1)(2,"span"),t._UZ(3,"img",2),t._uU(4," Internationalization"),t.qZA(),t.TgZ(5,"a",3),t._UZ(6,"img",4),t.qZA(),t.TgZ(7,"span",5),t.NdJ("click",function(){return n.add()}),t._UZ(8,"i",6),t.qZA(),t.YNc(9,X,2,0,"span",7),t.YNc(10,tt,2,0,"span",8),t.YNc(11,et,2,0,"span",9),t.qZA(),t.TgZ(12,"div",10)(13,"p-table",11),t.NdJ("selectionChange",function(m){return n.selectedRows=m})("selectionChange",function(){return n.i18NSelected()})("dblclick",function(){return n.dblClickI18N()}),t.YNc(14,nt,3,0,"ng-template",12),t.YNc(15,ot,3,2,"ng-template",13),t.qZA(),t.YNc(16,at,1,0,"p-progressSpinner",14),t.qZA()(),t._UZ(17,"app-i18n-form",15,16)),2&o&&(t.xp6(9),t.Q6J("ngIf",n.selectedRows.length),t.xp6(1),t.Q6J("ngIf",n.selectedRows.length),t.xp6(1),t.Q6J("ngIf",n.selectedRows.length),t.xp6(2),t.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",n.selectedRows)("dataKey",n.gridKey)("scrollable",!0)("value",n.rows),t.xp6(3),t.Q6J("ngIf",n.loading.grid),t.xp6(1),t.Q6J("data",n.data))},dependencies:[Z.O5,E.iA,D.jx,E.Ei,T.G,O.u,w],encapsulation:2})}return a})(),M=(()=>{class a{constructor(){}ngOnInit(){}static \u0275fac=function(o){return new(o||a)};static \u0275cmp=t.Xpm({type:a,selectors:[["app-I18N-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1"]],template:function(o,n){1&o&&(t.TgZ(0,"div",0),t._UZ(1,"app-i18n-w"),t.qZA())},dependencies:[F],encapsulation:2})}return a})();var it=i(3726),st=i(4950);const rt=[{path:"main",component:M,canActivate:[it.P]}];let lt=(()=>{class a{static \u0275fac=function(o){return new(o||a)};static \u0275mod=t.oAB({type:a});static \u0275inj=t.cJS({imports:[b.Bz.forChild(rt),N.u,st.A]})}return a})()}}]);
|
package/dist/2735.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[2735],{2735:(P,d,o)=>{o.r(d),o.d(d,{NativeProcessLogsM:()=>T});var g=o(7664),p=o(
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[2735],{2735:(P,d,o)=>{o.r(d),o.d(d,{NativeProcessLogsM:()=>T});var g=o(7664),p=o(8761),v=o(3726),a=o(5861),e=o(4946),f=o(3429),m=o(9961),c=o(95),u=o(6814),h=o(2660),S=o(756),L=o(7680),O=o(3259),C=o(3965);function b(s,Z){1&s&&e._UZ(0,"p-progressSpinner",15)}const N=[{path:"",component:(()=>{class s{instanceS;ns;servers=[];selectedServer=null;loading={grid:!1};editor;editorOptionsLogs={readOnly:!1,language:"plaintext",contextmenu:!1};constructor(t,r){this.instanceS=t,this.ns=r}ngOnInit(){var t=this;return(0,a.Z)(function*(){yield t.loadAllServers(),t.selectedServer=t.servers[0]._id})()}clearAllLogs(){var t=this;return(0,a.Z)(function*(){try{yield t.instanceS.clearServerLogs(null).toPromise(),t.getLogsOfOneServer().then(),t.ns.showSuccess("All native process log files are cleared from all servers.")}catch(r){t.ns.showErrorFromResponse(r.error||r,"Unable to clear server logs.")}})()}clearLogsOfOneServer(){var t=this;return(0,a.Z)(function*(){try{yield t.instanceS.clearServerLogs(t.selectedServer).toPromise(),t.getLogsOfOneServer().then(),t.ns.showSuccess(`Native process log file is cleared from ${t.selectedServer}.`)}catch(r){t.ns.showErrorFromResponse(r.error||r,"Unable to clear server logs.")}})()}getLogsOfOneServer(){var t=this;return(0,a.Z)(function*(){t.loading.grid=!0;try{const r=(yield t.instanceS.getAllNativeProcessLogs(t.selectedServer).toPromise()).data;t.editor.setValue(r[0].nativeProcessLogsText)}catch(r){t.ns.showErrorFromResponse(r.error||r,"Unable to load logs.")}t.loading.grid=!1})()}loadAllServers(){var t=this;return(0,a.Z)(function*(){t.loading.grid=!0,t.servers=[];try{t.servers=(yield t.instanceS.getAllConnectedServers().toPromise()).data}catch(r){t.ns.showErrorFromResponse(r.error||r,"Unable to load server list.")}t.loading.grid=!1})()}editorGenerated(t){this.editor=t}static \u0275fac=function(r){return new(r||s)(e.Y36(f.E),e.Y36(m.W))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-native-process-logs"]],decls:18,vars:8,consts:[["id","about",1,"p-2"],[1,"row","m-0"],[1,"col-4","p-0"],["optionLabel","name","optionValue","_id","filterBy","name","appendTo","body","styleClass","w-100 p-input-filled",3,"options","ngModel","filter","ngModelChange"],["pTooltip","Clear native process logs of this server.","sava-no-dbl-click","","type","button",1,"btn","btn-sm","ml-2",3,"disabled","click"],[1,"far","fa-trash-alt","text-warning","fa-fw"],["pTooltip","Reload logs.","sava-no-dbl-click","","type","button",1,"btn","btn-sm","ml-2",3,"disabled","click"],[1,"fas","fa-sync-alt","text-success","fa-fw"],[1,"col-4","text-right","p-0"],["pTooltip","Clear native process logs of all server.","sava-no-dbl-click","","type","button",1,"btn","btn-outline-light","btn-sm",3,"disabled","click"],[1,"far","fa-trash-alt","text-warning","fa-fw","mr-1"],[1,"pl-2","pr-2","pb-2","pt-0"],[1,"card-body","p-0","overflow-hidden",2,"height","calc(100vh - 115px)"],[3,"editorOptions","editorGenerated"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(r,n){1&r&&(e.TgZ(0,"section",0)(1,"div",1)(2,"div",2)(3,"p-dropdown",3),e.NdJ("ngModelChange",function(l){return n.selectedServer=l})("ngModelChange",function(){return n.getLogsOfOneServer()}),e.qZA()(),e.TgZ(4,"div",2)(5,"button",4),e.NdJ("click",function(){return n.clearLogsOfOneServer()}),e._UZ(6,"i",5),e.qZA(),e.TgZ(7,"button",6),e.NdJ("click",function(){return n.getLogsOfOneServer()}),e._UZ(8,"i",7),e.qZA()(),e.TgZ(9,"div",8)(10,"button",9),e.NdJ("click",function(){return n.clearAllLogs()}),e._UZ(11,"i",10),e.TgZ(12,"span"),e._uU(13,"Clear All Server Logs"),e.qZA()()()()(),e.TgZ(14,"section",11)(15,"div",12)(16,"app-monaco-editor",13),e.NdJ("editorGenerated",function(l){return n.editorGenerated(l)}),e.qZA()(),e.YNc(17,b,1,0,"p-progressSpinner",14),e.qZA()),2&r&&(e.xp6(3),e.Q6J("options",n.servers)("ngModel",n.selectedServer)("filter",!0),e.xp6(2),e.Q6J("disabled",n.loading.grid),e.xp6(2),e.Q6J("disabled",n.loading.grid),e.xp6(3),e.Q6J("disabled",n.loading.grid),e.xp6(6),e.Q6J("editorOptions",n.editorOptionsLogs),e.xp6(1),e.Q6J("ngIf",n.loading.grid))},dependencies:[c.JJ,c.On,u.O5,h.y,S.O,L.G,O.u,C.Lt],styles:["table[_ngcontent-%COMP%]{background-color:#3f3f3f}td[_ngcontent-%COMP%]{border-color:#4b4a4a!important;padding:10px}"]})}return s})(),canActivate:[v.P]}];let T=(()=>{class s{static \u0275fac=function(r){return new(r||s)};static \u0275mod=e.oAB({type:s});static \u0275inj=e.cJS({imports:[g.Bz.forChild(N),p.u]})}return s})()}}]);
|
package/dist/2908.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[2908],{2908:(u,s,t)=>{t.r(s),t.d(s,{RootSettingsM:()=>d});var a=t(7664),l=t(
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[2908],{2908:(u,s,t)=>{t.r(s),t.d(s,{RootSettingsM:()=>d});var a=t(7664),l=t(8761),o=t(4946);const e=[{path:"deployment-settings",loadChildren:()=>t.e(4575).then(t.bind(t,4575)).then(n=>n.DeploymentSettingsM)}];let d=(()=>{class n{static \u0275fac=function(h){return new(h||n)};static \u0275mod=o.oAB({type:n});static \u0275inj=o.cJS({imports:[a.Bz.forChild(e),l.u]})}return n})()}}]);
|
package/dist/3139.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[3139],{3139:(m,o,n)=>{n.r(o),n.d(o,{UtilityM:()=>C});var l=n(7664),d=n(
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[3139],{3139:(m,o,n)=>{n.r(o),n.d(o,{UtilityM:()=>C});var l=n(7664),d=n(8761),h=n(4946);const s=[{path:"monitoring",loadChildren:()=>n.e(2140).then(n.bind(n,2140)).then(t=>t.MonitoringM)},{path:"log-table",loadChildren:()=>Promise.all([n.e(1678),n.e(4211),n.e(7987),n.e(1025),n.e(5765),n.e(4186),n.e(885),n.e(4181),n.e(7470),n.e(9243),n.e(7975),n.e(6236),n.e(5249),n.e(8125),n.e(1558),n.e(8592),n.e(8296)]).then(n.bind(n,8296)).then(t=>t.LogTableM)},{path:"sandbox-settings",loadChildren:()=>Promise.all([n.e(1678),n.e(4211),n.e(7987),n.e(885),n.e(4181),n.e(7470),n.e(7975),n.e(6236),n.e(5249),n.e(8592),n.e(7368)]).then(n.bind(n,7368)).then(t=>t.SandboxSettingsM)},{path:"app-store",loadChildren:()=>n.e(913).then(n.bind(n,913)).then(t=>t.AppStoreM)},{path:"notes",loadChildren:()=>n.e(1957).then(n.bind(n,1957)).then(t=>t.NotesM)},{path:"utility-classes",loadChildren:()=>n.e(7649).then(n.bind(n,7649)).then(t=>t.UtilityClassesM)},{path:"internationalization",loadChildren:()=>n.e(2714).then(n.bind(n,5050)).then(t=>t.I18nM)},{path:"log-profile",loadChildren:()=>Promise.all([n.e(1678),n.e(4211),n.e(7987),n.e(1025),n.e(5765),n.e(4186),n.e(885),n.e(9243),n.e(8125),n.e(1558),n.e(8592),n.e(148)]).then(n.bind(n,148)).then(t=>t.LogProfileM)},{path:"native-process-logs",loadChildren:()=>n.e(2735).then(n.bind(n,2735)).then(t=>t.NativeProcessLogsM)},{path:"system-migration",loadChildren:()=>Promise.all([n.e(7975),n.e(8266)]).then(n.bind(n,8266)).then(t=>t.DatabasesMigrationM)},{path:"code-finder",loadChildren:()=>n.e(7470).then(n.bind(n,7470)).then(t=>t.CodeFinderM)},{path:"code-comparator/main",loadChildren:()=>n.e(4181).then(n.bind(n,4181)).then(t=>t.CodeComparatorM)},{path:"auto-increment",loadChildren:()=>n.e(5761).then(n.bind(n,5761)).then(t=>t.AutoIncrementM)},{path:"ts-gen-interfaces",loadChildren:()=>n.e(485).then(n.bind(n,485)).then(t=>t.TsGenInterfacesM)}];let C=(()=>{class t{static \u0275fac=function(M){return new(M||t)};static \u0275mod=h.oAB({type:t});static \u0275inj=h.cJS({imports:[l.Bz.forChild(s),d.u]})}return t})()}}]);
|
package/dist/3450.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[3450],{3450:(m,c,a)=>{a.r(c),a.d(c,{DashDevM:()=>v});var e=a(7664),r=a(
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[3450],{3450:(m,c,a)=>{a.r(c),a.d(c,{DashDevM:()=>v});var e=a(7664),r=a(8761),s=a(4946),d=a(3885);let i=(()=>{class t{constructor(){}ngOnInit(){}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=s.Xpm({type:t,selectors:[["app-dash-dev"]],decls:4,vars:1,consts:[[1,"pt-1"],[1,"row","ml-0","mr-0"],[1,"col-6","pl-1","pr-1","full-body"],[3,"showCheckbox"]],template:function(n,f){1&n&&(s.TgZ(0,"div",0)(1,"div",1)(2,"div",2),s._UZ(3,"app-w-instances",3),s.qZA()()()),2&n&&(s.xp6(3),s.Q6J("showCheckbox",!1))},dependencies:[d.f],encapsulation:2})}return t})();var l=a(1678);const h=[{path:"",component:i,canActivate:[a(3726).P]}];let v=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=s.oAB({type:t});static \u0275inj=s.cJS({imports:[e.Bz.forChild(h),r.u,l.DashboardM]})}return t})()}}]);
|
package/dist/4110.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[4110],{4110:(ye,g,o)=>{o.r(g),o.d(g,{RedisDashboardM:()=>he});var E=o(8176),N=o(7664),l=o(5861),e=o(4946),b=o(6990),d=o(3157),p=o(328),w=o(6925),h=o(553),v=o(2304),y=o(7240),D=o(9961),T=o(5852),C=o(7414),x=o(5219),S=o(3429),m=o(6814),R=o(756),K=o(7526),Z=o(7680),F=o(5043),I=o(3259),c=o(95),M=o(1601),A=o(2660),O=o(5025);const k=["monacoEditorModalC"];function U(n,i){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",28),e._uU(2," Add New Key"),e.qZA())}function J(n,i){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",29),e._uU(2," View New Key"),e.qZA())}function Y(n,i){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",30),e._uU(2," Edit New Key"),e.qZA())}function G(n,i){1&n&&(e.TgZ(0,"label",31),e._uU(1,"Key Name"),e.qZA())}function V(n,i){1&n&&(e.TgZ(0,"div",32),e._UZ(1,"input",33),e.qZA())}function P(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",34)(1,"app-monaco-editor",35),e.NdJ("editorGenerated",function(a){e.CHM(t);const r=e.oxw();return e.KtG(r.editorGenerated(a))}),e.qZA()()}if(2&n){const t=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!0)("editorOptions",t.editorOptionsRedis)}}function Q(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"a",36),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.viewError())}),e._uU(1,"View error"),e.qZA()}}function H(n,i){1&n&&(e.TgZ(0,"span"),e._uU(1,"Save"),e.qZA())}function L(n,i){1&n&&(e.TgZ(0,"span"),e._uU(1,"Update"),e.qZA())}function B(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"button",37),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.save())}),e._UZ(1,"i",38),e.YNc(2,H,2,0,"span",4),e.YNc(3,L,2,0,"span",4),e.qZA()}if(2&n){const t=e.oxw();e.Q6J("disabled",!(null!=t.form.get("keyName").value&&t.form.get("keyName").value.toString().trim())),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function q(n,i){1&n&&e._UZ(0,"p-progressSpinner",39)}const W=function(n){return{"col-3":n}},j=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=p.D;form;subscriptions=[];editorRedis;editorOptionsRedis={readOnly:!1,language:"json",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};BE_HOST_PORT=h.N.BE_HOST_PORT;viewDockerfileModelC;actualKeyData;constructor(t,s,a,r,f,u,_){this.fb=t,this.ns=s,this.monacoS=a,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 s=(0,l.Z)(function*(a){a&&(t.form.enable(),a.action===d.F.OPEN_FORM_IN_EDIT_MODE?(t.actualKeyData=a,t.form.reset(),t.form.get("ttl").setValue(t.actualKeyData.data.ttl),t.form.get("keyName").setValue(t.actualKeyData.data.keyName)):a.action===d.F.OPEN_FORM_IN_VIEW_MODE?(t.form.reset(),t.form.disable()):a.action===d.F.OPEN_FORM_IN_ADD_MODE&&(t.form.reset(),t.generalCS.setValueInEditor(t,"editorRedis","{}")))});return function(a){return s.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({keyName:[null,[c.kI.required]],ttl:[null,[c.kI.required]]})}showModal(){this.lastError=void 0,$("#idNewKeyForm").modal("show")}hideModal(){$("#idNewKeyForm").modal("hide")}save(){var t=this;return(0,l.Z)(function*(){const s=t.form.getRawValue();s.redisCodeStr=t.editorRedis.getValue();try{let a;if(t.loading.form=!0,t.lastError=void 0,t.data.mode===p.D.ADD)a=yield t.instanceS.saveRedisKeys(s),t.ns.showSuccess(t.constantsS.redis.addSuccess),t.data.eventChannel.emit({action:t.data.mode===p.D.ADD?d.F.SAVED:d.F.UPDATED});else if(t.data.mode===p.D.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.F.UPDATED,data:t.form.get("ttl").value})}t.loading.form=!1}catch(a){t.loading.form=!1,t.ns.showErrorFromResponse(a.error||a,"Unable to save redis key."),t.lastError=a.error}})()}editorGenerated(t){var s=this;return(0,l.Z)(function*(){s.editorRedis=t,yield s.monacoS.loadSchemaEditorSettings(s.BE_HOST_PORT,s.authCS.getUserId(),null),s.monacoS.addSaveCodeKeyBinding(t,a=>{s.form.valid&&s.save()})})()}viewError(){this.viewDockerfileModelC.showModal(this.generalCS.stringify(this.lastError),M.d.json)}ngOnDestroy(){this.generalCS.unsubscribe(this.subscriptions)}static \u0275fac=function(s){return new(s||n)(e.Y36(c.qu),e.Y36(D.W),e.Y36(v.b),e.Y36(S.E),e.Y36(C.L),e.Y36(T.D),e.Y36(y.b))};static \u0275cmp=e.Xpm({type:n,selectors:[["app-redis-new-key-form"]],viewQuery:function(s,a){if(1&s&&e.Gf(k,5),2&s){let r;e.iGM(r=e.CRH())&&(a.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(s,a){1&s&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,U,3,0,"span",4),e.YNc(5,J,3,0,"span",4),e.YNc(6,Y,3,0,"span",4),e.TgZ(7,"div",5)(8,"button",6)(9,"span",7),e._UZ(10,"i",8),e.qZA()(),e.TgZ(11,"a",9),e._UZ(12,"img",10),e.qZA()()(),e.TgZ(13,"div",11)(14,"form",12)(15,"div",13),e.YNc(16,G,2,0,"label",14),e.YNc(17,V,2,0,"div",15),e.TgZ(18,"label",16),e._uU(19,"TTL"),e.qZA(),e.TgZ(20,"div",17),e._UZ(21,"input",18),e.qZA()(),e.YNc(22,P,2,2,"div",19),e.qZA()(),e.TgZ(23,"div",20),e.YNc(24,Q,2,0,"a",21),e.TgZ(25,"button",22),e._UZ(26,"i",23),e._uU(27," Close"),e.qZA(),e.YNc(28,B,4,3,"button",24),e.qZA(),e.YNc(29,q,1,0,"p-progressSpinner",25),e.qZA()()(),e._UZ(30,"app-monaco-editor-modal",26,27)),2&s&&(e.xp6(4),e.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",a.data.mode===a.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",a.data.mode===a.EFormMode.EDIT),e.xp6(8),e.Q6J("formGroup",a.form),e.xp6(2),e.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),e.xp6(1),e.Q6J("ngClass",e.VKq(15,W,a.data.mode===a.EFormMode.EDIT)),e.xp6(2),e.Q6J("ngClass",e.WLB(17,j,a.data.mode===a.EFormMode.ADD,a.data.mode===a.EFormMode.EDIT)),e.xp6(2),e.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),e.xp6(2),e.Q6J("ngIf",a.lastError),e.xp6(4),e.Q6J("ngIf",a.data.mode!==a.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",a.loading.form),e.xp6(1),e.Q6J("modalId","idMonacoEditorModalInRedisDashboard")("editorOptionsMonacoEditorModal",a.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[c._Y,c.Fj,c.wV,c.JJ,c.JL,c.sg,c.u,m.mk,m.O5,A.y,R.O,Z.G,O.A],encapsulation:2})}return n})();const X=["redisNewKeyFormC"];function ee(n,i){if(1&n&&(e.TgZ(0,"span",7)(1,"h4",8),e._uU(2),e.qZA()()),2&n){const t=e.oxw(2);e.xp6(2),e.Oqu(t.constantsS.redis.setupExternalRedis)}}function te(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"span",28),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(4);return e.KtG(a.keyDelete())}),e._UZ(1,"i",29),e.qZA()}}function ae(n,i){if(1&n&&(e.TgZ(0,"div",30),e._uU(1),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.Oqu(t.label)}}function se(n,i){1&n&&e._UZ(0,"p-progressSpinner",31)}function ne(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",11)(1,"div",12)(2,"span"),e._UZ(3,"img",13),e._uU(4," Redis Dashboard"),e.qZA(),e.TgZ(5,"span")(6,"div",14)(7,"a",15),e._UZ(8,"img",16),e.qZA()(),e.TgZ(9,"span",17),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(3);return e.KtG(a.add())}),e._UZ(10,"i",18),e.qZA(),e.TgZ(11,"span",19),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(3);return e.KtG(a.loadRedisDataList())}),e._UZ(12,"i",20),e.qZA(),e.YNc(13,te,2,0,"span",21),e.TgZ(14,"span",22),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(3);return e.KtG(a.flushAll())}),e._UZ(15,"i",23),e.qZA()()(),e.TgZ(16,"div",24)(17,"p-tree",25),e.NdJ("selectionChange",function(a){e.CHM(t);const r=e.oxw(3);return e.KtG(r.selectedKeys=a)})("selectionChange",function(){e.CHM(t);const a=e.oxw(3);return e.KtG(a.selectedKeysChange())}),e.YNc(18,ae,2,1,"ng-template",26),e.qZA(),e.YNc(19,se,1,0,"p-progressSpinner",27),e.qZA()()}if(2&n){const t=e.oxw(3);e.xp6(13),e.Q6J("ngIf",null==t.selectedKeys?null:t.selectedKeys.length),e.xp6(4),e.Q6J("value",t.parsedData)("selection",t.selectedKeys)("filter",!0)("metaKeySelection",!0),e.xp6(2),e.Q6J("ngIf",t.loading.grid)}}function oe(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"span",39),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(4);return e.KtG(a.update())}),e._UZ(1,"i",40),e.TgZ(2,"span"),e._uU(3,"Update"),e.qZA()()}}function ie(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"span",39),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(4);return e.KtG(a.updateTTL())}),e._UZ(1,"i",40),e.TgZ(2,"span"),e._uU(3,"UpdateTTL"),e.qZA()()}}function re(n,i){if(1&n&&(e.TgZ(0,"span",41)(1,"span"),e._uU(2),e.qZA()()),2&n){const t=e.oxw(4);e.xp6(2),e.Oqu(t.ttlValue)}}function le(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",11)(1,"div",12)(2,"span",32),e._UZ(3,"i",33),e._uU(4," Redis "),e.qZA(),e.TgZ(5,"span",34),e._uU(6),e.qZA(),e.YNc(7,oe,4,0,"span",35),e.YNc(8,ie,4,0,"span",35),e.YNc(9,re,3,1,"span",36),e.qZA(),e.TgZ(10,"div",37)(11,"app-monaco-editor",38),e.NdJ("editorGenerated",function(a){e.CHM(t);const r=e.oxw(3);return e.KtG(r.editorGenerated(a))}),e.qZA()()()}if(2&n){const t=e.oxw(3);e.xp6(6),e.Oqu(null==t.selectedKeys||null==t.selectedKeys[0]?null:t.selectedKeys[0].key),e.xp6(1),e.Q6J("ngIf",null==t.selectedKeys||null==t.selectedKeys[0]?null:t.selectedKeys[0].key),e.xp6(1),e.Q6J("ngIf",null==t.selectedKeys||null==t.selectedKeys[0]?null:t.selectedKeys[0].key),e.xp6(1),e.Q6J("ngIf",(null==t.selectedKeys||null==t.selectedKeys[0]?null:t.selectedKeys[0].key)&&t.ttlValue>0),e.xp6(2),e.Q6J("isSchemaEditor",!1)("editorOptions",t.editorOptionsSchema)}}const de=function(){return{height:"100%"}},ce=function(){return[30,70]};function pe(n,i){1&n&&(e.TgZ(0,"p-splitter",9),e.YNc(1,ne,20,6,"ng-template",10),e.YNc(2,le,12,6,"ng-template",10),e.qZA()),2&n&&(e.Akn(e.DdM(3,de)),e.Q6J("panelSizes",e.DdM(4,ce)))}function me(n,i){if(1&n&&(e.TgZ(0,"div",3)(1,"div",4),e.YNc(2,ee,3,1,"span",5),e.YNc(3,pe,3,5,"p-splitter",6),e.qZA()()),2&n){const t=e.oxw();e.xp6(2),e.Q6J("ngIf",!t.isExternalRedisSetupDoneByRoot),e.xp6(1),e.Q6J("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=h.N.BE_HOST_PORT;redisNewKeyFormC;data={mode:p.D.ADD,eventChannel:new e.vpe,formData:void 0};virtual={itemHeight:28};parsedData;ttlValue;intervalRef;constructor(t,s,a,r,f,u,_,ve){this.monacoS=t,this.generalS=s,this.ns=a,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.F.SAVED?(this.redisNewKeyFormC.hideModal(),this.loadRedisDataList()):t.action===d.F.UPDATED&&(this.redisNewKeyFormC.hideModal(),this.loadRedisDataList(),this.ttlValue=t.data))})),this.generalS.setNewTitle("API Maker - Redis Dashboard")}loadRedisDataList(){var t=this;return(0,l.Z)(function*(){t.loading.grid=!0;const s=(yield t.instanceS.getRedisKeysTree().toPromise()).data;for(const r of s)t.generalS.convertKTreeItemToPrimeNGTreeItem(r);const a={};t.generalS.getMapOfAllItems(a,s),t.parsedData=s,t.treeNodes=t.parsedData,t.allTreeItemsMap=a,t.loading.grid=!1,t.cd.detectChanges()})()}selectedKeysChange(){var t=this;return(0,l.Z)(function*(){if(t.ttlValue="",1===t.selectedKeys.length){const s=t.selectedKeys[0];if(s.children?.length)t.editor.setValue("");else{const a=yield t.instanceS.getRedisValue(s.key).toPromise();a?.data?.value&&(t.editor.setValue("string"==typeof a?.data?.value?a.data.value:JSON.stringify(a?.data?.value,null,4)),a?.data?.ttl>0&&(t.ttlValue=a.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.Z)(function*(){try{t.loading.grid=!0;const s={keyName:t.selectedKeys[0].key,redisCodeStr:t.editor.getValue(),ttl:t.ttlValue};yield t.instanceS.updateRedisKeys(s),t.data.mode=p.D.EDIT,t.ns.showSuccess(t.constantsS.redis.editSuccess),t.loading.grid=!1}catch(s){t.loading.grid=!1,t.ns.showErrorFromResponse(s.error||s,"Unable to update.")}})()}updateTTL(){var t=this;return(0,l.Z)(function*(){try{const s={keyName:t.selectedKeys[0].key,redisCodeStr:t.editor.getValue(),ttl:t.ttlValue};t.data.formData=void 0,t.data.mode=p.D.EDIT,t.data.eventChannel.emit({action:d.F.OPEN_FORM_IN_EDIT_MODE,data:s}),t.redisNewKeyFormC.showModal()}catch(s){t.loading.grid=!1,t.ns.showErrorFromResponse(s.error||s,"Unable to update TTL.")}})()}editorGenerated(t){var s=this;return(0,l.Z)(function*(){s.editor=t,yield s.monacoS.loadSchemaEditorSettings(s.BE_HOST_PORT,s.authCS.getUserId(),null)})()}add(){this.data.formData=void 0,this.data.mode=p.D.ADD,this.data.eventChannel.emit({action:d.F.OPEN_FORM_IN_ADD_MODE}),this.redisNewKeyFormC.showModal()}keyDelete(){var t=this;return(0,l.Z)(function*(){var s;t.confirmationService.confirm({message:t.constantsS.redis.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(s=(0,l.Z)(function*(){yield t.removePermanent()}),function(){return s.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,l.Z)(function*(){t.loading.grid=!0;const s=yield t.instanceS.redisKeyPermanentDelete(b.map(t.selectedKeys,"key")).toPromise();t.loading.grid=!1,s.success?(t.ns.showSuccess(t.constantsS.redis.removePermanent),t.loadRedisDataList(),t.editor.setValue(""),t.selectedKeys=[],t.ttlValue=""):t.ns.showErrorFromResponse(s,t.constantsS.redis.removePermanentError)})()}isExternalRedisSetupDoneByRoot;getExternalRedisSetupFromPackageJson(){var t=this;return(0,l.Z)(function*(){t.loading.grid=!0;try{const s=(yield t.instanceS.getExternalSetupStatus().toPromise()).data;t.loading.grid=!1,t.isExternalRedisSetupDoneByRoot=!0===s.isRedisSetupDone}catch{t.isExternalRedisSetupDoneByRoot=!1}})()}flushAll(){var t=this;return(0,l.Z)(function*(){var s;t.confirmationService.confirm({message:t.constantsS.redis.flushAllConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(s=(0,l.Z)(function*(){yield t.flushAllData()}),function(){return s.apply(this,arguments)})})})()}flushAllData(){var t=this;return(0,l.Z)(function*(){t.loading.grid=!0;const s=yield t.instanceS.resetCache().toPromise();t.loading.grid=!1,s.success?(t.ns.showSuccess("Flush operation completed."),t.loadRedisDataList(),t.selectedItem=!1,t.editor.setValue("")):t.ns.showErrorFromResponse(s,t.constantsS.redis.removePermanentError)})()}ngOnDestroy(){this.stopTTLReduceInterval(),this.generalS.unsubscribe(this.subscriptions)}ERequestMethod=w.Yp;undefined=void 0;static \u0275fac=function(s){return new(s||n)(e.Y36(v.b),e.Y36(y.b),e.Y36(D.W),e.Y36(T.D),e.Y36(C.L),e.Y36(e.sBO),e.Y36(x.YP),e.Y36(S.E))};static \u0275cmp=e.Xpm({type:n,selectors:[["app-redis-dashboard"]],viewQuery:function(s,a){if(1&s&&e.Gf(X,5),2&s){let r;e.iGM(r=e.CRH())&&(a.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(s,a){1&s&&(e.YNc(0,me,4,2,"div",0),e._UZ(1,"app-redis-new-key-form",1,2)),2&s&&(e.Q6J("ngIf",void 0!==a.isExternalRedisSetupDoneByRoot),e.xp6(1),e.Q6J("data",a.data))},dependencies:[m.O5,R.O,x.jx,K.mp,Z.G,F.q,I.u,z]})}return n})();var ue=o(1678),_e=o(4950);const ge=[{path:"",component:fe}];let he=(()=>{class n{static \u0275fac=function(s){return new(s||n)};static \u0275mod=e.oAB({type:n});static \u0275inj=e.cJS({imports:[N.Bz.forChild(ge),E.u,ue.DashboardM,_e.A]})}return n})()}}]);
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[4110],{4110:(ye,g,o)=>{o.r(g),o.d(g,{RedisDashboardM:()=>he});var E=o(8761),N=o(7664),l=o(5861),e=o(4946),b=o(6990),d=o(3157),p=o(328),w=o(6925),h=o(553),v=o(2304),y=o(7240),D=o(9961),T=o(5852),C=o(7414),x=o(5219),S=o(3429),m=o(6814),R=o(756),K=o(7526),Z=o(7680),F=o(5043),I=o(3259),c=o(95),M=o(1601),A=o(2660),O=o(5025);const k=["monacoEditorModalC"];function U(n,i){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",28),e._uU(2," Add New Key"),e.qZA())}function J(n,i){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",29),e._uU(2," View New Key"),e.qZA())}function Y(n,i){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",30),e._uU(2," Edit New Key"),e.qZA())}function G(n,i){1&n&&(e.TgZ(0,"label",31),e._uU(1,"Key Name"),e.qZA())}function V(n,i){1&n&&(e.TgZ(0,"div",32),e._UZ(1,"input",33),e.qZA())}function P(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",34)(1,"app-monaco-editor",35),e.NdJ("editorGenerated",function(a){e.CHM(t);const r=e.oxw();return e.KtG(r.editorGenerated(a))}),e.qZA()()}if(2&n){const t=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!0)("editorOptions",t.editorOptionsRedis)}}function Q(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"a",36),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.viewError())}),e._uU(1,"View error"),e.qZA()}}function H(n,i){1&n&&(e.TgZ(0,"span"),e._uU(1,"Save"),e.qZA())}function L(n,i){1&n&&(e.TgZ(0,"span"),e._uU(1,"Update"),e.qZA())}function B(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"button",37),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.save())}),e._UZ(1,"i",38),e.YNc(2,H,2,0,"span",4),e.YNc(3,L,2,0,"span",4),e.qZA()}if(2&n){const t=e.oxw();e.Q6J("disabled",!(null!=t.form.get("keyName").value&&t.form.get("keyName").value.toString().trim())),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function q(n,i){1&n&&e._UZ(0,"p-progressSpinner",39)}const W=function(n){return{"col-3":n}},j=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=p.D;form;subscriptions=[];editorRedis;editorOptionsRedis={readOnly:!1,language:"json",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};BE_HOST_PORT=h.N.BE_HOST_PORT;viewDockerfileModelC;actualKeyData;constructor(t,s,a,r,f,u,_){this.fb=t,this.ns=s,this.monacoS=a,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 s=(0,l.Z)(function*(a){a&&(t.form.enable(),a.action===d.F.OPEN_FORM_IN_EDIT_MODE?(t.actualKeyData=a,t.form.reset(),t.form.get("ttl").setValue(t.actualKeyData.data.ttl),t.form.get("keyName").setValue(t.actualKeyData.data.keyName)):a.action===d.F.OPEN_FORM_IN_VIEW_MODE?(t.form.reset(),t.form.disable()):a.action===d.F.OPEN_FORM_IN_ADD_MODE&&(t.form.reset(),t.generalCS.setValueInEditor(t,"editorRedis","{}")))});return function(a){return s.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({keyName:[null,[c.kI.required]],ttl:[null,[c.kI.required]]})}showModal(){this.lastError=void 0,$("#idNewKeyForm").modal("show")}hideModal(){$("#idNewKeyForm").modal("hide")}save(){var t=this;return(0,l.Z)(function*(){const s=t.form.getRawValue();s.redisCodeStr=t.editorRedis.getValue();try{let a;if(t.loading.form=!0,t.lastError=void 0,t.data.mode===p.D.ADD)a=yield t.instanceS.saveRedisKeys(s),t.ns.showSuccess(t.constantsS.redis.addSuccess),t.data.eventChannel.emit({action:t.data.mode===p.D.ADD?d.F.SAVED:d.F.UPDATED});else if(t.data.mode===p.D.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.F.UPDATED,data:t.form.get("ttl").value})}t.loading.form=!1}catch(a){t.loading.form=!1,t.ns.showErrorFromResponse(a.error||a,"Unable to save redis key."),t.lastError=a.error}})()}editorGenerated(t){var s=this;return(0,l.Z)(function*(){s.editorRedis=t,yield s.monacoS.loadSchemaEditorSettings(s.BE_HOST_PORT,s.authCS.getUserId(),null),s.monacoS.addSaveCodeKeyBinding(t,a=>{s.form.valid&&s.save()})})()}viewError(){this.viewDockerfileModelC.showModal(this.generalCS.stringify(this.lastError),M.d.json)}ngOnDestroy(){this.generalCS.unsubscribe(this.subscriptions)}static \u0275fac=function(s){return new(s||n)(e.Y36(c.qu),e.Y36(D.W),e.Y36(v.b),e.Y36(S.E),e.Y36(C.L),e.Y36(T.D),e.Y36(y.b))};static \u0275cmp=e.Xpm({type:n,selectors:[["app-redis-new-key-form"]],viewQuery:function(s,a){if(1&s&&e.Gf(k,5),2&s){let r;e.iGM(r=e.CRH())&&(a.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(s,a){1&s&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,U,3,0,"span",4),e.YNc(5,J,3,0,"span",4),e.YNc(6,Y,3,0,"span",4),e.TgZ(7,"div",5)(8,"button",6)(9,"span",7),e._UZ(10,"i",8),e.qZA()(),e.TgZ(11,"a",9),e._UZ(12,"img",10),e.qZA()()(),e.TgZ(13,"div",11)(14,"form",12)(15,"div",13),e.YNc(16,G,2,0,"label",14),e.YNc(17,V,2,0,"div",15),e.TgZ(18,"label",16),e._uU(19,"TTL"),e.qZA(),e.TgZ(20,"div",17),e._UZ(21,"input",18),e.qZA()(),e.YNc(22,P,2,2,"div",19),e.qZA()(),e.TgZ(23,"div",20),e.YNc(24,Q,2,0,"a",21),e.TgZ(25,"button",22),e._UZ(26,"i",23),e._uU(27," Close"),e.qZA(),e.YNc(28,B,4,3,"button",24),e.qZA(),e.YNc(29,q,1,0,"p-progressSpinner",25),e.qZA()()(),e._UZ(30,"app-monaco-editor-modal",26,27)),2&s&&(e.xp6(4),e.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",a.data.mode===a.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",a.data.mode===a.EFormMode.EDIT),e.xp6(8),e.Q6J("formGroup",a.form),e.xp6(2),e.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),e.xp6(1),e.Q6J("ngClass",e.VKq(15,W,a.data.mode===a.EFormMode.EDIT)),e.xp6(2),e.Q6J("ngClass",e.WLB(17,j,a.data.mode===a.EFormMode.ADD,a.data.mode===a.EFormMode.EDIT)),e.xp6(2),e.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),e.xp6(2),e.Q6J("ngIf",a.lastError),e.xp6(4),e.Q6J("ngIf",a.data.mode!==a.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",a.loading.form),e.xp6(1),e.Q6J("modalId","idMonacoEditorModalInRedisDashboard")("editorOptionsMonacoEditorModal",a.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[c._Y,c.Fj,c.wV,c.JJ,c.JL,c.sg,c.u,m.mk,m.O5,A.y,R.O,Z.G,O.A],encapsulation:2})}return n})();const X=["redisNewKeyFormC"];function ee(n,i){if(1&n&&(e.TgZ(0,"span",7)(1,"h4",8),e._uU(2),e.qZA()()),2&n){const t=e.oxw(2);e.xp6(2),e.Oqu(t.constantsS.redis.setupExternalRedis)}}function te(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"span",28),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(4);return e.KtG(a.keyDelete())}),e._UZ(1,"i",29),e.qZA()}}function ae(n,i){if(1&n&&(e.TgZ(0,"div",30),e._uU(1),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.Oqu(t.label)}}function se(n,i){1&n&&e._UZ(0,"p-progressSpinner",31)}function ne(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",11)(1,"div",12)(2,"span"),e._UZ(3,"img",13),e._uU(4," Redis Dashboard"),e.qZA(),e.TgZ(5,"span")(6,"div",14)(7,"a",15),e._UZ(8,"img",16),e.qZA()(),e.TgZ(9,"span",17),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(3);return e.KtG(a.add())}),e._UZ(10,"i",18),e.qZA(),e.TgZ(11,"span",19),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(3);return e.KtG(a.loadRedisDataList())}),e._UZ(12,"i",20),e.qZA(),e.YNc(13,te,2,0,"span",21),e.TgZ(14,"span",22),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(3);return e.KtG(a.flushAll())}),e._UZ(15,"i",23),e.qZA()()(),e.TgZ(16,"div",24)(17,"p-tree",25),e.NdJ("selectionChange",function(a){e.CHM(t);const r=e.oxw(3);return e.KtG(r.selectedKeys=a)})("selectionChange",function(){e.CHM(t);const a=e.oxw(3);return e.KtG(a.selectedKeysChange())}),e.YNc(18,ae,2,1,"ng-template",26),e.qZA(),e.YNc(19,se,1,0,"p-progressSpinner",27),e.qZA()()}if(2&n){const t=e.oxw(3);e.xp6(13),e.Q6J("ngIf",null==t.selectedKeys?null:t.selectedKeys.length),e.xp6(4),e.Q6J("value",t.parsedData)("selection",t.selectedKeys)("filter",!0)("metaKeySelection",!0),e.xp6(2),e.Q6J("ngIf",t.loading.grid)}}function oe(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"span",39),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(4);return e.KtG(a.update())}),e._UZ(1,"i",40),e.TgZ(2,"span"),e._uU(3,"Update"),e.qZA()()}}function ie(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"span",39),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(4);return e.KtG(a.updateTTL())}),e._UZ(1,"i",40),e.TgZ(2,"span"),e._uU(3,"UpdateTTL"),e.qZA()()}}function re(n,i){if(1&n&&(e.TgZ(0,"span",41)(1,"span"),e._uU(2),e.qZA()()),2&n){const t=e.oxw(4);e.xp6(2),e.Oqu(t.ttlValue)}}function le(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",11)(1,"div",12)(2,"span",32),e._UZ(3,"i",33),e._uU(4," Redis "),e.qZA(),e.TgZ(5,"span",34),e._uU(6),e.qZA(),e.YNc(7,oe,4,0,"span",35),e.YNc(8,ie,4,0,"span",35),e.YNc(9,re,3,1,"span",36),e.qZA(),e.TgZ(10,"div",37)(11,"app-monaco-editor",38),e.NdJ("editorGenerated",function(a){e.CHM(t);const r=e.oxw(3);return e.KtG(r.editorGenerated(a))}),e.qZA()()()}if(2&n){const t=e.oxw(3);e.xp6(6),e.Oqu(null==t.selectedKeys||null==t.selectedKeys[0]?null:t.selectedKeys[0].key),e.xp6(1),e.Q6J("ngIf",null==t.selectedKeys||null==t.selectedKeys[0]?null:t.selectedKeys[0].key),e.xp6(1),e.Q6J("ngIf",null==t.selectedKeys||null==t.selectedKeys[0]?null:t.selectedKeys[0].key),e.xp6(1),e.Q6J("ngIf",(null==t.selectedKeys||null==t.selectedKeys[0]?null:t.selectedKeys[0].key)&&t.ttlValue>0),e.xp6(2),e.Q6J("isSchemaEditor",!1)("editorOptions",t.editorOptionsSchema)}}const de=function(){return{height:"100%"}},ce=function(){return[30,70]};function pe(n,i){1&n&&(e.TgZ(0,"p-splitter",9),e.YNc(1,ne,20,6,"ng-template",10),e.YNc(2,le,12,6,"ng-template",10),e.qZA()),2&n&&(e.Akn(e.DdM(3,de)),e.Q6J("panelSizes",e.DdM(4,ce)))}function me(n,i){if(1&n&&(e.TgZ(0,"div",3)(1,"div",4),e.YNc(2,ee,3,1,"span",5),e.YNc(3,pe,3,5,"p-splitter",6),e.qZA()()),2&n){const t=e.oxw();e.xp6(2),e.Q6J("ngIf",!t.isExternalRedisSetupDoneByRoot),e.xp6(1),e.Q6J("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=h.N.BE_HOST_PORT;redisNewKeyFormC;data={mode:p.D.ADD,eventChannel:new e.vpe,formData:void 0};virtual={itemHeight:28};parsedData;ttlValue;intervalRef;constructor(t,s,a,r,f,u,_,ve){this.monacoS=t,this.generalS=s,this.ns=a,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.F.SAVED?(this.redisNewKeyFormC.hideModal(),this.loadRedisDataList()):t.action===d.F.UPDATED&&(this.redisNewKeyFormC.hideModal(),this.loadRedisDataList(),this.ttlValue=t.data))})),this.generalS.setNewTitle("API Maker - Redis Dashboard")}loadRedisDataList(){var t=this;return(0,l.Z)(function*(){t.loading.grid=!0;const s=(yield t.instanceS.getRedisKeysTree().toPromise()).data;for(const r of s)t.generalS.convertKTreeItemToPrimeNGTreeItem(r);const a={};t.generalS.getMapOfAllItems(a,s),t.parsedData=s,t.treeNodes=t.parsedData,t.allTreeItemsMap=a,t.loading.grid=!1,t.cd.detectChanges()})()}selectedKeysChange(){var t=this;return(0,l.Z)(function*(){if(t.ttlValue="",1===t.selectedKeys.length){const s=t.selectedKeys[0];if(s.children?.length)t.editor.setValue("");else{const a=yield t.instanceS.getRedisValue(s.key).toPromise();a?.data?.value&&(t.editor.setValue("string"==typeof a?.data?.value?a.data.value:JSON.stringify(a?.data?.value,null,4)),a?.data?.ttl>0&&(t.ttlValue=a.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.Z)(function*(){try{t.loading.grid=!0;const s={keyName:t.selectedKeys[0].key,redisCodeStr:t.editor.getValue(),ttl:t.ttlValue};yield t.instanceS.updateRedisKeys(s),t.data.mode=p.D.EDIT,t.ns.showSuccess(t.constantsS.redis.editSuccess),t.loading.grid=!1}catch(s){t.loading.grid=!1,t.ns.showErrorFromResponse(s.error||s,"Unable to update.")}})()}updateTTL(){var t=this;return(0,l.Z)(function*(){try{const s={keyName:t.selectedKeys[0].key,redisCodeStr:t.editor.getValue(),ttl:t.ttlValue};t.data.formData=void 0,t.data.mode=p.D.EDIT,t.data.eventChannel.emit({action:d.F.OPEN_FORM_IN_EDIT_MODE,data:s}),t.redisNewKeyFormC.showModal()}catch(s){t.loading.grid=!1,t.ns.showErrorFromResponse(s.error||s,"Unable to update TTL.")}})()}editorGenerated(t){var s=this;return(0,l.Z)(function*(){s.editor=t,yield s.monacoS.loadSchemaEditorSettings(s.BE_HOST_PORT,s.authCS.getUserId(),null)})()}add(){this.data.formData=void 0,this.data.mode=p.D.ADD,this.data.eventChannel.emit({action:d.F.OPEN_FORM_IN_ADD_MODE}),this.redisNewKeyFormC.showModal()}keyDelete(){var t=this;return(0,l.Z)(function*(){var s;t.confirmationService.confirm({message:t.constantsS.redis.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(s=(0,l.Z)(function*(){yield t.removePermanent()}),function(){return s.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,l.Z)(function*(){t.loading.grid=!0;const s=yield t.instanceS.redisKeyPermanentDelete(b.map(t.selectedKeys,"key")).toPromise();t.loading.grid=!1,s.success?(t.ns.showSuccess(t.constantsS.redis.removePermanent),t.loadRedisDataList(),t.editor.setValue(""),t.selectedKeys=[],t.ttlValue=""):t.ns.showErrorFromResponse(s,t.constantsS.redis.removePermanentError)})()}isExternalRedisSetupDoneByRoot;getExternalRedisSetupFromPackageJson(){var t=this;return(0,l.Z)(function*(){t.loading.grid=!0;try{const s=(yield t.instanceS.getExternalSetupStatus().toPromise()).data;t.loading.grid=!1,t.isExternalRedisSetupDoneByRoot=!0===s.isRedisSetupDone}catch{t.isExternalRedisSetupDoneByRoot=!1}})()}flushAll(){var t=this;return(0,l.Z)(function*(){var s;t.confirmationService.confirm({message:t.constantsS.redis.flushAllConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(s=(0,l.Z)(function*(){yield t.flushAllData()}),function(){return s.apply(this,arguments)})})})()}flushAllData(){var t=this;return(0,l.Z)(function*(){t.loading.grid=!0;const s=yield t.instanceS.resetCache().toPromise();t.loading.grid=!1,s.success?(t.ns.showSuccess("Flush operation completed."),t.loadRedisDataList(),t.selectedItem=!1,t.editor.setValue("")):t.ns.showErrorFromResponse(s,t.constantsS.redis.removePermanentError)})()}ngOnDestroy(){this.stopTTLReduceInterval(),this.generalS.unsubscribe(this.subscriptions)}ERequestMethod=w.Yp;undefined=void 0;static \u0275fac=function(s){return new(s||n)(e.Y36(v.b),e.Y36(y.b),e.Y36(D.W),e.Y36(T.D),e.Y36(C.L),e.Y36(e.sBO),e.Y36(x.YP),e.Y36(S.E))};static \u0275cmp=e.Xpm({type:n,selectors:[["app-redis-dashboard"]],viewQuery:function(s,a){if(1&s&&e.Gf(X,5),2&s){let r;e.iGM(r=e.CRH())&&(a.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(s,a){1&s&&(e.YNc(0,me,4,2,"div",0),e._UZ(1,"app-redis-new-key-form",1,2)),2&s&&(e.Q6J("ngIf",void 0!==a.isExternalRedisSetupDoneByRoot),e.xp6(1),e.Q6J("data",a.data))},dependencies:[m.O5,R.O,x.jx,K.mp,Z.G,F.q,I.u,z]})}return n})();var ue=o(1678),_e=o(4950);const ge=[{path:"",component:fe}];let he=(()=>{class n{static \u0275fac=function(s){return new(s||n)};static \u0275mod=e.oAB({type:n});static \u0275inj=e.cJS({imports:[N.Bz.forChild(ge),E.u,ue.DashboardM,_e.A]})}return n})()}}]);
|