芝麻web文件管理V1.00
编辑当前文件:/home/pulsehostuk9/www/cloud.pulsehost.co.uk/static/js/IPAllowList.app.a06fe490ddafa06af95c.min.js
"use strict";(self.webpackChunkafterlogic_aurora_platform=self.webpackChunkafterlogic_aurora_platform||[]).push([[283],{aayN:(t,i,o)=>{var e=o("a7T2"),s=o("KC/L");t.exports={CurrentIP:"",init:function(t){var i=e.extend({},t[this.ServerModuleName]||{},t.IPAllowList||{});e.isEmpty(i)||(this.CurrentIP=s.pString(i.CurrentIP,this.CurrentIP))}}},Gtz2:(t,i,o)=>{var e=o("H20a"),s=o("9kOp"),n=o("aayN");t.exports=function(t){return n.init(t),s.isUserNormalOrTenant()&&!s.isMobile()?{start:function(t){t.isModuleEnabled("SecuritySettingsWebclient")?t.run("SecuritySettingsWebclient","registerSecuritySettingsSection",[function(){var t=o("XaRb");return t.ViewTemplate="IPAllowList_IPAllowListSettingsSectionFormView",t},"IPAllowList"]):t.run("SettingsWebclient","registerSettingsTab",[function(){return o("XaRb")},"ip-allow-list",e.i18n("IPALLOWLIST/LABEL_SETTINGS_TAB")])}}:null}},aWgw:(t,i,o)=>{var e=o("a7T2"),s=o("p09A"),n=o("H20a"),l=o("EFhx"),r=o("/QeJ"),p=o("o1lX"),I=o("XeMN"),a=o("oUN1"),u=o("aayN"),A=o("skxT");function h(){p.call(this),this.aAllowedIpAddresses=[],this.fCallback=null,this.ip=s.observable(""),this.ipFocus=s.observable(!0),this.comment=s.observable(""),this.inProgress=s.observable(!1)}e.extendOwn(h.prototype,p.prototype),h.prototype.PopupTemplate="IPAllowList_AddIpToAllowlistPopup",h.prototype.onOpen=function(t,i){this.aAllowedIpAddresses=t,this.fCallback=i,this.ip(""),this.ipFocus(!0),this.comment("")},h.prototype.validateAndAddIp=function(){if(""===this.ip())A.showError(n.i18n("IPALLOWLIST/ERROR_IP_EMPTY")),this.ipFocus(!0);else if(this.ip()!==u.CurrentIP&&-1===this.aAllowedIpAddresses.indexOf(u.CurrentIP)){var t=n.i18n("IPALLOWLIST/CONFIRM_NOT_CURRENT_IP",{CURRENTIP:u.CurrentIP});a.showPopup(I,[t,e.bind((function(t){t&&this.addIp()}),this),"",n.i18n("IPALLOWLIST/ACTION_PROCEED")])}else this.addIp()},h.prototype.addIp=function(){var t={IP:this.ip(),Comment:this.comment()};this.inProgress(!0),l.send("IPAllowList","AddIpToAllowlist",t,this.onAddIpToAllowlistResponse,this)},h.prototype.onAddIpToAllowlistResponse=function(t){this.inProgress(!1),t&&t.Result?(A.showReport(n.i18n("IPALLOWLIST/REPORT_ADD_IP")),this.close(!0)):r.showErrorByCode(t,n.i18n("IPALLOWLIST/ERROR_ADD_IP"))},h.prototype.close=function(t){e.isFunction(this.fCallback)&&this.fCallback(!!t),this.closePopup()},t.exports=new h},XaRb:(t,i,o)=>{var e=o("a7T2"),s=o("p09A"),n=o("H20a"),l=o("EFhx"),r=o("/QeJ"),p=o("XeMN"),I=o("TdEd"),a=o("oUN1"),u=o("skxT"),A=I.run("SettingsWebclient","getAbstractSettingsFormViewClass"),h=o("aWgw"),P=o("aayN");function c(){A.call(this),this.ipAllowlist=s.observableArray([]),this.sCurrentIp=P.CurrentIP}e.extendOwn(c.prototype,A.prototype),c.prototype.ViewTemplate="IPAllowList_IPAllowListSettingsFormView",c.prototype.onShow=function(){this.clearAll()},c.prototype.clearAll=function(){this.populateIpAllowlist()},c.prototype.populateIpAllowlist=function(){l.send("IPAllowList","GetIpAllowlist",null,(function(t){e.isObject(t&&t.Result)?this.ipAllowlist(e.map(t.Result,(function(t,i){return{IP:i,Comment:t.Comment}}))):r.showErrorByCode(t,n.i18n("IPALLOWLIST/ERROR_CANNOT_GET_IP_ALLOWLIST"))}),this)},c.prototype.addIpToAllowlist=function(){var t=e.map(this.ipAllowlist(),(function(t){return t.IP}));a.showPopup(h,[t,this.populateIpAllowlist.bind(this)])},c.prototype.askRemoveIp=function(t){var i=t===this.sCurrentIp&&this.ipAllowlist().length>1?n.i18n("IPALLOWLIST/CONFIRM_REMOVE_CURRENT_IP"):n.i18n("IPALLOWLIST/CONFIRM_REMOVE_IP"),o=n.i18n("IPALLOWLIST/CONFIRM_HEADING_REMOVE_IP",{IP:t});a.showPopup(p,[i,e.bind((function(i){i&&this.removeIp(t)}),this),o,n.i18n("IPALLOWLIST/ACTION_PROCEED")])},c.prototype.removeIp=function(t){var i={IP:t};l.send("IPAllowList","RemoveIpFromAllowlist",i,(function(t){this.populateIpAllowlist(),t&&t.Result?u.showReport(n.i18n("IPALLOWLIST/REPORT_REMOVE_IP")):r.showErrorByCode(t,n.i18n("IPALLOWLIST/ERROR_REMOVE_IP"))}),this)},t.exports=new c}}]);