PageSourceSearch

https://dcs.vn/9666.987417c08705e3a1.js

js dcs.vn collected 2026-09-24 21:35:48 UTC 24,628 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkmyapp=self.webpackChunkmyapp||[]).push([[9666],{39666:(ot,I,a)=>{a.r(I),a.d(I,{CoreWhitelistIpsComponent:()=>nt});var t=a(23135),_=a(98231),c=a(90695),v=a(51628),x=a(62252),f=a(52317),C=a(44025),b=a(86570),R=a(52702),V=a(62794),M=a(77257),A=a(30059),E=a(8077),T=a(15941),g=a(15799),F=a(98259),w=a(51996),d=a(15385),O=a(8179),y=a(44267),S=a(27720),k=a(28113),P=a(2765);function L(n,h){1&n&&(t.j41(0,"span",5),t.nrm(1,"i",6),t.k0s())}function B(n,h){1&n&&(t.j41(0,"div",12),t.nrm(1,"vts-alert",13),t.nI1(2,"translate"),t.k0s()),2&n&&(t.R7$(),t.Y8G("vtsMessage",t.bMT(2,1,"core.whitelist.modal.disabledWarning")))}function W(n,h){1&n&&t.EFF(0," Vui l\xf2ng nh\u1eadp \u0111\u1ecba ch\u1ec9 URL ho\u1eb7c IP h\u1ee3p l\u1ec7 ")}function j(n,h){if(1&n&&t.EFF(0),2&n){let e;const i=t.XpG(3);t.SpI(" ",null==(e=i.form.get("urlAddress"))?null:e.getError("serverError")," ")}}function U(n,h){1&n&&t.EFF(0," URL kh\xf4ng h\u1ee3p l\u1ec7 ! ")}function G(n,h){if(1&n&&t.DNE(0,W,1,0)(1,j,1,1)(2,U,1,0),2&n){let e;const i=t.XpG(2);t.vxM(null!=(e=i.form.get("urlAddress"))&&e.hasError("required")||null!=(e=i.form.get("urlAddress"))&&e.hasError("whitespaceOnly")?0:null!=(e=i.form.get("urlAddress"))&&e.hasError("serverError")?1:null!=(e=i.form.get("urlAddress"))&&e.hasError("invalidUrl")?2:-1)}}function N(n,h){if(1&n){const e=t.RV6();t.qex(0),t.DNE(1,B,3,3,"div",7),t.j41(2,"form",8)(3,"vts-form-item")(4,"vts-form-label",9),t.EFF(5),t.nI1(6,"translate"),t.k0s(),t.j41(7,"vts-form-control",10)(8,"input",11),t.nI1(9,"translate"),t.bIt("keydown",function(s){t.eBV(e);const o=t.XpG();return t.Njj(o.blockInvalidUrlChars(s))})("paste",function(s){t.eBV(e);const o=t.XpG();return t.Njj(o.handleUrlPaste(s))})("input",function(){let s;t.eBV(e);const o=t.XpG();return t.Njj(null==(s=o.form.get("urlAddress"))?null:s.markAsDirty())}),t.k0s()()()(),t.DNE(10,G,3,1,"ng-template",null,2,t.C5r),t.bVm()}if(2&n){const e=t.sdS(11),i=t.XpG();t.R7$(),t.Y8G("ngIf",!i.isWhitelistEnabled()),t.R7$(),t.Y8G("formGroup",i.form),t.R7$(3),t.JRh(t.bMT(6,6,"core.whitelist.field.ipAddress")),t.R7$(2),t.Y8G("vtsValidateStatus",i.form.controls.urlAddress)("vtsErrorTip",e),t.R7$(),t.Y8G("placeholder",t.bMT(9,8,"core.whitelist.placeholder.ipAddress"))}}function X(n,h){if(1&n){const e=t.RV6();t.j41(0,"button",14),t.bIt("click",function(){t.eBV(e);const s=t.XpG(2);return t.Njj(s.handleDelete())}),t.nrm(1,"i",19),t.EFF(2," X\xf3a "),t.k0s()}}function $(n,h){if(1&n){const e=t.RV6();t.j41(0,"button",20),t.bIt("click",function(){t.eBV(e);const s=t.XpG(2);return t.Njj(s.handleEdit())}),t.nrm(1,"i",21),t.EFF(2," Ch\u1ec9nh s\u1eeda "),t.k0s()}}function z(n,h){if(1&n){const e=t.RV6();t.j41(0,"button",22),t.bIt("click",function(){t.eBV(e);const s=t.XpG(2);return t.Njj(s.handleSave())}),t.nrm(1,"i",23),t.EFF(2," L\u01b0u th\xf4ng tin "),t.k0s()}if(2&n){const e=t.XpG(2);t.Y8G("vtsLoading",e.isLoading())}}function Q(n,h){if(1&n){const e=t.RV6();t.j41(0,"button",14),t.bIt("click",function(){t.eBV(e);const s=t.XpG();return t.Njj(s.handleCancel())}),t.nrm(1,"i",15),t.EFF(2," Quay l\u1ea1i "),t.k0s(),t.DNE(3,X,3,0,"button",16)(4,$,3,0,"button",17)(5,z,3,1,"button",18)}if(2&n){const e=t.XpG();t.R7$(3),t.vxM(e.isDetailMode()&&e.canDelete()?3:-1),t.R7$(),t.vxM(e.isDetailMode()&&e.canUpdate()?4:-1),t.R7$(),t.vxM(!e.isDetailMode()&&e.canSave()?5:-1)}}let Y=(()=>{class n{blockInvalidUrlChars(e){e.key.length>1||this.ALLOWED_URL_CHARS.test(e.key)||e.preventDefault()}handleUrlPaste(e){e.preventDefault();const s=(e.clipboardData?.getData("text")||"").split("").filter(m=>this.ALLOWED_URL_CHARS.test(m)).join(""),o=e.target,r=o.selectionStart??o.value.length,l=o.selectionEnd??o.value.length,p=this.form.get("urlAddress")?.value||"",u=p.slice(0,r)+s+p.slice(l);this.form.get("urlAddress")?.setValue(u),setTimeout(()=>o.setSelectionRange(r+s.length,r+s.length),0)}ngOnInit(){}constructor(){this.fb=(0,t.WQX)(c.ok),this.configService=(0,t.WQX)(w.Fl),this.elRef=(0,t.WQX)(t.aKT),this.isVisible=t.geq.required(),this.isEditMode=(0,t.hFB)(!1),this.isDetailMode=(0,t.hFB)(!1),this.data=(0,t.hFB)(null),this.isLoading=(0,t.hFB)(!1),this.errorMessage=(0,t.hFB)(null),this.canDelete=(0,t.hFB)(!1),this.canUpdate=(0,t.hFB)(!1),this.canSave=(0,t.hFB)(!1),this.returnToDetailOnCancel=(0,t.hFB)(!1),this.onCancel=(0,t.CGW)(),this.onSave=(0,t.CGW)(),this.onDelete=(0,t.CGW)(),this.onEdit=(0,t.CGW)(),this.isWhitelistEnabled=(0,t.vPA)(!0),this.URL_REGEX=/^https?:\/\/[a-zA-Z0-9\-._~:/?#\[\]@!$&'()*+,;=%]+$/,this.VALIDATOR_URL_ADDRESS=e=>{if(!e.value)return null;const i="string"==typeof e.value?e.value.trim():e.value;return 0===i.length?{whitespaceOnly:!0}
1:this.URL_REGEX.test(i)?null:{invalidUrl:!0}},this.form=this.fb.group({urlAddress:["",[c.k0.required,this.VALIDATOR_URL_ADDRESS]]}),this.ALLOWED_URL_CHARS=/^[a-zA-Z0-9\-._~:/?#\[\]@!$&'()*+,;=%]$/,(0,t.QZP)(()=>{const e=this.data();e?this.form.patchValue({urlAddress:e.urlAddress}):this.form.reset(),this.isDetailMode()?this.form.disable():this.form.enable()}),(0,t.QZP)(()=>{const e=this.errorMessage();if(!e)return;const i=this.form.get("urlAddress");i?.setErrors({serverError:e}),i?.markAsDirty(),i?.markAsTouched(),setTimeout(()=>{this.elRef.nativeElement.querySelector('input[formControlName="urlAddress"]')?.focus()},0)})}handleCancel(){this.onCancel.emit()}handleDelete(){if(!this.canDelete())return;const e=this.data();e&&this.onDelete.emit(e)}handleEdit(){if(!this.canUpdate())return;const e=this.data();e&&this.onEdit.emit(e)}handleSave(){if(!this.canSave())return;const e=this.form.get("urlAddress");e?.value&&"string"==typeof e.value&&e.setValue(e.value.trim(),{emitEvent:!1}),this.form.invalid?Object.values(this.form.controls).forEach(i=>{i.invalid&&(i.markAsDirty(),i.updateValueAndValidity({onlySelf:!0}))}):this.onSave.emit(this.form.value)}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["lib-whitelist-ip-modal"]],inputs:{isVisible:[1,"isVisible"],isEditMode:[1,"isEditMode"],isDetailMode:[1,"isDetailMode"],data:[1,"data"],isLoading:[1,"isLoading"],errorMessage:[1,"errorMessage"],canDelete:[1,"canDelete"],canUpdate:[1,"canUpdate"],canSave:[1,"canSave"],returnToDetailOnCancel:[1,"returnToDetailOnCancel"]},outputs:{isVisible:"isVisibleChange",onCancel:"onCancel",onSave:"onSave",onDelete:"onDelete",onEdit:"onEdit"},decls:7,vars:7,consts:[["closeIconTpl",""],["modalFooter",""],["urlErrorTip",""],["vtsClassName","standard-vts-modal whitelist-ip-modal",3,"vtsVisibleChange","vtsOnCancel","vtsVisible","vtsTitle","vtsCloseIcon","vtsFooter","vtsAutofocus"],[4,"vtsModalContent"],["vts-tooltip","","vtsTooltipTitle","\u0110\xf3ng",1,"cursor-pointer"],["vts-icon","","vtsType","Close:custom"],["class","modal-notice",4,"ngIf"],["vts-form","","vtsLayout","vertical",1,"space-y-form",3,"formGroup"],["vtsRequired",""],[3,"vtsValidateStatus","vtsErrorTip"],["vts-input","","formControlName","urlAddress",3,"keydown","paste","input","placeholder"],[1,"modal-notice"],["vtsType","warning","vtsShowIcon","",3,"vtsMessage"],["vts-button","","vtsType","default",3,"click"],["vts-icon","","vtsType","ArrowBack:custom"],["vts-button","","vtsType","default"],["vts-button","","vtsType","primary"],["vts-button","","vtsType","primary",3,"vtsLoading"],["vts-icon","","vtsType","DeleteUser:custom"],["vts-button","","vtsType","primary",3,"click"],["vts-icon","","vtsType","edit:figma"],["vts-button","","vtsType","primary",3,"click","vtsLoading"],["vts-icon","","vtsType","PaperTick:custom"]],template:function(i,s){if(1&i){const o=t.RV6();t.j41(0,"vts-modal",3),t.nI1(1,"translate"),t.mxI("vtsVisibleChange",function(l){return t.eBV(o),t.DH7(s.isVisible,l)||(s.isVisible=l),t.Njj(l)}),t.bIt("vtsOnCancel",function(){return t.eBV(o),t.Njj(s.handleCancel())}),t.DNE(2,L,2,0,"ng-template",null,0,t.C5r)(4,N,12,10,"ng-container",4)(5,Q,6,3,"ng-template",null,1,t.C5r),t.k0s()}if(2&i){const o=t.sdS(3),r=t.sdS(6);t.R50("vtsVisible",s.isVisible),t.Y8G("vtsTitle",t.bMT(1,5,s.isDetailMode()?"core.whitelist.modal.detail":s.isEditMode()?"core.whitelist.modal.edit":"core.whitelist.modal.add"))("vtsCloseIcon",o)("vtsFooter",r)("vtsAutofocus",null)}},dependencies:[_.MD,_.bT,c.X1,c.qT,c.me,c.BC,c.cb,c.j4,c.JD,v.h,v.D9,g.SX,k.tH,k.BE,g.dF,g.Qp,g.rA,g.Yc,y.iO,y.fZ,T.u,C.G,C.R$,P.T,b.dA,b.qb,S.RU,S.EV,S.Xc,E.BL,E.uC,M.u,M.r],styles:["[_nghost-%COMP%]{display:block}.modal-form[_ngcontent-%COMP%]{padding:16px 0}  vts-form-item.vts-form-item{margin-bottom:0!important}"]})}}return n})();const H=["ipTpl"],K=()=>({enable:!0}),Z=()=>({background:"#F3F4F6",color:"#1F2937"}),J=()=>({"max-width":"600px","word-break":"break-all"});function q(n,h){if(1&n){const e=t.RV6();t.j41(0,"button",14),t.bIt("click",function(){t.eBV(e);const s=t.XpG(2);return t.Njj(s.openAddModal())}),t.nrm(1,"i",15),t.EFF(2," Th\xeam m\u1edbi "),t.k0s()}}function tt(n,h){if(1&n&&(t.j41(0,"div",7)(1,"div",8)(2,"div",9)(3,"h2",10),t.EFF(4,"C\u1ea5u h\xecnh gi\u1edbi h\u1ea1n \u0111\u1ecba ch\u1ec9 m\u1ea1ng"),t.k0s()()(),t.j41(5,"div",11)(6,"div",12),t.DNE(7,q,3,0,"button",13),t.k0s()()()),2&n){const e=t.XpG();t.R7$(7),t.Y8G("ngIf",e.showCreate)}}function et(n,h){1&n&&(t.j41(0,"b",19),t.EFF(1,"Tr\u1ea1ng th\xe1i ho\u1ea1t \u0111\u1ed9ng:"),t.k0s())}function it(n,h){if(1&n){const e=t.RV6();t.j41(0,"div",16)(1,"vts-select",17),t.nI1(2,"translate"),t.bIt("ngModelChange",function(s){t.eBV(e);const o=t.XpG();return t.Njj(o.onFilterStatusChange(s))}),t.nrm(3,"vts-option",18)(4,"vts-option",18),t.k0s(),t.DNE(5,et,2,0,"ng-template",null,3,t.C5r),t.k0s()}if(2&n){const e=t.sdS(6),i=t.XpG();t.R7$(),t.Y8G("ngModel",i.filterStatus())("vtsPrefix",e)("vtsPlaceHolder",t.bMT(2,8,"common.dropdown.all"))("vtsAllowClear",!0),t.R7$(2),t.Y8G("vtsLabel","Ho\u1ea1t \u0111\u1ed9ng")("vtsValue",!0),t.R7$(),t.Y8G("vtsLabel","Kh\xf4ng ho\u1ea1t \u0111\u1ed9ng")("vtsValue",!1)}}function st(n,h){if(1&n&&(t.j41(0,"td",20)(1,"vts-tag",21),t.EFF(2),t.k0s()()),2&n){const e=h.$implicit;t.R7$(),t.Y8G("vtsColor",t.lJ4(4,Z))("vtsTooltipTitle",e.urlAddress)("vtsTooltipOverlayStyle",t.lJ4(5,J)),t.R7$(),t.SpI(" ",e.urlAddress," ")}}let nt=(()=>{class n{constructor(){this.checkPermissionService=(0,t.WQX)(d.X4S),this.whitelistService=(0,t.WQX)(w.hC),this.configService=(0,t.WQX)(w.Fl),this.toastService=(0,t.WQX)(V.Mo),this.dialogService=(0,t.WQX)(O.o3),this.breadcrumbService=(0,t.WQX)(d.BZs),this.destroy$=new x.B,this.showCreate=!1,this.showUpdate=!1,this.showDelete=!1,this.data=(0,t.vPA)([]),this.loading=(0,t.vPA)(!1),this.isEnabled=(0,t.vPA)(!1),this.filterStatus=(0,t.vPA)(null),this.modalVisible=(0,t.vPA)(!1),this.modalLoading=(0,t.vPA)(!1),this.isEditMode=(0,t.vPA)(!1),this.isDetailMode=(0,t.vPA)(!1),this.selectedItem=(0,t.vPA)(null),this.modalErrorMessage=(0,t.vPA)(null),this.returnToDetailAfterEdit=(0,t.vPA)(!1),this.ipTpl=(0,t.ebz)("ipTpl"),this.pagingParams={searchKey:"",pageIndex:1,pageSize:10,total:0,searchBoxConfig:{placeholder:"core.whitelist.placeholder.search"},onChangePagingParams:(e,i)=>{"search"===i&&(this.pagingParams.searchKey=e),"pageIndex"===i&&(this.pagingParams.pageIndex=e),"pageSize"===i&&(this.pagingParams.pageSize=e),this.loadData()}},this.columnConfig=(0,t.EWP)(()=>({cols:[{title:"core.whitelist.field.ipAddress",useField:"urlAddress",width:"400px",useTemplate:this.ipTpl()},{title:"core.whitelist.field.createdBy",useField:"createdBy",width:"180px"},{title:"core.whitelist.field.createdDate",useField:"createdDate",width:"180px",isDate:!0,alignContent:"center",alignTitle:"center"}]})),this.statusOptions={statusKey:"status",useSwitchStatus:!0,actionKey:d.fb6.changeStatus,trueSwitchValue:1,disableSwitch:!0,width:"180px",stages:[{value:!0,text:"core.whitelist.status.active",preset:"success"},{value:!1,text:"core.whitelist.status.inactive",preset:"default"}]},this.baseActionOptions=[{icon:"edit:figma",eventName:d.fb6.update,type:"icon",text:"S\u1eeda"},{icon:"DeleteUser:custom",eventName:d.fb6.delete,type:"icon",text:"X\xf3a"}],this.actionOptions={actions:[],onClick:(e,i)=>this.handleAction(e,i),fixedRight:!0}}ngOnInit(){this.checkActionPermission(),this.breadcrumbService.setBreadcrumbs([{label:"Trang ch\u1ee7",url:"/dashboard"},{label:"Qu\u1ea3n l\xfd c\u1ea5u h\xecnh chung",disabled:!0},{label:"C\u1ea5u h\xecnh gi\u1edbi h\u1ea1n \u0111\u1ecba ch\u1ec9 m\u1ea1ng",url:"/whitelist-ips"}]),this.loadData()}onFilterStatusChange(e){this.filterStatus.set(e),this.pagingParams.pageIndex=1,this.loadData()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}checkActionPermission(){this.checkPermissionService.checkPermissionForActionByMethod(["POST","PATCH","DELETE"],["/api/admin/whitelist-ips","/api/admin/whitelist-ips/{id}","/api/admin/whitelist-ips/{id}"]).subscribe({next:s=>{const o=s.data??s;this.showCreate=!0===o[0],this.showUpdate=!0===o[1],this.showDelete=!0===o[2],this.syncActionOptionsWithPermission()},error:()=>{this.showCreate=!1,this.showUpdate=!1,this.showDelete=!1,this.syncActionOptionsWithPermission()}})}syncActionOptionsWithPermission(){this.statusOptions={...this.statusOptions,disableSwitch:!this.showUpdate},this.actionOptions={...this.actionOptions,actions:this.baseActionOptions.filter(e=>e.eventName===d.fb6.update?this.showUpdate:e.eventName!==d.fb6.delete||this.showDelete)}}sanitizeSearchValue(e){return e&&e.trim()||void 0}loadData(){this.loading.set(!0);const e={page:this.pagingParams.pageIndex-1,size:this.pagingParams.pageSize,urlAddress:this.sanitizeSearchValue(this.pagingParams.searchKey)};null!==this.filterStatus()&&(e.status=this.filterStatus()),this.whitelistService.list(e).pi
1pe((0,f.Q)(this.destroy$)).subscribe({next:i=>{i.body&&(this.data.set(i.body.whitelistIps),this.pagingParams.total=i.body.pagination.totalElements),this.loading.set(!1)},error:i=>{this.loading.set(!1),this.toastService.error("","L\u1ed7i t\u1ea3i danh s\xe1ch IP")}})}onRowClick(e){e?.item&&this.handleAction("view",e.item)}handleAction(e,i){"view"===e?(this.isDetailMode.set(!0),this.isEditMode.set(!1),this.returnToDetailAfterEdit.set(!1),this.selectedItem.set(i),this.modalVisible.set(!0)):e===d.fb6.update?(this.isDetailMode.set(!1),this.isEditMode.set(!0),this.returnToDetailAfterEdit.set(!1),this.selectedItem.set(i),this.modalVisible.set(!0)):e===d.fb6.changeStatus?this.toggleStatus(i):e===d.fb6.delete&&this.confirmDelete(i)}toggleStatus(e){if(!this.showUpdate)return void this.toastService.error("","B\u1ea1n kh\xf4ng c\xf3 quy\u1ec1n thay \u0111\u1ed5i tr\u1ea1ng th\xe1i IP whitelist");const i=!!e.status;this.dialogService.confirmMessage(`\u0110\u1ed3ng ch\xed vui l\xf2ng x\xe1c nh\u1eadn ch\u1eafc ch\u1eafn mu\u1ed1n ${i?"kh\xf3a":"m\u1edf kh\xf3a"} IP whitelist <strong>${d.$Db.escapeHtml(e.urlAddress||"")}</strong>`,void 0,void 0,{},i?"X\xe1c nh\u1eadn kh\xf3a IP whitelist":"X\xe1c nh\u1eadn m\u1edf kh\xf3a IP whitelist",{text:i?"Kh\xf3a":"M\u1edf kh\xf3a",icon:i?"lock:figma":"unlock:figma"},{text:"Quay l\u1ea1i",icon:"ArrowBack:custom"}).afterClose.subscribe(r=>{r===d.h87.RESULT_CLOSE_DIALOG.CONFIRM&&this.whitelistService.getById(e.id).pipe((0,f.Q)(this.destroy$)).subscribe({next:l=>{if(l.lastModifiedDate!==e.lastModifiedDate)return this.toastService.warning("","D\u1eef li\u1ec7u \u0111\xe3 b\u1ecb thay \u0111\u1ed5i b\u1edfi ng\u01b0\u1eddi d\xf9ng kh\xe1c. Vui l\xf2ng th\u1eed l\u1ea1i."),void this.loadData();this.whitelistService.update(e.id,{urlAddress:e.urlAddress,status:!e.status}).pipe((0,f.Q)(this.destroy$)).subscribe({next:p=>{this.toastService.success("",i?"Kh\xf3a IP whitelist th\xe0nh c\xf4ng":"M\u1edf kh\xf3a IP whitelist th\xe0nh c\xf4ng"),this.whitelistService.getById(e.id).pipe((0,f.Q)(this.destroy$)).subscribe({next:u=>{this.data.update(m=>m.map(D=>D.id===e.id?u:D))},error:()=>{this.data.update(u=>u.map(m=>m.id===e.id?p:m))}})},error:()=>{this.data.update(p=>p.map(u=>u.id===e.id?{...u,status:e.status}:u)),this.toastService.error("",i?"Kh\xf3a IP whitelist th\u1ea5t b\u1ea1i":"M\u1edf kh\xf3a IP whitelist th\u1ea5t b\u1ea1i"),this.loadData()}})},error:()=>{this.toastService.error("","Kh\xf4ng th\u1ec3 ki\u1ec3m tra tr\u1ea1ng th\xe1i b\u1ea3n ghi. Vui l\xf2ng th\u1eed l\u1ea1i."),this.loadData()}})})}openAddModal(){this.showCreate?(this.isDetailMode.set(!1),this.isEditMode.set(!1),this.returnToDetailAfterEdit.set(!1),this.selectedItem.set(null),this.modalErrorMessage.set(null),this.modalVisible.set(!0)):this.toastService.error("","B\u1ea1n kh\xf4ng c\xf3 quy\u1ec1n th\xeam m\u1edbi IP whitelist")}handleModalCancel(){if(this.modalErrorMessage.set(null),this.returnToDetailAfterEdit()&&this.selectedItem())return this.returnToDetailAfterEdit.set(!1),this.isEditMode.set(!1),void this.isDetailMode.set(!0);this.returnToDetailAfterEdit.set(!1),this.modalVisible.set(!1)}handleModalDelete(e){this.showDelete?this.confirmDelete(e):this.toastService.error("","B\u1ea1n kh\xf4ng c\xf3 quy\u1ec1n x\xf3a IP whitelist")}handleModalEdit(e){this.showUpdate?(this.isDetailMode.set(!1),this.isEditMode.set(!0),this.returnToDetailAfterEdit.set(!0),this.selectedItem.set(e),this.modalErrorMessage.set(null)):this.toastService.error("","B\u1ea1n kh\xf4ng c\xf3 quy\u1ec1n ch\u1ec9nh s\u1eeda IP whitelist")}handleModalSave(e){(this.isEditMode()?this.showUpdate:this.showCreate)?(this.modalLoading.set(!0),(this.isEditMode()?this.whitelistService.update(this.selectedItem().id,e):this.whitelistService.create(e)).pipe((0,f.Q)(this.destroy$)).subscribe({next:()=>{this.modalErrorMessage.set(null),this.toastService.success("",this.isEditMode()?"C\u1eadp nh\u1eadt th\xe0nh c\xf4ng":"Th\xeam m\u1edbi th\xe0nh c\xf4ng"),this.modalLoading.set(!1),this.modalVisible.set(!1),this.returnToDetailAfterEdit.set(!1),this.loadData()},error:o=>{this.modalLoading.set(!1);const r=o?.error?.errorCode||o?.error?.code||o?.error?.error,l=o?.error?.message||o?.error?.detail||"",p=o?.status,u=o?.error?.detail||"";if(409===p||r?.includes("EXISTS")||l?.toLowerCase().includes("t\u1ed3n t\u1ea1i")||l?.toLowerCase().includes("exist")||u.includes("Duplicate entry"))this.modalErrorMessage.set("\u0110\u1ecba ch\u1ec9 URL \u0111\xe3 t\u1ed3n t\u1ea1i. Vui l\xf2ng nh\u1eadp \u0111\u1ecba ch\u1ec9 m\u1edbi"),this.toastService.error("","\u0110\u1ecba ch\u1ec9 URL \u0111\xe3 t\u1ed3n t\u1ea1i. Vui l\xf2ng nh\u1eadp \u0111\u1ecba ch\u1ec9 m\u1edbi");else if("INVALID_URL"===r||l?.toLowerCase().includes("kh\xf4ng h\u1ee3p l\u1ec7")||l?.toLowerCase().includes("invalid_url")||l?.toLowerCase().includes("invalid url"))this.modalErrorMessage.set("URL kh\xf4ng h\u1ee3p l\u1ec7 !");else{this.modalErrorMessage.set(null);const m=o?.error?.fieldErrors?.[0]?.message,D=this.translateFieldError(m);this.toastService.error("",D||(this.isEditMode()?"L\u1ed7i c\u1eadp nh\u1eadt":"L\u1ed7i th\xeam m\u1edbi"))}}})):this.toastService.error("","B\u1ea1n kh\xf4ng c\xf3 quy\u1ec1n l\u01b0u IP whitelist")}translateFieldError(e){return"URL address must start with http or https and must not contain spaces"===e?"\u0110\u1ecba ch\u1ec9 URL ph\u1ea3i b\u1eaft \u0111\u1ea7u b\u1eb1ng http ho\u1eb7c https v\xe0 kh\xf4ng \u0111\u01b0\u1ee3c ch\u1ee9a kho\u1ea3ng tr\u1eafng":e||null}confirmDelete(e){this.showDelete?this.dialogService.confirmMessage(`B\u1ea1n c\xf3 ch\u1eafc ch\u1eafn mu\u1ed1n x\xf3a \u0111\u1ecba ch\u1ec9 URL "<strong>${d.$Db.escapeHtml(e.urlAddress)}</strong>"?`,void 0,void 0,{},"X\xe1c nh\u1eadn x\xf3a",{text:"X\xf3a",icon:"DeleteUser:custom"},{text:"Quay l\u1ea1i",icon:"ArrowBack:custom"}).afterClose.subscribe(s=>{s===d.h87.RESULT_CLOSE_DIALOG.CONFIRM&&this.whitelistService.delete(e.id).subscribe({next:()=>{this.toastService.success("","X\xf3a th\xe0nh c\xf4ng"),this.selectedItem()?.id===e.id&&(this.modalVisible.set(!1),this.selectedItem.set(null)),this.loadData()},error:o=>{const r=o?.status,l=o?.error?.errorCode||o?.error?.code;404===r||"ENTITY_NOT_FOUND"===l||"ENTITY_NOT_EXIST"===l?(this.toastService.error("","B\u1ea3n ghi \u0111\xe3 b\u1ecb x\xf3a"),this.loadData()):this.toastService.error("","L\u1ed7i x\xf3a IP")}})}):this.toastService.error("","B\u1ea1n kh\xf4ng c\xf3 quy\u1ec1n x\xf3a IP whitelist")}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["lib-core-whitelist-ips"]],viewQuery:function(i,s){1&i&&t.wEZ(s.ipTpl,H,5),2&i&&t.NyB()},decls:9,vars:25,consts:[["titleTemplate",""],["moreFilterRef",""],["ipTpl",""],["statusPrefixTemp",""],[1,"whitelist-ips-container"],[3,"onClickDataItem","onReloadTable","loading","vtsTableTitle","data","columns","actionOptions","statusOptions","pagingParams","vtsCreatable","vtsShowCheckbox","vtsSh
1owTableConfig","vtsSearchable","vtsEntityName","moreFilterRef","autoResize"],[3,"onCancel","onSave","onDelete","onEdit","isVisible","isEditMode","isDetailMode","data","isLoading","errorMessage","canDelete","canUpdate","canSave","returnToDetailOnCancel"],[1,"whitelist-ips-header-wrapper"],[1,"header-section"],[1,"header-section__content"],[1,"header-section__title"],[1,"action-bar"],[1,"action-bar__right"],["vtsSize","md","vts-button","","vtsType","primary","class","add-btn",3,"click",4,"ngIf"],["vtsSize","md","vts-button","","vtsType","primary",1,"add-btn",3,"click"],["vts-icon","","vtsType","AddFolder:custom"],[1,"more-filter-col",2,"grid-column","span 12"],["vtsSize","md",2,"width","200px",3,"ngModelChange","ngModel","vtsPrefix","vtsPlaceHolder","vtsAllowClear"],[3,"vtsLabel","vtsValue"],[2,"white-space","nowrap"],[1,"pd-0"],["vts-tooltip","",2,"font-size","var(--text-sm, 0.875rem)","max-width","380px","overflow","hidden","text-overflow","ellipsis","white-space","nowrap","display","inline-block","vertical-align","middle",3,"vtsColor","vtsTooltipTitle","vtsTooltipOverlayStyle"]],template:function(i,s){if(1&i){const o=t.RV6();t.j41(0,"div",4),t.DNE(1,tt,8,1,"ng-template",null,0,t.C5r),t.j41(3,"vts-custom-pro-table",5),t.bIt("onClickDataItem",function(l){return t.eBV(o),t.Njj(s.onRowClick(l))})("onReloadTable",function(){return t.eBV(o),t.Njj(s.loadData())}),t.k0s(),t.DNE(4,it,7,10,"ng-template",null,1,t.C5r)(6,st,3,6,"ng-template",null,2,t.C5r),t.j41(8,"lib-whitelist-ip-modal",6),t.bIt("onCancel",function(){return t.eBV(o),t.Njj(s.handleModalCancel())})("onSave",function(l){return t.eBV(o),t.Njj(s.handleModalSave(l))})("onDelete",function(l){return t.eBV(o),t.Njj(s.handleModalDelete(l))})("onEdit",function(l){return t.eBV(o),t.Njj(s.handleModalEdit(l))}),t.k0s()()}if(2&i){const o=t.sdS(2),r=t.sdS(5);t.R7$(3),t.Y8G("loading",s.loading())("vtsTableTitle",o)("data",s.data())("columns",s.columnConfig())("actionOptions",s.actionOptions)("statusOptions",s.statusOptions)("pagingParams",s.pagingParams)("vtsCreatable",!1)("vtsShowCheckbox",!1)("vtsShowTableConfig",!1)("vtsSearchable",!0)("vtsEntityName","c\u1ea5u h\xecnh gi\u1edbi h\u1ea1n \u0111\u1ecba ch\u1ec9 m\u1ea1ng")("moreFilterRef",r)("autoResize",t.lJ4(24,K)),t.R7$(5),t.Y8G("isVisible",s.modalVisible())("isEditMode",s.isEditMode())("isDetailMode",s.isDetailMode())("data",s.selectedItem())("isLoading",s.modalLoading())("errorMessage",s.modalErrorMessage())("canDelete",s.showDelete)("canUpdate",s.showUpdate)("canSave",s.isEditMode()?s.showUpdate:s.showCreate)("returnToDetailOnCancel",s.returnToDetailAfterEdit())}},dependencies:[_.MD,_.bT,c.YN,c.BC,c.vS,v.h,v.D9,C.G,C.R$,P.T,b.dA,b.qb,R.u,M.u,A.M,A.$,E.BL,E.uC,T.u,T.mw,T.B1,g.SX,F.IY,Y],styles:[".whitelist-ips-container .custom-table-title{border-bottom:none!important;padding-bottom:0!important;min-height:unset!important}[_nghost-%COMP%]     .vts-pro-table-title{padding:0!important}.whitelist-ips-header-wrapper[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:space-between;align-items:center;gap:16px}.header-section[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px}.header-section__icon[_ngcontent-%COMP%]{width:40px;height:40px;background:var(--secondary-color-1);border-radius:8px;display:flex;align-items:center;justify-content:center}.header-section__icon[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:20px;color:var(--primary-color)}.header-section__title[_ngcontent-%COMP%]{margin:0;font-size:20px;font-weight:600;color:#000;line-height:1.4}.header-section__subtitle[_ngcontent-%COMP%]{margin:0;font-size:16px;color:#6b7280}.action-bar[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:16px 0}.action-bar__left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px}.action-bar__left[_ngcontent-%COMP%]   .toggle-info[_ngcontent-%COMP%]{display:flex;flex-direction:column}.action-bar__left[_ngcontent-%COMP%]   .toggle-info__title[_ngcontent-%COMP%]{font-weight:600;color:#262626;font-size:16px}.action-bar__left[_ngcontent-%COMP%]   .toggle-info__subtitle[_ngcontent-%COMP%]{font-size:12px;color:#6b7280}"]})}}return n})()}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.